/*
 * The state layer: what agr-register.css does not already style on a state
 * page. Enqueued by the site layer after agr-register.css. Reuses the core's
 * agr-* tokens and the brand templates' rec-* classes; adds the seventh chart
 * slot (g4, NOT OPERATING) and the Index's coverage code swatches.
 */

:root {
    --agr-g4: var(--agr-viz-g4, #4E4D47); --agr-g4-ink: var(--agr-viz-g4-ink, #FFFFFF);
}
html[data-ncg-theme="dark"] {
    --agr-g4: var(--agr-viz-g4-dark, #CFCEC6); --agr-g4-ink: #111111;
}
html[data-ncg-theme="high-contrast"] {
    --agr-g4: #FFFFFF; --agr-g4-ink: #000000;
}

/* NOT OPERATING: a hatched neutral, so it never reads as a point on the published ramp. */
.agr-g4 {
    background-color: var(--agr-g4);
    color: var(--agr-g4-ink);
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .28) 0 2px, transparent 2px 6px);
}
html[data-ncg-theme="dark"] .agr-g4 { background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, .22) 0 2px, transparent 2px 6px); }
@media (forced-colors: active) {
    .agr-g4 { background-color: Canvas; background-image: repeating-linear-gradient(90deg, CanvasText 0 1px, transparent 1px 4px); }
}

/* The Index's codes beside the core's swatches. */
.agr-code-program::before { background: var(--agr-s1); }
.agr-code-mention::before { background: var(--agr-s2); }
.agr-code-not-operating::before { background: var(--agr-g4); }

/* Identity and the citation line. */
.ndedi-state-hero {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 24px;
    align-items: start;
    margin-block-end: 28px;
}
.ndedi-state-hero-facts { margin: 0; }
.ndedi-state-hero-cite .agr-citeline { margin: 0; }
@media (max-width: 782px) {
    .ndedi-state-hero { grid-template-columns: minmax(0, 1fr); }
}

