/*
Theme Name: Narrative
Theme URI: https://metaflow.no
Author: Metaflow
Author URI: https://metaflow.no
Description: A modern, minimalist WordPress theme for podcast interviews and episodes. Features horizontal scrolling carousel, dark/light mode toggle, sticky audio player, video backgrounds, audio player with OGG/MP3 support, and a clean typography-focused design with custom color scheme.
Version: 1.18.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: narrative
Tags: blog, podcast, interviews, two-columns, custom-menu, featured-images, threaded-comments, translation-ready, dark-mode, carousel
*/

/* ==========================================================================
   CSS Custom Properties - Enhanced Fluid System
   ========================================================================== */

:root {
  /* Colors - Dark Mode Default */
  --color-bg: #212a2e;
  --color-text: #fff;
  --color-text-secondary: #999999;
  --color-border: #222;
  --color-accent: #fff;
  
  /* Typography - All 1.3rem */
  --font-size-base: 1.3rem;
  --font-size-small: 1.3rem;
  --font-size-h1: 1.3rem;
  --font-size-h2: 1.3rem;
  --font-size-episode-title: 1.3rem;
  --font-size-episode-meta: 1.3rem;
  
  /* Font Stacks */
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Fluid Spacing */
  --gutter: clamp(16px, 1.736vw, 33px);
  --container-padding: var(--gutter);
  --section-spacing: clamp(40px, 8vw, 154px);
  --card-gap: var(--gutter);
  
  /* Transitions */
  --transition-speed: 0.35s;
  --transition-ease: cubic-bezier(0.39, 0.575, 0.565, 1);
  
  /* Breakpoints (for reference) */
  --breakpoint-mobile: 480px;
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 1024px;
  --breakpoint-desktop-lg: 1440px;
  --breakpoint-desktop-xl: 1920px;
}

[data-colors="light"] {
  --color-bg: #fff;
  --color-text: #212a2e;
  --color-text-secondary: #666666;
  --color-border: #e5e5e5;
  --color-accent: #212a2e;
}

/* ==========================================================================
   Base Styles - Enhanced
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  overflow-x: clip;
  transition: background-color var(--transition-speed) var(--transition-ease),
              color var(--transition-speed) var(--transition-ease);
  min-height: 100vh;
  position: relative;
}

/* Dynamic blurred background when audio is playing */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--dynamic-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(20px);
  opacity: 0;
  transition: opacity 0.8s ease, background-image 0.8s ease;
  z-index: -1;
  pointer-events: none;
}

body.audio-playing::before {
  opacity: 1;
}

/* Grain overlay on blurred background */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.6)),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: -1;
  pointer-events: none;
}

body.audio-playing::after {
  opacity: 1;
}

/* ==========================================================================
   Typography - All 1.3rem
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 400;
  line-height: 1.2;
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
}

p {
  margin: 0 0 1.5em 0;
  line-height: 1.6;
  font-size: 1.3rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition-speed);
  font-size: 1.3rem;
}

strong {
  font-weight: 400;
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
}

a:hover {
  opacity: 0.7;
}

/* ==========================================================================
   Layout - Container System
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1920px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* ==========================================================================
   Header - Enhanced with Fluid Spacing
   ========================================================================== */

header[data-nav] {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--color-bg);
  padding: var(--gutter) var(--container-padding);
  transition: transform var(--transition-speed) var(--transition-ease),
              background-color var(--transition-speed);
}

header[data-nav].hidden {
  transform: translateY(-100%);
}

/* ==========================================================================
   Navigation - Standard WordPress Pattern
   ========================================================================== */

.main-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.main-navigation h1 {
  margin: 0;
}

.main-navigation ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.main-navigation a {
  font-size: 1.3rem;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.main-navigation a:hover {
  opacity: 1;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    order: 2;
  }
  
  .main-navigation h1 {
    order: 1;
  }
  
  .menu-toggle::before {
    content: '+ ';
  }
  
  .menu-toggle.toggled::before {
    content: '− ';
  }
  
  .main-navigation ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    padding: 1rem;
    gap: 1rem;
    order: 3;
    width: 100%;
  }
  
  .main-navigation ul.toggled {
    display: flex;
  }
}

