/* ==========================================================================
   Eemaan Foundation — Media & Podcast Library
   V16.5 "Studio"
   Full-height media application: fixed topic sidebar, content rails,
   and an edge-to-edge playback console.
   ========================================================================== */

:root {
  --s-green-950: #06231a;
  --s-green-900: #0a2e21;
  --s-green-800: #0d3b2b;
  --s-green-700: #10513a;
  --s-green-600: #16694b;
  --s-gold-400:  #e8c76a;
  --s-gold-500:  #d4ad45;
  --s-gold-600:  #b08e28;
  --s-red:       #d5342a;
  --s-red-dark:  #b2251c;

  --s-bg:        #fbfaf6;
  --s-paper:     #ffffff;
  --s-ink:       #14211c;
  --s-ink-2:     #4d5a54;
  --s-ink-3:     #8b968f;
  --s-line:      #e7e4dc;
  --s-line-2:    #d8d4c8;
  --s-chip:      #f1efe8;

  --s-t-xs: 12px;
  --s-t-sm: 13px;
  --s-t-md: 14px;
  --s-t-lg: 16px;

  --s-shadow-1: 0 1px 3px rgba(20, 40, 32, .06);
  --s-shadow-2: 0 8px 24px rgba(20, 40, 32, .1);
  --s-shadow-3: 0 20px 48px rgba(20, 40, 32, .16);

  --s-side-w: 232px;
  --s-console-h: 84px;
  --s-nav-h: 80px;

  --s-khatam: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23e8c76a' d='M12 1.6 15 6.2l5.2-1.4-1.4 5.2 4.6 3-4.6 3 1.4 5.2-5.2-1.4-3 4.6-3-4.6-5.2 1.4 1.4-5.2-4.6-3 4.6-3L.8 4.8 6 6.2z'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   0. Page-enter guard  (root cause of the unpinned console)

   site.js adds .page-enter to <body>, and style.css animates it with
   @keyframes efPage, which tweens transform: translateY(14px) -> translateY(0).
   Because the animation uses fill-mode "both", the final transform stays
   applied to <body> permanently - and translateY(0) is still a transform, so
   <body> becomes the containing block for every position:fixed child. That is
   what let the console scroll with the page.

   The fade is kept here, driven by opacity alone, and any transform on <body>
   is refused outright. !important is required: CSS animations outrank normal
   declarations, but not important ones.
   -------------------------------------------------------------------------- */

@keyframes mediaPageEnter { from { opacity: 0; } to { opacity: 1; } }

body.page-enter { animation: mediaPageEnter .6s ease both !important; }

body {
  transform: none !important;
  perspective: none !important;
  filter: none !important;
}

/* --------------------------------------------------------------------------
   1. Frame
   -------------------------------------------------------------------------- */

.media-page {
  position: relative;
  background: var(--s-bg);
  color: var(--s-ink);
  font-size: var(--s-t-md);
  padding: 0;
  min-height: calc(100vh - var(--s-nav-h));
  scroll-behavior: smooth;
}

.media-layout {
  display: grid;
  grid-template-columns: var(--s-side-w) minmax(0, 1fr);
  align-items: start;
  max-width: 1560px;
  margin: 0 auto;
}

.media-main {
  min-width: 0;
  padding: 26px 30px calc(var(--s-console-h) + 44px);
}

.media-page section[id] { scroll-margin-top: calc(var(--s-nav-h) + 20px); }

body.media-console-open { padding-bottom: 0; }

.media-page a:focus-visible,
.media-page button:focus-visible,
.media-page input:focus-visible,
.media-page select:focus-visible,
.media-player a:focus-visible,
.media-player button:focus-visible,
.media-player input:focus-visible,
.media-player select:focus-visible,
.media-filter-toggle:focus-visible {
  outline: 3px solid var(--s-gold-500);
  outline-offset: 2px;
  border-radius: 8px;
}

/* --------------------------------------------------------------------------
   2. Sidebar
   -------------------------------------------------------------------------- */

.media-sidebar {
  position: sticky;
  top: var(--s-nav-h);
  height: calc(100vh - var(--s-nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, var(--s-green-900) 0%, var(--s-green-950) 100%);
  color: #fff;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 199, 106, .35) transparent;
  padding-bottom: calc(var(--s-console-h) + 16px);
}
.media-sidebar::-webkit-scrollbar { width: 7px; }
.media-sidebar::-webkit-scrollbar-thumb { background: rgba(232, 199, 106, .3); border-radius: 99px; }

.media-sidebar > * { position: relative; z-index: 1; }

.media-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 18px 20px;
}
.media-side-brand { display: flex; align-items: center; gap: 11px; color: #fff; min-width: 0; }
.media-side-brand img { width: 38px; height: 38px; flex: 0 0 auto; object-fit: contain; }
.media-side-brand span { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.media-side-brand strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  color: var(--s-gold-400);
  letter-spacing: .06em;
}
.media-side-brand small {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .34em;
  color: #b9cdc3;
  font-weight: 700;
  margin-top: 3px;
}
.media-filter-close {
  display: none;
  color: #fff;
  width: 38px; height: 38px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
}

/* Topic navigation */
.media-primary-nav { padding: 0 12px; display: grid; gap: 1px; }
.media-primary-nav a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: #cfded7;
  padding: 10px 11px;
  border-radius: 9px;
  font-size: var(--s-t-md);
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.media-primary-nav a i { width: 18px; text-align: center; font-size: 15px; color: #9fbdb0; }
.media-primary-nav a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-primary-nav a em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #7f9a8e;
  flex: 0 0 auto;
}
.media-primary-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.media-primary-nav a:hover i { color: var(--s-gold-400); }
.media-primary-nav a.active { color: var(--s-gold-400); font-weight: 800; }
.media-primary-nav a.active i { color: var(--s-gold-400); }
.media-primary-nav a.active span {
  text-decoration: underline;
  text-decoration-color: rgba(232, 199, 106, .55);
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

.media-side-rule { height: 1px; background: rgba(255, 255, 255, .1); margin: 18px 18px 0; }

/* Filter block */
.media-side-block { padding: 18px 18px 0; }
.media-side-heading {
  color: var(--s-gold-400);
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: 10px;
  font-weight: 900;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.media-side-form { padding: 0 18px; display: grid; gap: 18px; }
.media-side-form label > span,
.media-filter-label {
  display: block;
  font-size: var(--s-t-xs);
  color: #c3d5cd;
  font-weight: 700;
  margin-bottom: 7px;
}
.media-side-form select {
  width: 100%;
  appearance: none;
  background: rgba(255, 255, 255, .06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23b9cdc3' stroke-width='2' stroke-linecap='round' d='m5.5 8 4.5 4.5L14.5 8'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: 10px 32px 10px 11px;
  font-size: var(--s-t-sm);
  font-weight: 600;
  font-family: inherit;
}
.media-side-form select option { color: var(--s-ink); background: #fff; }

/* Series checkbox group */
.media-check-list { display: grid; gap: 9px; }
.media-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--s-t-sm);
  color: #d3e0da;
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
}
.media-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.media-check i {
  width: 17px; height: 17px;
  flex: 0 0 auto;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, .3);
  display: grid;
  place-items: center;
  font-size: 9px;
  color: var(--s-green-900);
  font-style: normal;
  transition: background .15s ease, border-color .15s ease;
}
.media-check input:checked + i {
  background: var(--s-gold-400);
  border-color: var(--s-gold-400);
}
.media-check input:checked + i::before { content: "\2713"; font-weight: 900; }
.media-check input:focus-visible + i { outline: 2px solid var(--s-gold-500); outline-offset: 2px; }
.media-check span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-check:hover { color: #fff; }

/* Duration range */
.media-range-wrap { padding-top: 2px; }
.media-range-wrap input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  height: 20px;
  cursor: pointer;
  margin: 0;
}
.media-range-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--s-gold-400) var(--s-fill, 100%), rgba(255, 255, 255, .16) var(--s-fill, 100%));
}
.media-range-wrap input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .16); }
.media-range-wrap input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--s-gold-400); }
.media-range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--s-gold-400);
  border: 2px solid var(--s-green-900);
}
.media-range-wrap input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--s-gold-400);
  border: 2px solid var(--s-green-900);
}
.media-range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8ea79c;
  font-weight: 600;
  margin-top: 5px;
}

