/*
Theme Name: Oceano TV
Theme URI: https://oceano.tv/
Author: Oceano TV
Description: Bilingual local-news theme for the South Carolina Lowcountry. Spanish primary, English secondary. Built for short attributed briefs published by an automated newsroom pipeline. No page builder, no jQuery, no bundled plugins.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: oceano
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root{
  --navy-deep:#0c1e2b;
  --navy:#132a3a;
  --panel:#16303f;
  --panel-2:#1b3b4d;
  --sky:#2ba9e0;
  --sky-soft:#6ec6f5;
  --amber:#f0a83c;
  --red:#e5544b;

  --ink:#ffffff;
  --muted:rgba(255,255,255,.68);
  --faint:rgba(255,255,255,.44);
  --line:rgba(110,198,245,.20);
  --line-2:rgba(255,255,255,.09);

  --wrap:1180px;
  --r:14px;
  --r-lg:20px;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  background:var(--navy-deep);
  color:var(--ink);
  font-family:'Poppins',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  font-weight:300;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
img{ max-width:100%; height:auto; display:block; }
a{ color:inherit; text-decoration:none; }
h1,h2,h3{ font-weight:600; line-height:1.16; letter-spacing:-.022em; margin:0; }

.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.skip{ position:absolute; left:-9999px; }
.skip:focus{ left:14px; top:14px; z-index:99; background:var(--sky); color:#06131c; padding:10px 16px; border-radius:8px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-head{
  position:sticky; top:0; z-index:40;
  background:rgba(12,30,43,.86);
  backdrop-filter:saturate(140%) blur(12px);
  border-bottom:1px solid var(--line-2);
}
.bar{
  max-width:var(--wrap); margin:0 auto;
  padding:14px clamp(16px,4vw,32px);
  display:flex; align-items:center; gap:clamp(14px,3vw,32px);
}
.brand img{ height:30px; width:auto; }

.towns-nav{ display:flex; gap:2px; flex:1; overflow-x:auto; scrollbar-width:none; }
.towns-nav::-webkit-scrollbar{ display:none; }
.towns-nav a{
  font-size:13.5px; font-weight:400; color:var(--muted);
  padding:7px 13px; border-radius:100px; white-space:nowrap;
  transition:color .15s, background .15s;
}
.towns-nav a:hover{ color:var(--ink); background:rgba(255,255,255,.06); }
.towns-nav a[aria-current]{ color:#06131c; background:var(--sky); font-weight:500; }

.search{ display:flex; align-items:center; gap:6px;
  background:rgba(255,255,255,.05); border:1px solid var(--line-2);
  border-radius:100px; padding:5px 6px 5px 14px; }
.search input{
  background:none; border:0; outline:none; color:var(--ink);
  font:inherit; font-size:13.5px; width:clamp(90px,14vw,170px);
}
.search input::placeholder{ color:var(--faint); }
.search button{
  background:var(--sky); border:0; color:#06131c; cursor:pointer;
  width:28px; height:28px; border-radius:100px; display:grid; place-items:center;
}

/* ==========================================================================
   Alert strip
   ========================================================================== */
