/* AiB Platform — the canvas map grammar (Морето днес on /free-tools/).
   Loaded only by tools/public/moreto_dnes/widget.html, after css/public/public.css. The
   design is the owner-approved concept mockup, spoken in the platform's
   tokens: monochrome cartography on paper, the sea a quiet info-family
   wash, and the three semantic statuses (--ok/--warn/--danger) doing ALL
   the talking. Sodium never appears here — wordmark discipline. The kit
   carries the primitives: the day choice (.segmented), the verdict
   (.badge--lg), the count dots (.status-dot), the panel that turns bottom
   sheet (.sheet with .sheet-grip / .sheet-close / .sheet-body) and the
   warning (.callout--warn); this file holds only the map's own grammar.

   Ladder literals used: 1020 (the side panel becomes the bottom sheet —
   the 1020 two-column fold) and 719 (phone: the JS crops the open sea out
   of the viewBox; sizes bump to stay legible and tappable). */

/* The canvas page's bleed, method cards and panel meta — moved here from the
   platform's public/tools.css: everything this tool owns lives in its package. */
.sea-bleed { width: 100vw; margin-inline: calc(50% - 50vw); }
.sea-panel-meta { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 11px; color: var(--grey); line-height: 1.7; }
.sea-method { padding: clamp(36px, 6vw, 64px) 0 0; }
.sea-method h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.01em; margin: 0 0 6px; }
.sea-method-sub { color: var(--grey); max-width: 60ch; margin: 0 0 26px; }
.sea-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.sea-m-card { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--paper); padding: var(--space-5); box-shadow: var(--shadow-card); }
.sea-m-card h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.sea-m-card p { margin: 0; color: var(--grey); font-size: var(--fs-md); }
.sea-m-num { font-size: 11px; color: var(--grey); letter-spacing: 0.1em; display: block; margin-bottom: 10px; }
.sea-warning { margin-top: clamp(24px, 4vw, 40px); }

@media (max-width: 1020px) {
  .sea-method-grid { grid-template-columns: minmax(0, 1fr); }
  .sea-sheet-open .cookie-note { opacity: 0; pointer-events: none; transition: opacity var(--dur-fast); }
}


/* ---------- full-bleed sections ---------- */
/* Break out of .public-main's 1080px column; the body's overflow-x clip
   (base.css drift guard) absorbs the scrollbar-width remainder of 100vw. */

/* ---------- hero ---------- */
.sea-hero { margin-top: 18px; }
.sea-hero .public-statement { font-size: clamp(28px, 3.6vw, 44px); }
.sea-empty-note { color: var(--grey); max-width: 56ch; margin: 18px 0 0; }

.day-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: var(--space-6); }
.day-meta { font-size: 12px; color: var(--grey); margin-left: var(--space-1); }

/* ---------- the sticky spine: the coast barcode ---------- */
.sea-spine {
  /* the sticky ink header is ~70px tall (16px paddings + the CTA pill);
     the offset must clear it fully or the spine's own top padding slides
     underneath and the bars read as glued to the header */
  position: sticky; top: 68px;
  z-index: var(--z-sticky); background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  padding: 14px var(--pad) 10px; margin-top: 26px;
}
.sea-spine-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 18px; }
.sea-spine-bar { flex: 1 1 auto; min-width: 0; }
.sea-barcode { display: flex; gap: 2px; height: 18px; min-width: 0; }
.sea-barcode button {
  flex: 1 1 0; min-width: 3px; border: 0; border-radius: 2px; padding: 0; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}
.sea-barcode button:hover { opacity: 0.75; }
.sea-barcode button[aria-current="true"] { transform: scaleY(1.45); outline: 1.5px solid var(--ink); outline-offset: 1px; }
.bc-o { background: var(--ok); } .bc-w { background: var(--warn); }
.bc-d { background: var(--danger); } .bc-na { background: var(--hairline-strong); }
.sea-spine-ends { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.1em; color: var(--grey); text-transform: uppercase; margin-top: var(--space-1); }
.sea-counts { display: flex; gap: 14px; white-space: nowrap; font-size: 13px; color: var(--grey); }
.sea-counts b { color: var(--ink); font-weight: 600; }
.sea-counts .status-dot { margin-right: 5px; }

/* ---------- region chips ---------- */
.sea-regions { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 14px 0 0; }
.sea-region-chip {
  border: 1px solid var(--hairline); border-radius: var(--radius-pill); background: var(--paper);
  cursor: pointer; padding: 6px 14px; font: inherit; font-size: 13px; color: var(--grey);
}
.sea-region-chip:hover { border-color: var(--hairline-strong); color: var(--ink); }
/* narrow screens only: the panel is off-screen until a tap, so say so */
.sea-tap-hint { display: none; margin: var(--space-3) 0 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); }