.media-side-form button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--s-gold-500);
  color: #241c05;
  border-radius: 9px;
  padding: 11px;
  font-size: var(--s-t-sm);
  font-weight: 800;
  font-family: inherit;
}
.media-side-form button[type="submit"]:hover { background: var(--s-gold-400); }

.media-clear-filters {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 18px;
  margin-top: 18px;
  font-size: var(--s-t-sm);
  color: #b9cdc3;
  font-weight: 600;
}
.media-clear-filters:hover { color: var(--s-gold-400); }

.media-admin-link {
  margin: 16px 18px 0;
  padding: 11px;
  display: flex; gap: 9px; align-items: center;
  border: 1px solid rgba(232, 199, 106, .38);
  border-radius: 9px;
  color: var(--s-gold-400);
  font-size: var(--s-t-sm);
  font-weight: 700;
}
.media-admin-link:hover { background: rgba(232, 199, 106, .1); }

/* Donate card */
.media-side-message {
  margin: 22px 18px 26px;
  border-radius: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  text-align: left;
}
.media-side-message > i { display: none; }
.media-side-message strong {
  display: block;
  font-size: var(--s-t-md);
  color: #fff;
  font-weight: 800;
  line-height: 1.3;
}
.media-side-message p { font-size: var(--s-t-xs); line-height: 1.5; color: #a8bfb5; margin-top: 5px; }
.media-side-message a {
  display: block;
  text-align: center;
  margin-top: 13px;
  background: var(--s-gold-500);
  color: #241c05;
  border-radius: 8px;
  padding: 11px;
  font-size: var(--s-t-sm);
  font-weight: 800;
}
.media-side-message a:hover { background: var(--s-gold-400); }

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */

.media-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.media-eyebrow { display: none; }
.media-page-header h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(30px, 2.7vw, 40px);
  line-height: 1.05;
  color: var(--s-green-800);
  font-weight: 700;
  letter-spacing: -.01em;
}
.media-page-header > div > p:last-child {
  font-size: var(--s-t-md);
  color: var(--s-ink-2);
  margin-top: 6px;
}

.media-search {
  height: 44px;
  width: clamp(280px, 30vw, 420px);
  background: var(--s-paper);
  border: 1px solid var(--s-line-2);
  border-radius: 9px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.media-search:focus-within { border-color: var(--s-green-600); box-shadow: 0 0 0 3px rgba(22, 105, 75, .12); }
.media-search > i { display: none; }
.media-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0;
  padding: 0 14px;
  color: var(--s-ink);
  font-size: var(--s-t-lg);
  font-family: inherit;
  background: transparent;
}
.media-search input::placeholder { color: var(--s-ink-3); font-size: var(--s-t-sm); }
.media-search > a { color: var(--s-ink-3); padding: 0 8px; display: grid; place-items: center; }
.media-search > a:hover { color: var(--s-red); }
.media-search button {
  flex: 0 0 auto;
  align-self: stretch;
  width: 46px;
  background: var(--s-green-800);
  color: #fff;
  font-size: 14px;
}
.media-search button:hover { background: var(--s-green-700); }

.media-saved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--s-t-sm);
  font-weight: 700;
  color: var(--s-ink-2);
  padding: 10px 4px;
  background: none;
  font-family: inherit;
  white-space: nowrap;
}
.media-saved-toggle i { font-size: 15px; }
.media-saved-toggle:hover { color: var(--s-green-700); }
.media-saved-toggle[aria-pressed="true"] { color: var(--s-red); }
.media-saved-toggle em {
  font-style: normal;
  background: var(--s-chip);
  border-radius: 99px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--s-ink-2);
}

/* Tabs */
.media-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 20px;
  scrollbar-width: none;
}
.media-tabs::-webkit-scrollbar { display: none; }
.media-tabs a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--s-paper);
  color: var(--s-ink-2);
  border: 1px solid var(--s-line-2);
  border-radius: 9px;
  padding: 10px 17px;
  font-size: var(--s-t-sm);
  font-weight: 700;
  transition: border-color .15s ease, color .15s ease;
}
.media-tabs a i { font-size: 14px; color: var(--s-ink-3); }
.media-tabs a em { display: none; }
.media-tabs a:hover { border-color: var(--s-green-600); color: var(--s-green-700); }
.media-tabs a:hover i { color: var(--s-green-600); }
.media-tabs a.active {
  background: var(--s-green-800);
  border-color: var(--s-green-800);
  color: #fff;
}
.media-tabs a.active i { color: #fff; }

/* Active filter chips */
.media-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.media-active-filters > span {
  font-size: var(--s-t-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--s-ink-3);
}
.media-active-filters a {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--s-paper);
  border: 1px solid var(--s-line-2);
  color: var(--s-green-800);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: var(--s-t-xs);
  font-weight: 700;
}
.media-active-filters a i { color: var(--s-ink-3); font-size: 11px; }
.media-active-filters a:hover { border-color: var(--s-red); color: var(--s-red); }
.media-active-filters a:hover i { color: var(--s-red); }