header nav .logo {
  font-size: var(--font-size-h2);
  font-weight: 500;
}

/* Dark/Light Toggle */
.light-dark {
  display: flex;
  gap: clamp(0.5rem, 1vw, 1rem);
  align-items: center;
}

.light-dark button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  opacity: 1;
  transition: opacity var(--transition-speed);
  position: relative;
}

.light-dark button:hover {
  opacity: 0.7;
}

.light-dark button .circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-sizing: border-box;
}

/* Dark mode button - always white with border */
.light-dark button .dark-circle {
  background-color: #fff;
  border: 1.2px solid #fff;
}

/* Light mode button - always light gray with dark border */
.light-dark button .light-circle {
  background-color: #D9D9D9;
  border: 1.2px solid #666;
}

/* ==========================================================================
   Hero Section - Improved
   ========================================================================== */

article[b-tpl="cta banner"] {
  position: relative;
  margin-bottom: var(--section-spacing);
  max-height: 8vh;
}

article[b-tpl="cta banner"] .inner {
  position: relative;
  display: grid;
  min-height: clamp(150px, 15vh, 200px);
  max-height: 15vh;
  border-radius: clamp(30px, 3vw, 60px);
  overflow: hidden;
}

article[b-tpl="cta banner"] .bg {
  grid-area: 1/1;
  position: relative;
}

article[b-tpl="cta banner"] .bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

article[b-tpl="cta banner"] .content {
  grid-area: 1/1;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4rem .9rem .9rem .9rem;
  gap: clamp(1rem, 2vw, 2rem);
}

article[b-tpl="cta banner"] .content .text p {
  font-size: clamp(1.5rem, 2.6vw, 3rem);
  font-weight: 500;
  margin: 0;
}

article[b-tpl="cta banner"] .button a {
  display: inline-block;
  padding: clamp(0.75rem, 1.5vw, 1.25rem) clamp(1.25rem, 2vw, 2rem);
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  border-radius: 30px;
  font-weight: 500;
  transition: backdrop-filter 0.55s;
}

article[b-tpl="cta banner"] .button a:hover {
  backdrop-filter: saturate(1000%) blur(60px);
}

/* ==========================================================================
   Episodes Section - Enhanced Carousel
   ========================================================================== */

article[b-tpl="episodes"] {
  padding-top: var(--section-spacing);
  padding-bottom: var(--section-spacing);
}

article[b-tpl="episodes"] .inner > .actions {
  display: flex;
  gap: var(--gutter);
  align-items: center;
  margin-bottom: clamp(1rem, 2vw, 2rem);
  padding-left: var(--container-padding);
}

article[b-tpl="episodes"] .inner > .actions h2 {
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
  font-weight: 400;
  margin: 0;
}

article[b-tpl="episodes"] .inner > .actions .sort-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.2rem);
  color: var(--color-text);
  opacity: 0.8;
  transition: opacity var(--transition-speed), color var(--transition-speed);
  margin-left: auto;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}

article[b-tpl="episodes"] .inner > .actions .sort-toggle:hover {
  opacity: 1;
}

article[b-tpl="episodes"] .inner > .actions .sort-label {
  font-weight: 400;
}

article[b-tpl="episodes"] .inner > .actions .sort-arrows {
  font-family: monospace;
  font-size: 1.2rem;
}

/* Dark mode */
.dark-mode article[b-tpl="episodes"] .inner > .actions .sort-toggle {
  color: #FFFFFF;
}

/* Light mode */
.light-mode article[b-tpl="episodes"] .inner > .actions .sort-toggle {
  color: #000000;
}

article[b-tpl="episodes"] .inner > .actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: clamp(20px, 2.5vw, 32px);
  height: clamp(20px, 2.5vw, 32px);
  opacity: 0.8;
  transition: opacity var(--transition-speed);
}

article[b-tpl="episodes"] .inner > .actions button.active,
article[b-tpl="episodes"] .inner > .actions button:hover {
  opacity: 1;
}