/* ---------- the map canvas ---------- */
.sea-map { background: var(--info-face); margin-top: 18px; border-block: 1px solid var(--hairline); }
.sea-grid {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 396px;
  gap: 0 28px; padding: 0 var(--pad);
}
.sea-coast { min-width: 0; }
.sea-coast svg { width: 100%; height: auto; display: block; }

.sea-panel-col { min-width: 0; }
/* the kit's .sheet: a sticky paper side panel here, a bottom sheet at
   1020 and below. It pins under header + spine (134px) and is capped to the viewport
   by the kit — a sticky box taller than the room under the header would
   surface its tail only once the whole map had scrolled by (on a laptop,
   ≈700px of CSS height at Windows scaling, the panel's bottom hid until
   Резово). The short-viewport tier below tightens the rhythm so it usually
   fits whole; .sheet-body scrolls inside only as the last resort. */
.sea-panel { --app-sticky-top: 134px; margin: var(--space-8) 0; }
.sea-panel .sheet-body { scrollbar-width: thin; }

.sea-panel-region { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); margin: 0; }
.sea-panel-name { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); letter-spacing: -0.01em; margin: var(--space-1) 0 0; }
/* the panel's day switch: the hero's pills again, closer together */
.sea-panel-days { gap: 6px; margin-top: var(--space-3); }

.sea-verdict { margin-top: 14px; }
.sea-reason { margin: var(--space-3) 0 0; font-size: 14px; max-width: 42ch; }
.sea-empty { color: var(--grey); font-size: 14px; margin: 10px 0 0; max-width: 40ch; }

/* five facts (waves, wind, air, water, UV) sit in two rows of three; the
   560 tier folds them to two columns where the panel is a phone sheet */
.sea-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) 14px; margin: 18px 0 0; padding-top: var(--space-4); border-top: 1px solid var(--hairline); }
.sea-facts dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); margin: 0; }
.sea-facts dd { margin: 3px 0 0; font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.sea-facts dd small { font-weight: 400; color: var(--grey); font-size: 12px; }

.sea-hours { margin-top: 18px; padding-top: var(--space-4); border-top: 1px solid var(--hairline); }
.sea-hours-title, .sea-alts-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); margin: 0 0 var(--space-2); }
.sea-hour-strip { display: flex; gap: 3px; }
.sea-hour-cell { flex: 1 1 0; min-width: 0; text-align: center; }
.sea-hour-tick { height: 22px; border-radius: 3px; }
.sea-hour-cell span { display: block; font-family: var(--font-mono); font-size: 9px; color: var(--grey); margin-top: var(--space-1); }
.tick-o { background: var(--ok); opacity: 0.85; } .tick-w { background: var(--warn); opacity: 0.85; } .tick-d { background: var(--danger); opacity: 0.85; }

.sea-alts { margin-top: 18px; padding-top: var(--space-4); border-top: 1px solid var(--hairline); }
.sea-alt-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px dashed var(--hairline); }
.sea-alt-row:last-child { border-bottom: 0; }
.sea-alt-link { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-weight: 600; text-align: left; color: var(--ink); }
.sea-alt-link:hover { text-decoration: underline; }
.sea-alt-dist { font-family: var(--font-mono); font-size: 12px; color: var(--grey); white-space: nowrap; }
.sea-alt-state { font-size: 12px; font-weight: 600; color: var(--ok); }
.sea-alts-empty { color: var(--grey); font-size: 13px; margin: var(--space-1) 0 0; }

.sea-panel-flag { color: var(--grey); font-size: 12px; margin: 10px 0 0; }

/* short laptop viewports (height, not the width ladder — the one place
   the coast page keys on it): the panel's vertical rhythm tightens so the
   whole reading fits under header + spine without an inner scroll */
@media (min-width: 1021px) and (max-height: 840px) {
  .sea-panel { margin: var(--space-6) 0; max-height: calc(100dvh - 134px - 16px); }
  .sea-panel .sheet-body { padding: 14px 18px var(--space-4); }
  .sea-panel-name { font-size: 22px; }
  .sea-panel-days { margin-top: 6px; }
  .sea-verdict { margin-top: var(--space-2); }
  .sea-reason { margin-top: 6px; font-size: var(--fs-md); }
  .sea-facts { gap: 6px var(--space-4); margin-top: 10px; padding-top: 10px; }
  .sea-facts dd { font-size: 16px; }
  .sea-hours, .sea-alts { margin-top: var(--space-2); padding-top: var(--space-2); }
  .sea-hour-tick { height: 14px; }
  .sea-hour-cell span { margin-top: 2px; }
  .sea-alt-row { padding: var(--space-1) 0; }
  .sea-panel-meta { margin-top: var(--space-2); padding-top: 6px; line-height: 1.4; }
  .sea-panel-flag { margin-top: 5px; }
}

