/* Thamizhan Mazhai: the cyclone tracker and the Mazhai shell. Builds on styles.css and districts.css. */
:root { --sea: #dfe9ea; --sea-ink: #5f8590; --land: #ece2cf; --land-edge: #c9b99c; --tn: #e2d2b2; --trk: #3a3a8c; --fut: #b2361c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sea: #0f1a1f; --sea-ink: #6d9aa6; --land: #241d16; --land-edge: #3d3226; --tn: #3a2f22; --trk: #a7b1ff; --fut: #ff8a65; }
}
:root[data-theme="dark"] { --sea: #0f1a1f; --sea-ink: #6d9aa6; --land: #241d16; --land-edge: #3d3226; --tn: #3a2f22; --trk: #a7b1ff; --fut: #ff8a65; }

.cy-checked { margin: 0; color: var(--ink-faint); font-size: .88rem; max-width: 70ch; }
.cy-stage { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .9fr); gap: clamp(18px, 3vw, 36px); align-items: start; }
.cy-mapbox { position: sticky; top: calc(var(--header-h) + 14px); }
.bay-map { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.bay-map .sea-bg { fill: var(--sea); }
.bay-map .sea { fill: var(--sea-ink); font: italic 500 22px var(--display); text-anchor: middle; opacity: .8; letter-spacing: .04em; }
.bay-map .land path { fill: var(--land); stroke: var(--land-edge); stroke-width: .8; }
.bay-map .tn path { fill: var(--tn); stroke: var(--land-edge); stroke-width: .5; }
.bay-map .tn path.coast { fill: color-mix(in srgb, var(--tn) 70%, var(--gold) 30%); }
.bay-map .tn path.near { fill: color-mix(in srgb, var(--lvl-orange) 55%, var(--tn)); }
.bay-map .zone { stroke: none; }
.bay-map .z-green { fill: rgba(63, 138, 98, .2); }
.bay-map .z-orange { fill: rgba(232, 129, 42, .28); }
.bay-map .z-red { fill: rgba(200, 40, 30, .35); }
.bay-map .trk { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.bay-map .trk.past { stroke: var(--trk); }
.bay-map .trk.fut { stroke: var(--fut); stroke-dasharray: 7 6; }
.bay-map .dot.past { fill: var(--trk); }
.bay-map .dot.fut { fill: var(--sea); stroke: var(--fut); stroke-width: 2.2; }
.bay-map .fut-t { font: 600 12px var(--sans); fill: var(--fut); paint-order: stroke; stroke: var(--sea); stroke-width: 3px; }
.bay-map .reach { stroke: var(--ink-soft); stroke-width: 1.2; stroke-dasharray: 2 5; fill: none; }
.bay-map .reach-t { font: 700 13px var(--sans); fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--sea); stroke-width: 4px; }
.bay-map .eye .core { fill: var(--fut); }
.bay-map .eye .hole { fill: var(--sea); }
.bay-map .eye .pulse { fill: none; stroke: var(--fut); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: eye-pulse 2.4s ease-out infinite; }
.bay-map .storm-name { font: 700 17px var(--sans); fill: var(--ink); letter-spacing: .06em; paint-order: stroke; stroke: var(--sea); stroke-width: 4px; }
@keyframes eye-pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.2); opacity: 0; } }
.cy-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .84rem; color: var(--ink-soft); }
.cy-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cy-legend i { display: inline-block; width: 22px; height: 0; border-top: 2.4px solid var(--trk); }
.cy-legend .lg-fut { border-top: 2.4px dashed var(--fut); }
.cy-legend .lg-zone { height: 12px; border: 0; border-radius: 4px; background: linear-gradient(90deg, rgba(63, 138, 98, .45), rgba(232, 129, 42, .55), rgba(200, 40, 30, .6)); }

.cy-side { display: grid; gap: 16px; }
.cy-card { padding: clamp(16px, 3vw, 24px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line-strong); }
.cy-card h2 { margin: 22px 0 10px; font-size: 1.15rem; }
.cy-sentence { margin: 0; font-size: clamp(1.05rem, 1.8vw, 1.22rem); line-height: 1.55; color: var(--ink); }
.cy-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 18px 0 0; }
.cy-facts dt { font-size: .8rem; color: var(--ink-faint); }
.cy-facts dd { margin: 2px 0 0; font-weight: 600; }
.cy-facts dd small { display: block; font-weight: 400; font-size: .78rem; color: var(--ink-faint); }
.cy-facts a { color: var(--ink); }
.cy-agree { margin: 0 0 8px; font-weight: 500; }
.cy-sources { width: 100%; border-collapse: collapse; font-size: .84rem; }
.cy-sources th { text-align: left; font-weight: 500; color: var(--ink-faint); padding: 4px 6px 6px 0; border-bottom: 1px solid var(--line-strong); }
.cy-sources td { padding: 8px 6px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.cy-sources td.ok { color: var(--lvl-green); font-weight: 600; white-space: nowrap; }
.cy-sources td.ok .i { width: 14px; height: 14px; vertical-align: -2px; }
.cy-sources td.off { color: var(--lvl-orange); font-weight: 600; }
.cy-sources tr.missing td { color: var(--ink-faint); }
.cy-sources a { color: var(--ink); }
.cy-sub { font: 600 .92rem/1.3 var(--sans); margin: 0 0 8px; color: var(--ink-soft); }
.cy-within { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cy-within a { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; }
.cy-within a:hover { border-color: var(--gold); }
.cy-within span { color: var(--ink-soft); font-size: .86rem; }
.cy-within em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-weight: 600; color: var(--kumkum); font-size: .86rem; }
.cy-official { margin-top: clamp(28px, 5vw, 48px); max-width: 76ch; color: var(--ink-soft); }
.cy-official a { display: inline-flex; gap: 5px; align-items: center; color: var(--ink); }
.cy-official .i { width: 14px; height: 14px; }

@media (max-width: 960px) {
  .cy-stage { grid-template-columns: 1fr; }
  .cy-mapbox { position: static; }
}
@media (max-width: 600px) {
  .cy-sources th:nth-child(3), .cy-sources td:nth-child(3) { display: none; }
  .bay-map .fut-t { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .bay-map .eye .pulse { animation: none; opacity: .5; } }

/* ---------- the Mazhai shell */
body.mazhai .topbar .nav a .lbl { white-space: nowrap; }
.mz-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.mz-foot a { color: inherit; }

/* A storm in the seas shows on the state page too, linking to the tracker. */
.storm-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px; border-radius: 14px; max-width: 760px;
  background: color-mix(in srgb, var(--lvl-orange) 12%, var(--surface-solid)); border: 1px solid color-mix(in srgb, var(--lvl-orange) 45%, transparent);
  color: var(--ink); text-decoration: none; }
.storm-strip .lvl-dot { background: var(--lvl-orange); }
.storm-strip strong { margin-left: auto; color: var(--kumkum); font-weight: 600; }
.storm-strip:hover { border-color: var(--lvl-orange); }
.tn-head > * { min-width: 0; }
.storm-strip { max-width: 100%; }
.storm-strip > span:not(.lvl-dot) { flex: 1 1 220px; }
.tn-cta .btn { white-space: normal; text-align: left; max-width: 100%; height: auto; min-height: 44px; line-height: 1.3; }