article[b-tpl="episodes"] .inner > .actions button svg {
  width: 100%;
  height: 100%;
  fill: #fff;
}

article[b-tpl="episodes"] .inner > .actions button svg path {
  fill: #fff;
}

/* Light mode - black icons */
[data-colors="light"] article[b-tpl="episodes"] .inner > .actions button svg,
[data-colors="light"] article[b-tpl="episodes"] .inner > .actions button svg path {
  fill: #212a2e;
}

/* Horizontal Scrolling Carousel - Smart Snap */
.marquee {
  display: flex;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  padding-bottom: 1rem;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
}

.marquee::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.episode {
  scroll-snap-align: center;
  scroll-snap-stop: normal;
}

.marquee.grabbing {
  cursor: grabbing;
}

.marquee-group {
  display: flex;
  gap: var(--card-gap);
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  flex-shrink: 0;
  min-width: 100%;
}

/* ==========================================================================
   Episode Cards - Fluid & Responsive
   ========================================================================== */

/* Episode card pulse animation for shared links */
@keyframes episodePulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(254, 251, 176, 0.7);
  }
  50% {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 0 0 20px rgba(254, 251, 176, 0);
  }
}

.episode.highlight-episode {
  animation: episodePulse 1s ease-out;
}

.episode {
  position: relative;
  flex-shrink: 0;
  width: clamp(280px, 70vw, 450px);
  max-height: 70dvh;
  aspect-ratio: 536 / 782;
  color: #fff;
  scroll-margin-top: 2rem;
  transition: transform var(--transition-speed) var(--transition-ease);
}

.episode:hover {
  transform: translateY(-4px);
}

/* Episode Background - CSS background-image with cover */
.episode .bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 105%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  border-radius: 0;
}

/* Episode Content Overlay */
.episode .content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 105%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.2) 30%,
    rgba(0, 0, 0, 0.3) 60%,
    rgba(0, 0, 0, 0.9) 100%
  );
}

/* Episode Header */
.episode .header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-shrink: 0;
}

.episode .header .title {
  flex: 1;
  text-align: left;
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
  font-weight: 400;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode .header .episode-number {
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  text-align: right;
}

/* Episode Footer - Always Visible */
.episode .footer {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

/* Speaker name - full width */
.episode .footer .speaker-name {
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
  font-weight: 400;
  line-height: 1.2;
  color: white;
  padding-bottom: clamp(0.75rem, 1.5vw, 1rem);
  border-bottom: 1.5px solid rgba(255, 255, 255, 1);
  width: 100%;
}

/* Meta row - duration and location side by side */
.episode .footer .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(0.75rem, 1.5vw, 1rem) 0;
  border-bottom: 1.5px solid rgba(255, 255, 255, 1);
  width: 100%;
}

.episode .footer .meta-row .duration,
.episode .footer .meta-row .location {
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
  font-weight: 400;
  color: white;
}

.episode .footer .meta-row .location {
  text-align: right;
}

.episode .footer .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(0.75rem, 1.5vw, 1rem) 0 0;
  gap: clamp(1rem, 2vw, 2rem);
  width: 100%;
  visibility: visible;
}

.episode .actions button,
.episode .actions .play-episode-btn,
.episode .actions .share-btn,
.episode .actions a {
  background: none;
  border: none;
  color: white;
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
  visibility: visible;
}

/* Share button gets capitalize instead of uppercase */
.episode .actions .share-btn {
  text-transform: capitalize;
}

/* SVG icons in buttons */
.episode .actions button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Theme color for icons */
.dark-mode .episode .actions button svg {
  color: #FFFFFF;
}

.light-mode .episode .actions button svg {
  color: #000000;
}

.episode .actions button:hover,
.episode .actions .share-btn:hover,
.episode .actions a:hover {
  opacity: 0.7;
}
  visibility: visible;
  transition: opacity var(--transition-speed);
}

.episode .actions button:hover,
.episode .actions a:hover {
  opacity: 0.7;
}

/* ==========================================================================
   List View - Enhanced Table Layout
   ========================================================================== */

