/*
Theme Name: Anguo FM
Theme URI: https://anguofm.co.ke
Author: Anguo FM
Author URI: https://anguofm.co.ke
Description: A custom WordPress theme for Anguo FM, the Taita-language community radio station broadcasting on 90.9 FM (Taita Taveta) and 102.3 FM (Mombasa). Features a persistent, collapsible live-stream player that keeps playing as visitors browse the site.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: anguo-fm
Tags: one-column, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =====================================================
   Design tokens
   ===================================================== */
:root{
  --cream:#FDFBEC;
  --sand:#F2ECD2;
  --sand-line:#E6DEBB;
  --ink:#211F14;
  --ink-soft:#5B5A46;
  --green:#00A654;
  --green-deep:#00612F;
  --green-tint:#DFF3E6;
  --red:#EE1B24;
  --red-deep:#A9121A;
  --olive:#8E9A3B;
  --olive-deep:#535A16;
  --surface:#FFFFFF;
  --shadow: 0 18px 40px -18px rgba(33,31,20,0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --focus: 3px solid #145C34;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --cream:#181A11;
    --sand:#20230F;
    --sand-line:#33341C;
    --ink:#F4F1E1;
    --ink-soft:#B9B79E;
    --green:#2ECC7A;
    --green-deep:#8BE8B3;
    --green-tint:#1B3626;
    --red:#FF5B57;
    --red-deep:#FF8A87;
    --olive:#C7D26B;
    --olive-deep:#E4EDA4;
    --surface:#22240F;
    --shadow: 0 18px 44px -16px rgba(0,0,0,0.65);
  }
}
:root[data-theme="dark"]{
  --cream:#181A11; --sand:#20230F; --sand-line:#33341C; --ink:#F4F1E1; --ink-soft:#B9B79E;
  --green:#2ECC7A; --green-deep:#8BE8B3; --green-tint:#1B3626; --red:#FF5B57; --red-deep:#FF8A87;
  --olive:#C7D26B; --olive-deep:#E4EDA4; --surface:#22240F; --shadow: 0 18px 44px -16px rgba(0,0,0,0.65);
}

/* =====================================================
   Base
   ===================================================== */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--cream);
  color:var(--ink);
  font-family:"Work Sans", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing:antialiased;
  line-height:1.5;
}
h1,h2,h3,h4{
  font-family:"Baloo 2", ui-rounded, system-ui, sans-serif;
  margin:0; text-wrap:balance; color:var(--ink);
}
p{ margin:0; }
a{ color:inherit; text-decoration:none; }
img{ display:block; max-width:100%; height:auto; }
button{ font-family:inherit; }
::selection{ background:var(--green); color:#fff; }
:focus-visible{ outline:var(--focus); outline-offset:2px; }
.screen-reader-text{ position:absolute; width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0); }
.skip-link{
  position:absolute; left:-9999px; top:0; background:var(--ink); color:var(--cream);
  padding:12px 18px; z-index:200; border-radius:0 0 10px 0;
}
.skip-link:focus{ left:0; }

.mono{ font-family:"Space Mono", ui-monospace, monospace; }
.eyebrow{
  font-family:"Space Mono", ui-monospace, monospace; text-transform:uppercase;
  letter-spacing:0.14em; font-size:12.5px; font-weight:700; color:var(--green-deep);
}
.wrap{ max-width:1180px; margin:0 auto; padding:0 28px; }
@media (max-width:640px){ .wrap{ padding:0 20px; } }

/* =====================================================
   Header
   ===================================================== */