/* --------------------------------------------------------------------------
   4. Featured hero
   -------------------------------------------------------------------------- */

.media-hero {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: 40px;
  align-items: center;
  min-height: 300px;
  background: linear-gradient(100deg, var(--s-green-900) 0%, var(--s-green-800) 46%, var(--s-green-700) 100%);
  border-radius: 14px;
  overflow: hidden;
  padding: 30px 36px;
  color: #fff;
  box-shadow: var(--s-shadow-2);
}
.media-hero-pattern {
  position: absolute; inset: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 72% 34%, rgba(232, 199, 106, .12) 0 1px, transparent 1.6px),
    linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, .03) 49%, rgba(255, 255, 255, .03) 51%, transparent 52%);
  background-size: 30px 30px, 60px 60px;
}
.media-hero > * { position: relative; z-index: 1; }

.media-hero-cover {
  flex: 0 0 280px;
  width: 280px;
  height: 280px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-color: var(--s-green-950);
  border: 1.5px solid rgba(232, 199, 106, .8);
  box-shadow: 0 0 0 1px rgba(232, 199, 106, .22), 0 0 46px rgba(232, 199, 106, .2), 0 16px 38px rgba(0, 0, 0, .4);
  position: relative;
  overflow: hidden;
}
.media-hero-cover > span { display: none; }
.media-hero-cover.placeholder {
  background-image:
    radial-gradient(circle at 50% 34%, rgba(232, 199, 106, .3) 0 16%, transparent 17%),
    linear-gradient(150deg, #0f5f47, #05231a);
}
.media-hero-cover.placeholder::before {
  content: "EEMAAN\A MEDIA";
  white-space: pre;
  position: absolute; inset: 0;
  display: grid; place-items: center;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 32px;
  line-height: .9;
  color: var(--s-gold-400);
  font-weight: 700;
}

.media-hero-copy { flex: 1 1 auto; min-width: 0; }
.media-feature-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--s-gold-400);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.media-hero-copy h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(26px, 2.5vw, 38px);
  line-height: 1.1;
  font-weight: 700;
  color: #fff;
  margin: 12px 0 0;
  text-wrap: balance;
}
.media-hero-copy h3 { font-size: var(--s-t-lg); color: #fff; font-weight: 700; margin-top: 6px; }
.media-hero-speaker { font-size: var(--s-t-md); color: var(--s-gold-400); font-weight: 800; margin-top: 10px; }
.media-hero-episode { font-size: var(--s-t-md); color: var(--s-gold-500); font-weight: 800; margin-top: 4px; }
.media-hero-description {
  font-size: var(--s-t-md);
  line-height: 1.6;
  color: #c6d8d1;
  margin-top: 12px;
  max-width: 62ch;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-hero-foot {
  display: grid;
  justify-items: end;
  gap: 14px;
  margin-top: 18px;
}
.media-hero-stats {
  display: flex; flex-wrap: wrap; gap: 24px;
  justify-content: flex-end;
  color: #c6d8d1;
  font-size: var(--s-t-sm);
  font-weight: 600;
}
.media-hero-stats span { display: flex; align-items: center; gap: 8px; }
.media-hero-stats i { color: #9fbdb0; font-size: 13px; }

.media-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.media-primary-action, .media-secondary-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: var(--s-t-md);
  font-weight: 700;
  min-height: 44px;
  font-family: inherit;
  transition: background .15s ease, transform .15s ease;
}
.media-primary-action { background: var(--s-gold-500); color: #241c05; }
.media-primary-action:hover { background: var(--s-gold-400); transform: translateY(-1px); }
.media-secondary-action { color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.media-secondary-action:hover { background: rgba(255, 255, 255, .1); }


/* --------------------------------------------------------------------------
   5. Section heads and rails
   -------------------------------------------------------------------------- */

.media-section { margin-top: 34px; }
.media-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.media-section-head > div { display: flex; align-items: center; gap: 11px; min-width: 0; }
.media-section-icon {
  width: 26px; height: 26px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 19px;
  background: none;
}
.media-section-icon.audio { color: var(--s-green-700); }
.media-section-icon.video { color: var(--s-red); }
.media-section-icon.radio { color: var(--s-green-700); }
.media-section-head p { display: none; }
.media-section-head h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  line-height: 1.1;
  color: var(--s-green-800);
  font-weight: 700;
}
.media-section-head > a {
  flex: 0 0 auto;
  font-size: var(--s-t-sm);
  font-weight: 700;
  color: var(--s-ink-2);
}
.media-section-head > a i { display: none; }
.media-section-head > a:hover { color: var(--s-green-700); text-decoration: underline; text-underline-offset: 4px; }

.media-rail { position: relative; }
.media-card-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 216px;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.media-card-row::-webkit-scrollbar { display: none; }
.media-rail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--s-paper);
  border: 1px solid var(--s-line-2);
  color: var(--s-ink-2);
  box-shadow: var(--s-shadow-2);
  z-index: 3;
  font-size: 12px;
}
.media-rail-nav[hidden] { display: none; }
.media-rail-nav.prev { left: -12px; }
.media-rail-nav.next { right: -12px; }
.media-rail-nav:hover { border-color: var(--s-green-600); color: var(--s-green-700); }

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */

.media-audio-card, .media-video-card, .media-library-card {
  background: var(--s-paper);
  border: 1px solid var(--s-line);
  border-radius: 11px;
  overflow: hidden;
  box-shadow: var(--s-shadow-1);
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  scroll-snap-align: start;
}
.media-audio-card:hover, .media-video-card:hover, .media-library-card:hover {
  box-shadow: var(--s-shadow-2);
  transform: translateY(-2px);
  border-color: var(--s-line-2);
}

.media-card-art, .media-library-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--s-green-900);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.media-library-art { cursor: default; }
.media-card-art.placeholder, .media-library-art.placeholder {
  background-image:
    radial-gradient(circle at 50% 40%, rgba(232, 199, 106, .24) 0 20%, transparent 21%),
    linear-gradient(145deg, #10604a, #05231a);
}
.media-card-art > *, .media-library-art > * { position: relative; z-index: 2; }

.media-duration {
  position: absolute;
  right: 8px; bottom: 8px;
  background: rgba(6, 20, 15, .82);
  color: #fff;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.media-card-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.9);
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .95);
  color: var(--s-green-800);
  font-size: 15px;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.media-card-art:hover .media-card-play,
.media-card-art:focus-visible .media-card-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.media-progress-strip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, .25);
  z-index: 3;
}
.media-progress-strip > i { display: block; height: 100%; width: 0; background: var(--s-gold-400); }

