/* Azores ocean forecast. Tokens and type follow AIR Centre One (staff), so
   the two apps read as one family. CSP forbids inline styles: every rule
   lives here. */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/roboto-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/roboto-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --brand: #f07d2f;
  --navy: #1a3a5c;
  /* The point marker sits on the map and the chart; navy vanishes on dark. */
  --marker: var(--navy);
  --background: #f3f5f8;
  --foreground: #101828;
  --card: #fff;
  --muted-foreground: #4a5568;
  --accent: #fde6d8;
  --border: #dde2e9;
  --border-strong: #b3bdca;
  --input: #66768c;
  --chrome: var(--navy);
  --warning: #8a4b00;
  --radius: 8px;
  --gutter: 1rem;
  --panel: 22rem;
  --font-body: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Map colours: sea outside the model area, land and coastline. */
  --map-sea: #c9d6e3;
  --map-land: #e9e4da;
  --map-coast: #8a8172;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0b1626;
    --foreground: #e2e8f0;
    --card: #12223a;
    --muted-foreground: #a0aec0;
    --accent: #3a2414;
    --border: #233955;
    --border-strong: #3d5675;
    --input: #8193ab;
    --chrome: #0e2240;
    --marker: #9cc5f0;
    --warning: #f5b366;
    --map-sea: #1c2c40;
    --map-land: #3a3f47;
    --map-coast: #6b7280;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
}

.app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100dvh;
}

.bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem var(--gutter);
  background: var(--chrome);
  color: #fff;
}

.bar h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel);
  min-height: 0;
}

.map {
  min-height: 0;
}

.map canvas.drawing {
  cursor: crosshair;
}

/* Both sit over the map; the note shows only after a tile fails. */
.map-note,
.map-message {
  margin: 0;
  font-size: 0.875rem;
  color: var(--warning);
}

.map-note {
  display: none;
  position: absolute;
  z-index: 2;
  left: 0.5rem;
  bottom: 1.75rem;
  max-width: calc(100% - 1rem);
  padding: 0.25rem 0.5rem;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.map-note.on {
  display: block;
}

.map-message {
  padding: var(--gutter);
}

.zoom {
  display: grid;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.zoom button {
  width: 32px;
  height: 32px;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--foreground);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.zoom button + button {
  border-top: 1px solid var(--border);
}

.panel {
  overflow-y: auto;
  padding: 0 var(--gutter);
  background: var(--card);
  border-left: 1px solid var(--border);
}

.empty {
  padding: var(--gutter);
}

/* Below the width where map and panel both stay usable, the panel moves
   under the map and the page scrolls. */
@media (max-width: 52rem) {
  .app {
    height: auto;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  /* The model domain is about 5:4 in Web Mercator; matching it leaves no
     empty sea above and below the data. */
  .map {
    aspect-ratio: 5 / 4;
  }

  .panel {
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

.group {
  display: grid;
  gap: 0.625rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

.group:last-child {
  border-bottom: 0;
}

.group h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.field label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
}

.row > .field {
  flex: 1 1 6rem;
}

.heading-row {
  justify-content: space-between;
  align-items: center;
}

select,
.input {
  width: 100%;
  min-height: 40px;
  padding: 0.375rem 0.625rem;
  font: inherit;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--input);
  border-radius: var(--radius);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

.time-label {
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 0.25rem;
  padding: 0.375rem 0.875rem;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  color: var(--foreground);
  background: transparent;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.btn:hover {
  border-color: var(--input);
}

/* The primary button is outlined, with orange words. */
.btn-primary {
  color: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--brand);
}

.btn-quiet {
  min-height: 32px;
  padding: 0.125rem 0.625rem;
  font-weight: 400;
  border-width: 1px;
}

.legend {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: 3px;
}

.legend-ends {
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.hint,
.coords,
.caption {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.value {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
}

.note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--warning);
}

.chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart-axis {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linejoin: round;
}

.chart-marker {
  fill: var(--marker);
  stroke: var(--card);
  stroke-width: 2;
}

.chart-label {
  font-size: 10px;
  fill: var(--muted-foreground);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