header.site{
  position:sticky; top:0; z-index:40;
  background:color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--sand-line);
}
.header-row{ display:flex; align-items:center; justify-content:space-between; height:78px; }
.logo{ display:flex; align-items:center; }
.logo img{ display:block; height:56px; width:auto; border-radius:10px; }
nav.main{ display:flex; align-items:center; gap:6px; }
nav.main ul{ display:flex; align-items:center; gap:6px; list-style:none; margin:0; padding:0; }
nav.main a{
  display:inline-block; font-size:15px; font-weight:600; color:var(--ink-soft);
  padding:10px 14px; border-radius:999px; transition:.15s;
}
nav.main a:hover{ color:var(--ink); background:var(--sand); }
nav.main li.current-menu-item > a,
nav.main a[aria-current="page"]{ color:var(--surface); background:var(--green); }
.freq-badge{
  display:flex; align-items:center; gap:8px; font-family:"Space Mono", monospace;
  font-size:12.5px; font-weight:700; color:var(--ink-soft); border:1px solid var(--sand-line);
  border-radius:999px; padding:7px 12px; white-space:nowrap;
}
.freq-badge b{ color:var(--green-deep); font-size:13px; }
.header-actions{ display:flex; align-items:center; gap:14px; }
.burger{ display:none; background:none; border:0; cursor:pointer; padding:8px; flex-direction:column; gap:4px; }
.burger span{ width:22px; height:2.5px; background:var(--ink); border-radius:2px; }
@media (max-width:920px){
  nav.main{ display:none; }
  .freq-badge{ display:none; }
  .burger{ display:flex; }
}
.mobile-nav{ display:none; flex-direction:column; gap:4px; padding:10px 20px 18px; border-bottom:1px solid var(--sand-line); background:var(--cream); }
.mobile-nav.open{ display:flex; }
.mobile-nav ul{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; }
.mobile-nav a{ display:block; font-size:16px; font-weight:600; color:var(--ink); padding:10px 6px; border-radius:10px; }
.mobile-nav li.current-menu-item > a{ color:var(--green-deep); }

/* =====================================================
   Hero
   ===================================================== */