.media-card-body, .media-video-body, .media-library-copy {
  padding: 13px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* Category chip */
.media-card-tags, .media-library-kicker, .media-video-body > div:first-child {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.media-card-tags span, .media-library-kicker span {
  display: inline-block;
  background: var(--s-chip);
  color: var(--s-ink-2);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.media-video-body > div:first-child span {
  font-size: var(--s-t-xs);
  color: var(--s-ink-3);
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.media-card-tags em, .media-library-kicker em, .media-video-body > div:first-child em {
  font-style: normal;
  font-size: 11px;
  color: var(--s-ink-3);
  font-weight: 600;
  flex: 0 0 auto;
}

.media-audio-card h3, .media-video-card h3, .media-library-card h3 {
  font-size: var(--s-t-md);
  line-height: 1.35;
  color: var(--s-ink);
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}
.media-card-speaker, .media-library-speaker, .media-video-body p {
  font-size: var(--s-t-sm);
  color: var(--s-ink-2);
  font-weight: 600;
}
.media-card-description, .media-library-description {
  font-size: var(--s-t-xs);
  line-height: 1.5;
  color: var(--s-ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta row carries the round play button on audio cards */
.media-card-meta, .media-library-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--s-ink-3);
  font-weight: 600;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--s-line);
}
.media-card-meta span, .media-library-meta span { display: inline-flex; align-items: center; gap: 5px; }
.media-card-meta i, .media-library-meta i { font-size: 11px; }

.media-card-cta {
  position: absolute;
  right: 12px; bottom: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--s-green-800);
  color: #fff;
  font-size: 12px;
  padding: 0;
  transition: background .15s ease, transform .15s ease;
}
.media-card-cta span { display: none; }
.media-card-cta:hover { background: var(--s-green-600); transform: scale(1.06); }
.media-card-body { position: relative; padding-right: 56px; }

.media-library-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: 38px;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: var(--s-t-sm);
  font-weight: 700;
  background: var(--s-green-800);
  color: #fff;
  margin-top: 10px;
  font-family: inherit;
}
.media-library-action:hover { background: var(--s-green-600); }
.media-library-action.video { background: var(--s-red); }
.media-library-action.video:hover { background: var(--s-red-dark); }
.media-library-action.radio { background: var(--s-gold-600); color: #fff; }
.media-library-action.radio:hover { background: var(--s-gold-500); color: #241c05; }

/* Save (heart) control */
.media-save {
  position: absolute;
  right: 8px; top: 8px;
  z-index: 4;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(6, 20, 15, .6);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: opacity .18s ease, background .15s ease;
  backdrop-filter: blur(3px);
}
.media-audio-card:hover .media-save,
.media-video-card:hover .media-save,
.media-library-card:hover .media-save,
.media-save:focus-visible,
.media-save[aria-pressed="true"] { opacity: 1; }
.media-save[aria-pressed="true"] { background: var(--s-red); }
.media-save:hover { background: rgba(213, 52, 42, .9); }

/* Video */
.media-video-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 280px; gap: 16px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-behavior: smooth; padding-bottom: 6px; }
.media-video-grid::-webkit-scrollbar { display: none; }
.media-video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  max-height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--s-green-900);
}
.media-video-thumb.placeholder {
  background-image:
    radial-gradient(circle at 50% 40%, rgba(232, 199, 106, .22) 0 18%, transparent 19%),
    linear-gradient(145deg, #10604a, #05231a);
}
.media-youtube-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 52px; height: 37px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(213, 52, 42, .92);
  color: #fff;
  font-size: 18px;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.media-video-thumb:hover .media-youtube-play { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }

/* Radio */
.media-radio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.media-radio-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 13px;
  align-items: center;
  background: var(--s-paper);
  border: 1px solid var(--s-line);
  border-radius: 11px;
  padding: 13px 14px;
  box-shadow: var(--s-shadow-1);
  color: var(--s-ink);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.media-radio-card:hover { box-shadow: var(--s-shadow-2); border-color: var(--s-line-2); }
.media-radio-logo {
  width: 46px; height: 46px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--s-green-800);
  display: grid; place-items: center;
  color: var(--s-gold-400);
  font-size: 16px;
  border: 2px solid var(--s-line);
}
.media-radio-logo:not(.placeholder) > i { display: none; }
.media-radio-copy { min-width: 0; display: grid; gap: 2px; }
.media-radio-copy strong {
  font-size: var(--s-t-md);
  font-weight: 800;
  color: var(--s-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.media-radio-copy small {
  font-size: var(--s-t-xs);
  color: var(--s-ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.media-radio-copy em {
  font-style: normal;
  font-size: 11px;
  color: var(--s-ink-3);
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  margin-top: 3px;
}
.media-radio-copy em b {
  background: var(--s-red);
  color: #fff;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 9px;
  letter-spacing: .08em;
  font-weight: 800;
}
.media-radio-wave { display: flex; align-items: center; gap: 2px; height: 22px; }
.media-radio-wave i {
  display: block;
  width: 2px;
  border-radius: 2px;
  background: var(--s-ink-3);
  opacity: .5;
  animation: sWave 1.2s ease-in-out infinite;
}
.media-radio-wave i:nth-child(1) { height: 35%; animation-delay: 0s; }
.media-radio-wave i:nth-child(2) { height: 70%; animation-delay: .1s; }
.media-radio-wave i:nth-child(3) { height: 50%; animation-delay: .2s; }
.media-radio-wave i:nth-child(4) { height: 90%; animation-delay: .3s; }
.media-radio-wave i:nth-child(5) { height: 45%; animation-delay: .4s; }
.media-radio-wave i:nth-child(6) { height: 75%; animation-delay: .5s; }
.media-radio-wave i:nth-child(7) { height: 30%; animation-delay: .6s; }
@keyframes sWave { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
.media-radio-play {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--s-green-800);
  color: #fff;
  font-size: 13px;
  flex: 0 0 auto;
}
.media-radio-card:hover .media-radio-play { background: var(--s-green-600); }

/* --------------------------------------------------------------------------
   7. Catalogue and empty states
   -------------------------------------------------------------------------- */

.media-catalogue { margin-top: 40px; }
.media-catalogue-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--s-line);
  padding-top: 26px;
  margin-bottom: 18px;
}
.media-catalogue-head p { display: none; }
.media-catalogue-head h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--s-green-800);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}
.media-catalogue-head span { font-size: var(--s-t-sm); color: var(--s-ink-3); font-weight: 600; }
.media-catalogue-head > a {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--s-line-2);
  background: var(--s-paper);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: var(--s-t-sm);
  font-weight: 700;
  color: var(--s-ink-2);
}
.media-catalogue-head > a:hover { border-color: var(--s-red); color: var(--s-red); }

