/* Shared Atlas palette for mastheads, reading surfaces and map controls. */
:root {
  --atlas-navy: #153641;
  --atlas-ink: #17323b;
  --atlas-muted: #4d646c;
  --atlas-paper: #f2f6f5;
  --atlas-card: #fff;
  --atlas-border: #cddbd9;
  --atlas-link: #075f68;
  --atlas-focus: #087c89;
}
html:has(body[data-atlas-surface]),
body[data-atlas-surface] { background: var(--atlas-paper); color: var(--atlas-ink); }
body[data-atlas-surface] :focus-visible {
  outline: 2px solid var(--atlas-focus);
  outline-offset: 3px;
}
body[data-atlas-surface] > :is(.bar, .top, .head, .nv-top, header[data-atlas-masthead]) {
  background: var(--atlas-navy);
  color: #fff;
  border-bottom: 1px solid #42636b;
}
body[data-atlas-surface] > :is(.bar, .top, .head, header[data-atlas-masthead]) a {
  color: #e5f5f4;
}
body[data-atlas-surface] > :is(.bar, .top, .head, .nv-top, header[data-atlas-masthead]) :focus-visible {
  outline-color: #a5edf1;
}
body[data-atlas-surface] > .bar .role { color: #d7e6e7; }
body[data-atlas-surface] > .bar .who { color: #f1d696; }
body[data-atlas-surface] > .bar .wrap { height: auto; min-height: 56px; padding-block: 6px; }
body[data-atlas-surface] > .bar img { width: 34px; height: 34px; }
body[data-atlas-surface] > footer { border-color: var(--atlas-border); }

body[data-atlas-surface="editorial"] {
  --line: var(--atlas-border);
  --mute: var(--atlas-muted);
}
body[data-atlas-surface="editorial"] > :is(.hero, .rhero) {
  --line: rgba(201,162,39,.32);
  --mute: #b5c9cf;
  background: var(--atlas-navy);
  color: #fffdf8;
}
body[data-atlas-surface="editorial"] > :is(.sec, .figs, .shelf, .hydro-bridge, main, footer) {
  --paper: var(--atlas-ink);
  --gold: var(--atlas-link);
  --gold2: var(--atlas-link);
}
body[data-atlas-surface="editorial"] > .figs { background: #e6efed; }
body[data-atlas-surface="editorial"] .fig b,
body[data-atlas-surface="editorial"] .hydro-bridge h2 { color: var(--atlas-ink); }
body[data-atlas-surface="editorial"] :is(.sec .intro, .d p, .rc .hook, .note p, .hydro-lede, .hydro-note, .india p, .region .seed, .region .hook) {
  color: var(--atlas-muted);
}
body[data-atlas-surface="editorial"] :is(.d, .rc, .shelf .card, .india, .hydro-table) {
  background: var(--atlas-card);
  border-color: var(--atlas-border);
}
body[data-atlas-surface="editorial"] .d { border-top-color: var(--acc); min-height: 0; }
body[data-atlas-surface="editorial"] :is(.d:hover, .rc:hover, .rc.on) { background: #e8f3f1; border-color: #659692; }
body[data-atlas-surface="editorial"] :is(.d .n, .d .go, .hydro-bridge .kicker, .hydro-table th, .hydro-table a, .hydro-note a) {
  color: var(--atlas-link);
}
body[data-atlas-surface="editorial"] .hydro-table table { color: var(--atlas-ink); }
body[data-atlas-surface="editorial"] .hydro-table :is(th, td) { border-color: var(--atlas-border); }
body[data-atlas-surface="editorial"] .shelf .card { border-radius: 8px; }
body[data-atlas-surface="editorial"] > .shelf .wait { color: var(--atlas-muted); }
body[data-atlas-surface="editorial"] .others a { color: var(--atlas-link); }

body[data-atlas-surface="state"] {
  --sheet: var(--atlas-paper);
  --card: var(--atlas-card);
  --border: var(--atlas-border);
}
body[data-atlas-surface="state"].map-mode { background: var(--atlas-paper); }
body[data-atlas-surface="state"] > .nv-top :is(.brand, .brand-sub, .nav-lab) { color: #e1eeee; }
body[data-atlas-surface="state"] > .nv-top .mainnav a:not(.on) { color: #f5fbfa; background: transparent; }
body[data-atlas-surface="state"] > .nv-top .mainnav a:hover,
body[data-atlas-surface="state"] > .nv-top .mainnav a:focus-visible { color: #fff; background: #315661; }
body[data-atlas-surface="state"] > .nv-top .mainnav a.on { color: #fff; background: #176770; }
body[data-atlas-surface="state"] > .nv-top .nav-group { border-color: #547179; }
body[data-atlas-surface="state"] > .nv-top :is(.nav-more summary, .nav-more[open] summary) { color: #e1eeee; }
body[data-atlas-surface="state"] > .nv-top .nav-more-list { background: var(--atlas-navy); border-color: #547179; }
body[data-atlas-surface="state"] #layout-map :is(.map-chrome, .float-rail) { background: var(--atlas-navy); }
body[data-atlas-surface="state"] #layout-map .float-card { background: #214550; }

@media (max-width: 760px) {
  body[data-atlas-surface="evidence"] :is(.filters, .toolbar) > label { min-width: 0; max-width: 100%; }
  body[data-atlas-surface="evidence"] :is(.filters, .toolbar) :is(input, select) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }
}

.atlas-inventory-reading {
  color: var(--atlas-muted);
  margin-block: 6px 10px;
  font-size: .9rem;
}
.atlas-inventory-provenance { margin-top: 12px; }
.atlas-inventory-provenance > summary {
  cursor: pointer;
  color: var(--atlas-link);
  font-weight: 650;
}
.atlas-inventory-provenance[open] > summary { margin-bottom: 8px; }

.atlas-inventory-filters > summary {
  cursor: pointer;
  color: var(--atlas-link);
  font-weight: 650;
}
.atlas-inventory-status { margin: 6px 0; }

/* Compact editorial layouts. Keep map canvases and reading text at usable sizes. */
body[data-atlas-page="home"] > .hero .wrap {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(12px, 3vw, 32px);
  padding-block: 18px;
}
body[data-atlas-page="home"] .hero h1 { font-size: clamp(1.9rem, 4.4vw, 3.8rem); }
body[data-atlas-page="home"] .hero .rule { margin-block: 10px; }
body[data-atlas-page="home"] :is(.live, .ctas) { margin-top: 12px; }
body[data-atlas-page="home"] .ctas { gap: 6px; }
body[data-atlas-page="home"] .ctas .btn { padding: 8px 10px; letter-spacing: .06em; }
body[data-atlas-page="home"] .mapcell svg { max-height: 410px; }
body[data-atlas-page="home"] .sec { padding-block: 18px 10px; }
body[data-atlas-page="home"] .sec h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-top: 6px;
}
body[data-atlas-page="home"] .sec .intro { font-size: .9375rem; line-height: 1.5; margin-top: 6px; }
body[data-atlas-page="home"] .teach {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 920px;
  margin-top: 9px;
}
body[data-atlas-page="home"] .teach-card { background: #fff; }
body[data-atlas-page="home"] .teach-card span { padding: 6px 8px; letter-spacing: .04em; }
body[data-atlas-page="home"] .fig { padding: 9px 10px; }
body[data-atlas-page="home"] .fig b { font-size: clamp(1.2rem, 2.2vw, 1.75rem); }
body[data-atlas-page="home"] .fig span { margin-top: 3px; }
body[data-atlas-page="home"] :is(.disc, .regions) { margin-top: 10px; }
body[data-atlas-page="home"] :is(.d, .rc) { padding: 9px 11px; }
body[data-atlas-page="home"] :is(.d, .rc) h3 { font-size: clamp(1.05rem, 2vw, 1.28rem); margin-top: 3px; }
body[data-atlas-page="home"] :is(.d p, .rc .hook) { font-size: .875rem; line-height: 1.35; margin-top: 4px; }
body[data-atlas-page="home"] :is(.d .go, .rc .st) { padding-top: 5px; letter-spacing: .08em; }
body[data-atlas-page="home"] .rc .mini { height: 44px; margin-bottom: 4px; }
body[data-atlas-page="home"] .note { gap: 8px; margin-top: 12px; padding-top: 8px; }
body[data-atlas-page="home"] .note p { font-size: .9rem; line-height: 1.5; margin-bottom: 6px; }

body[data-atlas-surface="editorial"] > .rhero .wrap { padding-block: 16px; }
body[data-atlas-surface="editorial"] > .rhero svg { max-height: 440px; }
body[data-atlas-surface="editorial"] > .rhero h1 { font-size: clamp(1.9rem, 4vw, 3.25rem); }
body[data-atlas-surface="editorial"] :is(.shelf, .hydro-bridge) :is(.card, .atlas-functional-section) {
  padding: 11px 13px;
}
body[data-atlas-surface="editorial"] .shelf .card .go { margin-top: 8px; }
body[data-atlas-surface="editorial"] .others { margin-top: 16px; }
body[data-atlas-surface="evidence"] .v10-collapsible > summary { padding: 8px 12px; }
body[data-atlas-surface="evidence"] .v10-collapsible-body { padding: 8px 12px; }
body[data-atlas-page="dashboard"] :is(.section, .panel, .notice, .card, .dataset) { padding: 9px 11px; }
body[data-atlas-page="dashboard"] .section { padding-inline: 0; }
body[data-atlas-page="dashboard"] h2 { font-size: clamp(1.3rem, 2.5vw, 1.65rem); margin-bottom: 7px; }

/* Use the same plate colour field on both menus and the opened heading. */
body[data-atlas-page="home"] .sec .disc > .d,
body[data-atlas-page="plates"] #plates .card[data-plate],
body[data-atlas-page="plates"] .plate-sec > .band {
  background: linear-gradient(120deg, color-mix(in srgb, var(--acc) 85%, #041018), color-mix(in srgb, var(--acc) 65%, #041018));
  color: #fffdf8;
}
body[data-atlas-page="home"] .sec .disc > .d :is(.n, h3, p, .go),
body[data-atlas-page="plates"] #plates .card[data-plate] :is(.n, b, .c) {
  color: #fffdf8;
}
body[data-atlas-page="home"] .sec .disc > .d:is(:hover, :focus-visible),
body[data-atlas-page="plates"] #plates .card[data-plate]:is(:hover, :focus-visible, .active) {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  position: relative;
  z-index: 1;
}
body[data-atlas-page="plates"] #plates .card[data-plate] { padding: 8px 10px; }
body[data-atlas-page="plates"] .plate-sec {
  background: color-mix(in srgb, var(--acc) 31%, #fff);
}
body[data-atlas-page="plates"] .plate-sec > .band { padding: 13px 16px; }
body[data-atlas-page="plates"] .plate-sec > .body { padding: 11px 12px; }
body[data-atlas-page="plates"] .plate-sec .box {
  background: color-mix(in srgb, var(--acc) 5%, #fffdf8);
  padding: 9px 10px 5px;
}

@media (max-width: 760px) {
  body[data-atlas-page="home"] > .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  body[data-atlas-page="home"] .mapcell svg { max-height: 225px; }
  body[data-atlas-page="home"] .wrap { padding-inline: 12px; }
  body[data-atlas-page="home"] :is(.disc, .regions) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  body[data-atlas-page="home"] .figs .wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-atlas-page="home"] .fig { padding: 6px; }
  body[data-atlas-page="home"] .note { gap: 1px; }
  body[data-atlas-surface="editorial"] > .rhero svg { max-height: 275px; }
}

/* Match the regional cards to the geography colours in both entry points. */
:is(.rc[data-region="east"], .places > a[href="../east/"]) { --region-accent: #23634e; }
:is(.rc[data-region="west"], .places > a[href="../west/"]) { --region-accent: #72522a; }
:is(.rc[data-region="north"], .places > a[href="../north/"]) { --region-accent: #305c89; }
:is(.rc[data-region="south"], .places > a[href="../south/"]) { --region-accent: #8a4160; }
body[data-atlas-page="home"] .regions > .rc[data-region],
body[data-atlas-page="plates"] .places > a:is([href="../east/"], [href="../west/"], [href="../north/"], [href="../south/"]) {
  background: color-mix(in srgb, var(--region-accent) 25%, #fff);
  border-top: 4px solid var(--region-accent);
}
body[data-atlas-page="home"] .regions > .rc[data-region]:is(:hover, .on),
body[data-atlas-page="plates"] .places > a:is([href="../east/"], [href="../west/"], [href="../north/"], [href="../south/"]):hover {
  background: color-mix(in srgb, var(--region-accent) 34%, #fff);
}

/* Keep the plate index within reach and preserve legibility on narrow screens. */
body[data-atlas-page="plates"] #plates {
  scroll-margin-top: 14px;
}
body[data-atlas-page="plates"] .plate-sec .pn {
  background: color-mix(in srgb, var(--acc) 8%, #fff);
  overflow-wrap: anywhere;
}
body[data-atlas-page="plates"] .plate-sec .pn:focus-visible {
  outline-color: var(--acc);
}
@media (max-width: 520px) {
  body[data-atlas-page="plates"] .plate-sec .pnav {
    gap: 5px;
  }
  body[data-atlas-page="plates"] .plate-sec .pn {
    padding: 7px 6px;
  }
}
