/* VK5DR - shared styles for the public site and the admin page.
   Palette comes from the banner: solder-mask blue, copper pads, silver lettering.
   Font: IBM Plex Sans, self-hosted (SIL Open Font License, see fonts/OFL-LICENSE.txt). */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --board: #061f3b;       /* page */
  --board-2: #0b2c52;    /* raised panels */
  --board-3: #0f3866;    /* hover / inset */
  --line: #1e4d83;
  --copper: #e2b27a;
  --silver: #cfd9e6;
  --muted: #a5b9d1;
  --silk: #f2f7fb;
  --link: #9bcbff;
  --good: #72d6a0;
  --fair: #f2c455;
  --bad: #ff9d8d;
  --gutter: clamp(1rem, 4vw, 2rem);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { margin: 0; background: var(--board); color: var(--silver); font: 400 1rem/1.65 var(--sans); }

a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { color: var(--silk); }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 0.5rem; top: -4rem; background: var(--copper); color: #1a1205; padding: 0.5rem 0.9rem; z-index: 30; }
.skip:focus { top: 0.5rem; }

.wrap { max-width: 70rem; margin-inline: auto; padding-inline: var(--gutter); }

/* ---- top bar ---- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--board); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem; padding-block: 0.3rem; }
.mark { display: inline-flex; align-items: center; gap: 0.6rem; font: 600 1.15rem/1 var(--sans); letter-spacing: 0.07em; color: var(--silk); text-decoration: none; padding: 0.7rem 0; }
.mark svg { display: block; flex: none; }
.bar nav { display: flex; flex-wrap: wrap; gap: 0 0.1rem; margin-inline: -0.5rem; }
.bar nav a { color: var(--silver); text-decoration: none; padding: 0.7rem 0.6rem; font-weight: 500; font-size: 0.95rem; }
.bar nav a:hover { color: var(--silk); text-decoration: underline; text-decoration-color: var(--copper); text-decoration-thickness: 2px; text-underline-offset: 0.45em; }

/* ---- hero: the banner is the headline ---- */
.hero { position: relative; background: var(--board-2); overflow: hidden; width: 100%; height: clamp(16rem, 62vw, 34rem); }
@media (min-width: 700px) { .hero { height: clamp(22rem, 38vw, 44rem); } }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 65%; }
@media (min-width: 700px) { .hero img { object-position: 50% 57%; } }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 22%; background: linear-gradient(to bottom, rgba(6, 31, 59, 0), var(--board-2)); pointer-events: none; }

/* ---- station clocks ---- */
.strip { background: var(--board-2); border-bottom: 1px solid var(--line); }
.strip .wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cell { padding: 1rem 0 1.1rem; min-width: 0; }
.cell .cap { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.875rem; }
.clock { margin: 0; font: 500 clamp(1.7rem, 5vw, 2.4rem)/1.05 var(--sans); font-variant-numeric: tabular-nums; color: var(--silk); }
.cell .sub { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.875rem; }
.cell.sun { grid-column: 1 / -1; border-top: 1px solid var(--line); }
.sun-times { display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; margin: 0; }
.sun-times div { display: flex; align-items: baseline; gap: 0.6rem; }
.sun-times dt { color: var(--muted); font-size: 0.9rem; }
.sun-times dd { margin: 0; font: 500 1.35rem/1.2 var(--sans); font-variant-numeric: tabular-nums; color: var(--silk); }
@media (min-width: 760px) {
  .strip .wrap { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .cell + .cell { border-left: 1px solid var(--line); padding-left: 1.75rem; }
  .cell.sun { grid-column: auto; border-top: 0; }
}

/* ---- bands ---- */
.band { padding-block: clamp(2.5rem, 6vw, 4.25rem); }
.band + .band { border-top: 1px solid var(--line); }

h2 { display: flex; align-items: center; gap: 0.65rem; margin: 0 0 1.1rem; font: 600 clamp(1.45rem, 2.6vw, 1.85rem)/1.2 var(--sans); letter-spacing: -0.005em; color: var(--silk); }
h2::before { content: ""; flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 2px solid var(--copper); background: var(--board); }
.lede { margin: -0.4rem 0 1.5rem; max-width: 62ch; color: var(--muted); }

.about { display: grid; gap: 2.5rem; }
@media (min-width: 780px) { .about { grid-template-columns: minmax(0, 1fr) 17rem; gap: 3.5rem; } }
.prose p { margin: 0 0 1.1rem; max-width: 64ch; font-size: 1.0625rem; line-height: 1.75; color: var(--silk); }
.prose p:last-child { margin-bottom: 0; }

.glance { margin: 0; padding-left: 1.1rem; border-left: 2px solid var(--copper); display: grid; gap: 1rem; align-content: start; }
.glance dt { font-size: 0.875rem; color: var(--muted); }
.glance dd { margin: 0; font-size: 1.0625rem; color: var(--silk); }

.spec { list-style: none; margin: 0; padding: 0; }
.spec li { display: grid; gap: 0.15rem 1.5rem; padding: 0.8rem 0; border-top: 1px solid var(--line); }
.spec li:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .spec li { grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); } }
.spec .k { color: var(--muted); }
.spec .v { color: var(--silk); }

