/*
 * Corpus Phase 2 — DIRECTORY page type. 349 pages: city, states, and `/letter/` index pages
 * across other families. Group 2 owns the template and the `city` + `states` image sets; the
 * `/letter/` pages borrow this same CSS while their images stay whichever family owns them.
 *
 * Contract: docs/handoff/CORPUS-PHASE2-DESIGN-20260903.md §4.5. Reference: Cleo `/learn` —
 * its CARD GRAMMAR only, never its shell (learn's own H1 is visually hidden and it has zero
 * `<section>` elements; a directory page's H1 stays visible, per the news-index precedent used
 * for `hub`).
 */

[data-gg-page-type="directory"] .gg-corpus-directory {
    width: min(100% - 64px, 1280px);
    margin: 48px auto 0;
    padding: 0 32px;
}

@media (max-width: 760px) {
    [data-gg-page-type="directory"] .gg-corpus-directory { width: 100%; padding: 0 20px; }
}

[data-gg-page-type="directory"] .gg-corpus-directory__eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px;
    font: 400 11.9px/1.2 Simplon, monospace;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gg-muted);
}

[data-gg-page-type="directory"] .gg-corpus-directory__eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--gg-accent);
}

[data-gg-page-type="directory"] .gg-corpus-directory h1 { color: var(--gg-ink); }

[data-gg-page-type="directory"] .gg-corpus-directory__dek {
    max-width: 62ch;
    margin: 16px 0 0;
    /* 1.6, not Cleo's measured 1.27: the owner rubric requires >= 1.6 on Indic body
       text and 1.27 clips Devanagari and Tamil matras. Same call, same selector role
       and same rationale as `.gg-corpus-dek` in css/corpus-article.css. */
    font: 400 22px/1.6 PPNeue, Arial, sans-serif;
    color: var(--gg-muted);
}

/* 2. Location strip — mono row, only from values already in the page's own DOM. */
[data-gg-page-type="directory"] .gg-corpus-directory__strip {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 32px 0 0;
    padding: 18px 0;
    border-top: 1px solid var(--gg-line);
    border-bottom: 1px solid var(--gg-line);
    font: 400 16px/1.6 Simplon, monospace;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gg-muted);
}

[data-gg-page-type="directory"] .gg-corpus-directory__strip span { color: var(--gg-ink); }

/* 3. Card grid — the family card image, 1/1, radius 28, `.media-card` grammar. */
[data-gg-page-type="directory"] .gg-corpus-directory__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin: 48px 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 1279px) and (min-width: 1120px) {
    [data-gg-page-type="directory"] .gg-corpus-directory__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1119px) and (min-width: 761px) {
    [data-gg-page-type="directory"] .gg-corpus-directory__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}

@media (max-width: 760px) {
    [data-gg-page-type="directory"] .gg-corpus-directory__grid { grid-template-columns: 1fr; gap: 14px; }
}

[data-gg-page-type="directory"] .gg-corpus-directory__card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--gg-line);
    border-radius: 28px;
    background: #fff;
    color: var(--gg-ink);
    text-decoration: none;
    transition: transform 0.22s var(--gg-ease), box-shadow 0.22s var(--gg-ease);
}

[data-gg-page-type="directory"] .gg-corpus-directory__card:hover {
    transform: translateY(-3px);
    box-shadow: var(--gg-shadow);
}

[data-gg-page-type="directory"] .gg-corpus-directory__card-media {
    display: block;
    overflow: hidden;
}

[data-gg-page-type="directory"] .gg-corpus-directory__card-media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

[data-gg-page-type="directory"] .gg-corpus-directory__card h3 {
    margin: 0;
    padding: 18px 20px 22px;
    font: 350 20px/1.15 PPNeue, Arial, sans-serif;
    letter-spacing: -0.02em;
}

@media (prefers-reduced-motion: reduce) {
    [data-gg-page-type="directory"] .gg-corpus-directory__card { transition: none; }
    [data-gg-page-type="directory"] .gg-corpus-directory__card:hover { transform: none; box-shadow: none; }
}

/* 4. A-Z rail stays in normal flow, with full-size wrapped touch targets. */
[data-gg-page-type="directory"] .gg-corpus-directory__az {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 44px;
    align-items: center;
    margin: 24px 0;
    padding: 0 4px;
    background: var(--gg-paper);
    font: 400 16px Simplon, monospace;
    text-transform: uppercase;
}