.hero{ position:relative; overflow:hidden; background:var(--cream); }
.hero-grid{ display:grid; grid-template-columns:1.05fr 0.95fr; align-items:center; gap:40px; padding:64px 0 0; }
@media (max-width:900px){ .hero-grid{ grid-template-columns:1fr; padding-top:40px; } }
.hero h1{ font-size:clamp(40px, 5.6vw, 68px); line-height:0.98; font-weight:800; letter-spacing:-0.01em; }
.hero h1 .accent{ color:var(--green); }
.hero-tagline{ font-family:"Baloo 2", sans-serif; font-weight:700; color:var(--red); font-size:20px; margin-top:14px; transform:rotate(-1.5deg); display:inline-block; }
.hero-sub{ margin-top:18px; max-width:46ch; color:var(--ink-soft); font-size:17px; }
.hero-ctas{ display:flex; gap:14px; margin-top:30px; flex-wrap:wrap; }
.btn{ display:inline-flex; align-items:center; gap:10px; font-weight:700; font-size:15px; border-radius:999px; cursor:pointer; border:2px solid transparent; padding:14px 24px; transition:.15s; }
.btn-primary{ background:var(--green); color:#fff; }
.btn-primary:hover{ background:var(--green-deep); }
.btn-ghost{ background:transparent; border-color:var(--ink); color:var(--ink); }
.btn-ghost:hover{ background:var(--ink); color:var(--cream); }
.btn svg{ width:16px; height:16px; }
.freq-pills{ display:flex; gap:10px; margin-top:28px; flex-wrap:wrap; }
.freq-pill{ background:var(--surface); border:1px solid var(--sand-line); border-radius:16px; padding:10px 16px; box-shadow:var(--shadow); }
.freq-pill .num{ font-family:"Space Mono", monospace; font-weight:700; font-size:19px; color:var(--green-deep); }
.freq-pill .loc{ font-size:11.5px; color:var(--ink-soft); }
.hero-art{ position:relative; }
.hero-art img{ width:100%; border-radius:24px; }
.hero-art figcaption{ font-family:"Space Mono", monospace; font-size:11px; color:var(--ink-soft); margin-top:8px; text-align:right; }

/* =====================================================
   On-air strip
   ===================================================== */
.onair{ background:var(--ink); color:var(--cream); border-radius:var(--radius-lg); display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 28px; margin:56px 0; flex-wrap:wrap; }
.onair-left{ display:flex; align-items:center; gap:16px; }
.live-dot{ width:10px; height:10px; border-radius:50%; background:var(--red); box-shadow:0 0 0 0 rgba(238,27,36,.7); animation:pulse 1.8s infinite; flex:none; }
@keyframes pulse{ 0%{ box-shadow:0 0 0 0 rgba(238,27,36,.55);} 70%{ box-shadow:0 0 0 10px rgba(238,27,36,0);} 100%{ box-shadow:0 0 0 0 rgba(238,27,36,0);} }
.onair .label{ font-family:"Space Mono",monospace; font-size:11.5px; letter-spacing:.12em; color:#C9C6AE; text-transform:uppercase; }
.onair .show{ font-family:"Baloo 2",sans-serif; font-size:20px; font-weight:700; }
.onair .host{ font-size:13.5px; color:#C9C6AE; }
.onair-play{ display:flex; align-items:center; gap:10px; background:var(--green); color:#fff; border:0; border-radius:999px; padding:11px 20px; font-weight:700; cursor:pointer; flex:none; }
.onair-play:hover{ background:var(--green-deep); }

/* =====================================================
   Section shell
   ===================================================== */
section{ padding:64px 0; }
.section-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:36px; flex-wrap:wrap; }
.section-head h2{ font-size:clamp(28px,3.6vw,40px); margin-top:6px; }
.section-head .link{ font-weight:700; font-size:14px; color:var(--green-deep); background:none; border:0; cursor:pointer; display:flex; align-items:center; gap:6px; }
.bg-sand{ background:var(--sand); }
.page-title{ font-size:clamp(32px,4.4vw,48px); margin-top:8px; }
.page-lede{ margin-top:14px; max-width:60ch; color:var(--ink-soft); font-size:17px; }

/* =====================================================
   Schedule
   ===================================================== */
.day-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:28px; }
.day-tabs button{ background:var(--surface); border:1px solid var(--sand-line); color:var(--ink-soft); font-weight:700; font-size:13.5px; padding:9px 16px; border-radius:999px; cursor:pointer; }
.day-tabs button[aria-selected="true"]{ background:var(--green); border-color:var(--green); color:#fff; }
.schedule-panel{ display:none; }
.schedule-panel.is-active{ display:grid; }
.show-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
@media (max-width:900px){ .show-grid{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:640px){ .show-grid{ grid-template-columns:1fr;} }
.show-card{ background:var(--surface); border-radius:var(--radius-md); padding:22px; box-shadow:var(--shadow); display:flex; flex-direction:column; gap:10px; border:1px solid var(--sand-line); }
.show-card .time{ font-family:"Space Mono",monospace; font-weight:700; color:var(--green-deep); font-size:13.5px; }
.show-card h3{ font-size:20px; }
.show-card .host{ font-size:13.5px; color:var(--red); font-weight:600; }
.show-card p{ font-size:14px; color:var(--ink-soft); }
.show-card .tags{ display:flex; gap:6px; flex-wrap:wrap; margin-top:auto; padding-top:6px; }
.tag{ font-size:11px; font-weight:700; letter-spacing:.02em; background:var(--green-tint); color:var(--green-deep); padding:4px 9px; border-radius:999px; }

/* =====================================================
   Presenters
   ===================================================== */
.presenter-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
@media (max-width:900px){ .presenter-grid{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:520px){ .presenter-grid{ grid-template-columns:1fr;} }
.presenter-card{ text-align:left; }
.avatar{ width:100%; aspect-ratio:1; border-radius:50%; display:flex; align-items:center; justify-content:center; font-family:"Baloo 2",sans-serif; font-weight:800; font-size:34px; color:#fff; margin-bottom:14px; box-shadow:var(--shadow); overflow:hidden; }
.avatar img{ width:100%; height:100%; object-fit:cover; }
.presenter-card h3{ font-size:18px; }
.presenter-card .role{ font-size:13px; color:var(--red); font-weight:700; margin-top:2px; }
.presenter-card .bio{ font-size:13.5px; color:var(--ink-soft); margin-top:8px; }

/* =====================================================
   Stats / value prop
   ===================================================== */
.stats-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
@media (max-width:900px){ .stats-grid{ grid-template-columns:repeat(2,1fr);} }
.stat{ background:var(--surface); border:1px solid var(--sand-line); border-radius:var(--radius-md); padding:24px; }
.stat .n{ font-family:"Space Mono",monospace; font-weight:700; font-size:32px; color:var(--green-deep); font-variant-numeric:tabular-nums; }
.stat .l{ font-size:13px; color:var(--ink-soft); margin-top:4px; }

.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:48px; align-items:center; }
@media (max-width:860px){ .two-col{ grid-template-columns:1fr; } }
.photo-frame{ border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow); }
.photo-frame img{ width:100%; }
.prose h2{ font-size:clamp(26px,3.4vw,36px); }
.prose p{ color:var(--ink-soft); margin-top:14px; font-size:15.5px; }
.prose ul{ margin:16px 0 0; padding:0; list-style:none; display:flex; flex-direction:column; gap:10px; }
.prose ul li{ display:flex; gap:10px; font-size:14.5px; color:var(--ink-soft); }
.prose ul li::before{ content:"\25CF"; color:var(--red); font-size:9px; line-height:2.1; }

/* =====================================================
   Packages
   ===================================================== */
.pkg-grid{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
@media (max-width:760px){ .pkg-grid{ grid-template-columns:1fr; } }
.pkg-card{ background:var(--surface); border-radius:var(--radius-lg); padding:32px; box-shadow:var(--shadow); border:1px solid var(--sand-line); display:flex; flex-direction:column; gap:16px; }
.pkg-card.hi{ background:var(--ink); color:var(--cream); border-color:var(--ink); }
.pkg-card.hi .pkg-item{ color:#E7E4CD; }
.pkg-card .pkg-tag{ align-self:flex-start; background:var(--red); color:#fff; font-size:11.5px; font-weight:700; letter-spacing:.06em; padding:5px 12px; border-radius:999px; }
.pkg-card h3{ font-size:26px; }
.pkg-item{ display:flex; gap:10px; font-size:14.5px; color:var(--ink-soft); align-items:flex-start; }
.pkg-item svg{ width:18px; height:18px; flex:none; margin-top:2px; color:var(--green); }
.pkg-card.hi .pkg-item svg{ color:var(--green); }

/* =====================================================
   Contact
   ===================================================== */
.contact-grid{ display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media (max-width:860px){ .contact-grid{ grid-template-columns:1fr; } }
.contact-card{ background:var(--surface); border:1px solid var(--sand-line); border-radius:var(--radius-md); padding:22px; display:flex; gap:14px; align-items:flex-start; }
.contact-card svg{ width:22px; height:22px; color:var(--green-deep); flex:none; margin-top:2px; }
.contact-card h4{ font-size:15px; }
.contact-card p{ font-size:13.5px; color:var(--ink-soft); margin-top:4px; }
.town-list{ display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.town-list span{ background:var(--sand); border:1px solid var(--sand-line); font-size:12.5px; font-weight:600; padding:6px 12px; border-radius:999px; }

/* =====================================================
   Blog / posts
   ===================================================== */
.post-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
@media (max-width:900px){ .post-grid{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:640px){ .post-grid{ grid-template-columns:1fr;} }
.post-card{ background:var(--surface); border:1px solid var(--sand-line); border-radius:var(--radius-md); overflow:hidden; box-shadow:var(--shadow); display:flex; flex-direction:column; }
.post-card .thumb{ aspect-ratio:16/10; background:var(--sand); overflow:hidden; }
.post-card .thumb img{ width:100%; height:100%; object-fit:cover; }
.post-card .body{ padding:18px 20px 22px; display:flex; flex-direction:column; gap:8px; }
.post-card .date{ font-family:"Space Mono",monospace; font-size:11.5px; color:var(--ink-soft); }
.post-card h3{ font-size:18px; }
.post-card p{ font-size:13.5px; color:var(--ink-soft); }
.single-article{ max-width:74ch; margin:0 auto; }
.single-article .entry-content{ margin-top:24px; font-size:16px; color:var(--ink); }
.single-article .entry-content p{ margin:0 0 18px; }
.single-article .entry-content img{ border-radius:var(--radius-md); margin:18px 0; }
.single-article .entry-meta{ font-family:"Space Mono",monospace; font-size:12px; color:var(--ink-soft); }
.pagination{ display:flex; gap:10px; margin-top:40px; flex-wrap:wrap; }
.pagination a, .pagination span{ border:1px solid var(--sand-line); border-radius:999px; padding:8px 16px; font-size:13.5px; font-weight:600; }
.pagination .current{ background:var(--green); border-color:var(--green); color:#fff; }

.comments-area{ margin-top:56px; }
.comment-list{ list-style:none; margin:0; padding:0; }
.comment-list .comment-body{ background:var(--surface); border:1px solid var(--sand-line); border-radius:var(--radius-md); padding:18px 20px; margin-bottom:16px; }
.comment-form input, .comment-form textarea{
  width:100%; border:1px solid var(--sand-line); border-radius:12px; padding:12px 14px;
  font-family:inherit; font-size:14.5px; background:var(--surface); color:var(--ink);
}
.comment-form label{ font-size:13px; font-weight:600; margin-bottom:6px; display:block; }
.comment-form p{ margin-bottom:16px; }

/* =====================================================
   Footer
   ===================================================== */
footer.site{ background:var(--ink); color:var(--cream); padding:56px 0 28px; margin-top:40px; }
.foot-grid{ display:grid; grid-template-columns:1.3fr 1fr 1fr; gap:40px; }
@media (max-width:760px){ .foot-grid{ grid-template-columns:1fr; gap:28px; } }
.footer-logo-badge{
  display:inline-flex; background:var(--cream); border-radius:16px; padding:10px 14px;
  box-shadow:var(--shadow);
}
.footer-logo-badge img{ display:block; height:64px; width:auto; border-radius:8px; }
footer.site p.tag{ color:#C9C6AE; font-size:14px; margin-top:14px; max-width:32ch; }
footer.site h5{ font-family:"Space Mono",monospace; font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:#9A987F; margin-bottom:14px; }
footer.site ul{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px; }
footer.site ul a{ color:#E7E4CD; font-size:14px; }
footer.site ul a:hover{ color:var(--green); }
.foot-bottom{ border-top:1px solid #3A3823; margin-top:40px; padding-top:20px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; font-size:12.5px; color:#8C8A70; }

/* =====================================================
   Player bar (persistent, collapsible)
   ===================================================== */
.player-space{ height:96px; }
.player{ position:fixed; left:0; right:0; bottom:0; z-index:9999; display:flex; justify-content:center; padding:0 16px 16px; pointer-events:none; }
.player-inner{
  pointer-events:auto; width:100%; max-width:900px; background:var(--ink); color:var(--cream);
  border-radius:22px; box-shadow:0 20px 50px -14px rgba(0,0,0,.55); padding:14px 18px;
  display:flex; align-items:center; gap:16px; transition:max-width .25s ease, padding .25s ease, border-radius .25s ease;
}
.player.collapsed .player-inner{ max-width:230px; border-radius:999px; padding:10px; }
.player.collapsed .p-meta, .player.collapsed .p-scrub, .player.collapsed .p-vol{ display:none; }
.p-play{ flex:none; width:46px; height:46px; border-radius:50%; background:var(--green); border:0; display:flex; align-items:center; justify-content:center; cursor:pointer; color:#fff; }
.p-play:hover{ background:var(--green-deep); }
.p-play svg{ width:18px; height:18px; }
.p-live{ flex:none; display:flex; align-items:center; gap:7px; }
.p-meta{ min-width:0; flex:1; }
.p-meta .show{ font-family:"Baloo 2",sans-serif; font-weight:700; font-size:14.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.p-meta .sub{ font-size:11.5px; color:#B9B79E; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.p-bars{ display:flex; align-items:flex-end; gap:2px; height:20px; }
.p-bars i{ width:3px; background:var(--green); border-radius:2px; display:block; animation:bar 1.1s ease-in-out infinite; }
.p-bars i:nth-child(2){ animation-delay:.15s; }
.p-bars i:nth-child(3){ animation-delay:.3s; }
.p-bars i:nth-child(4){ animation-delay:.45s; }
@keyframes bar{ 0%,100%{ height:5px; } 50%{ height:18px; } }
.player:not(.playing) .p-bars i{ animation-play-state:paused; height:4px; }
.p-vol{ display:flex; align-items:center; gap:8px; flex:none; }
.p-vol input[type=range]{ width:80px; accent-color:var(--green); }
.p-collapse{ flex:none; width:34px; height:34px; border-radius:50%; background:transparent; border:1px solid #4A4830; color:#C9C6AE; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.p-collapse:hover{ border-color:var(--green); color:var(--green); }
.p-collapse svg{ width:14px; height:14px; transition:transform .25s; }
.player.collapsed .p-collapse svg{ transform:rotate(180deg); }
@media (max-width:640px){ .p-vol{ display:none; } .player-inner{ gap:12px; } }

/* =====================================================
   View transition + reduced motion
   ===================================================== */
.view-enter{ animation:fadein .35s ease; }
@keyframes fadein{ from{ opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }
@media (prefers-reduced-motion: reduce){
  .live-dot, .p-bars i, .view-enter, html{ animation:none !important; scroll-behavior:auto !important; }
}
