/* ==========================================================================
   site.css: the shared look of How India Lives, November 2026.

   Every page links this file LAST, after its own <style> block, so a rule here
   wins over a page rule of the same weight. The pages keep their layout and
   behaviour rules; this file owns type, rules, buttons, labels, cards and the
   footer, so those look the same on every page type. The generated pages under
   m/ link it too (scripts/build_map_pages.py).

   The system, so that nobody undoes it by accident:
   - The page is the paper the map sheets are printed on (--primary-bg in
     assets/tokens.css equals the ground of every PNG under maps/), so a map
     needs no card, border radius or shadow to sit on the page.
   - Depth is drawn with rules. A 2px ink rule opens a section; a hairline
     separates items. Nothing has a drop shadow except a menu or a dialog.
   - One type family, Inter. Display is heavy and tight; labels (section names,
     sources, counts) are small tracked capitals; figures use tabular numerals.
     JetBrains Mono was tried for labels and dropped: its dotted zero makes
     "2011" and "10" read as code. No gradient text: a gradient painted into
     text is ink, and no check can measure it.
   - Corners are 2px.
   - Hindi: Devanagari has no capitals and its conjuncts break when tracked, so
     every label drops its letter-spacing under html:lang(hi), and running text
     gets more line height.

   Colours come from assets/tokens.css only. A colour written here as a literal
   is invisible to scripts/check_design.py, so do not add one.
   ========================================================================== */

/* ── Base ── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    font-family: var(--font-text);
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss01", "cv11";
}
h1, h2, h3 { font-family: var(--font-text); letter-spacing: -0.02em; text-wrap: balance; }
::selection { background: var(--text-primary); color: var(--primary-bg); }
:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; border-radius: 0; }
img { max-width: 100%; }

html:lang(hi) body { line-height: 1.8; }
html:lang(hi) h1, html:lang(hi) h2, html:lang(hi) h3 { letter-spacing: 0; line-height: 1.35; }
html:lang(hi) * { letter-spacing: 0 !important; }

/* A small label: section names, sources, counts. */
.eyebrow,
.hero-spotlight-section,
.motw-label,
.story-card-meta,
.story-meta,
.story-map-title,
.related-maps-title,
.collection-count,
.result-count,
.crumb,
.vt {
    font-family: var(--font-label);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Tags: a source or a year is a label, never a pill ── */
.tag {
    font-family: var(--font-label);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--text-muted);
}
.tag.source { background: none; color: var(--text-secondary); }
[data-theme="dark"] .tag.source { background: none; }
.tag + .tag::before { content: "\00B7"; margin: 0 0.55em; color: var(--text-muted); font-weight: 400; display: inline-block; text-decoration: none; }
.tag.newer,
.tag.newer:hover {
    background: none;
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.25em;
    border-radius: 0;
}
.tag.newer:hover { color: var(--accent-hover); }

/* ── Footer, on every page ── */
.site-footer {
    text-align: left;
    max-width: calc(var(--page) + 48px);
    margin: 72px auto 0;
    padding: 28px 24px 56px;
    border-top: 0;
    position: relative;
}
.site-footer::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; border-top: var(--rule-strong); }
.site-footer p {
    max-width: 62ch;
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 0.88rem !important;
    line-height: 1.6;
}
.site-footer p:last-child { color: var(--text-muted); }
.site-footer a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 0.2em; }
.site-footer a:hover { color: var(--accent-color); }
.site-footer #source-spotlight { color: var(--text-primary) !important; font-size: 1rem !important; margin-bottom: 20px !important; max-width: 56ch; }
.site-footer #newsletter-signup { margin: 24px 0 !important; max-width: 420px !important; }
.site-footer #newsletter-signup input {
    border: 1px solid var(--text-primary) !important;
    border-radius: var(--radius) !important;
    min-height: 44px;
    min-width: 0;   /* without it the row is 374px wide in a 320px viewport */
    font-size: 0.95rem !important;
    background: var(--card-bg) !important;
}
.site-footer #newsletter-signup button {
    border-radius: var(--radius) !important;
    min-height: 44px;
    font-size: 0.88rem !important;
    font-family: var(--font-text) !important;
    padding: 0 18px !important;
}
@media (max-width: 600px) {
    .site-footer { padding: 24px 16px 40px; margin-top: 48px; }
    .site-footer::before { left: 16px; right: 16px; }
}

/* ==========================================================================
   Home page (index.html)
   ========================================================================== */