[data-gg-page-type="directory"] .gg-corpus-directory__az a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    color: var(--gg-muted);
}

[data-gg-page-type="directory"] .gg-corpus-directory__az a[aria-current="true"] {
    color: #fff;
    background: var(--gg-accent);
}

/* Legacy directory descriptions now sit on the native light paper, not the old dark body. */
body.gg-programmatic-page[data-gg-page-type="directory"] > section .text-gray-300 {
    color: var(--gg-muted);
}

/* Legacy trust captions must remain readable on native directory paper. */
body.gg-programmatic-page[data-gg-page-type="directory"] > section p.text-green-400 {
    color: var(--gg-muted);
}

/* Directory actions carry native button colors despite the legacy link reset. */
body.gg-programmatic-page[data-gg-page-type="directory"] > section a.bg-gradient-to-r {
    color: #fff;
    text-decoration: none;
}
body.gg-programmatic-page[data-gg-page-type="directory"] > section a.glass-card {
    color: var(--gg-purple);
    text-decoration: none;
}


/* Native city content keeps its heading first; service artwork names the service. */
body.gg-programmatic-page[data-gg-page-type="directory"] .gg-corpus-city__service {
    display: block;
    min-height: 44px;
    border-radius: 28px;
    padding: 24px;
    background: #fff;
    color: var(--gg-ink);
    text-decoration: none;
}
body.gg-programmatic-page[data-gg-page-type="directory"] .gg-corpus-city__service h3 {
    color: var(--gg-ink);
    font: 500 22px/1.35 PPNeue, Arial, sans-serif;
    margin: 16px 0 8px;
}
body.gg-programmatic-page[data-gg-page-type="directory"] .gg-corpus-city__service p {
    color: var(--gg-muted);
    font: 400 16px/1.6 PPNeue, Arial, sans-serif;
}
body.gg-programmatic-page[data-gg-page-type="directory"] .gg-corpus-city__art {
    width: 72px;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
}
body.gg-programmatic-page[data-gg-page-type="directory"] .gg-corpus-city__service:focus-visible {
    outline: 3px solid var(--gg-accent);
    outline-offset: 4px;
}

/* The retained breadcrumb is a NAV, outside the legacy section text remap. */
body.gg-programmatic-page[data-gg-page-type="directory"][data-gg-corpus-city="v1"] > nav[aria-label="Breadcrumb"] {
    background: var(--gg-paper);
    border-color: var(--gg-line);
}
body.gg-programmatic-page[data-gg-page-type="directory"][data-gg-corpus-city="v1"] > nav[aria-label="Breadcrumb"] li.text-gray-300 {
    color: var(--gg-ink);
}
body.gg-programmatic-page[data-gg-page-type="directory"][data-gg-corpus-city="v1"] > nav[aria-label="Breadcrumb"] a {
    color: var(--gg-accent);
}
body.gg-programmatic-page[data-gg-page-type="directory"][data-gg-corpus-city="v1"] > nav[aria-label="Breadcrumb"] li.text-orange-400 {
    color: var(--gg-muted);
}

/* State pages: the orange festival chips measured 3.5:1. */
[data-gg-page-type="directory"] .festival { color: #9a3412; }

/* ---- L15 invisible-text sweep (2026-10-10): tool, forecast, comparison, directory ---------------------------------------- */

/* ==== L15 tfc, 2026-10-10: invisible / low-contrast text on directory pages =======================
 * Every rule is scoped to [data-gg-page-type="directory"] plus an exact, counted class pattern. */

/* States pages (29): the legacy navy hero keeps its Hindi caption in var(--primary), which the theme sets to #6d36b5
 * (2.2:1 on the navy). */
[data-gg-page-type="directory"] header:not([data-gg-corpus-shell]) .hindi { color: #e0d4f7; }

/* City pages (211): the closing CTA band is `from-orange-900/30 to-red-900/30`, a 30% rose wash on the light page,
 * with `text-gray-300` copy that the theme maps to muted (3.6:1 on the wash). Ink clears 6:1. */
[data-gg-page-type="directory"] [class*="bg-gradient-to-"][class*="-900/"] :is(.text-gray-300, .text-gray-400, .text-gray-500) { color: var(--gg-ink); }