.media-catalogue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.media-library-type {
  position: absolute;
  left: 8px; top: 8px;
  z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(255, 255, 255, .94);
  color: var(--s-green-800);
}
.media-library-type.video { color: var(--s-red-dark); }
.media-library-type.radio { color: var(--s-gold-600); }
.media-library-featured {
  position: absolute;
  left: 8px; bottom: 8px;
  z-index: 3;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--s-gold-500);
  color: #241c05;
  font-size: 11px;
}

.media-empty-state {
  text-align: center;
  background: var(--s-paper);
  border: 1px dashed var(--s-line-2);
  border-radius: 14px;
  padding: 48px 24px;
  color: var(--s-ink-2);
}
.media-empty-state > div {
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #e9f2ee;
  color: var(--s-green-700);
  font-size: 22px;
}
.media-empty-state h2, .media-empty-state h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 27px;
  color: var(--s-green-800);
  font-weight: 700;
}
.media-empty-state p { font-size: var(--s-t-md); margin-top: 8px; max-width: 50ch; margin-inline: auto; }
.media-empty-state a {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  background: var(--s-green-800);
  color: #fff;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: var(--s-t-sm);
  font-weight: 700;
}
.media-empty-state a:hover { background: var(--s-green-600); }
.media-empty-hero { padding: 60px 24px; }

/* --------------------------------------------------------------------------
   Bottom-fixed widget clearance

   The console owns the bottom strip. Any other fixed widget anchored there
   (privacy consent banner, admin inline-editor launcher and messages) is
   pushed above it so nothing ever covers the playback controls.
   -------------------------------------------------------------------------- */

body.media-console-open .ef-consent-banner { bottom: calc(var(--s-console-h) + 18px); }
body.media-console-open #ef-inline-editor .ef-launcher { bottom: calc(var(--s-console-h) + 22px); }
body.media-console-open #ef-inline-editor .ef-message { bottom: calc(var(--s-console-h) + 94px); }
body.media-console-open #ef-inline-editor .ef-toolbar { margin-bottom: calc(var(--s-console-h) + 12px); }

/* Same offsets for browsers that paint before the script runs. :has() is kept
   in separate blocks: an unsupported selector would invalidate a whole
   comma-separated group, taking the rules above down with it. */
body:has(.media-player) .ef-consent-banner { bottom: calc(var(--s-console-h) + 18px); }
body:has(.media-player) #ef-inline-editor .ef-launcher { bottom: calc(var(--s-console-h) + 22px); }
body:has(.media-player) #ef-inline-editor .ef-message { bottom: calc(var(--s-console-h) + 94px); }
body:has(.media-player) #ef-inline-editor .ef-toolbar { margin-bottom: calc(var(--s-console-h) + 12px); }

/* Series cards: one card per series, with an episode count and CTA */
.media-series-card .media-card-body { padding-right: 14px; gap: 8px; }

.media-series-badge {
  position: absolute;
  left: 8px; top: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 20, 15, .82);
  color: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.media-series-badge i { font-size: 10px; color: var(--s-gold-400); }

.media-series-facts { display: grid; gap: 3px; margin-top: 2px; }
.media-series-facts > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.media-series-facts dt {
  font-size: var(--s-t-sm);
  font-weight: 700;
  color: var(--s-ink);
  flex: 0 0 auto;
}
.media-series-facts dd {
  font-size: var(--s-t-sm);
  font-weight: 700;
  color: var(--s-ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.media-series-cta {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 7px;
  padding: 9px 16px;
  margin-top: 6px;
  background: var(--s-gold-500);
  color: #241c05;
  font-size: var(--s-t-sm);
  font-weight: 800;
  font-family: inherit;
  transition: background .15s ease, transform .15s ease;
}
.media-series-cta:hover { background: var(--s-gold-400); transform: translateY(-1px); }

/* About dialog: series introduction and per-episode notes */
.media-series-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.media-series-about {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 7px;
  border: 1px solid var(--s-line-2);
  background: var(--s-paper);
  color: var(--s-ink-2);
  font-size: var(--s-t-sm);
  font-weight: 700;
  font-family: inherit;
  transition: border-color .15s ease, color .15s ease;
}
.media-series-about i { font-size: 13px; color: var(--s-ink-3); }
.media-series-about:hover { border-color: var(--s-green-600); color: var(--s-green-700); }
.media-series-about:hover i { color: var(--s-green-600); }
.media-series-cta { margin-top: 0; }

.media-about-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  padding: 24px;
}
.media-about-modal[hidden] { display: none; }
.media-about-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 16, 12, .78);
  backdrop-filter: blur(5px);
  cursor: pointer;
}
.media-about-box {
  position: relative;
  width: min(720px, 100%);
  max-height: min(84vh, 780px);
  display: flex;
  flex-direction: column;
  background: var(--s-paper);
  border-radius: 14px;
  box-shadow: var(--s-shadow-3);
  overflow: hidden;
  animation: mediaModalIn .22s ease;
}
.media-about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--s-line);
  flex: 0 0 auto;
}
.media-about-head h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--s-green-800);
  line-height: 1.2;
  min-width: 0;
}
.media-about-close {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--s-ink-2);
  background: var(--s-chip);
  font-size: 15px;
}
.media-about-close:hover { background: var(--s-red); color: #fff; }
.media-about-body { overflow: auto; overscroll-behavior: contain; padding: 18px; }

.media-about-hero { display: flex; gap: 16px; align-items: flex-start; }
.media-about-cover {
  flex: 0 0 108px;
  width: 108px; height: 108px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--s-green-900);
  border: 1px solid var(--s-line-2);
}
.media-about-cover.placeholder {
  background-image:
    radial-gradient(circle at 50% 40%, rgba(232, 199, 106, .28) 0 20%, transparent 21%),
    linear-gradient(145deg, #10604a, #05231a);
}
.media-about-heading { min-width: 0; }
.media-about-kicker {
  display: inline-block;
  background: var(--s-chip);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--s-ink-2);
}
.media-about-heading h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--s-ink);
  margin-top: 6px;
}
.media-about-speaker { font-size: var(--s-t-sm); color: var(--s-gold-600); font-weight: 800; margin-top: 4px; }
.media-about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  list-style: none;
  padding: 0;
}
.media-about-stats li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--s-t-xs);
  color: var(--s-ink-3);
  font-weight: 600;
}
.media-about-stats i { font-size: 12px; }

