/* SJAF CMS — Frontend styles
   Aesthetic: warm ivory background with deep-forest brand and terracotta accents.
   Distinctive: asymmetric layout, editorial serif headings, oversized numerals,
   soft grain overlay, generous spacing. WCAG AA verified color pairs. */

:root {
  --bg: #f6f1e7;                 /* ivory */
  --surface: #fffaf0;
  --ink: #1c2a24;                /* deep forest ink */
  --ink-soft: #3a4a44;
  --brand: #14472e;              /* deep forest */
  --brand-2: #1e6b45;
  --accent: #c9502a;             /* terracotta */
  --accent-soft: #f0d3c1;
  --border: #d9d0bd;
  --focus: #ffcc33;
  --danger: #a3241a;
  --danger-bg: #f7dcd7;
  --success: #14612c;
  --success-bg: #d6ecd8;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(28, 42, 36, 0.08);
  --font-serif: "Fraunces", "Bricolage Grotesque", "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:  "Manrope", "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  /* Only applied if user overrides via .theme-dark; default is light-ivory */
}

/* Grain (very subtle) */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(28,42,36,0.05) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: .35;
}

* { box-sizing: border-box; }
html, body { 
  max-width: 100%; 
  overflow-x: hidden; 
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere; /* Stronger than break-word to strictly contain long unbroken strings */
  word-wrap: break-word;
  word-break: break-word;
}

/* Enforce max-width bounds to stop horizontal scrolling */
.container { 
  max-width: 1180px; 
  margin: 0 auto; 
  padding: 0 24px; 
  position: relative; 
  z-index: 1; 
  width: 100%; 
  box-sizing: border-box; 
}

/* Accessibility helpers */
.sr-only {
  position:absolute!important; width:1px!important; height:1px!important;
  padding:0!important; margin:-1px!important; overflow:hidden!important;
  clip:rect(0 0 0 0)!important; white-space:nowrap!important; border:0!important;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--brand);
  color: #fff; padding: 10px 16px; z-index: 100; text-decoration: none;
  border-bottom-right-radius: 8px;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--brand); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; word-wrap: break-word; }
h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); margin: 0 0 .35em; }
h2 { font-size: clamp(1.4rem, 2vw, 1.8rem); margin: 1.4em 0 .4em; }
h3 { font-size: 1.25rem; margin: 1.2em 0 .3em; }
p, li { font-size: 1.03rem; }
a { color: var(--brand-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
hr { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(150%) blur(10px);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0; }
.brand { font-family: var(--font-serif); font-weight: 700; color: var(--brand); text-decoration: none; font-size: 1.3rem; letter-spacing: -0.01em; }
.primary-nav { display: flex; align-items: center; gap: 22px; }
.primary-nav ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 6px; flex-wrap: wrap; }
.primary-nav a { display: inline-block; padding: 8px 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; }
.primary-nav a:hover { background: var(--accent-soft); color: var(--brand); }
.site-search { display: flex; gap: 6px; }
.site-search input { padding: 9px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); min-width: 180px; }
.site-search button { padding: 9px 16px; background: var(--brand); color: #fff; border: 0; border-radius: 999px; cursor: pointer; font-weight: 600; }
.site-search button:hover { background: var(--accent); }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--border);
    background: var(--surface); border-radius: 12px; cursor: pointer;
    z-index: 50; /* Ensure toggle is above the overlay */
  }
  .nav-toggle .bars { display: block; width: 20px; height: 2px; background: var(--ink); position: relative; transition: background 0.2s ease; }
  .nav-toggle .bars::before, .nav-toggle .bars::after {
    content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--ink); transition: transform 0.3s ease, top 0.3s ease;
  }
  .nav-toggle .bars::before { top: -6px; } .nav-toggle .bars::after { top: 6px; }
  
  /* Hamburger to X Animation */
  .nav-toggle[aria-expanded="true"] .bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .bars::before { transform: rotate(45deg); top: 0; }
  .nav-toggle[aria-expanded="true"] .bars::after { transform: rotate(-45deg); top: 0; }

  /* Blurred Full-Screen Overlay Menu */
  .primary-nav { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    width: 100%; 
    height: calc(100vh - 80px); /* Adjust height to prevent scrolling past screen */
    /* CRITICAL FIX: Lowered opacity to 0.65 to make blur highly visible in Light Mode */
    background: rgba(246, 241, 231, 0.65); 
    backdrop-filter: blur(16px); 
    -webkit-backdrop-filter: blur(16px);
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; /* Changed to flex-start for left alignment */
    padding: 40px 30px; /* Added side padding for better left-aligned look */
    gap: 20px;
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-10px); 
    transition: all 0.3s ease; 
    overflow-y: auto;
    border-top: 1px solid rgba(0,0,0,0.05); /* Softer border */
  }
  html.theme-dark .primary-nav {
    background: rgba(18, 30, 25, 0.75); /* Dark mode semi-transparent */
    border-top: 1px solid rgba(255,255,255,0.05);
  }
  .primary-nav.is-open { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
  }
  /* CRITICAL FIX: Left Align Menu Items with professional spacing */
  .primary-nav ul { flex-direction: column; align-items: flex-start; width: 100%; gap: 8px; }
  .primary-nav a { font-size: 1.3rem; padding: 12px 0; width: 100%; text-align: left; font-weight: 600; border-bottom: 1px solid rgba(0,0,0,0.05); transition: all 0.2s ease; }
  html.theme-dark .primary-nav a { border-bottom: 1px solid rgba(255,255,255,0.05); }
  .primary-nav a:hover { background: transparent; color: var(--accent); padding-left: 10px; } /* Smooth slide effect on hover/tap */
  .header-row { flex-wrap: wrap; }
  
  /* Left align the search bar inside mobile menu */
  .site-search { width: 100%; max-width: 100%; flex-direction: row; margin-top: 20px; }
  .site-search input { width: 100%; text-align: left; padding: 14px; border-radius: 8px 0 0 8px; border-right: none; }
  .site-search button { width: auto; padding: 14px 24px; border-radius: 0 8px 8px 0; }
}

