/* Air attack archive: the landing page. Tokens come from styles.css.
   The map is the hub: date controls above it, national totals and the map
   key directly beside it (below it on a phone), reviewed damage under it. */

/* ------------------------------------------------------------ navigation */

.site-nav-row { display: flex; align-items: stretch; justify-content: space-between; gap: var(--s4); }
.site-nav-primary { min-width: 0; flex: 0 1 auto; }
.site-nav-more { position: relative; flex: none; }
.site-nav-more > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s2); height: 100%;
  padding: var(--s3) 0 10px; font-size: 14px; line-height: 20px; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.site-nav-more > summary::-webkit-details-marker { display: none; }
.site-nav-more > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.site-nav-more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.site-nav-more > summary:hover { color: var(--ink); }
.site-nav-more > summary:focus-visible { outline-offset: -2px; }
.site-nav-more.has-current > summary { color: var(--ink); border-bottom-color: var(--amber); font-weight: 500; }
.site-nav-menu {
  position: absolute; right: 0; top: 100%; z-index: 30; list-style: none; min-width: 240px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: var(--s1) 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.site-nav .site-nav-menu a { padding: var(--s2) var(--s4); border-bottom: 0; border-left: 2px solid transparent; }
.site-nav .site-nav-menu a[aria-current="page"] { border-left-color: var(--amber); border-bottom: 0; }
.site-nav .site-nav-menu a:hover { background: var(--hover); }
@media (max-width: 599px) {
  .site-nav-more-long { display: none; }
  /* The landing page gives the map the first screen; the monthly-archive line belongs to its own views. */
  body[data-view="air"] .masthead-tag, body[data-view="air"] .period-line { display: none; }
  body[data-view="air"] .masthead-row { padding-top: var(--s3); padding-bottom: var(--s2); }
}

/* --------------------------------------------------------------- top bar */

.air-root { padding-top: var(--s5); }
.air-root > .state { margin-top: var(--s4); }
.air-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s2) var(--s8);
  padding-bottom: var(--s3); border-bottom: 1px solid var(--rule);
}
.air-kicker { font: 600 22px/28px var(--serif); color: var(--ink); width: fit-content; }
.air-update {
  margin-top: var(--s3); font-size: 13px; line-height: 20px; color: var(--muted);
  border-left: 2px solid var(--amber); padding-left: var(--s3);
}
.air-update-key { color: var(--ink); font-weight: 500; }

.air-dates { display: grid; gap: var(--s1); min-width: 0; flex: 0 1 auto; }
.air-dates-label { font: 500 12px/16px var(--sans); color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.air-dates-row { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.air-dates select {
  min-width: 0; max-width: 100%; flex: 1 1 auto; font: 500 15px/20px var(--mono); color: var(--ink);
  background: var(--surface); border: 1px solid var(--control); border-radius: 4px; padding: var(--s2) var(--s8) var(--s2) var(--s3);
}
.air-step {
  font: 500 14px/20px var(--sans); white-space: nowrap; padding: var(--s2) var(--s1); text-decoration: none;
  min-height: 36px; display: inline-flex; align-items: center;
}
.air-step:hover { text-decoration: underline; }
.air-step.is-disabled { color: var(--muted); }

/* Date strip: the reports on a true time scale, reusing the timeline marks. */
.air-strip { min-width: 0; margin-top: var(--s1); }
.air-strip .tl-slider { margin-top: 0; }
.air-strip .tl-marks .is-current { background: var(--amber); }
.air-strip .tl-ends { gap: var(--s2); }

/* ------------------------------------------------------------------- hub */

.air-hub { padding-top: var(--s5); display: grid; gap: var(--s5); }
.air-hub > * { min-width: 0; }
@media (min-width: 960px) {
  .air-hub {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: var(--s8); row-gap: var(--s5);
    grid-template-areas: "map counts" "map context" "map types" "regions provenance";
    grid-template-rows: auto auto 1fr auto;
  }
  .air-counts { grid-area: counts; }
  .air-map-fig { grid-area: map; align-self: start; }
  .air-context { grid-area: context; }
  .air-breakdown { grid-area: types; }
  .air-regions { grid-area: regions; }
  .air-provenance { grid-area: provenance; }
}

/* ---------------------------------------------------------------- totals */

.air-counts { border-top: 2px solid var(--ink); padding-top: var(--s3); }
.air-counts-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); font: 500 13px/20px var(--sans); color: var(--muted); }
.air-period-chip {
  font: 600 12px/16px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber);
  border: 1px solid rgba(231, 198, 91, 0.6); border-radius: 3px; padding: 2px var(--s2);
}
.air-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s2); }
.air-stat-label { font: 500 13px/20px var(--sans); color: var(--muted); }
.air-stat-value { font: 600 44px/52px var(--mono); letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.air-stat-value.is-missing { font: 500 20px/52px var(--sans); color: var(--muted); letter-spacing: 0; }
.air-note { font-size: 13px; line-height: 20px; color: var(--muted); margin-top: var(--s2); max-width: 48em; }
.air-note-warn { border-left: 2px solid var(--amber); padding-left: var(--s3); color: var(--ink); }
.air-when { display: grid; gap: var(--s1); margin-top: var(--s3); font-size: 13px; line-height: 20px; }
.air-when > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--s2); }
.air-when dt { color: var(--muted); }
.air-when dd { color: var(--ink); margin: 0; }
.air-read { margin-top: var(--s2); font-size: 12px; line-height: 18px; color: var(--muted); }
.air-read time { font-family: var(--mono); }