.media-about-intro { margin-top: 20px; }
.media-about-intro h4,
.media-about-episodes h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 900;
  color: var(--s-gold-600);
  margin-bottom: 8px;
}
.media-about-intro p { font-size: var(--s-t-md); line-height: 1.65; color: var(--s-ink-2); }

.media-about-episodes { margin-top: 22px; }
.media-about-episodes ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.media-about-episodes li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 8px;
  border-radius: 9px;
  border-top: 1px solid var(--s-line);
}
.media-about-episodes li:first-child { border-top: 0; }
.media-about-episodes li:hover { background: #f7f5ef; }
.media-about-play {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--s-green-800);
  color: #fff;
  font-size: 12px;
  flex: 0 0 auto;
  transition: background .15s ease, transform .15s ease;
}
.media-about-play:hover { background: var(--s-green-600); transform: scale(1.06); }
.media-about-play.is-playing { background: var(--s-gold-500); color: #241c05; }
.media-about-episode-copy { min-width: 0; }
.media-about-episode-copy strong {
  display: block;
  font-size: var(--s-t-sm);
  font-weight: 800;
  color: var(--s-ink);
  line-height: 1.35;
}
.media-about-episode-copy > span {
  display: block;
  font-size: 11px;
  color: var(--s-ink-3);
  font-weight: 600;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.media-about-episode-copy p {
  font-size: var(--s-t-xs);
  line-height: 1.55;
  color: var(--s-ink-2);
  margin-top: 6px;
}

.media-about-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: var(--s-t-sm);
  font-weight: 700;
  color: var(--s-green-700);
}
.media-about-all:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 640px) {
  .media-about-modal { padding: 10px; }
  .media-about-box { max-height: 92vh; }
  .media-about-hero { flex-direction: column; }
  .media-about-cover { flex-basis: auto; width: 96px; height: 96px; }
  .media-series-actions { justify-content: stretch; }
  .media-series-about, .media-series-cta { flex: 1 1 auto; justify-content: center; }
}

/* On-page video player (lightbox) */
.media-video-modal {
  position: fixed;
  inset: 0;
  /* Above the console (9000) so video playback owns the screen. */
  z-index: 9500;
  display: grid;
  place-items: center;
  padding: 24px;
}
.media-video-modal[hidden] { display: none; }
.media-video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 16, 12, .82);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.media-video-modal-box {
  position: relative;
  width: min(1040px, 100%);
  background: #0b241b;
  border: 1px solid rgba(232, 199, 106, .35);
  border-radius: 14px;
  box-shadow: var(--s-shadow-3);
  overflow: hidden;
  animation: mediaModalIn .22s ease;
}
@keyframes mediaModalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.media-video-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
}
.media-video-modal-head h2 {
  font-size: var(--s-t-md);
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.media-video-modal-close {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #c6d8d1;
  background: rgba(255, 255, 255, .06);
  font-size: 15px;
}
.media-video-modal-close:hover { color: #fff; background: rgba(213, 52, 42, .85); }
.media-video-modal-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.media-video-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.media-video-modal-foot { padding: 11px 16px; display: flex; justify-content: flex-end; }
.media-video-modal-foot a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--s-t-xs);
  font-weight: 700;
  color: #9fbdb0;
}
.media-video-modal-foot a:hover { color: #fff; }
@media (max-width: 640px) {
  .media-video-modal { padding: 10px; align-items: center; }
  .media-video-modal-head { padding: 11px 12px; }
}

/* "Watch now" card action */
.media-watch-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: var(--s-t-sm);
  font-weight: 700;
  background: var(--s-red);
  color: #fff;
  margin-top: 10px;
  font-family: inherit;
}
.media-watch-cta:hover { background: var(--s-red-dark); }
.media-watch-cta.is-external { background: var(--s-paper); color: var(--s-red-dark); border: 1px solid var(--s-line-2); }
.media-watch-cta.is-external:hover { border-color: var(--s-red); }
button.media-video-thumb { border: 0; padding: 0; cursor: pointer; font-family: inherit; text-align: inherit; }

