/* Forecast Waves — the explorer page's own chrome.
 *
 * Everything with a counterpart on the sibling sites is *not* here: the card, rule,
 * badge, seg, btn, timeline and wind-option components all come from
 * forecastwaves.css, which carries the same component vocabulary as
 * forecasteuro.css and forecasteagle.css do. This file is only the layout a map page
 * needs on top of that — the instrument cluster, the stage and its overlays, the
 * legend bar and the kilometre-marker facts strip.
 *
 * Forecast Euro keeps the equivalent block inline in `ecmwf.html`. It lives in its
 * own file here because two pages share it (the ocean explorer and the Great Lakes
 * one are the same instrument pointed at different water), and duplicating 200 lines
 * of layout across two documents is how the two drift apart.
 */

.explorer { max-width: 1560px; margin: 0 auto; padding: 14px 18px 28px; }

.titlebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.titlebar h1 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -.01em; }

/* Instrument cluster: the control strip reads as one panel of instruments rather
   than a scattering of form controls. Same shape as Euro's toolbar. */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 13px; margin-bottom: 12px; box-shadow: 0 6px 22px rgba(0,0,0,.08);
}
.toolbar .group { display: flex; flex-direction: column; gap: 5px; }
.toolbar .group > div { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.toolbar label {
  font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mut);
}
.toolbar select { font-size: 11px; padding: 5px 7px; max-width: 200px; }
/* The boundary-overlay checkboxes. Capped and wrapped rather than left to flow: there
   are six of them and an unbounded row pushes the export controls off the toolbar. */
.overlay-box { display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 320px; }
.switch { display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
          font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink2); cursor: pointer; }
.switch input { accent-color: var(--sign); }
.toolbar input[type=range] { accent-color: var(--sign); }

/* The model row is this site's own control and its most important one.
 *
 * Every other site on the network is one model, or one model per page. Here four
 * global wave models are drawn from the same instrument with the same colour tables
 * over the same water, and the *disagreement between them* is a large part of what
 * the site is for — so the model buttons are wide, first, and always visible rather
 * than a select buried among the display options. */