/* ── Opening: what the site is, then a map ── */
.hero {
    background: none;
    border-bottom: 0;
    padding: 96px 24px 40px;
    overflow: visible;
}
.hero::before, .hero::after { display: none; }
.hero-inner {
    max-width: var(--page);
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 56px;
    align-items: start;
}
.hero-text h1 {
    font-family: var(--font-text);
    font-size: clamp(2.5rem, 7.2vw, 5rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.045em;
    margin: 0 0 20px;
}
.hero-text h1 span { background: none; padding: 0; color: inherit; -webkit-text-fill-color: currentColor; }
.hero-text .subtitle {
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    line-height: 1.45;
    color: var(--text-secondary);
    max-width: 30em;
    margin: 0 0 28px;
}
/* The five counts are a ruled row of figures, not a set of badges. */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 28px;
    border-top: var(--rule-strong);
    border-bottom: var(--rule);
}
.hero-stat { text-align: left; padding: 12px 8px 12px 12px; border-left: var(--rule); }
.hero-stat:first-child { padding-left: 0; border-left: 0; }
.hero-stat .number {
    font-family: var(--font-text);
    font-variant-numeric: tabular-nums;
    font-size: clamp(1.3rem, 2.3vw, 1.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
}
.hero-stat .label {
    display: block;
    font-family: var(--font-label);
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    line-height: 1.3;
    margin-top: 4px;
    color: var(--text-muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .method-link, .hero .surprise-btn {
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--radius);
    font-family: var(--font-text);
    font-size: 0.9rem;
    font-weight: 600;
    justify-content: center;
    box-shadow: none;
    transition: background .15s, color .15s;
}
.hero .method-link { background: var(--text-primary); color: var(--primary-bg); border: 1px solid var(--text-primary); }
.hero .method-link:hover { background: var(--accent-color); border-color: var(--accent-color); color: var(--on-accent); }
.hero .surprise-btn { background: transparent; color: var(--text-primary); border: 1px solid var(--text-primary); }
.hero .surprise-btn:hover { background: var(--text-primary); color: var(--primary-bg); }

/* The featured map: the sheet on the page, with its caption under a rule. */
.hero-spotlight-card,
.hero-spotlight-card:hover {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    overflow: visible;
}
.hero-spotlight-img { background: var(--secondary-bg); outline: 1px solid var(--border-color); aspect-ratio: 3052 / 1725; }
.hero-spotlight-img img { object-fit: contain; }
.hero-spotlight-body { padding: 14px 0 0; }
.hero-spotlight-section { display: block; margin-bottom: 6px; color: var(--text-muted); }
.hero-spotlight-body h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.25; margin-bottom: 6px; }
.hero-spotlight-card:hover h3 { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.hero-spotlight-body p { font-size: 0.98rem; line-height: 1.5; color: var(--text-secondary); max-width: 60ch; }
.hero-spotlight-progress { justify-content: flex-start; gap: 4px; margin-top: 16px; }
/* Each step is a 24px target with a short bar drawn inside it. */
.hero-spotlight-dot,
.hero-spotlight-dot.active { width: 24px; height: 24px; border-radius: 0; background: none; position: relative; }
.hero-spotlight-dot::after { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--border-color); }
.hero-spotlight-dot.active::after { background: var(--text-primary); }

@media (max-width: 900px) {
    .hero { padding: 84px 16px 28px; }
    /* One column, and the map comes straight after the sentence that says what
       the site is. .hero-text dissolves so its children can be ordered with
       the map between them. */
    .hero-inner { display: flex; flex-direction: column; gap: 0; }
    .hero-text { display: contents; }
    .hero-text h1 { order: 1; font-size: clamp(2.5rem, 12vw, 3.6rem); margin-bottom: 12px; }
    .hero-text .subtitle { order: 2; font-size: 1.02rem; margin-bottom: 18px; }
    .hero-spotlight { order: 3; display: block; max-width: none; width: 100%; margin-bottom: 26px; }
    .hero-stats { order: 4; margin-bottom: 20px; width: 100%; }
    .hero-actions { order: 5; display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .hero-stat { padding: 10px 4px 10px 8px; }
    .hero-stat .label { font-size: 0.56rem; letter-spacing: 0; }
}

/* ── What is new: a note between two rules ── */
.newdata { padding: 0 24px; max-width: calc(var(--page) + 48px); margin: 0 auto; }
.newdata-inner {
    background: none;
    border: 0;
    border-top: var(--rule);
    border-bottom: var(--rule);
    border-radius: 0;
    box-shadow: none !important;
    padding: 18px 0;
    gap: 12px 32px;
}
.newdata strong { color: var(--text-primary); }
.newdata p { color: var(--text-secondary); font-size: 0.98rem; max-width: 80ch; }
.newdata a.go,
.newdata a.go:hover {
    background: none;
    color: var(--accent-color);
    padding: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.25em;
}
.newdata a.go::after { content: "\2192"; margin-left: 0.4em; }
.newdata a.go:hover { color: var(--accent-hover); }

/* ── Map of the week ── */
.motw-banner { max-width: calc(var(--page) + 48px); }
.motw-inner,
.motw-inner:hover {
    background: none;
    border: 0;
    border-bottom: var(--rule);
    border-radius: 0;
    box-shadow: none;
    padding: 20px 0;
    margin-top: 0;
    grid-template-columns: 220px 1fr;
    gap: 24px;
}
.motw-img { border-radius: 0; outline: 1px solid var(--border-color); }
.motw-label { color: var(--text-muted); font-weight: 600; }
.motw-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.motw-inner:hover .motw-title { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.motw-takeaway { font-size: 0.98rem; max-width: 70ch; }

/* ── Theme tabs: text on a rule ── */
.section-nav { background: var(--primary-bg); padding: 0 24px; border-bottom: var(--rule); -webkit-mask-image: none; mask-image: none; }
.section-nav ul { max-width: var(--page); gap: 0; padding: 0; }
.section-nav a,
.section-nav a:hover {
    font-family: var(--font-label);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 0 10px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--text-muted);
    box-shadow: inset 0 -2px 0 transparent;
}
.section-nav li:first-child a { padding-left: 0; }
.section-nav a:hover { color: var(--text-primary); }
.section-nav a.active { color: var(--text-primary); background: none; box-shadow: inset 0 -2px 0 var(--text-primary); }

/* ── Search and the questions ── */
.filter-bar { max-width: calc(var(--page) + 48px); padding: 28px 24px 0; gap: 14px; }
.filter-bar input {
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--text-primary);
    border-radius: var(--radius);
    box-shadow: none;
    font-size: 1rem;
    background: var(--card-bg);
}
.filter-bar input::placeholder { color: var(--text-muted); opacity: 1; }
.filter-bar input:focus { outline: 2px solid var(--accent-color); outline-offset: 2px; border-color: var(--text-primary); }
.autocomplete-list { border: 1px solid var(--text-primary); border-top: 0; border-radius: 0; box-shadow: var(--shadow-xl); }
.question-pills { gap: 6px; }
.question-pill,
.question-pill:hover {
    font-family: var(--font-text);
    font-size: 0.84rem;
    font-weight: 500;
    min-height: 36px;
    padding: 0 12px;
    border-radius: var(--radius);
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.question-pill:hover { border-color: var(--text-primary); color: var(--text-primary); }
.question-pill.active { background: var(--text-primary); border-color: var(--text-primary); color: var(--primary-bg); }

/* ── Story threads: a ruled row ── */
.collections-section { max-width: calc(var(--page) + 48px); padding: 36px 24px 0; }
.collections-header { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 0; padding-bottom: 12px; border-bottom: var(--rule-strong); }
.collections-header h2 { font-size: 1.15rem; font-weight: 700; }
.collections-header p { font-size: 0.9rem; color: var(--text-muted); }
.collections-scroll { gap: 0; padding-bottom: 0; border-bottom: var(--rule); }
.collection-card,
.collection-card:hover {
    background: none;
    border: 0;
    border-right: var(--rule);
    border-radius: 0;
    box-shadow: none;
    transform: none;
    min-width: 250px;
    max-width: 280px;
    padding: 18px 20px 18px 0;
    margin-right: 20px;
}
.collection-card h3 { font-size: 1rem; line-height: 1.3; margin-bottom: 6px; }
.collection-card:hover h3 { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.collection-card p { font-size: 0.86rem; line-height: 1.5; }
.collection-card .collection-count { color: var(--text-muted); font-weight: 600; }

/* ── A theme section ── */
.section { max-width: calc(var(--page) + 48px); padding: 72px 24px 0; }
.section-header { border-left: 0 !important; border-top: var(--rule-strong); padding: 16px 0 0; margin-bottom: 28px; }
.section-header h2 { font-family: var(--font-text); font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 8px; }
.section-header h2::after { content: none; }
.section-header p { font-size: 1.02rem; color: var(--text-secondary); max-width: 62ch; }
.map-count {
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-left: 12px;
    font-family: var(--font-label);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    vertical-align: 0.5em;
}

/* ── Map cards: the map is the content ──
   The caption is one fixed stack: source and year, title, takeaway, policy. */
.section-layout { gap: 40px; }
.map-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 28px; }
.map-card, .map-card-lead,
.map-card:hover, .map-card-lead:hover {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    overflow: visible;
}
.map-card .map-image,
.map-card-lead .map-image {
    aspect-ratio: 3052 / 1725;
    background: var(--secondary-bg);
    outline: 1px solid var(--border-color);
    transition: outline-color .15s;
}
.map-card .map-image img,
.map-card-lead .map-image img { object-fit: contain; }
.map-card:hover .map-image { outline-color: var(--text-primary); }
.map-card .card-body { padding: 12px 0 0; }
.map-card .meta,
.map-card-lead .meta { order: -1; margin: 0 0 6px; padding: 0; border: 0; gap: 0; row-gap: 2px; }
.map-card h3 { font-size: 1.08rem; font-weight: 700; line-height: 1.25; margin-bottom: 6px; }
.map-card:hover h3 { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.map-card .takeaway { font-size: 0.95rem; line-height: 1.5; color: var(--text-secondary); margin-bottom: 0; display: block; overflow: visible; -webkit-line-clamp: unset; flex: 0 1 auto; }
.map-card .policy-preview,
.map-card:hover .policy-preview {
    background: none;
    border-radius: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 400;
    padding: 0 0 0 10px;
    border-left: 2px solid var(--border-color);
    margin: 0;
}
.map-card:hover .policy-preview { margin-top: 10px; }

/* The page declares .map-card (flex) after .map-card-lead (grid), so the lead
   card was a stack at every width. It is a grid here: map left, caption right. */
.map-card-lead { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: start; }
.map-card-lead .card-body { padding: 0; justify-content: flex-start; }
.map-card-lead h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 12px; }
.map-card-lead .takeaway { font-size: 1.1rem; line-height: 1.5; color: var(--text-primary); margin-bottom: 14px; }
.map-card-lead .policy-note { font-size: 0.95rem; font-weight: 400; color: var(--text-secondary); border-top: 0; border-left: 2px solid var(--text-primary); padding: 0 0 0 12px; }

/* During a search every match is shown, collapsed or not (see applyFilters in index.html). */
body.filtering .map-grid .map-card.hidden-card { display: flex; }
body.filtering .expand-btn-wrap { display: none; }
.expand-btn-wrap { margin-top: 32px; border-top: var(--rule); border-bottom: var(--rule); }
.expand-btn,
.expand-btn:hover {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 0;
    background: none;
    font-family: var(--font-text);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}
.expand-btn:hover { background: var(--hover-bg); }

@media (max-width: 900px) {
    .newdata, .section-nav { padding-left: 16px; padding-right: 16px; }
    .filter-bar { padding: 20px 16px 0; }
    .collections-section { padding: 28px 16px 0; }
    .section { padding: 56px 16px 0; }
    .map-card-lead { grid-template-columns: 1fr; gap: 0; }
    .map-card-lead .card-body { padding: 12px 0 0; }
    .map-card-lead h3 { font-size: 1.4rem; }
    .map-card-lead .takeaway { font-size: 1.02rem; }
    .map-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px 20px; }
    .question-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
    .question-pills::-webkit-scrollbar { display: none; }
    .question-pill { flex: none; }
    .filter-bar .result-count { text-align: left; }
    .section-header h2 { font-size: 1.7rem; }
    .section-header p { font-size: 0.98rem; }
    .map-count { font-size: 0.7rem; }
    .collection-card { min-width: 230px; padding: 16px 16px 16px 0; margin-right: 16px; }
}

/* ── State profile bar ── */
.state-profile-banner { max-width: calc(var(--page) + 48px); }
.state-profile-inner { background: var(--secondary-bg); border: 0; border-left: 4px solid var(--text-primary); border-radius: 0; }
.state-profile-inner h2 { font-size: 1.4rem; font-weight: 800; }
.state-profile-close { border-radius: var(--radius); min-height: 40px; border-color: var(--text-primary) !important; color: var(--text-primary) !important; background: none; }
.state-profile-close:hover { background: var(--text-primary); color: var(--primary-bg) !important; }

/* ── Dialogs: state picker, about, map detail ── */
.state-overlay, .about-overlay, .detail-overlay { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(10, 12, 14, 0.72); }
.state-panel, .about-panel, .detail-panel {
    background: var(--primary-bg);
    border: 1px solid var(--text-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}
.state-panel-header h2, .about-panel-header h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; }
.detail-panel { max-width: 960px; }
.detail-panel-header { padding: 20px 24px 16px; align-items: center; }
.detail-panel-header h2 { font-size: clamp(1.15rem, 2.4vw, 1.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.detail-nav-btn, .detail-close-btn, .about-panel-close {
    width: 40px; height: 40px; min-width: 40px;
    border-radius: var(--radius);
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.detail-nav-btn:hover, .detail-close-btn:hover, .about-panel-close:hover { background: var(--text-primary); border-color: var(--text-primary); color: var(--primary-bg); }
.detail-map-container { background: var(--secondary-bg); padding: 0; }
.detail-map-container img { border-radius: 0; max-height: 62vh; }
.detail-takeaway {
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 16px;
    max-width: 62ch;
}
.detail-policy {
    background: none;
    border-left: 2px solid var(--text-primary);
    border-radius: 0;
    padding: 0 0 0 14px;
    font-size: 0.98rem;
    max-width: 66ch;
}
.detail-policy strong { font-family: var(--font-label); font-weight: 600; color: var(--text-muted); letter-spacing: 0.06em; }
.detail-meta { gap: 0; row-gap: 4px; }
.detail-meta .tag { font-size: 0.72rem; padding: 0; }
.detail-actions { gap: 8px; }
/* Seven actions in seven colours read as a toolbar from another decade. One
   style: an outlined button. The first one, the way into the interactive view,
   is filled. The inline colours in the markup are overridden here, which also
   removes white on WhatsApp green (1.98:1). */
.detail-download-btn {
    min-height: 40px;
    padding: 0 14px;
    border-radius: var(--radius);
    font-family: var(--font-text);
    font-size: 0.86rem;
    background: none !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--text-primary);
    text-decoration: none;
}
.detail-download-btn svg { fill: none; }
.detail-download-btn svg[fill="white"] { fill: currentColor; }
.detail-download-btn:hover { background: var(--text-primary) !important; color: var(--primary-bg) !important; }
#detail-interactive-btn { background: var(--accent-color) !important; color: var(--on-accent) !important; border-color: var(--accent-color); }
#detail-interactive-btn:hover { background: var(--accent-hover) !important; color: var(--on-accent) !important; border-color: var(--accent-hover); }
.detail-license { flex-basis: 100%; font-size: 0.8rem; margin-top: 6px; }
.related-maps-grid { gap: 16px; }
.related-map-item, .related-map-item:hover { border: 0; border-radius: 0; box-shadow: none; }
.related-map-item img { outline: 1px solid var(--border-color); }
.related-map-item span { padding: 8px 0 0; font-size: 0.82rem; font-weight: 600; color: var(--text-primary); white-space: normal; }
.related-map-item:hover span { text-decoration: underline; text-underline-offset: 0.2em; }
.state-search { border: 1px solid var(--text-primary); border-radius: var(--radius); min-height: 44px; background: var(--card-bg); }
.state-grid { gap: 0; border-top: var(--rule); border-left: var(--rule); }
.state-btn,
.state-btn:hover { border: 0; border-right: var(--rule); border-bottom: var(--rule); border-radius: 0; background: none; min-height: 44px; font-size: 0.86rem; text-align: left; padding: 8px 12px; color: var(--text-primary); }
.state-btn:hover { background: var(--text-primary); color: var(--primary-bg); }
.about-panel-body { font-size: 1rem; line-height: 1.65; }
.about-panel-body .about-stats { gap: 0; border-top: var(--rule-strong); border-bottom: var(--rule); text-align: left; }
.about-panel-body .about-stat-item { background: none; border-radius: 0; padding: 12px 8px 12px 0; }
.about-panel-body .about-stat-num { font-family: var(--font-label); font-weight: 600; color: var(--text-primary); letter-spacing: -0.04em; }
.about-panel-body .about-stat-label { font-family: var(--font-label); }
.about-panel-body .about-sources { gap: 0; }
.about-panel-body .about-sources span { font-family: var(--font-label); background: none; padding: 0; border-radius: 0; font-size: 0.74rem; }
.about-panel-body .about-sources span + span::before { content: "\00B7"; margin: 0 0.6em; }
@media (max-width: 768px) {
    .detail-panel-header { padding: 14px 14px 12px; }
    .detail-panel-header h2 { font-size: 1.1rem; }
    .detail-nav-btn, .detail-close-btn { width: 40px; height: 40px; min-width: 40px; }
    .detail-takeaway { font-size: 1.05rem; padding: 0; }
    .detail-policy { font-size: 0.92rem; padding: 0 0 0 12px; }
    .detail-actions { flex-direction: row; }
    .detail-download-btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
    .related-maps-grid { grid-template-columns: repeat(2, 1fr); }
    .related-map-item span { font-size: 0.78rem; padding: 6px 0 0; }
}

/* ==========================================================================
   Interactive atlas (explore.html)
   The two-column head above 960px is laid out by the page itself and is not
   touched here: see CLAUDE.md before changing it.
   ========================================================================== */
.wrap { max-width: calc(var(--page) + 48px); padding-left: 24px; padding-right: 24px; }
.page-head h1, .wrap > h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.eyebrow { color: var(--text-muted); }
.wrap .lead { font-size: 1rem; line-height: 1.55; }

/* Tabs sit on a rule; the open one is underlined in ink. */
.view-tabs { gap: 0; padding: 0; background: none; border: 0; border-bottom: var(--rule); border-radius: 0; }
.view-tab,
.view-tab:hover { border-radius: 0; padding: 0 16px; min-height: 44px; font-size: 0.92rem; color: var(--text-muted); background: none; box-shadow: inset 0 -2px 0 transparent; }
.view-tab:first-child { padding-left: 0; }
.view-tab:hover { color: var(--text-primary); }
.view-tab.active { background: none; color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--text-primary); }
.mode-tabs { gap: 0; padding: 0; background: none; border: 1px solid var(--text-primary); border-radius: var(--radius); }
.mode-tab { border-radius: 0; min-height: 40px; color: var(--text-primary); }
.mode-tab[aria-pressed="true"] { background: var(--text-primary); color: var(--primary-bg); box-shadow: none; }
.select-wrap .sw-label { font-family: var(--font-label); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.06em; margin-bottom: 6px; }
.search-input { border-radius: var(--radius); min-height: 44px; border-color: var(--border-color); border-bottom: 0; margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.search-input::placeholder { color: var(--text-muted); opacity: 1; }
select.im-select { border: 1px solid var(--text-primary); border-radius: var(--radius); min-height: 48px; font-size: 1rem; }
.search-input + select.im-select { border-top-left-radius: 0; border-top-right-radius: 0; }
.dl-btn { font-family: var(--font-label); border-radius: var(--radius); min-height: 40px; padding: 0 12px; background: none; border-color: var(--border-color); color: var(--text-primary); }
.dl-btn:hover { border-color: var(--text-primary); color: var(--text-primary); background: var(--hover-bg); }
.meta-row { font-family: var(--font-label); font-size: 0.76rem; gap: 6px 14px; }
.meta-row .badge { background: none; border: 0; border-radius: 0; padding: 0; color: var(--text-primary); font-weight: 700; }
.source-link { text-decoration: underline; text-underline-offset: 0.2em; }
.ind-desc { font-size: 0.98rem; }

.wrap .map-grid { gap: 32px; margin-top: 24px; grid-template-columns: minmax(0, 1fr) 300px; }
.wrap .map-card,
.wrap .map-card:hover { background: none; border: 0; border-top: var(--rule-strong); border-radius: 0; padding: 12px 0 0; }
.panel { background: none; border: 0; border-top: var(--rule-strong); border-radius: 0; padding: 12px 0 0; }
.panel h3 { font-family: var(--font-label); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.06em; }
.side { gap: 28px; }
.legend-bar { height: 14px; border-radius: 0; }
.legend-scale, .legend-avg, .legend-dir { font-family: var(--font-label); }
.legend-scale { font-size: 0.76rem; }
.legend-avg { font-size: 0.7rem; }
.legend-dir { font-size: 0.7rem; }
.legend-dir .dot { border-radius: 0; width: 10px; height: 10px; }
.rank-row { padding: 8px 0; font-size: 0.92rem; }
.rank-row .r-name { color: var(--text-primary); }
.rank-row .r-val, .rank-bar-row .rb-val, .rank-bar-row .rb-rank, .trend { font-family: var(--font-label); font-weight: 600; }
.rank-gap { opacity: 1; }
.rank-list { background: none; border: 0; border-top: var(--rule-strong); border-radius: 0; padding: 8px 0 0; margin-top: 24px; }
.rank-bar-row { padding: 5px 0; border-bottom: var(--rule); }
.rank-bar-row .rb-name { font-size: 0.9rem; }
.rank-bar-row .rb-track { background: none; border-radius: 0; height: 14px; }
.rank-bar-row .rb-fill { border-radius: 0; }
.rank-avg-note { border-top: 0; font-family: var(--font-label); }
.scatter-card { background: none; border: 0; border-top: var(--rule-strong); border-radius: 0; padding: 12px 0 0; }
#scatter-svg text { font-family: var(--font-label); }
.corr-card .big-r { font-family: var(--font-label); font-weight: 600; font-size: 2.6rem; letter-spacing: -0.05em; }
.state-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -0.035em; }
.state-head .st-tag { font-family: var(--font-label); background: none; border: 0; border-radius: 0; padding: 0; font-weight: 600; }
.state-dash { gap: 0 28px; border-top: var(--rule-strong); }
.dash-card,
a.dash-card:hover { background: none; border: 0; border-bottom: var(--rule); border-radius: 0; padding: 14px 0; transform: none; }
a.dash-card:hover .dash-name { text-decoration: underline; text-underline-offset: 0.2em; }
.dash-name small { font-family: var(--font-label); }
.dash-val { font-family: var(--font-label); font-weight: 600; letter-spacing: -0.04em; }
.dash-val small { font-family: var(--font-label); letter-spacing: 0; }
.dash-track { border-radius: 0; height: 6px; }
.dash-track .fill { border-radius: 0; }
.dash-foot { font-family: var(--font-label); font-size: 0.72rem; }
.tooltip { border-radius: var(--radius); box-shadow: var(--shadow-xl); padding: 10px 12px; }
.tooltip .t-val { font-family: var(--font-label); font-weight: 600; }
.note { background: none; border: 0; border-top: var(--rule); border-radius: 0; padding: 16px 0 0; margin-top: 40px; font-size: 0.86rem; line-height: 1.6; color: var(--text-secondary); }
.wrap .credit { font-size: 0.82rem; }
.wrap .credit a, .note a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 0.2em; }
@media (min-width: 900px) { .note { columns: 2; column-gap: 40px; } }
@media (max-width: 820px) {
    .wrap .map-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 600px) {
    .wrap { padding-left: 16px; padding-right: 16px; }
    .view-tabs { display: flex; }
    .view-tab { flex: 1 1 auto; padding: 0 8px; }
}

/* ==========================================================================
   Stories (stories.html)
   ========================================================================== */
.story-index { max-width: calc(var(--page) + 48px); padding: 104px 24px 0; }
.story-index h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1; margin-bottom: 14px; }
.story-index > p { font-size: 1.1rem; line-height: 1.5; max-width: 34em; margin-bottom: 36px; }
.story-index-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 32px; border-top: var(--rule-strong); }
/* The hairline is above each entry, so the rules of one row line up whatever the text lengths. */
.story-index-card,
.story-index-card:hover {
    background: none;
    border: 0;
    border-top: var(--rule);
    border-radius: 0;
    box-shadow: none;
    transform: none;
    padding: 20px 0 22px;
}
.story-index-card h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 8px; }
.story-index-card:hover h3 { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.story-index-card p { font-size: 0.96rem; line-height: 1.5; margin-bottom: 12px; max-width: 46ch; }
.story-index-card .story-card-meta { font-size: 0.7rem; }
.wa-share, .wa-share:hover { border-radius: var(--radius); min-height: 44px; background: none; color: var(--text-primary); border: 1px solid var(--text-primary); margin-top: 28px; }
.wa-share svg { fill: currentColor; }
.wa-share:hover { background: var(--text-primary); color: var(--primary-bg); }
.story-container { max-width: calc(var(--page) + 48px); padding-left: 24px; padding-right: 24px; }
.story-container > * { max-width: 46rem; }
.story-container > .story-map { max-width: 64rem; margin-left: 0; margin-right: 0; }
.story-container > .story-map .story-map-caption { margin-left: 0; margin-right: 0; max-width: 46rem; }
.story-title-block { text-align: left; padding: 32px 0; border-bottom: var(--rule-strong); margin-bottom: 36px; }
.story-title-block h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.story-title-block .story-subtitle { margin: 0 0 18px; font-size: 1.2rem; line-height: 1.45; }
.story-text { font-size: 1.1rem; line-height: 1.7; color: var(--text-primary); }
.story-text em { color: inherit; font-weight: 700; }
.story-map img { border-radius: 0; border: 1px solid var(--border-color); }
.story-map-caption { background: none; border-left: 2px solid var(--text-primary); border-radius: 0; font-size: 0.95rem; }
.story-divider svg { color: var(--text-muted); }
.story-cta { text-align: left; }
.story-cta a { border-radius: var(--radius); background: var(--text-primary); color: var(--primary-bg); min-height: 44px; }
.story-cta a:hover { background: var(--accent-color); color: var(--on-accent); }
.back-to-stories { font-family: var(--font-label); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-primary); min-height: 44px; }
.story-progress { background: var(--text-primary); height: 2px; }
@media (max-width: 768px) {
    .story-index { padding: 88px 16px 0; }
    .story-index-grid { grid-template-columns: 1fr; }
    .story-text { font-size: 1.05rem; }
    .story-container { padding-left: 16px; padding-right: 16px; }
    .content { padding: 88px 16px 0; }
}