.episodes-list {
  display: none;
  width: 100%;
  max-width: 1920px;
  margin: clamp(2rem, 4vw, 4rem) auto 0;
  padding: 0 var(--container-padding);
}

.episodes-list.active {
  display: block;
}

.episode-item {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  padding: clamp(1rem, 2vw, 1.5rem) 0;
  border-top: 1px solid var(--color-border);
  transition: opacity var(--transition-speed);
}

.episode-item:last-child {
  border-bottom: 1px solid var(--color-border);
}

.episode-item .title {
  flex: 1;
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
  font-weight: 400;
  line-height: 1.4;
}

.episode-item .actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
  flex-shrink: 0;
}

.episode-item .actions .episode-number {
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
  font-weight: 400;
}

.episode-item .actions a,
.episode-item .actions button {
  background: none;
  border: none;
  color: var(--color-text);
  font-size: clamp(1.25rem, 1.125rem + 0.4vw, 1.5rem);
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: opacity var(--transition-speed);
}

.episode-item .actions a:hover,
.episode-item .actions button:hover {
  opacity: 0.7;
}
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 500;
}

.episode-item .actions {
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  align-items: center;
  flex-shrink: 0;
}

.episode-item .actions a,
.episode-item .actions button {
  font-size: var(--font-size-small);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  
  letter-spacing: 0.05em;
  transition: opacity var(--transition-speed);
}

.episode-item .actions a:hover,
.episode-item .actions button:hover {
  opacity: 0.7;
}

/* Hide/Show Views */
.marquee.hidden {
  display: none;
}

/* ==========================================================================
   Footer - Enhanced
   ========================================================================== */

footer {
  border-top: 1px solid var(--color-border);
  padding: clamp(2rem, 4vw, 4rem) var(--container-padding);
  margin-top: var(--section-spacing);
}

footer .brand {
  margin: 0;
  text-align: center;
  font-weight: 500;
}

footer .spread {
  display: flex;
  gap: clamp(0.5rem, 1vw, 1rem);
  justify-content: center;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 300;
}

/* ==========================================================================
   Audio Player - Sticky Bottom (Enhanced)
   ========================================================================== */

.audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background-color: #000000;
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: clamp(0.75rem, 1.5vw, 1rem) clamp(1rem, 2vw, 2rem);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
  transition: transform var(--transition-speed) var(--transition-ease);
  transform: translateY(100%);
}

.audio-player.active {
  transform: translateY(0);
}

.audio-player .play-pause-btn {
  width: clamp(28px, 3vw, 36px);
  height: clamp(28px, 3vw, 36px);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FFFFFF;
  transition: opacity var(--transition-speed);
}

.audio-player .play-pause-btn:hover {
  opacity: 0.7;
}

.audio-player .play-pause-btn svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.audio-player .controls {
  flex: 1;
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1vw, 1rem);
  min-width: 0;
}

.audio-player .controls__current-time,
.audio-player .controls__total-time {
  font-size: clamp(0.75rem, 1vw, 0.875rem);
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
  min-width: clamp(35px, 4vw, 45px);
  flex-shrink: 0;
}

.audio-player .controls__slider {
  flex: 1;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  position: relative;
  cursor: pointer;
  border-radius: 2px;
  min-width: 0;
  z-index: 1;
}

.audio-player .controls__progress {
  height: 100%;
  background-color: #FFFFFF;
  position: relative;
  border-radius: 2px;
  transition: width 0.1s linear;
  z-index: 2;
}

.audio-player .controls__progress .pin {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-color: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 3;
}

.audio-player .podcast-title {
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  font-weight: 500;
  color: #FFFFFF;
  flex-shrink: 0;
  max-width: 35%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-player .volume {
  position: relative;
  flex-shrink: 0;
}

.audio-player .volume__button {
  background: none;
  border: none;
  cursor: pointer;
  padding: clamp(4px, 0.5vw, 8px);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-speed);
}

.audio-player .volume__button:hover {
  opacity: 0.7;
}

.audio-player .volume__button svg {
  width: clamp(16px, 2vw, 20px);
  height: clamp(16px, 2vw, 20px);
  fill: currentColor;
}