/* ---------- SVG cartography ---------- */
#sea-svg .land { fill: var(--canvas); }
#sea-svg .coastline { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
#sea-svg .depth { fill: none; stroke: var(--info); stroke-width: 0.7; stroke-dasharray: 1 7; stroke-linecap: round; }
#sea-svg .geo-label { font-family: var(--font-body); font-style: italic; font-size: 12px; fill: var(--grey-on-face); }
#sea-svg .sea-label { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: 0.55em; fill: var(--info); opacity: 0.28; text-transform: uppercase; }
#sea-svg .town-label { font-family: var(--font-display); font-weight: 700; font-size: 14px; fill: var(--ink); }
#sea-svg .scale-line { stroke: var(--grey); }
#sea-svg .compass, #sea-svg .scale-label { font-family: var(--font-mono); font-size: 10px; fill: var(--grey-on-face); letter-spacing: 0.1em; }

#sea-svg .beach { cursor: pointer; }
#sea-svg .beach .tick { stroke: var(--grey-dark); stroke-width: 1; }
#sea-svg .beach .b-dot { stroke: var(--paper); stroke-width: 1.5; transition: r var(--dur-fast) var(--ease-out); }
#sea-svg .beach .b-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; fill: var(--grey-label); }
#sea-svg .beach:hover .b-dot { r: 9; }
#sea-svg .beach .b-ring { fill: none; stroke: var(--ink); stroke-width: 1.4; opacity: 0; }
#sea-svg .beach.is-sel .b-ring, #sea-svg .beach:focus-visible .b-ring { opacity: 1; }
#sea-svg .beach.is-sel .b-dot { r: 9; }
#sea-svg .beach.is-sel .b-label { font-weight: 700; fill: var(--ink); }
/* the group is focusable (keyboard reaches every beach), but the browser's
   own focus rectangle around its bbox reads as a stray box on click — the
   selection ring circle above is the one focus/selection indicator */
#sea-svg .beach:focus { outline: none; }
.st-o { fill: var(--ok); } .st-w { fill: var(--warn); } .st-d { fill: var(--danger); }
.st-na { fill: var(--grey-dark); }

/* ---------- under the map ---------- */
/* the warning keeps a reading measure */
.sea-warning .callout { max-width: 76ch; }

/* ---------- keyboard ---------- */
.sea-region-chip:focus-visible, .sea-barcode button:focus-visible,
.sea-alt-link:focus-visible, .sea-panel .sheet-grip:focus-visible, .sea-panel .sheet-close:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

/* ---------- tablet & phone: the bottom sheet ---------- */
@media (max-width: 1020px) {
  .sea-grid { grid-template-columns: minmax(0, 1fr); padding: 0 var(--space-2); }
  .sea-panel-col { position: static; }
  /* The side panel becomes the kit's bottom sheet, which exists ONLY while
     a beach is being read: off-screen until a tap opens it; Затвори, the
     grip, Escape, a swipe down or scrolling the map out of view all put it
     back (the script wires them). It never peeks — a fixed peek rode over
     the hero, the method cards and the footer, and fought the cookie pill
     for the same corner (public/tools.css fades the pill while it is up).
     The kit's sheet rung keeps it above that pill. */
  .sea-panel { margin: 0 auto; }
  /* the sheet no longer peeks, so the map needs only breathing room under
     Резово — anything more reads as an empty blue band under the coast */
  .sea-map { padding-bottom: var(--space-4); }
  .sea-tap-hint { display: block; }
}

@media (max-width: 719px) {
  .sea-counts { display: none; }
  .sea-spine { top: 62px; }
  .sea-hero { margin-top: var(--space-2); }
  .sea-hero .public-statement { font-size: clamp(24px, 7.5vw, 32px); }
  /* the phone viewBox crops the open sea (the JS swaps it), so SVG units
     render near 1:0.78 — sizes bump so labels stay legible, dots tappable */
  #sea-svg .garnish { display: none; }
  #sea-svg .beach .b-label { font-size: 15px; }
  #sea-svg .beach .b-dot { r: 9; }
  #sea-svg .beach:hover .b-dot, #sea-svg .beach.is-sel .b-dot { r: 11; }
  #sea-svg .beach .b-ring { r: 17; }
  #sea-svg .sea-label { opacity: 0.18; }
}

@media (max-width: 560px) {
  .sea-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* reduced motion: base.css stops every transition, the sheet's included */