/* ------------------------------------------------------------------- map */

.air-map-fig { margin: 0; }
.air-map {
  position: relative; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden;
  background: radial-gradient(120% 90% at 55% 40%, #121C29 0%, #0D141E 55%, var(--bg) 100%);
}
.air-map-svg { display: block; width: 100%; height: auto; touch-action: pan-y pinch-zoom; }
.air-map:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.air-map.is-zoomed .air-map-svg { cursor: grab; touch-action: none; }
.air-map.is-dragging .air-map-svg { cursor: grabbing; }
.air-tools { z-index: 2; }
.air-map-help { margin-top: var(--s1); font-size: 12px; line-height: 18px; color: var(--muted); }
.air-legend-gap { color: var(--muted); font-size: 13px; }
.air-region { fill: #141E2A; stroke: #2C394A; stroke-width: 0.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.air-region.is-documented { fill: rgba(231, 198, 91, 0.28); stroke: var(--amber); stroke-width: 1.4; cursor: pointer; transition: fill 120ms ease; }
.air-region.is-documented:hover { fill: rgba(231, 198, 91, 0.46); }
.air-region.is-selected { fill: rgba(231, 198, 91, 0.62); stroke: #F6E3A1; stroke-width: 2.4; }
.air-map-label {
  font: 600 15px/1 var(--sans); fill: var(--ink); pointer-events: none;
  paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round;
}
/* Labels keep their reading size when the map is zoomed. */
.air-map-labels { font-size: calc(15px / var(--air-zoom, 1)); stroke-width: calc(4px / var(--air-zoom, 1)); }
.air-map-labels .air-map-label { font-size: inherit; stroke-width: inherit; }
.air-map-label.is-selected { fill: #FFF6D6; }
.air-map-missing { min-height: 200px; display: grid; place-items: center; padding: var(--s6); }
.air-map-fallback { color: var(--muted); max-width: 32em; text-align: center; }
.air-map-caption { margin-top: var(--s3); }
.air-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); font-size: 14px; line-height: 20px; }
.air-legend li { display: flex; align-items: center; gap: var(--s2); }
.air-swatch { flex: none; width: 16px; height: 16px; border-radius: 2px; background: #141E2A; border: 1px solid var(--control); }
.air-swatch.is-documented { background: rgba(231, 198, 91, 0.45); border-color: var(--amber); }
.air-map-scope { margin-top: var(--s1); font-size: 13px; line-height: 20px; color: var(--muted); }

/* A change of date is visible on the map and the totals together. */
@keyframes air-arrive { from { opacity: 0.25; } to { opacity: 1; } }
.air-hub.is-new .air-region.is-documented,
.air-hub.is-new .air-map-label,
.air-hub.is-new .air-stat-value { animation: air-arrive 360ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .air-hub.is-new .air-region.is-documented, .air-hub.is-new .air-map-label, .air-hub.is-new .air-stat-value { animation: none; }
  .air-region.is-documented { transition: none; }
}

/* --------------------------------------------------------------- regions */

.air-regions { border-top: 1px solid var(--rule); padding-top: var(--s4); }
.air-coverage { font-size: 14px; line-height: 22px; color: var(--muted); max-width: 52em; }
.air-coverage + .air-coverage { margin-top: var(--s1); }
.air-region-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.air-region-button {
  display: inline-flex; align-items: baseline; gap: var(--s2); min-height: 40px; padding: var(--s2) var(--s3);
  font: 500 15px/20px var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--control); border-radius: 4px; cursor: pointer;
}
.air-region-button:hover { border-color: var(--amber); }
.air-region-button[aria-pressed="true"] { background: rgba(231, 198, 91, 0.16); border-color: var(--amber); }
.air-region-count { font: 400 13px/20px var(--mono); color: var(--muted); }
.air-cases { margin-top: var(--s4); }
.air-cases:empty { display: none; }
.air-cases-hint { font-size: 14px; line-height: 22px; color: var(--muted); }
.air-cases-head { border-top: 2px solid var(--amber); padding-top: var(--s3); }
.air-cases-title { font: 600 24px/32px var(--serif); width: fit-content; }
.air-cases-note { font-size: 14px; line-height: 20px; color: var(--muted); margin-top: var(--s1); }
.air-case-list { margin-top: var(--s3); display: grid; gap: var(--s4); }

/* --------------------------------------------------------------- context */

.air-title { font: 600 26px/32px var(--serif); letter-spacing: -0.005em; }
.air-summary { margin-top: var(--s2); font: 400 17px/26px var(--serif); color: var(--ink); max-width: 40em; }

/* ---------------------------------------------------------------- types */

.air-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.air-table th, .air-table td { padding: var(--s2) 0; border-top: 1px solid var(--rule); text-align: left; vertical-align: top; }
.air-table thead th { border-top: 0; font: 500 12px/16px var(--sans); color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; padding-top: 0; }
.air-table .num { text-align: right; padding-left: var(--s3); font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.air-table thead .num { font-family: var(--sans); }
.air-table td.is-missing { color: var(--muted); font-family: var(--sans); font-size: 13px; }
.air-table tbody th { font-weight: 400; }
.air-type { display: flex; gap: var(--s2); align-items: flex-start; }
.air-type .cls-icon { flex: none; margin-top: 0; }
.air-type-label { display: block; color: var(--ink); }
.air-type-class { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.air-type-defs { margin-top: var(--s3); font-size: 13px; line-height: 20px; }
.air-type-defs > summary { cursor: pointer; color: var(--accent); width: fit-content; }
.air-type-defs .cls-legend { grid-template-columns: 1fr; }

/* ------------------------------------------------------------ provenance */

.air-provenance > .section-label { margin-top: var(--s5); }
.air-provenance > :first-child.section-label { margin-top: 0; }
.air-bulletins { margin-bottom: var(--s2); }
.air-bulletin-list { list-style: none; display: grid; gap: var(--s3); }
.air-bulletin { border-left: 2px solid var(--rule); padding-left: var(--s3); }
.air-bulletin.is-headline { border-left-color: var(--amber); }
.air-bulletin-label { font: 600 14px/20px var(--sans); display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.air-bulletin-tag { font: 500 11px/16px var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--amber); }
.air-bulletin-figures { font: 400 14px/20px var(--mono); color: var(--muted); }
.air-bulletin-figures strong { color: var(--ink); font-weight: 600; }
.air-bulletin-source { font-size: 13px; line-height: 20px; }
.air-sources { list-style: none; display: grid; gap: var(--s3); font-size: 14px; line-height: 20px; }
.air-source-pub { font-size: 13px; color: var(--muted); }
.air-source-origin { font-size: 13px; color: var(--muted); }
.air-sources .host, .air-bulletin-source .host, .air-check .host { color: var(--muted); }
.air-checks { margin-top: var(--s4); font-size: 13px; line-height: 20px; }
.air-checks > summary { cursor: pointer; color: var(--accent); width: fit-content; }
.air-check-list { list-style: none; display: grid; gap: var(--s3); margin-top: var(--s2); }
.air-check-meta { color: var(--muted); }
.air-check-kind { color: var(--ink); }
.air-check.is-changed .air-check-status, .air-check.is-unavailable .air-check-status { color: var(--amber); }
.air-qualifiers { padding-left: var(--s4); font-size: 14px; line-height: 22px; color: var(--muted); }
.air-qualifiers li + li { margin-top: var(--s1); }
.air-rejected { margin-top: var(--s6); }

/* -------------------------------------------------------------- secondary */

.air-secondary { margin-top: var(--s12); border-top: 1px solid var(--rule); padding-top: var(--s5); max-width: 52em; }
.air-secondary-title { font: 600 18px/24px var(--sans); }
.air-secondary p { margin-top: var(--s1); color: var(--muted); font-size: 15px; line-height: 22px; }
.air-secondary-links { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); margin-top: var(--s3); }

@media (max-width: 599px) {
  .air-stat-value { font-size: 36px; line-height: 44px; }
  .air-stat-value.is-missing { line-height: 44px; }
  .air-map-labels { font-size: calc(22px / var(--air-zoom, 1)); }
  .air-dates { flex: 1 1 100%; }
  .air-root { padding-top: var(--s3); }
  .air-kicker { font-size: 18px; line-height: 24px; }
  .air-hub { padding-top: var(--s3); gap: var(--s4); }
  .air-dates select { padding-top: 6px; padding-bottom: 6px; }
  /* The explorer hides the wide reset on phones; here it appears once the map is zoomed, so touch readers can return in one tap. */
  .air-map .air-tools .ex-tool-wide { display: none; }
  .air-map.is-zoomed .air-tools .ex-tool-wide { display: block; }
}
