/* Make Sphinx graphviz SVGs scale to the content column instead of rendering at
   their intrinsic pt size (which looks tiny in a wide RTD content area and leaves
   white space on the right). The Sphinx graphviz extension wraps each diagram in
   <div class="graphviz"><object>...svg...</object></div>. */
.graphviz {
    text-align: center;
    margin: 1em 0;
}
.graphviz object,
.graphviz svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Mermaid: conf.py sets `useMaxWidth: false` so every diagram renders at its
   intrinsic viewBox width (1 viewBox unit = 1 CSS pixel) and per-character
   pixel size is identical across diagrams. This block just centers them and
   strips the default <pre> code-block frame, plus caps absurdly wide diagrams
   so they don't break out of the content column. */
pre.mermaid {
    text-align: center;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 1em 0 !important;
}
pre.mermaid > svg,
.mermaid > svg {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

/* Tables: wrap long cell text instead of triggering the RTD theme's
   horizontal scroll wrapper. Forces a fixed layout so the :widths:
   directive in list-table actually pins the column proportions, and
   allows long words to break so prose cells wrap cleanly. */
.rst-content table.docutils {
    width: 100%;
    table-layout: fixed;
}
.rst-content table.docutils td,
.rst-content table.docutils th {
    white-space: normal !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.wy-table-responsive {
    overflow: visible;
}

/* Opt-in horizontal scroll for tables with `:class: scroll-table`. The
   table becomes its own scroll container (via display: block), cells keep
   their intrinsic width, and identifiers don't break. Use this for tables
   whose cells contain class names or function calls that must stay on one
   line. */
.rst-content table.docutils.scroll-table {
    display: block;
    overflow-x: auto;
    width: 100%;
    table-layout: auto;
}
.rst-content table.docutils.scroll-table td,
.rst-content table.docutils.scroll-table th {
    white-space: nowrap !important;
    word-wrap: normal;
    overflow-wrap: normal;
}

/* Default for Desktop: 50% width */
.responsive-img {
    width: 40%;
    height: auto;
}

/* Override for Mobile (screens smaller than 768px): 100% width */
@media screen and (max-width: 768px) {
    .responsive-img {
        width: 90%;
    }
}

/* -------------------------------------------------------------------------
   Landing page (docs/index.rst)
   Hero image + 2x2 quick-links card grid. Colors match the geodex blue
   palette used by mermaid/graphviz diagrams (#e7f0fa / #2980b9).
   ------------------------------------------------------------------------- */

.landing-hero {
    text-align: center;
    margin: 1.5em 0 2em 0;
}
.landing-hero img {
    max-width: 85%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25em;
    margin: 2em 0 1em 0;
}
@media screen and (max-width: 768px) {
    .landing-grid {
        grid-template-columns: 1fr;
    }
}

.landing-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    background: #fff;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.landing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    border-color: #2980b9;
}

.landing-card-thumb {
    background: #f7fbfe;
    border-bottom: 1px solid #e7f0fa;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 190px;
    overflow: hidden;
    padding: 0.9em;
    box-sizing: border-box;
}
.landing-card-thumb img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
}

.landing-card-thumb-text {
    background: #f4f7fa;
}
.landing-card-thumb-text pre {
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
    font-size: 0.82em;
    line-height: 1.55;
    color: #2c3e50;
    white-space: pre;
    text-align: left;
}

.landing-card-thumb-placeholder {
    background:
        repeating-linear-gradient(
            45deg,
            #f7fbfe,
            #f7fbfe 10px,
            #eef4fb 10px,
            #eef4fb 20px
        );
    color: #6c7a89;
    font-size: 0.9em;
    line-height: 1.5;
    text-align: center;
    padding: 1em;
}
.landing-card-thumb-placeholder em {
    color: #2980b9;
    font-style: normal;
}

.landing-card-body {
    padding: 0.9em 1.15em 1.05em 1.15em;
}
.landing-card-body h3 {
    margin: 0 0 0.35em 0;
    font-size: 1.08em;
    color: #2980b9;
    font-weight: 600;
}
.landing-card-body p {
    margin: 0;
    color: #444;
    font-size: 0.93em;
    line-height: 1.5;
}