#models { display: flex; gap: 5px; flex-wrap: wrap; }
.model-btn { font-size: 12px; font-weight: 800; padding: 6px 12px; }
.model-btn.on { background: var(--sign); color: #fff; border-color: var(--sign-dk); }
.model-btn small { display: block; font-size: 9px; font-weight: 700; letter-spacing: .04em;
                   opacity: .72; margin-top: 1px; }

/* Field picker, banded by what the quantity *is*.
 *
 * A wave model publishes the sea state decomposed — the combined sea, the wind sea
 * under it, two or three swell trains crossing it, and on ECMWF a six-way split by
 * period. That is up to sixteen fields, and sixteen buttons in a row is not a picker.
 * The bands come from the catalog (`field_groups`), so a model that publishes no
 * swell partition simply has no Swell band rather than an empty one. */
#fields { display: flex; flex-direction: column; gap: 4px; max-width: 560px; }
.field-band { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field-band-label {
  font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mut); min-width: 92px;
}
.field-btn { font-size: 11.5px; padding: 5px 10px; }
.field-btn.on { background: var(--sign); color: #fff; border-color: var(--sign-dk); }

/* The place picker: the World Ocean, seven basins and twenty seas as buttons; the
   forty-five coastal approaches in the select beside them. */
#sectors { display: flex; flex-direction: column; gap: 4px; }
.sector-group { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.sector-group-label {
  font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mut); min-width: 62px;
}
.sector-btn { font-size: 11px; padding: 5px 9px; }
/* Basins take the identity colour; seas take the darker crest, so the two tiers are
   distinguishable at a glance without a second label. */
.sector-btn.on { background: var(--sign); color: #fff; border-color: var(--sign-dk); }
.sector-btn:disabled { opacity: .4; }

/* Place navigator: breadcrumb up the hierarchy, chips down it. */
.navbar { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.crumbs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.crumb {
  font: 800 12px var(--font); letter-spacing: .01em; color: var(--navy);
  background: none; border: 0; padding: 2px 3px; cursor: pointer; border-radius: 3px;
}
.crumb:hover { background: var(--line2); }
.crumb.on { color: var(--ink); cursor: default; text-decoration: underline;
            text-decoration-color: var(--sign); text-underline-offset: 3px;
            text-decoration-thickness: 2px; }
.crumb-sep { color: var(--mut); font-size: 10px; }
.drill-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.drill-label { font-size: 9px; font-weight: 700; letter-spacing: .12em;
               text-transform: uppercase; color: var(--mut); white-space: nowrap; }
.drill-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  font: 700 10.5px var(--font); color: var(--ink2); background: var(--card);
  border: 1px solid var(--line); border-radius: 3px; padding: 3px 7px; cursor: pointer;
}
.chip:hover { border-color: var(--sign); color: var(--ink); }

/* Compass pad — walk to the neighbouring water without going back to the top. */
.compass {
  position: absolute; z-index: 6; top: 64px; left: 10px;
  display: grid; grid-template-columns: repeat(3, 26px); grid-template-rows: repeat(3, 26px);
  background: rgba(10,14,20,.84); border: 1px solid var(--figure-line); border-radius: 5px;
  padding: 3px;
}
.compass-btn {
  background: none; border: 0; color: #e9e7e0; font-size: 11px; line-height: 1;
  cursor: pointer; border-radius: 3px; padding: 0;
}
.compass-btn:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.compass-btn:disabled { opacity: .22; cursor: default; }
.compass-mid { grid-area: 2 / 2; display: grid; place-items: center;
               font: 800 9px var(--mono-font); color: #9fb0c2; }
.dir-n { grid-area: 1 / 2; } .dir-w { grid-area: 2 / 1; }
.dir-e { grid-area: 2 / 3; } .dir-s { grid-area: 3 / 2; }

#coords { display: flex; gap: 9px; align-items: baseline; }
.probe-v { font-weight: 900; font-size: 13px; color: #fff; letter-spacing: -.01em; }
.probe-xy { color: #9fb0c2; font-size: 10.5px; font-weight: 700; }

.stage-wrap { position: relative; border: 1px solid var(--line); border-radius: 8px;
              overflow: hidden; box-shadow: 0 6px 22px rgba(0,0,0,.08);
              transition: max-width .18s ease; }
#stage {
  position: relative; width: 100%; height: min(74vh, 860px); min-height: 400px;
  /* The ground under a wave map is water, so the holding colour is the sea rather
     than the pale land the sibling sites open on. */
  background: #9fb6c4;
}
/* The swell overlay composites frame to frame on its own canvas above the map. */
#wave-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 4; }

#stage .maplibregl-ctrl-group {
  border-radius: 3px; border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
#stage .maplibregl-ctrl-group button + button { border-top: 1px solid var(--line2); }
#stage .maplibregl-ctrl-scale {
  background: rgba(255,255,255,.82); border-color: var(--ink2); color: var(--ink);
  font: 700 10px var(--font); letter-spacing: .04em;
}
#stage .maplibregl-ctrl-attrib { font: 600 10px var(--font); }

.stage-overlay {
  position: absolute; z-index: 5; pointer-events: none;
  background: rgba(10, 14, 20, .84); border: 1px solid var(--figure-line);
  border-radius: 4px; padding: 7px 11px; color: #e9e7e0;
  font-size: 12px; font-weight: 700;
}
.stage-overlay:empty { display: none; }
.ov-tl { top: 10px; left: 10px; }
.ov-tr { top: 10px; right: 10px; text-align: right; }
.ov-bl { bottom: 10px; left: 10px; }
.ov-title { font-weight: 900; font-size: 14px; letter-spacing: -.01em; }
.ov-sub { color: #9fb0c2; font-size: 11px; font-weight: 700; }
.ov-model { color: var(--sign-sub); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; }

#status {
  display: none; margin: 10px 0; padding: 11px 14px; border-radius: 4px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink2);
  font-weight: 700; font-size: 13px;
}
#status.is-error { border-color: var(--sign); color: var(--sign-dk); }

.legend-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; box-shadow: 0 6px 22px rgba(0,0,0,.08);
}
#legend { flex: 1 1 340px; min-width: 260px; position: relative; }
.legend-bar { height: 15px; border-radius: 2px; border: 1px solid var(--line); }
.legend-ticks { position: relative; height: 15px; margin-top: 2px; }
.legend-ticks span {
  position: absolute; transform: translateX(-50%); font-size: 10px; font-weight: 700;
  color: var(--mut); font-family: var(--mono-font); white-space: nowrap;
}
.legend-units { font-size: 10px; color: var(--ink2); margin-top: 2px; font-weight: 800; letter-spacing: .08em; }

/* Kilometre-marker style facts strip */
.facts { display: flex; flex-wrap: wrap; margin-top: 14px; background: var(--card);
         border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
         box-shadow: 0 6px 22px rgba(0,0,0,.08); }
.fact { padding: 10px 20px; border-left: 1px solid var(--line2); flex: 1 1 140px; }
.fact:first-child { border-left: 0; }
.fact .k { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; color: var(--mut); }
.fact .v { font-size: 15px; font-weight: 900; margin-top: 3px; white-space: nowrap; }

.tl-hint { font: 700 9.5px var(--mono-font); letter-spacing: .1em; color: var(--mut);
           text-align: center; margin-top: 6px; }

@media (max-width: 640px) {
  #stage { height: 56vh; }
  .field-band-label, .sector-group-label { min-width: 0; }
}