.audio-player .volume__controls {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #000000;
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: clamp(0.5rem, 1vw, 0.75rem);
  margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.audio-player .volume__controls.hidden {
  display: none;
}

.audio-player .volume__slider {
  width: 4px;
  height: clamp(80px, 10vh, 120px);
  background-color: rgba(254, 251, 176, 0.2);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.audio-player .volume__progress {
  position: absolute;
  bottom: 0;
  width: 100%;
  background-color: #FFFFFF;
  border-radius: 2px;
  transition: height 0.1s linear;
}

.audio-player [data-close] {
  background: none;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  padding: clamp(4px, 0.5vw, 8px);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  flex-shrink: 0;
  transition: opacity var(--transition-speed);
}

.audio-player [data-close]:hover {
  opacity: 0.7;
}

/* ==========================================================================
   Responsive Breakpoints - Mobile First
   ========================================================================== */

/* Mobile (0-479px) */
@media (max-width: 479px) {
  :root {
    --font-size-base: 16px;
    --section-spacing: 40px;
  }
  
  header[data-nav] {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  
  header nav {
    flex-direction: column;
    gap: 1rem;
  }
  
  .episode {
    width: clamp(260px, 80vw, 350px);
  }
  
  article[b-tpl="cta banner"] .content {
    flex-direction: column;
    text-align: center;
  }
  
  .audio-player .podcast-title {
    display: none;
  }
}

/* Tablet Portrait (480-767px) */
@media (min-width: 480px) and (max-width: 767px) {
  .episode {
    width: clamp(300px, 70vw, 400px);
  }
  
  article[b-tpl="cta banner"] .content {
    flex-direction: column;
    text-align: center;
  }
}

/* Tablet Landscape (768-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .episode {
    width: clamp(350px, 60vw, 500px);
  }
  
  .episode-item {
    flex-wrap: wrap;
  }
  
  .episode-item .actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .episode {
    width: clamp(380px, 32vw, 550px);
  }
  
  .marquee-group {
    gap: calc(var(--card-gap) * 1.2);
  }
  
  .episode-item > * {
    opacity: 0.7;
  }
  
  .episode-item:hover > * {
    opacity: 1;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  :root {
    --container-padding: clamp(33px, 1.736vw, 40px);
  }
  
  .episode {
    max-width: 600px;
  }
}

/* XL Desktop (1920px+) */
@media (min-width: 1920px) {
  :root {
    --container-padding: 33px;
    --section-spacing: 154px;
  }
  
  .container {
    padding-left: 33px;
    padding-right: 33px;
  }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.hidden {
  display: none !important;
}

/* Loading States */
.loading {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.loading.active {
  display: block;
}

/* Focus States for Accessibility */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Custom Adjustments
   ========================================================================== */

/* Episodes list view adjustments */
.episodes-list .title {
  width: 65%;
}

.episodes-list .actions {
  width: 35%;
  display: grid;
  gap: 30px;
}

/* Dark mode colors */
html[data-colors='dark'] {
  --color-bg: #212a2e;
  --color-text: #fff;
  --color-text-secondary: #333;
  --color-border: #fff;
  --color-accent: #fff;
}

/* Light mode colors */
[data-colors="light"] {
  --color-bg: #fff;
  --color-text: #212a2e;
  --color-text-secondary: #444;
  --color-border: #e5e5e5;
  --color-accent: #212a2e;
}

/* Entry header sizing */
.entry-header h1 {
  font-size: 3rem;
}

/* Episode footer spacing */
.episode .footer dl,
.episode .footer dl.duration,
.episode .footer dl.location {
  padding: 0.4rem 0;
}

/* Light/dark toggle circles */
.light-dark button .dark-circle {
  background-color: #222;
  border: 1.2px solid #fff;
}

.light-dark button .light-circle {
  background-color: #fff;
  border: 1.2px solid #222;
}

/* Page content padding */
.content.page-content {
  padding: 5rem 1.5rem 1.5rem 1.5rem;
}

.content.page-content .inner {
  padding: 1rem;
}

/* Paragraph sizing */
p {
  font-size: clamp(1.125rem, 1.0556rem + 0.2222vw, 1.25rem);
}

/* Episode header proportions */
.episode .header .title {
  flex: 0 0 65%;
}

.episode .header .meta {
  flex: 0 0 30%;
}

/* Main content padding */
#content > .content {
  padding: 1rem 0 1rem 0;
}

/* Header positioning */
header[data-nav] {
  position: relative;
}

/* Print Styles */
@media print {
  header[data-nav],
  footer,
  .audio-player,
  .actions {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .episode {
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   User Custom Adjustments
   ========================================================================== */

/* Hide dark/light mode toggle */
.light-dark {
  display: none !important;
}

/* Episodes list adjustments */
.episodes-list .actions {
  gap: 12px;
  order: 1;
}

.episodes-list .title {
  order: 2;
}

.episodes-list .article-link {
  display: none !important;
}

/* Episode card header */
.episode .header .title {
  flex: 0 0 70%;
}

/* Episode footer spacing */
.episode .footer dl,
.episode .footer dl.duration,
.episode .footer dl.location {
  padding: 0.1rem 0;
}

/* Single episode page */
#content .content.single-episode {
  padding: 1rem !important;
}

/* Episodes action buttons sizing */
article[b-tpl="episodes"] .inner > .actions button {
  width: clamp(20px, 1.5vw, 32px);
  height: clamp(20px, 1.5vw, 32px);
}

/* Remove border from episode actions */
.episode .footer .actions,
.episode .actions {
  border-top: 0;
}

/* Meta row spacing */
.meta-row {
  padding: 0.3rem 0 !important;
}

/* Transparent header */
header[data-nav] {
  background-color: transparent;
}

  border-top-color: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Single Episode Page
   ========================================================================== */

.single-episode .inner {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem) var(--container-padding);
}

.single-episode .featured-image {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.single-episode .featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.single-episode .entry-header {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.single-episode .entry-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

.single-episode .entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 2vw, 1.5rem);
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  opacity: 0.8;
}

.single-episode .entry-meta span {
  display: inline-block;
}

.episode-audio-single {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.play-single-episode {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: 2px solid currentColor;
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.play-single-episode:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.play-single-episode svg {
  width: 18px;
  height: auto;
}

.single-episode .entry-content {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
  margin-bottom: clamp(3rem, 6vw, 4rem);
}

.single-episode .entry-content p {
  margin-bottom: 1.5rem;
}

.single-episode .entry-footer {
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--color-border);
}

/* Hide single episode play button when player is active */
body.audio-playing .play-single-episode {
  display: none;
}

/* ==========================================================================
   Single Episode Page - Desktop 50/50 Split Layout
   ========================================================================== */

@media (min-width: 900px) {
  .single-episode .inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(3rem, 5vw, 6rem);
    align-items: start;
  }
  
  /* Left column wrapper */
  .single-episode .left-column {
    grid-column: 1;
  }
  
  /* Right column wrapper */
  .single-episode .right-column {
    grid-column: 2;
  }
  
  /* Footer spans both columns */
  .single-episode .entry-footer {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Audio Visualizer Animation - Single Page & Homepage Cards
   ========================================================================== */

/* Minimalist audio bars visualizer - white and vertically centered */
.audio-visualizer {
  display: none;
  gap: 6px;
  height: 48px;
  align-items: center;
  margin-top: 1rem;
  justify-content: center;
}

/* Single page visualizer - positioned above title in left column */
.single-episode .left-column .audio-visualizer {
  margin-top: 0;
  margin-bottom: 2rem;
  justify-content: flex-start;
}

/* Show on single page when audio playing */
body.audio-playing .single-episode .audio-visualizer {
  display: flex;
}

/* Show on homepage card when that specific card is playing */
.episode.playing .audio-visualizer {
  display: flex;
}

.audio-bar {
  width: 3px;
  background: #ffffff;
  opacity: 0.7;
  border-radius: 2px;
}

/* Animate bars on single page */
body.audio-playing .single-episode .audio-bar:nth-child(1) { animation: audioBar 0.7s ease-in-out infinite; animation-delay: 0s; }
body.audio-playing .single-episode .audio-bar:nth-child(2) { animation: audioBar 0.9s ease-in-out infinite; animation-delay: 0.1s; }
body.audio-playing .single-episode .audio-bar:nth-child(3) { animation: audioBar 0.6s ease-in-out infinite; animation-delay: 0.2s; }
body.audio-playing .single-episode .audio-bar:nth-child(4) { animation: audioBar 0.8s ease-in-out infinite; animation-delay: 0.15s; }
body.audio-playing .single-episode .audio-bar:nth-child(5) { animation: audioBar 0.7s ease-in-out infinite; animation-delay: 0.3s; }
body.audio-playing .single-episode .audio-bar:nth-child(6) { animation: audioBar 1s ease-in-out infinite; animation-delay: 0.05s; }
body.audio-playing .single-episode .audio-bar:nth-child(7) { animation: audioBar 0.8s ease-in-out infinite; animation-delay: 0.25s; }

/* Animate bars on playing homepage card */
.episode.playing .audio-bar:nth-child(1) { animation: audioBar 0.7s ease-in-out infinite; animation-delay: 0s; }
.episode.playing .audio-bar:nth-child(2) { animation: audioBar 0.9s ease-in-out infinite; animation-delay: 0.1s; }
.episode.playing .audio-bar:nth-child(3) { animation: audioBar 0.6s ease-in-out infinite; animation-delay: 0.2s; }
.episode.playing .audio-bar:nth-child(4) { animation: audioBar 0.8s ease-in-out infinite; animation-delay: 0.15s; }
.episode.playing .audio-bar:nth-child(5) { animation: audioBar 0.7s ease-in-out infinite; animation-delay: 0.3s; }
.episode.playing .audio-bar:nth-child(6) { animation: audioBar 1s ease-in-out infinite; animation-delay: 0.05s; }
.episode.playing .audio-bar:nth-child(7) { animation: audioBar 0.8s ease-in-out infinite; animation-delay: 0.25s; }

@keyframes audioBar {
  0%, 100% { height: 6px; opacity: 0.5; }
  50% { height: 38px; opacity: 0.9; }
}

/* Loading state for audio visualizer */
.audio-visualizer.loading .audio-bar {
  animation: none !important;
  opacity: 0.3;
}

.audio-visualizer .loading-text {
  font-size: 11px;
  color: #ffffff;
  opacity: 0.7;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Skip to content link - Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100000;
  font-size: 14px;
}

.skip-link:focus {
  top: 0;
}

.screen-reader-text:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
  padding-top: 1rem;
}

.breadcrumbs a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: rgba(255, 255, 255, 0.9);
}

.breadcrumbs span {
  color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   v1.18.0 — Site custom CSS (merged from Simple Custom CSS and JS plugin)
   Changes from the original snippet:
   - fixed invalid syntax: blur(10px !important) -> blur(10px) !important
   - removed duplicate .main-navigation rule (only the second ever applied)
   - the disabled *max-height hack preserved as a comment
   ========================================================================== */

body::after {
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.6)),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.18'/%3E%3C/svg%3E") !important;
}
body { background-color: #161c1f; }
body::before { filter: blur(10px) !important; }
.episode .footer .meta-row { border-bottom: 0 !important; }
.main-navigation { flex-direction: row; opacity: 1; }
.main-navigation a { opacity: 0.7; }
.main-navigation a:hover { opacity: 1; }
.marquee { margin-bottom: 5rem; }
.actions { padding-top: 16px; border-top: 1.5px solid #fff; }
.episodes-list.active .actions { padding-top: 0px; border-top: 0px solid #fff; }
article.type-episode { min-width: 95vw; }
.episode { max-height: none !important; }
@media only screen and (min-width: 1024px) {
    .episode .right-column { max-height: 80vh; overflow-y: scroll; }
}
.content.single-episode .featured-image { display: block; }
.content.single-episode .featured-image img {
    /* max-height: 25vh;  <- was disabled via the *-hack in the original; re-enable if wanted */
    width: 100%;
}