/* "Browse the full library" reveal */
.media-browse-all { margin-top: 44px; text-align: center; }
.media-browse-all a {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 13px 26px;
  border-radius: 10px;
  border: 1px solid var(--s-line-2);
  background: var(--s-paper);
  color: var(--s-green-800);
  font-size: var(--s-t-md);
  font-weight: 800;
  box-shadow: var(--s-shadow-1);
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.media-browse-all a i { color: var(--s-gold-600); }
.media-browse-all a em {
  font-style: normal;
  background: var(--s-chip);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: var(--s-t-xs);
  color: var(--s-ink-2);
  font-weight: 700;
}
.media-browse-all a:hover { border-color: var(--s-green-600); color: var(--s-green-700); transform: translateY(-1px); }

/* Drawer trigger */
.media-filter-toggle {
  display: none;
  position: fixed;
  left: 14px;
  bottom: calc(var(--s-console-h) + 14px);
  z-index: 74;
  background: var(--s-green-800);
  color: #fff;
  border-radius: 99px;
  padding: 12px 18px;
  box-shadow: var(--s-shadow-3);
  font-size: var(--s-t-sm);
  font-weight: 700;
  gap: 9px;
  align-items: center;
}
.media-sidebar-overlay { display: none; }

/* --------------------------------------------------------------------------
   8. Console
   -------------------------------------------------------------------------- */

.media-player {
  /* !important throughout: the console must stay pinned to the viewport even
     if a theme, plugin or future stylesheet tries to reposition it. */
  position: fixed !important;
  /* Above all page content and site modals (100). Deliberately below the
     consent banner (9999) and the admin inline editor: those are offset
     upward by the rules further down, so nothing overlaps either way. */
  z-index: 9000 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  margin: 0 !important;
  min-height: var(--s-console-h);
  background: linear-gradient(180deg, #0b2d21 0%, #071d16 100%);
  border-top: 1px solid rgba(232, 199, 106, .3);
  color: #fff;
  padding: 0 22px;
  /* Clears the iOS home indicator / Safari bottom chrome. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.media-player audio { display: none; }

.mp-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(300px, 1.15fr);
  align-items: center;
  gap: 22px;
  min-height: var(--s-console-h);
}

/* Now playing */
.media-player-track { display: flex; align-items: center; gap: 13px; min-width: 0; }
.player-cover {
  position: relative;
  width: 52px; height: 52px;
  flex: 0 0 auto;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: var(--s-green-700);
  color: var(--s-gold-400);
  display: grid; place-items: center;
  font-size: 16px;
  overflow: hidden;
}
.mp-eq {
  position: absolute;
  right: 4px; bottom: 4px;
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
  padding: 2px;
  border-radius: 3px;
  background: rgba(5, 20, 15, .7);
}
.media-player[data-state="playing"] .mp-eq { display: flex; }
.mp-eq i { display: block; width: 2px; border-radius: 1px; background: var(--s-gold-400); animation: sWave .9s ease-in-out infinite; }
.mp-eq i:nth-child(1) { height: 55%; animation-delay: 0s; }
.mp-eq i:nth-child(2) { height: 100%; animation-delay: .15s; }
.mp-eq i:nth-child(3) { height: 45%; animation-delay: .3s; }
.mp-eq i:nth-child(4) { height: 80%; animation-delay: .45s; }

.player-meta { min-width: 0; }
.player-meta small, .player-meta b, .player-meta span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-meta small { display: none; }
.player-meta b { font-size: var(--s-t-md); font-weight: 700; color: #fff; line-height: 1.3; }
.player-meta span { font-size: var(--s-t-sm); color: #9fbdb0; font-weight: 500; margin-top: 2px; }
.media-player[data-state="error"] .player-meta span { color: #ffb4ab; font-weight: 700; }

/* Transport */
.media-player-controls { display: flex; align-items: center; gap: 4px; justify-content: center; }
.mp-btn, .player-close, .mp-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  color: #b6cdc3;
  background: none;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  transition: color .15s ease, background .15s ease;
}
.mp-btn:hover, .player-close:hover, .mp-chip:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.mp-btn[aria-pressed="true"], .mp-btn.is-on { color: var(--s-gold-400); }
.mp-btn[aria-pressed="true"]::after, .mp-btn.is-on::after {
  content: "";
  position: absolute;
  bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--s-gold-400);
}
.mp-btn b {
  position: absolute;
  left: 50%; top: 54%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  font-weight: 900;
  pointer-events: none;
}
.mp-chip { font-size: var(--s-t-xs); min-width: 40px; }

.player-main-toggle {
  width: 46px; height: 46px;
  min-width: 46px;
  margin: 0 6px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  color: var(--s-green-900);
  font-size: 16px;
  transition: transform .15s ease, background .15s ease;
}
.player-main-toggle:hover { background: var(--s-gold-400); transform: scale(1.05); }
.player-main-toggle:active { transform: scale(.96); }
.media-player[data-state="loading"] .player-main-toggle i { animation: sSpin .9s linear infinite; }
@keyframes sSpin { to { transform: rotate(360deg); } }

/* Right cluster */
.mp-utils { display: flex; align-items: center; gap: 14px; justify-content: flex-end; min-width: 0; }

.player-progress {
  display: grid;
  grid-template-columns: 42px minmax(80px, 1fr) 42px;
  gap: 10px;
  align-items: center;
  color: #9fbdb0;
  font-size: var(--s-t-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: 1;
  min-width: 0;
}
.player-progress > span:last-child { text-align: right; }

.mp-rail { position: relative; height: 18px; display: flex; align-items: center; }
.mp-rail::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .16);
}
.mp-buffer {
  position: absolute;
  left: 0;
  height: 4px;
  width: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, .22);
  transition: width .3s linear;
}

.media-player input[type="range"] {
  position: relative;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.media-player input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--s-gold-400) var(--mp-fill, 0%), rgba(255, 255, 255, .001) var(--mp-fill, 0%));
}
.media-player input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .001); }
.media-player input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--s-gold-400); }
.media-player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  border: 0;
  background: var(--s-gold-400);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  transition: transform .15s ease;
}
.media-player input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 0;
  background: var(--s-gold-400);
}
.media-player #playerSeek:hover::-webkit-slider-thumb { transform: scale(1.3); }
/* Signature: the khatam star takes over the seek handle while scrubbing. */
.media-player #playerSeek:active::-webkit-slider-thumb {
  width: 18px; height: 18px;
  margin-top: -7px;
  border-radius: 0;
  background: var(--s-khatam) center/contain no-repeat;
  box-shadow: none;
  transform: none;
}