/* Versions and year cycles: a disclosure menu above the identity. */
.ndedi-versions-menu { position: relative; margin-block-end: 20px; }
.ndedi-versions-menu summary {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    min-height: 44px; padding: 10px 44px 10px 16px; cursor: pointer; position: relative; list-style: none;
    border: 1px solid var(--ncg-color-border, #767676); border-radius: 10px;
    background: var(--ncg-color-bg-surface, #fff); color: var(--ncg-color-heading, #23312C);
}
.ndedi-versions-menu summary::-webkit-details-marker { display: none; }
.ndedi-versions-menu summary::after {
    content: ""; position: absolute; inset-inline-end: 18px; inset-block-start: 50%;
    width: 8px; height: 8px; margin-top: -6px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.ndedi-versions-menu details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
@media (prefers-reduced-motion: no-preference) { .ndedi-versions-menu summary::after { transition: transform .15s; } }
.ndedi-versions-menu summary:focus-visible { outline: 3px solid var(--agr-focus, #8A5A38); outline-offset: 2px; }
.ndedi-versions-menu-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--ncg-color-muted, #444); }
.ndedi-versions-menu-this { font-weight: 700; }
.ndedi-versions-menu-count { font-size: .9rem; color: var(--ncg-color-muted, #444); }
.ndedi-versions-menu-panel {
    position: absolute; z-index: 30; inset-inline-start: 0; margin-block-start: 8px;
    min-width: min(100%, 26rem); max-height: 70vh; overflow: auto; padding: 8px 20px 16px;
    border: 1px solid var(--ncg-color-border, #767676); border-radius: 10px;
    background: var(--ncg-color-bg-surface, #fff); box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.ndedi-versions-menu-cycle { font-size: 1rem; margin: 14px 0 6px; }
.ndedi-versions-menu-panel ul { list-style: none; margin: 0; padding: 0; }
.ndedi-versions-menu-panel li { padding: 6px 0; border-bottom: 1px solid var(--rec-hairline, #e3e0d8); }
.ndedi-versions-menu-panel li:last-child { border-bottom: 0; }
.ndedi-versions-menu-tag { font-size: .8rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; margin-inline-start: 6px; }
.ndedi-versions-menu-more { margin: 12px 0 0; }
@media (max-width: 640px) { .ndedi-versions-menu-panel { position: static; min-width: 0; max-height: none; overflow: visible; box-shadow: none; } }
@media print { .ndedi-versions-menu { display: none; } }

/* Formulations beside every table of codes: compact inside a panel. */
.ndedi-state-formulations { margin-block: 12px 20px; }
.ndedi-state-formulations li { font-size: 1rem; }

/* Cards for providers, responses, and licensed Schools and Programs detail. */
.ndedi-state-silence,
.ndedi-state-school,
.ndedi-state-response { margin-block: 16px; }
.ndedi-state-silence h3,
.ndedi-state-school h3 { margin-block: 0 8px; }
.ndedi-state-row-comments { margin-block: 16px; }

/* Figures and references. */
.ndedi-state-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.ndedi-state-sref { white-space: nowrap; }
.ndedi-state-asof { margin-block-start: 6px; }

/* The rendering rule by tier. */
.ndedi-state-locked { display: inline-flex; align-items: center; gap: 6px; color: var(--ncg-color-body, #333333); }
.ndedi-state-licensed-note,
.ndedi-state-unlicensed {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
    padding: 12px 16px;
    border: 1px dashed var(--ncg-color-border, #767676);
    border-radius: 8px;
    background: var(--ncg-color-bg-paper, #FAF8F3);
}
.ndedi-state-unlicensed { font-size: 1.02rem; line-height: 1.55; }

/* The plain-language summary (schema 1.2): readable measure, larger type, above the tabs. */
.ndedi-state-plain { max-width: 70ch; }
.ndedi-state-plain p { font-size: 1.08rem; line-height: 1.65; }

/* The method as applied and the contact of record. */
.ndedi-state-norms li { margin-block: 4px; }
.ndedi-state-contact { margin-block: 8px 16px; }

/* Disclosures inside tables: capture filenames on a coverage row, a fiscal channel's series. */
.ndedi-state-captures summary,
.ndedi-state-series summary { cursor: pointer; }
.ndedi-state-captures summary:focus-visible,
.ndedi-state-series summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.ndedi-state-captures .rec-list { margin: 6px 0 0; padding-inline-start: 1.1em; }
.ndedi-state-captures code { overflow-wrap: anywhere; font-size: .86em; }
.ndedi-state-series { margin-block: 8px; }
.ndedi-state-series .rec-table-wrap { margin-block-start: 8px; }

@media print {
    .ndedi-state-hero { grid-template-columns: minmax(0, 1fr); }
    .ndedi-state-licensed-note, .ndedi-state-unlicensed { border-style: solid; }
}

/* The narrative's section headings, free to every reader. */
.ndedi-narrative-contents { columns: 2 18rem; column-gap: 32px; margin: 0 0 16px; padding-inline-start: 0; list-style: none; }
.ndedi-narrative-contents li { break-inside: avoid; padding: 4px 0; }

/* Find a district or agency, above the tabs. */
.ndedi-find-agency { display: grid; gap: 6px; margin-block: 8px 28px; padding: 16px 20px; border: 1px solid var(--ncg-color-border, #767676); border-radius: 10px; background: var(--ncg-color-bg-surface, #fff); }
.ndedi-find-agency label { font-weight: 700; color: var(--ncg-color-heading, #23312C); }
.ndedi-find-agency-hint { font-size: .9rem; color: var(--ncg-color-muted, #444); }
.ndedi-find-agency-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ndedi-find-agency input[type="search"] { flex: 1 1 16rem; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ncg-color-border, #767676); border-radius: 6px; font: inherit; }
.ndedi-find-agency input[type="search"]:focus-visible { outline: 3px solid var(--agr-focus, #8A5A38); outline-offset: 2px; }
.ndedi-find-agency .rec-btn { min-height: 44px; }

/* Compare two versions. */
.ndedi-compare-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; margin-block: 8px 28px; padding: 16px 20px; border: 1px solid var(--ncg-color-border, #767676); border-radius: 10px; background: var(--ncg-color-bg-surface, #fff); }
.ndedi-compare-form label { display: grid; gap: 4px; font-weight: 700; flex: 1 1 14rem; }
.ndedi-compare-form select { min-height: 44px; padding: 6px 10px; font: inherit; font-weight: 400; border: 1px solid var(--ncg-color-border, #767676); border-radius: 6px; max-width: 100%; }
.ndedi-compare-form .rec-btn { min-height: 44px; }
.ndedi-compare-group { margin-block: 12px; }
.ndedi-compare-group > summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.ndedi-compare-locked { padding: 16px 20px; border: 1px solid var(--ncg-color-border, #767676); border-radius: 10px; }
.ndedi-versions-menu-more a + a { margin-inline-start: 16px; }