.alert-strip{ background:var(--red); }
.alert-strip a{
  max-width:var(--wrap); margin:0 auto;
  padding:11px clamp(16px,4vw,32px);
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  font-size:14px;
}
.alert-strip .tag{ background:rgba(0,0,0,.24); color:#fff; }
.alert-strip strong{ font-weight:600; }
.alert-strip .what{ color:rgba(255,255,255,.80); font-weight:300; font-size:13px; }

/* ==========================================================================
   Layout
   ========================================================================== */
main{ max-width:var(--wrap); margin:0 auto; padding:clamp(22px,4vw,42px) clamp(16px,4vw,32px) 80px; }

.grid{
  display:grid; gap:clamp(16px,2.4vw,26px);
  grid-template-columns:repeat(auto-fill,minmax(288px,1fr));
  margin-top:clamp(24px,4vw,40px);
}

/* ==========================================================================
   Meta + tags
   ========================================================================== */
.meta{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:11.5px; color:var(--faint); }
.meta time{ font-variant-numeric:tabular-nums; }
.meta .town{ color:var(--sky-soft); font-weight:500; }

.tag{
  display:inline-block; font-size:10px; font-weight:600;
  letter-spacing:.14em; text-transform:uppercase;
  padding:4px 9px; border-radius:5px; color:#06131c; background:var(--sky);
}
.tag-local{ background:rgba(110,198,245,.16); color:var(--sky-soft); }
.tag-breaking{ background:var(--amber); color:#2a1a02; }
.tag-alert{ background:var(--red); color:#fff; }

/* ==========================================================================
   Lead story
   ========================================================================== */
.lead{
  border:1px solid var(--line-2); border-radius:var(--r-lg);
  overflow:hidden; background:var(--navy);
}
.lead-link{ display:grid; grid-template-columns:1.25fr .95fr; }
.lead-media{ background:var(--panel); aspect-ratio:3/2; overflow:hidden; }
.lead-media img{ width:100%; height:100%; object-fit:cover; transition:transform .5s ease; }
.lead:hover .lead-media img{ transform:scale(1.03); }
.lead-body{ padding:clamp(22px,3.4vw,40px); align-self:center; }
.lead-body h1{ font-size:clamp(1.4rem,2.35vw,1.95rem); margin:13px 0 0; text-wrap:balance; }
.lead-body .en{ margin:12px 0 0; font-size:14px; color:var(--muted); font-style:italic; }
.lead-body .src{ margin:16px 0 0; font-size:12px; color:var(--faint); }
.lead.kind-alert{ border-color:rgba(229,84,75,.55); }
.lead.kind-breaking{ border-color:rgba(240,168,60,.45); }

@media (max-width:860px){
  .lead-link{ grid-template-columns:1fr; }
  .lead-media{ aspect-ratio:16/9; }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card{
  border:1px solid var(--line-2); border-radius:var(--r);
  overflow:hidden; background:var(--navy);
  transition:transform .18s ease, border-color .18s ease;
}
.card:hover{ transform:translateY(-3px); border-color:var(--line); }
.card-media{ aspect-ratio:16/9; background:var(--panel); overflow:hidden; }
.card-media img{ width:100%; height:100%; object-fit:cover; }
.card-body{ padding:16px 18px 20px; }
.card-body h2{ font-size:1.02rem; margin:11px 0 0; text-wrap:balance; }
.card-body .en{ margin:9px 0 0; font-size:12px; color:var(--faint); font-style:italic; }
.card-body .src{ margin:12px 0 0; font-size:11px; color:rgba(255,255,255,.34); }
.card.kind-alert{ border-color:rgba(229,84,75,.5); }
.card.kind-breaking{ border-color:rgba(240,168,60,.4); }

/* ==========================================================================
   Single brief
   ========================================================================== */
.brief{ max-width:760px; margin:0 auto; }
.brief-head h1{ font-size:clamp(1.65rem,3.6vw,2.4rem); margin:16px 0 0; text-wrap:balance; }
.brief-head .en{ margin:14px 0 0; font-size:15px; color:var(--muted); font-style:italic; }

.alert-box{
  margin:26px 0 0; padding:20px 22px;
  background:rgba(229,84,75,.10); border:1px solid rgba(229,84,75,.42);
  border-radius:var(--r);
  display:grid; gap:14px;
}
.alert-box dt{ font-size:10px; font-weight:600; letter-spacing:.16em; text-transform:uppercase; color:var(--red); }
.alert-box dd{ margin:3px 0 0; font-size:15px; font-weight:400; }

.brief-media{ margin:28px 0 0; }
.brief-media img{ width:100%; border-radius:var(--r); }
.brief-media figcaption{ margin-top:9px; font-size:11.5px; color:var(--faint); }

.brief-body{ margin:26px 0 0; font-size:16.5px; line-height:1.78; color:rgba(255,255,255,.86); }
.brief-body p{ margin:0 0 1.1em; }

.source-out{
  margin:34px 0 0; padding:22px 24px;
  background:var(--panel); border:1px solid var(--line-2); border-radius:var(--r);
}
.source-out .label{ margin:0 0 14px; font-size:13.5px; color:var(--muted); }

.btn{
  display:inline-flex; align-items:center; gap:9px;
  background:var(--sky); color:#06131c;
  font-size:14px; font-weight:600;
  padding:12px 20px; border-radius:100px;
  transition:background .15s, transform .15s;
}
.btn:hover{ background:var(--sky-soft); transform:translateY(-1px); }
.btn-ghost{ background:none; color:var(--ink); border:1px solid var(--line); }
.btn-ghost:hover{ background:rgba(110,198,245,.12); }

.share{ margin:30px 0 0; display:flex; align-items:center; gap:14px; font-size:13px; color:var(--faint); }
.share a{ color:var(--sky-soft); border-bottom:1px solid var(--line); }

.related{ max-width:var(--wrap); margin:64px auto 0; }
.related h2{ font-size:1.15rem; }

/* ==========================================================================
   Archive / search / empty
   ========================================================================== */
.archive-head{ padding-bottom:6px; border-bottom:1px solid var(--line-2); }
.archive-head h1{ font-size:clamp(1.6rem,4vw,2.4rem); }
.archive-head .count{ margin:8px 0 14px; font-size:12.5px; color:var(--faint); }

.empty{ text-align:center; padding:clamp(50px,12vh,110px) 0; }
.empty h1{ font-size:clamp(1.4rem,3.4vw,2rem); }
.empty p{ color:var(--muted); margin:14px 0 0; }
.empty-cta{ display:flex; gap:10px; justify-content:center; margin-top:26px; }

.pager{ margin:46px 0 0; display:flex; justify-content:center; }
.pager .page-numbers{
  display:inline-grid; place-items:center; min-width:38px; height:38px;
  padding:0 12px; margin:0 3px; border-radius:100px;
  font-size:13.5px; color:var(--muted); border:1px solid var(--line-2);
}
.pager .page-numbers.current{ background:var(--sky); color:#06131c; border-color:transparent; font-weight:600; }
.pager .page-numbers:hover:not(.current){ color:var(--ink); border-color:var(--line); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-foot{ border-top:1px solid var(--line-2); background:#091823; }
.foot-inner{
  max-width:var(--wrap); margin:0 auto;
  padding:clamp(34px,5vw,58px) clamp(16px,4vw,32px);
  display:grid; gap:clamp(26px,4vw,48px);
  grid-template-columns:1.6fr 1fr 1fr;
}
.foot-brand img{ height:28px; width:auto; }
.foot-brand p{ margin:16px 0 0; font-size:13.5px; color:var(--muted); max-width:38ch; }
.foot-brand .en{ font-size:12.5px; color:var(--faint); font-style:italic; }
.site-foot h2{ font-size:10.5px; font-weight:600; letter-spacing:.2em; text-transform:uppercase; color:var(--faint); margin-bottom:14px; }
.foot-towns, .foot-social{ display:flex; flex-direction:column; gap:9px; font-size:13.5px; }
.foot-towns a, .foot-social a{ color:var(--muted); }
.foot-towns a:hover, .foot-social a:hover{ color:var(--sky-soft); }

.foot-legal{
  border-top:1px solid var(--line-2);
  max-width:var(--wrap); margin:0 auto;
  padding:18px clamp(16px,4vw,32px);
  display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap;
  font-size:11.5px; color:var(--faint);
}

@media (max-width:820px){
  .foot-inner{ grid-template-columns:1fr 1fr; }
  .foot-brand{ grid-column:1 / -1; }
}

/* ==========================================================================
   Small screens
   ========================================================================== */
@media (max-width:680px){
  .bar{ flex-wrap:wrap; row-gap:10px; }
  .brand{ order:1; }
  .search{ order:2; margin-left:auto; }
  .towns-nav{ order:3; width:100%; flex:none; margin:0 calc(-1 * clamp(16px,4vw,32px)); padding:0 clamp(16px,4vw,32px); }
  .search input{ width:96px; }
}

@media (prefers-reduced-motion:reduce){
  *{ animation:none !important; transition:none !important; }
  .lead:hover .lead-media img{ transform:none; }
}

/* ==========================================================================
   Today bar + section heading
   ========================================================================== */
.today{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  font-size:12px; color:var(--faint); letter-spacing:.02em;
  padding-bottom:clamp(16px,2.4vw,24px);
}
.today .day{ color:var(--muted); }
.today .where::before{ content:'·'; margin-right:10px; color:var(--line-2); }
.today .pulse{
  width:7px; height:7px; border-radius:50%; background:var(--sky);
  box-shadow:0 0 0 0 rgba(43,169,224,.55); animation:oc-pulse 2.6s ease-out infinite;
}
@keyframes oc-pulse{
  0%{ box-shadow:0 0 0 0 rgba(43,169,224,.5); }
  70%{ box-shadow:0 0 0 9px rgba(43,169,224,0); }
  100%{ box-shadow:0 0 0 0 rgba(43,169,224,0); }
}

.section-head{
  display:flex; align-items:center; gap:16px;
  margin:clamp(34px,5vw,52px) 0 0;
  font-size:10.5px; font-weight:600; letter-spacing:.2em; text-transform:uppercase;
  color:var(--faint);
}
.section-head::after{ content:''; flex:1; height:1px; background:var(--line-2); }
.section-head + .grid{ margin-top:clamp(16px,2.4vw,22px); }

/* ==========================================================================
   Related — give it a rule so the width change reads as intentional
   ========================================================================== */
.related{ border-top:1px solid var(--line-2); padding-top:clamp(26px,4vw,38px); }
.related h2{ letter-spacing:-.01em; }

/* ==========================================================================
   Footer marsh band
   ========================================================================== */
.site-foot{ position:relative; }
.site-foot::before{
  content:''; position:absolute; inset:auto 0 0; height:230px;
  background:url('/brand/marsh.svg') no-repeat center bottom / 100% auto;
  opacity:.22; pointer-events:none;
  -webkit-mask-image:linear-gradient(to top,#000 35%,transparent);
  mask-image:linear-gradient(to top,#000 35%,transparent);
}
.foot-inner, .foot-legal{ position:relative; }

/* ==========================================================================
   Phones — the grid becomes a scannable list after the first two cards
   ========================================================================== */
@media (max-width:560px){
  .grid{ gap:14px; }
  .grid .card:nth-child(n+3) > a{ display:grid; grid-template-columns:104px 1fr; align-items:stretch; }
  .grid .card:nth-child(n+3) .card-media{ aspect-ratio:1; height:100%; }
  .grid .card:nth-child(n+3) .card-body{ padding:12px 14px; }
  .grid .card:nth-child(n+3) .card-body h2{ font-size:.94rem; margin:8px 0 0; }
  .grid .card:nth-child(n+3) .card-body .en,
  .grid .card:nth-child(n+3) .card-body .src{ display:none; }
  .lead-body h1{ font-size:1.42rem; }
  .alert-strip a{ flex-direction:column; align-items:flex-start; gap:6px; }
  .today .where{ display:none; }
}

/* ==========================================================================
   No-photo state

   Many briefs arrive without card art (the source posted text only, or the
   render service was skipped). Rather than leave a flat rectangle, give the
   card a coloured edge in its own kind, and give a lead with no media some
   depth of its own.
   ========================================================================== */
.card:not(:has(.card-media))::before{
  content:''; display:block; height:3px;
  background:linear-gradient(90deg, var(--sky-soft), rgba(110,198,245,0) 72%);
}
.card.kind-alert:not(:has(.card-media))::before{
  background:linear-gradient(90deg, var(--red), rgba(229,84,75,0) 72%);
}
.card.kind-breaking:not(:has(.card-media))::before{
  background:linear-gradient(90deg, var(--amber), rgba(240,168,60,0) 72%);
}
.card:not(:has(.card-media)) .card-body{ padding-top:18px; }
.card:not(:has(.card-media)) .card-body h2{ font-size:1.06rem; }

.lead:not(:has(.lead-media)){
  background:
    radial-gradient(120% 150% at 88% 8%, rgba(43,169,224,.17), transparent 58%),
    var(--navy);
}
.lead:not(:has(.lead-media)) .lead-body{ padding-block:clamp(30px,4.4vw,52px); }
.lead:not(:has(.lead-media)) .lead-link{ grid-template-columns:1fr; }
.lead:not(:has(.lead-media)) .lead-body h1{ max-width:22ch; }

.brief:not(:has(.brief-media)) .brief-head{
  padding-bottom:clamp(18px,2.6vw,26px);
  border-bottom:1px solid var(--line-2);
}