.player-volume { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.player-volume input { width: 82px; }

.mp-panel {
  position: absolute;
  right: 22px;
  bottom: calc(var(--s-console-h) + 8px);
  width: min(400px, calc(100vw - 44px));
  background: #0b2d21;
  border: 1px solid rgba(232, 199, 106, .3);
  border-radius: 12px;
  box-shadow: var(--s-shadow-3);
  padding: 14px;
  display: grid;
  gap: 12px;
  max-height: min(52vh, 440px);
  overflow: auto;
  overscroll-behavior: contain;
}
.mp-panel[hidden] { display: none; }
.mp-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 900;
  color: var(--s-gold-400);
}
.mp-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; }
.mp-options label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--s-t-xs); font-weight: 700; color: #b6cdc3; }
.mp-options select {
  appearance: none;
  background: rgba(255, 255, 255, .07) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23e8c76a' stroke-width='2' stroke-linecap='round' d='m5.5 8 4.5 4.5L14.5 8'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  color: #fff;
  font-family: inherit;
  font-size: var(--s-t-xs);
  font-weight: 700;
  padding: 7px 26px 7px 9px;
}
.mp-options select option { background: #0b2d21; color: #fff; }
.mp-options a, .mp-options button.mp-link {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  padding: 7px 11px;
  font-size: var(--s-t-xs);
  font-weight: 700;
  color: #b6cdc3;
  background: rgba(255, 255, 255, .04);
  font-family: inherit;
}
.mp-options a:hover, .mp-options button.mp-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.mp-options a[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.mp-queue { display: grid; gap: 2px; }
.mp-queue button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 9px;
  border-radius: 8px;
  color: #c6d8d1;
  background: transparent;
  font-family: inherit;
  font-size: var(--s-t-sm);
  font-weight: 600;
}
.mp-queue button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.mp-queue button > i:first-child { font-style: normal; font-size: 11px; color: #7f9a8e; text-align: center; font-weight: 700; }
.mp-queue button > span { min-width: 0; display: grid; gap: 1px; }
.mp-queue button > span b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mp-queue button > span em { font-style: normal; font-size: 11px; color: #7f9a8e; }
.mp-queue button > time { font-size: 11px; color: #7f9a8e; font-weight: 600; }
.mp-queue button.is-current { background: rgba(232, 199, 106, .14); color: #fff; }
.mp-queue button.is-current > i:first-child { color: var(--s-gold-400); }
.mp-empty { font-size: var(--s-t-sm); color: #8ea79c; padding: 8px 2px; }


.media-audio-card.is-playing, .media-library-card.is-playing { border-color: var(--s-gold-500); }
.media-audio-card.is-playing .media-card-play,
.media-library-card.is-playing .media-card-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Hidden by the client-side "Saved" filter */
.media-hidden-by-filter { display: none !important; }

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1320px) {
  .media-hero { gap: 26px; }
  .media-hero-cover { flex-basis: 240px; width: 240px; height: 240px; }
  .media-radio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .media-hero-cover { flex-basis: 220px; width: 220px; height: 220px; }
  .mp-bar { grid-template-columns: minmax(150px, 1fr) auto minmax(220px, 1fr); gap: 14px; }
  .player-volume input { width: 62px; }
}
@media (max-width: 1050px) {
  .media-layout { display: block; }
  .media-main { padding: 20px 18px calc(var(--s-console-h) + 40px); }
  .media-sidebar {
    position: fixed;
    z-index: 78;
    left: 0; top: 0; bottom: 0;
    height: 100%;
    width: min(320px, 88vw);
    transform: translateX(-104%);
    transition: transform .28s ease;
    padding-bottom: 24px;
  }
  .media-sidebar.open { transform: translateX(0); }
  .media-filter-close { display: grid; place-items: center; }
  .media-filter-toggle { display: flex; }
  .media-sidebar-overlay { position: fixed; z-index: 77; inset: 0; background: rgba(4, 20, 15, .55); backdrop-filter: blur(3px); }
  .media-sidebar-overlay.open { display: block; }
  .media-page-header { grid-template-columns: minmax(0, 1fr) auto; }
  .media-search { grid-column: 1 / -1; width: 100%; }
  .media-rail-nav { display: none; }
}
@media (max-width: 760px) {
  :root { --s-console-h: 150px; }
  .media-main { padding: 16px 14px calc(var(--s-console-h) + 30px); }
  .media-hero { padding: 22px; gap: 20px; min-height: 0; }
  .media-hero-cover { flex-basis: 180px; width: 180px; height: 180px; }
  .media-card-row { grid-auto-columns: 74vw; }
  .media-video-grid { grid-auto-columns: 82vw; }
  .media-radio-grid, .media-catalogue-grid { grid-template-columns: 1fr; }
  .media-radio-card { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .media-radio-wave { display: none; }
  .media-catalogue-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .media-section-head h2 { font-size: 22px; }

  /* Console: three stacked rows, nothing removed. */
  .media-player { padding: 8px 12px 10px; }
  .mp-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 8px;
    gap: 10px;
    min-height: 0;
  }
  .media-player-track { grid-column: 1; grid-row: 1; }
  .media-player-controls { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 2px; }
  .mp-utils { grid-column: 1 / -1; grid-row: 3; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
  .player-progress { flex: 1 1 100%; order: -1; }
  .player-volume input { width: 74px; }
  .player-cover { width: 44px; height: 44px; }
  .player-main-toggle { width: 42px; height: 42px; min-width: 42px; }
  .mp-panel { right: 12px; left: 12px; width: auto; bottom: calc(var(--s-console-h) + 6px); }
}
@media (max-width: 640px) {
  .media-hero { flex-direction: column; align-items: stretch; }
  .media-hero-cover { width: 200px; height: 200px; flex-basis: auto; margin: 0 auto; }
  .media-hero-foot { justify-items: start; }
  .media-hero-stats { justify-content: flex-start; }
  .media-hero-actions { justify-content: flex-start; }
}
@media (max-width: 420px) {
  .media-card-row { grid-auto-columns: 82vw; }
  .media-video-grid { grid-auto-columns: 88vw; }
  .mp-btn, .player-close { min-width: 32px; height: 32px; padding: 0 5px; }
  .player-volume input { width: 58px; }
  .media-saved-toggle span { display: none; }
}

/* -------------------------------------------------------------- 10. Motion */

@media (prefers-reduced-motion: reduce) {
  .media-page, .media-card-row, .media-video-grid { scroll-behavior: auto; }
  .media-page *, .media-player * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .media-audio-card:hover, .media-video-card:hover, .media-library-card:hover { transform: none; }
}

@media print {
  .media-sidebar, .media-player, .media-filter-toggle,
  .media-tabs, .media-search, .media-rail-nav, .media-save { display: none !important; }
  .media-layout { display: block; }
  .media-main { padding: 0; }
  .media-page { background: #fff; }
}

@media (forced-colors: active) {
  .media-audio-card, .media-video-card, .media-library-card,
  .media-radio-card, .media-player { border: 1px solid CanvasText; }
}