/* ==========================================================================
   Methodology (methodology.html)
   ========================================================================== */
.content { max-width: calc(var(--page) + 48px); padding: 104px 24px 0; }
.content > * { max-width: 46rem; }
.content h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1; margin-bottom: 16px; }
.content h1 span { background: none; color: inherit; -webkit-text-fill-color: currentColor; }
.content .lead { font-size: 1.2rem; line-height: 1.45; margin-bottom: 8px; }
.content h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; margin: 56px 0 14px; padding-top: 14px; border-top: var(--rule-strong); }
.content h2:first-of-type { border-top: var(--rule-strong); padding-top: 14px; }
.content p, .content li { font-size: 1.02rem; line-height: 1.65; }
.content code { border-radius: 0; }
.content > .table-scroll { overflow-x: auto; margin: 16px 0 24px; max-width: 56rem; }
.table-scroll .source-table { margin: 0; min-width: 560px; }
.source-table { font-size: 0.95rem; }
.source-table th { font-family: var(--font-label); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.06em; background: none; border-bottom: var(--rule-strong); padding-left: 0; vertical-align: bottom; }
.source-table td { padding-left: 0; vertical-align: top; }
.source-table td:first-child { color: var(--text-primary); }
.source-table td:nth-child(2), .source-table td:last-child { font-family: var(--font-label); font-size: 0.84rem; white-space: nowrap; }
.badge { font-family: var(--font-label); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.06em; border-radius: 0; padding: 3px 8px; }
.limitation { background: none; border: 0; border-top: var(--rule); border-radius: 0; padding: 16px 0 4px; margin-bottom: 0; }
.limitation h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.limitation p { font-size: 1rem; margin-bottom: 12px; }
.content > p[style] { background: none !important; border: 0 !important; border-top: var(--rule-strong) !important; border-radius: 0 !important; padding: 16px 0 0 !important; }