/* Main */
.site-main { padding: 40px 0 80px; }
.container.grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 56px; }
@media (max-width: 900px) { .container.grid { grid-template-columns: 1fr; gap: 32px; } }

/* Hero */
.hero {
  background:
    linear-gradient(135deg, rgba(20,71,46,0.9) 0%, rgba(20,71,46,0.65) 55%, rgba(201,80,42,0.55) 100%),
    linear-gradient(180deg, #14472e, #0f3521);
  color: #fdf3e2;
  padding: 96px 0 88px;
  position: relative; overflow: hidden;
}
.hero .container { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: end; }
.hero-eyebrow { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.18em; font-size: .82rem; opacity: .85; }
.hero h1 { color: #fdf3e2; margin: 12px 0 10px; }
.hero p.lead { font-size: 1.15rem; max-width: 55ch; opacity: .95; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hero-stats .stat { border-left: 2px solid rgba(253,243,226,.35); padding-left: 14px; }
.hero-stats .stat .num { font-family: var(--font-serif); font-size: 2.4rem; line-height: 1; color: #fdf3e2; display: block; }
.hero-stats .stat .lbl { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; opacity: .85; margin-top: 6px; display: block; }
@media (max-width: 800px) { .hero .container { grid-template-columns: 1fr; } .hero { padding: 64px 0 56px; } }

/* Section title */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 3rem 0 1.2rem; gap: 20px; }
.section-title h2 { margin: 0; }
.section-title .link { font-weight: 600; font-family: var(--font-sans); font-size: .95rem; }

/* Cards */
.post-card {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(28,42,36,0.10); }
.post-card .thumb { aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--accent-soft); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card h3 { margin: 4px 0; }
.post-card .meta { color: var(--ink-soft); font-size: .9rem; }
.post-card a.title-link { color: var(--brand); text-decoration: none; }
.post-card a.title-link:hover { color: var(--accent); text-decoration: underline; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }

/* Article & Responsive Padding Fix */
.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; }
@media (max-width: 600px) { 
  .article { padding: 24px 16px; } 
}
.article header .meta { color: var(--ink-soft); font-size: .95rem; margin-bottom: 14px; }
.article .featured { margin: 12px 0 24px; border-radius: 10px; overflow: hidden; }
.article .featured img { width: 100%; height: auto; display: block; }
.article .content > p:first-of-type::first-letter { font-family: var(--font-serif); font-size: 3.4rem; float: left; line-height: 1; padding: 4px 10px 0 0; color: var(--brand); }
.article .content img { max-width: 100%; height: auto; border-radius: 8px; }
.article .content blockquote { border-left: 4px solid var(--accent); padding: .5rem 1rem; color: var(--ink-soft); font-style: italic; }

/* Sidebar */
.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.sidebar-card h3 { margin-top: 0; }
.sidebar-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sidebar-card ul a { color: var(--ink); text-decoration: none; }
.sidebar-card ul a:hover { color: var(--accent); text-decoration: underline; }

/* Nav (prev/next) */
.postnav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.postnav a { display: block; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.postnav .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.postnav .title { display: block; font-weight: 600; color: var(--brand); margin-top: 4px; }
.postnav .next { text-align: right; }
@media (max-width: 600px) { .postnav { grid-template-columns: 1fr; } .postnav .next { text-align: left; } }

/* Comments */
.comments { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
.comment { padding: 16px 0; border-bottom: 1px dashed var(--border); }
.comment .who { font-weight: 600; color: var(--brand); }
.comment-form { display: grid; gap: 12px; max-width: 620px; }
.comment-form label { font-weight: 600; }
.comment-form input, .comment-form textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; width: 100%;
}
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .hp { position: absolute; left: -9999px; }
.comment-form button { justify-self: start; padding: 12px 22px; background: var(--brand); color: #fff; border: 0; border-radius: 999px; font-weight: 600; cursor: pointer; }
.comment-form button:hover { background: var(--accent); }
.comment-form [aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .9rem; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 12px; margin: 16px 0; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #a9d5b0; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #e6b6b0; }

/* Pagination */
.pagination { display: flex; gap: 6px; margin: 28px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); text-decoration: none; color: var(--ink);
  background: var(--surface);
}
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination a:hover { background: var(--accent-soft); }

/* Footer */
.site-footer { background: #0f3521; color: #d9d0bd; padding: 28px 0; margin-top: 40px; }
.site-footer a { color: #fdf3e2; }

/* Utility */
.tag { display: inline-block; background: var(--accent-soft); color: var(--brand); padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.btn { display: inline-block; padding: 10px 18px; background: var(--brand); color: #fff; text-decoration: none; border-radius: 999px; font-weight: 600; border: 0; cursor: pointer; }
.btn:hover { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.inline { display: inline-block; }

/* Modal Overlay (Guest Login Prompt) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(28,42,36,0.7);
  backdrop-filter: blur(4px); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay[aria-hidden="false"] { opacity: 1; visibility: visible; }
.modal-content {
  background: var(--surface); padding: 40px; border-radius: var(--radius);
  max-width: 480px; width: 90%; position: relative; box-shadow: 0 24px 50px rgba(0,0,0,0.3);
  transform: translateY(20px); transition: transform 0.3s ease; border: 1px solid var(--border);
}
.modal-overlay[aria-hidden="false"] .modal-content { transform: translateY(0); }
.modal-close {
  position: absolute; top: 16px; right: 20px; background: transparent; border: none;
  font-size: 2.2rem; cursor: pointer; color: var(--ink-soft); line-height: 1; padding: 0;
}
.modal-close:hover { color: var(--danger); }

/* Back To Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(201, 80, 42, 0.4);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}
.back-to-top:hover {
  background: var(--brand);
  transform: translateY(-4px);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
}

/* --- Phase 6: Print & PDF Offline Reading Styles --- */
@media print {
  body { background: #fff !important; color: #000 !important; }
  
  /* Hide UI elements that shouldn't be in the PDF */
  .site-header, .site-footer, .postnav, aside, #comments, 
  .audio-player-wrapper, .guest-prompt-btn, .save-post-btn, 
  .back-to-top, .section-title, #recent-blogs { 
      display: none !important; 
  }
  
  /* Make the article take full width */
  .container.grid { display: block !important; }
  .article { border: none !important; padding: 0 !important; box-shadow: none !important; }
  a { text-decoration: none !important; color: #000 !important; }
}

/* --- Phase 2: Accessibility Theme Overrides --- */
html.theme-dark body {
  --bg: #0e1a15;
  --surface: #121e19;
  --ink: #e9efe9;
  --ink-soft: #a9b8b1;
  --brand: #22a06b;
  --brand-2: #1c8f5c;
  --accent: #ffb84d;
  --accent-soft: #3a3126;
  --border: #2c3e37;
}
html.font-large body {
  font-size: 20px;
}
html.contrast-high body {
  --ink: #000;
  --ink-soft: #000;
  --bg: #fff;
  --surface: #fff;
  --border: #000;
  --brand: #000;
  --brand-2: #000;
  --accent: #000;
}
html.theme-dark.contrast-high body {
  --ink: #fff;
  --ink-soft: #fff;
  --bg: #000;
  --surface: #000;
  --border: #fff;
  --brand: #fff;
  --brand-2: #fff;
  --accent: #fff;
  --accent-soft: #222;
}

/* --- Phase 3: Notification Panel --- */
.notif-item { display: block; padding: 12px 0; border-bottom: 1px dashed var(--border); position: relative; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); border-radius: 8px; padding-left: 8px; padding-right: 8px; margin-left: -8px; margin-right: -8px; }
.notif-msg { color: var(--ink); font-size: 0.95rem; display: block; margin-right: 28px; line-height: 1.4; transition: color 0.2s ease; }
.notif-item:hover .notif-msg { color: var(--brand); }
.notif-time { color: var(--ink-soft); font-size: 0.75rem; display: block; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.notif-del { position: absolute; right: 0; top: 12px; background: transparent; border: none; color: var(--danger); cursor: pointer; opacity: 0.4; padding: 4px; font-size: 1.2rem; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.notif-del:hover { opacity: 1; background: var(--danger-bg); transform: scale(1.1); }

.dashboard-tablist {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  gap: 12px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 30px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.dashboard-tablist::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}
.dashboard-tab {
  background: none;
  border: none;
  padding: 12px 8px;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  outline-offset: 4px;
}
.dashboard-tab::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  border-radius: 3px 3px 0 0;
  transition: background-color 0.2s;
}
.dashboard-tab:hover {
  color: var(--brand);
}
.dashboard-tab[aria-selected="true"] {
  color: var(--brand);
  font-weight: 700;
}
.dashboard-tab[aria-selected="true"]::after {
  background: var(--brand);
}
.tab-panel {
  animation: fadeInTab 0.4s ease;
}
.tab-panel[hidden] {
  display: none !important;
}
@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Audio & Podcast Player Global Styles --- */
.pod-player {
  background: var(--player-bg, var(--brand));
  color: var(--player-color, #fff);
  border: var(--player-border, 1px solid transparent);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  text-align: center;
  transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
}
html.theme-dark .pod-player {
  --player-bg: var(--surface);
  --player-color: var(--ink);
  --player-border: 1px solid var(--border);
}

.pod-controls { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 24px); margin: 20px 0; flex-wrap: nowrap; width: 100%; overflow: hidden; }
.pod-btn { background: transparent; border: none; color: var(--player-color, #fff); font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s, color 0.2s; padding: 5px; flex-shrink: 0; }
.pod-btn:hover { transform: scale(1.1); color: var(--accent); }

.pod-btn-main { 
  background: var(--player-color, #fff); color: var(--player-bg, var(--brand)); 
  border-radius: 999px; font-size: 1.1rem; border: none; display: flex; align-items: center; justify-content: center; 
  cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 15px rgba(0,0,0,0.1); font-weight: bold; flex-shrink: 0; white-space: nowrap;
}
.pod-btn-main.circle { width: 64px; height: 64px; font-size: 1.8rem; }
html.theme-dark .pod-btn-main { background: var(--brand); color: #fff; }
html.theme-dark .pod-btn-main:hover { background: var(--accent) !important; color: #fff !important; }
.pod-btn-main:hover { background: var(--accent); color: #fff; transform: scale(1.05); }

.pod-btn-ghost { background: transparent; color: var(--player-color, #fff); border: 1px solid var(--player-color, #fff); padding: 6px 14px; font-size: 0.85rem; border-radius: 999px; cursor: pointer; transition: all 0.2s ease; flex-shrink: 0; white-space: nowrap; }
.pod-btn-ghost:hover { background: var(--player-color, #fff); color: var(--player-bg, var(--brand)); }
html.theme-dark .pod-btn-ghost { color: var(--ink); border-color: var(--border); }
html.theme-dark .pod-btn-ghost:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.pod-time { font-family: monospace; font-size: 1.1rem; opacity: 0.9; }
.pod-now-playing-title { font-size: 1.2rem; font-weight: bold; margin-bottom: 10px; min-height: 28px; line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; }
#radio-player-meta { color: var(--player-color, #fdf3e2); opacity: 0.8; }

/* Dynamic JS animation transition for CORS-safe visualizer */
.audio-waves { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 35px; margin: 15px 0; opacity: 0; transition: opacity 0.3s ease; }
.audio-waves.playing { opacity: 1; }
.wave { width: 5px; background: var(--player-color, #fff); border-radius: 3px; height: 5px; transition: height 0.15s ease; }
html.theme-dark .wave { background: var(--accent); }

/* Podcast / Radio Lists & Cards */
.pod-filters { 
    display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 30px; 
    padding: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; 
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; 
}
.pod-filters::-webkit-scrollbar { display: none; }
@media (max-width: 600px) { .pod-filters { justify-content: flex-start; } }

.pod-filters select { padding: 8px 15px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--ink); font-weight: bold; cursor: pointer; }
.pod-card { display: flex; gap: 15px; padding: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 15px; align-items: center; transition: box-shadow 0.2s; }
.pod-card:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.pod-thumb { width: 70px; height: 70px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.pod-info { flex-grow: 1; min-width: 0; }
.pod-title { margin: 0 0 5px 0; font-size: 1.1rem; color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-meta { font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-actions { display: flex; gap: 10px; flex-shrink: 0; }

@media (max-width: 600px) {
    .pod-card { flex-direction: column; text-align: center; }
    .pod-actions { justify-content: center; width: 100%; }
    .pod-title, .pod-meta { white-space: normal; }
}
