/* Monterey.News — fog, kelp and tide. */
:root {
  --bg: #EDF1F0;
  --surface: #FAFAF7;
  --ink: #10262E;
  --ink-2: #3D5258;
  --muted: #66777C;
  --line: #CCD6D5;
  --tide: #1F7A8C;
  --tide-soft: #D3E6E8;
  --c-fire: #C24A1B;
  --c-traffic: #A86A10;
  --c-rescue: #1F7A8C;
  --c-police: #3B5BA5;
  --c-community: #2E6B52;
  --c-spotlight: #8A4FA0;
  --c-longform: #10262E;
  --c-weather: #4F7896;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --text: "Literata", Georgia, "Times New Roman", serif;
  --wrap: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1C21; --surface: #132A31; --ink: #E4EEEC; --ink-2: #B5C6C5; --muted: #8DA1A3;
    --line: #26414A; --tide: #5FC4CF; --tide-soft: #17363E; --c-longform: #E4EEEC;
    --c-fire: #F07A4A; --c-traffic: #E0A84A; --c-rescue: #5FC4CF; --c-police: #8EA8F0; --c-community: #6CC49C; --c-spotlight: #C99BDB; --c-weather: #8DB5D4;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--text); }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--tide); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* language switching */
html[data-lang="en"] [lang="es"]:not(html) { display: none !important; }
html[data-lang="es"] [lang="en"]:not(html) { display: none !important; }

/* masthead */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.mast-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 10px; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 5vw, 38px); letter-spacing: -0.035em; text-decoration: none; line-height: 1; font-variation-settings: "opsz" 96; }
.wm-dot { color: var(--tide); }
.wm-b { font-weight: 500; }
.mast-tools { display: flex; align-items: center; gap: 10px; }
.tool { display: inline-flex; align-items: center; gap: 6px; font: 600 15px/1 var(--display); text-decoration: none; padding: 9px 10px; border-radius: 999px; }
.tool:hover { background: var(--tide-soft); }
.lang { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.lang button { font: 700 13px/1 var(--display); border: 0; background: transparent; color: var(--ink); padding: 8px 11px; cursor: pointer; }
html[data-lang="en"] .lang [data-set-lang="en"], html[data-lang="es"] .lang [data-set-lang="es"] { background: var(--ink); color: var(--surface); }
.sections { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.sections::-webkit-scrollbar { display: none; }
.sections a { font: 600 15px/1 var(--display); text-decoration: none; color: var(--ink-2); padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.sections a:hover { color: var(--ink); background: var(--tide-soft); }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* shared bits */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 6px; font: 600 13px/1.3 var(--display); color: var(--muted); }
.tag { color: var(--cat, var(--tide)); text-decoration: none; }
.tag::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.where { text-decoration: none; }
a.where:hover, a.tag:hover { text-decoration: underline; }
.es-flag { font: 700 11px/1 var(--display); border: 1px solid currentColor; border-radius: 4px; padding: 2px 4px; color: var(--ink-2); }
.when { font: 500 13px/1.3 var(--display); color: var(--muted); margin: 8px 0 0; }
.dek { color: var(--ink-2); margin: 6px 0 0; }
.cat-fire { --cat: var(--c-fire); } .cat-traffic { --cat: var(--c-traffic); } .cat-rescue { --cat: var(--c-rescue); }
.cat-police { --cat: var(--c-police); } .cat-community { --cat: var(--c-community); } .cat-spotlight { --cat: var(--c-spotlight); }
.cat-longform { --cat: var(--c-longform); } .cat-weather { --cat: var(--c-weather); }
.rule-h { font: 800 26px/1.1 var(--display); letter-spacing: -0.02em; margin: 0 0 16px; padding-top: 14px; border-top: 3px solid var(--ink); }

/* lead */
.lead { display: grid; gap: 28px; padding-top: 24px; padding-bottom: 8px; }
@media (min-width: 900px) { .lead { grid-template-columns: 1.75fr 1fr; } }
.lead-story .card-link { text-decoration: none; display: grid; gap: 16px; }
.lead-img { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 6px; background: var(--tide-soft); }
.lead-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.lead-hed { font: 800 clamp(30px, 4.6vw, 52px)/1.02 var(--display); letter-spacing: -0.03em; margin: 0; text-wrap: balance; font-variation-settings: "opsz" 96; }
.lead-story .card-link:hover .lead-hed { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.lead-story .dek { font-size: 19px; max-width: 60ch; }
.lead-side { display: grid; gap: 18px; align-content: start; }
.card.side .card-link { grid-template-columns: 120px 1fr; }
.card.side .card-img { aspect-ratio: 1; }
.card.side .hed { font-size: 18px; }
.card.side .dek { display: none; }

/* tide chart */
.tide { margin-top: 28px; }
.tide-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tide-head h2 { font: 800 20px/1.2 var(--display); margin: 0; letter-spacing: -0.01em; }
.tide-count { margin: 0; font: 600 14px/1 var(--display); color: var(--muted); }
.tide-scroll { overflow-x: auto; margin: 8px -16px 0; padding: 0 16px; scrollbar-width: thin; }
.tide-svg { width: 100%; min-width: 720px; height: auto; display: block; overflow: visible; }
.tide-area { fill: var(--tide-soft); }
.tide-line { fill: none; stroke: var(--tide); stroke-width: 2.5; }
.tide-svg text { font: 600 12px var(--display); fill: var(--muted); }
.tide-dot circle { fill: var(--cat); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; transition: r .15s; }
.tide-dot:hover circle, .tide-dot:focus circle { r: 9; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; margin: 6px 0 0; font: 600 13px/1.4 var(--display); }
.legend a { text-decoration: none; color: var(--cat); }
.legend a::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cat); margin-right: 6px; }

/* stream + grid */
.stream { margin-top: 36px; }
.filters { padding: 0; margin-bottom: 18px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.chip { flex: none; font: 600 14px/1 var(--display); color: var(--ink); background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 13px; cursor: pointer; }
.chip .n { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip.on .n { color: inherit; opacity: .7; }
.grid { display: grid; gap: 28px 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.card .card-link { text-decoration: none; display: grid; gap: 12px; }
.card-img { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: var(--tide-soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
/* portrait social cards: show the whole image, never crop faces */
.card-img.portrait, .lead-img.portrait { background: #0E222A; }
.card-img.portrait img, .lead-img.portrait img { object-fit: contain; }
.noimg { display: flex; align-items: flex-end; padding: 14px; background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--cat) 22%, transparent)), var(--tide-soft); position: relative; overflow: hidden; }
.noimg::before { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24' viewBox='0 0 120 24'%3E%3Cpath d='M0 12c10-8 20-8 30 0s20 8 30 0 20-8 30 0 20 8 30 0' fill='none' stroke='%23000' stroke-opacity='.08' stroke-width='2'/%3E%3C/svg%3E") 0 0 / 120px 24px; }
.noimg span { position: relative; font: 800 22px/1 var(--display); letter-spacing: -0.02em; color: var(--cat); }
.hed { font: 700 21px/1.18 var(--display); letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.card .card-link:hover .hed { text-decoration: underline; text-underline-offset: 3px; }
.card .dek { font-size: 15.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card[hidden] { display: none; }
.empty { color: var(--muted); font-style: italic; }
.grid.four { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }

/* lists */
.list-head { padding-top: 30px; padding-bottom: 18px; }
.list-head h1 { font: 800 clamp(34px, 6vw, 56px)/1 var(--display); letter-spacing: -0.035em; margin: 0; }
.list-intro { color: var(--ink-2); max-width: 60ch; }
.count { color: var(--muted); font: 600 14px/1 var(--display); margin: 12px 0 0; }
.places { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.places a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 16px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.places a:hover { background: var(--surface); }
.pl-name { font: 700 22px/1.2 var(--display); letter-spacing: -0.01em; }
.pl-n { font: 800 22px/1.2 var(--display); color: var(--tide); }
.pl-last { grid-column: 1 / -1; color: var(--muted); font-size: 15px; }

/* article */
.story-head { padding-top: 32px; }
.story-hed { font: 800 clamp(32px, 5.4vw, 56px)/1.03 var(--display); letter-spacing: -0.03em; margin: 8px 0 0; text-wrap: balance; font-variation-settings: "opsz" 96; }
.story-head .dek { font-size: 20px; line-height: 1.45; }
.byline { font: 700 15px/1 var(--display); margin: 18px 0 0; }
.upd { margin-left: 8px; }
.es-switch { margin-left: 10px; font: 700 13px/1 var(--display); color: var(--tide); background: var(--tide-soft); border: 0; border-radius: 999px; padding: 7px 11px; cursor: pointer; }
.followup { background: var(--tide-soft); padding: 10px 14px; border-radius: 6px; font: 500 15px/1.4 var(--display); }
.art-fig { max-width: 1000px; margin: 26px auto 0; padding: 0 16px; }
.art-fig img { width: 100%; border-radius: 6px; max-height: 78vh; object-fit: cover; }
.art-fig.portrait img { width: auto; max-width: 100%; max-height: 82vh; margin: 0 auto; object-fit: contain; }
.art-fig figcaption { font: 500 13px/1.4 var(--display); color: var(--muted); margin-top: 8px; text-align: right; }
.art-fig.portrait figcaption { text-align: center; }
.story-body { padding-top: 22px; padding-bottom: 40px; }
.prose { font-size: 19px; line-height: 1.68; }
.prose p { margin: 0 0 1.05em; }
.prose > p:first-child { font-size: 21px; }
.prose h2 { font: 800 28px/1.15 var(--display); letter-spacing: -0.02em; margin: 1.6em 0 .5em; }
.prose h3 { font: 700 22px/1.2 var(--display); margin: 1.4em 0 .4em; }
.prose blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 4px solid var(--tide); font-style: italic; color: var(--ink-2); }
.prose a { color: var(--tide); text-underline-offset: 3px; }
.prose li { margin-bottom: .4em; }
.longform .prose > p:first-child::first-letter { float: left; font: 800 4.1em/0.82 var(--display); padding: 6px 10px 0 0; color: var(--tide); }
.radio-note { font: 500 14px/1.45 var(--display); color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px; }
.lang-note { font: 600 14px/1.4 var(--display); background: var(--tide-soft); padding: 10px 14px; border-radius: 6px; }
.related { padding-bottom: 40px; }

/* search */
.search-form input { width: 100%; font: 600 clamp(20px, 3vw, 28px)/1.2 var(--display); padding: 14px 16px; border: 2px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--ink); margin-top: 16px; }
.search-form input::placeholder { color: var(--muted); font-weight: 500; }
mark { background: color-mix(in srgb, var(--tide) 25%, transparent); color: inherit; padding: 0 2px; border-radius: 2px; }

/* footer */
.foot { background: var(--ink); color: var(--bg); margin-top: 40px; padding: 36px 0 44px; font: 500 15px/1.5 var(--display); }
@media (prefers-color-scheme: dark) { .foot { background: #08141A; color: var(--ink); } }
.foot-grid { display: grid; gap: 18px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr; } }
.foot-mark { font: 800 28px/1 var(--display); letter-spacing: -0.03em; margin: 0 0 8px; }
.foot .wm-dot { color: #5FC4CF; }
.foot p { margin: 0 0 8px; max-width: 52ch; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