/* ==========================================================================
   Map pages and the index of all maps (m/, written by build_map_pages.py)
   ========================================================================== */
.mp { max-width: calc(var(--page) + 48px); margin: 0 auto; padding: 92px 24px 0; }
.mp .crumb { margin-bottom: 14px; }
.mp .crumb a { color: var(--text-muted); text-decoration: none; display: inline-block; padding: 8px 0; }
.mp .crumb a:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 0.25em; }
.mp h1 { font-size: clamp(1.9rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.04; margin: 0 0 16px; max-width: 22em; }
.mp-lead { font-size: clamp(1.1rem, 1.8vw, 1.4rem); line-height: 1.4; color: var(--text-primary); max-width: 46ch; margin: 0 0 28px; }
.mp-figure { margin: 0; }
.mp-figure a { display: block; }
.mp-figure img { display: block; width: 100%; height: auto; background: var(--secondary-bg); outline: 1px solid var(--border-color); }
.mp-figure figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding: 10px 0 0; font-family: var(--font-label); font-size: 0.74rem; letter-spacing: 0.02em; color: var(--text-muted); }
.mp-figure figcaption a { display: inline; color: var(--text-primary); text-decoration: underline; text-underline-offset: 0.25em; padding: 6px 0; }
.mp-cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; margin-top: 44px; align-items: start; }
.mp-block { border-top: var(--rule-strong); padding-top: 14px; }
.mp-block + .mp-block { margin-top: 36px; }
.mp-block h2 { font-family: var(--font-label); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 10px; }
.mp-block p { font-size: 1.05rem; line-height: 1.6; color: var(--text-secondary); max-width: 62ch; }
.mp-block p + p { margin-top: 12px; }
.mp-block a { color: var(--accent-color); text-decoration: underline; text-underline-offset: 0.2em; }
.mp-facts { margin: 0; }
.mp-facts div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: var(--rule); }
.mp-facts div:first-child { padding-top: 0; }
.mp-facts dt { font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding-top: 0.25em; }
.mp-facts dd { margin: 0; font-size: 0.98rem; line-height: 1.5; color: var(--text-primary); }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.mp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4em; min-height: 46px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--text-primary); background: none; color: var(--text-primary) !important; font-size: 0.94rem; font-weight: 600; text-decoration: none !important; }
.mp-btn:hover { background: var(--text-primary); color: var(--primary-bg) !important; }
.mp-btn.primary { background: var(--accent-color); border-color: var(--accent-color); color: var(--on-accent) !important; }
.mp-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent) !important; }
.mp-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 64px; border-top: var(--rule-strong); border-bottom: var(--rule); }
.mp-pager a { display: block; padding: 16px 0; color: var(--text-primary); text-decoration: none; min-width: 0; }
.mp-pager a + a, .mp-pager span + a { text-align: right; border-left: var(--rule); padding-left: 16px; }
.mp-pager a:first-child { padding-right: 16px; }
.mp-pager small { display: block; font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.mp-pager b { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.mp-pager a:hover b { text-decoration: underline; text-underline-offset: 0.2em; }
.mp-credit { font-size: 0.86rem; color: var(--text-muted); margin-top: 20px; max-width: 70ch; }
.mp-credit a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 900px) {
    .mp { padding: 80px 16px 0; }
    .mp-cols { grid-template-columns: 1fr; gap: 36px; margin-top: 32px; }
    .mp-actions .mp-btn { flex: 1 1 100%; }
    .mp-pager b { font-size: 0.92rem; }
}

/* The index of all maps */
.mp-index h1 { margin-bottom: 12px; }
.mp-index .mp-lead { color: var(--text-secondary); font-size: 1.1rem; max-width: 34em; }
.mp-index .mp-lead a { color: var(--accent-color); }
.mp-index section { margin: 56px 0 0; border-top: var(--rule-strong); padding-top: 14px; }
.mp-index h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; border: 0; padding: 0; margin: 0 0 12px; }
.mp-index h2 small { font-family: var(--font-label); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; color: var(--text-muted); margin-left: 8px; vertical-align: 0.3em; }
.mp-index ul { list-style: none; columns: 2; column-gap: 40px; margin: 0; padding: 0; }
.mp-index li { break-inside: avoid; margin: 0; border-bottom: var(--rule); }
.mp-index li a { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; padding: 11px 0; color: var(--text-primary); text-decoration: none; font-size: 0.98rem; line-height: 1.35; }
.mp-index li a:hover .t { text-decoration: underline; text-underline-offset: 0.2em; }
.mp-index .vt { font-size: 0.68rem; white-space: normal; text-align: right; }
@media (max-width: 760px) { .mp-index ul { columns: 1; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
@media print {
    .im-header, .site-footer #newsletter-signup, .mp-actions, .mp-pager { display: none !important; }
    body { background: none; }
}

/* Figures line up in columns. */
.hero-stat .number, .about-stat-num, .rank-row .r-val, .rank-bar-row .rb-val, .rank-bar-row .rb-rank,
.dash-val, .dash-foot, .corr-card .big-r, .tooltip .t-val, .legend-scale, .legend-avg, .meta-row,
.source-table td, .mp-facts dd, .tag, .vt { font-variant-numeric: tabular-nums; }

/* The site name stays in Latin script in Hindi mode, so it keeps its tracking. */
html:lang(hi) .hero-text h1 { letter-spacing: -0.045em !important; line-height: 0.98; }
html:lang(hi) .im-logo-main { letter-spacing: -0.02em !important; }
.detail-license { text-align: left !important; }

/* The ranking bar is a span. Width does not apply to an inline box, so the bar
   had no width at all until it was made a block. */
.rank-bar-row .rb-fill { display: block; }
.rank-bar-row .rb-track { background: var(--secondary-bg); }
/* A story opened on its own starts under the fixed bar, which is 60px tall. */
.story-container { padding-top: 92px; }