.contact p { margin: 0 0 0.5rem; color: var(--silk); max-width: 62ch; }
.link-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.4rem; }

/* ---- conditions ---- */
.readouts { margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 720px) { .readouts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .readouts { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.readout { background: var(--board-2); padding: 0.95rem 1rem 1.05rem; min-width: 0; }
.readout dt { color: var(--muted); font-size: 0.875rem; }
.readout dd { margin: 0; }
.readout .value { display: block; margin: 0.4rem 0 0.35rem; font: 500 clamp(1.7rem, 3.2vw, 2.1rem)/1.1 var(--sans); font-variant-numeric: tabular-nums; color: var(--silk); }
.readout .unit { margin-left: 0.3rem; font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.note { display: flex; align-items: baseline; gap: 0.45rem; font-size: 0.875rem; line-height: 1.35; color: var(--silver); }
.note::before { content: ""; flex: none; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); transform: translateY(0.02rem); }
.note[data-level="good"]::before { background: var(--good); }
.note[data-level="fair"]::before { background: var(--fair); }
.note[data-level="poor"]::before { background: var(--bad); }

.charts { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
@media (min-width: 900px) { .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.panel-fig { margin: 0; padding: 1rem 1rem 0.75rem; background: var(--board-2); border: 1px solid var(--line); min-width: 0; }
.panel-fig > figcaption { margin: 0 0 0.6rem; color: var(--silk); font-weight: 500; font-size: 0.95rem; }
.panel-fig .chart { min-height: 11rem; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .msg { margin: 0; padding: 3rem 0; text-align: center; color: var(--muted); font-size: 0.9rem; }
.axis line { stroke: var(--line); stroke-width: 1; }
.axis text, .lab { fill: var(--muted); font: 400 12px var(--sans); }
.bar-kp { fill: var(--muted); }
.bar-kp.good { fill: var(--good); }
.bar-kp.fair { fill: var(--fair); }
.bar-kp.poor { fill: var(--bad); }
.bar-kp.latest { stroke: var(--silk); stroke-width: 1.5; }
.xline { fill: none; stroke: var(--copper); stroke-width: 1.75; stroke-linejoin: round; }
.xdot { fill: var(--silk); stroke: var(--board-2); stroke-width: 2; }

.map-fig { margin: 0 0 1.25rem; }
.map-fig canvas { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; background: var(--board-2); border: 1px solid var(--line); }
.map-fig figcaption, .pic figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 0.875rem; max-width: 70ch; }

.pics { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .pics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pic { margin: 0; padding: 1rem; background: var(--board-2); border: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; }
.pic .frame { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 8rem; background: var(--board); }
.pic img { display: block; max-width: 100%; height: auto; }

.sources { margin: 1.5rem 0 0; color: var(--muted); font-size: 0.875rem; max-width: 80ch; }
.sources a { color: var(--link); }
.nojs { color: var(--muted); }

/* ---- gallery ---- */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.tile { display: block; width: 100%; margin: 0; padding: 0; border: 1px solid var(--line); background: var(--board-2); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tile:hover { border-color: var(--copper); }
.tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tile .cap { display: block; padding: 0.55rem 0.7rem 0.65rem; font-size: 0.9375rem; color: var(--silk); }
.empty { margin: 0; color: var(--muted); }

/* ---- lightbox ---- */
dialog.lightbox { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100vw; height: 100vh; background: transparent; color: var(--silk); }
.lightbox::backdrop { background: rgba(2, 12, 26, 0.95); }
.lb-inner { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 0.75rem; height: 100%; padding: 1rem; }
.lb-top, .lb-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lb-inner figure { margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 0.75rem; min-height: 0; }
.lb-inner img { max-width: 100%; max-height: 100%; min-height: 0; margin: auto; object-fit: contain; }
.lb-inner figcaption { text-align: center; min-height: 1.6em; }

/* ---- buttons (admin uses these too) ---- */
.btn { font: inherit; font-weight: 500; color: var(--silk); background: var(--board-2); border: 1px solid var(--line); padding: 0.55rem 1rem; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--copper); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--copper); border-color: var(--copper); color: #1a1205; font-weight: 600; }
.btn.danger { color: var(--bad); }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--line); padding-block: 2rem 3rem; color: var(--muted); font-size: 0.9rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.foot .sign { font: 600 1.05rem/1.3 var(--sans); letter-spacing: 0.02em; color: var(--silk); }
