@import url('/global.css');
/* ==========================================================
   TPchannel — Podcasts CSS (Redesign)
   ========================================================== */
.podcast-app-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}
.podcast-app-body a { color: inherit; text-decoration: none; }

.podcast-app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: var(--sp-2);
  min-height: 100vh;
  padding: var(--sp-2);
  background: var(--line);
}

.podcast-sidebar, .podcast-workspace {
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.podcast-sidebar {
  position: sticky;
  top: var(--sp-2);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 16px);
  padding: var(--sp-6) var(--sp-4);
}

.podcast-brand, .podcast-mobile-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-2) var(--sp-5);
  font-size: 21px;
  font-weight: 700;
}
.podcast-brand img, .podcast-mobile-brand img {
  width: 32px; height: 32px;
}
.podcast-mobile-brand { display: none; }

.podcast-primary-nav {
  display: grid;
  gap: var(--sp-1);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.podcast-primary-nav a, .podcast-admin-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 700;
  transition: all var(--duration) var(--ease);
}
.podcast-primary-nav a span, .podcast-admin-link span {
  display: grid;
  place-items: center;
  width: 22px;
  font-size: 20px;
}
.podcast-primary-nav a:hover, .podcast-primary-nav a.is-active, .podcast-admin-link:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}

.podcast-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6) var(--sp-2) var(--sp-3);
  font-weight: 700;
}
.podcast-library-head a {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg);
  transition: background var(--duration);
}
.podcast-library-head a:hover { background: var(--line); }

.podcast-library {
  display: grid;
  gap: var(--sp-1);
  overflow: auto;
  scrollbar-width: thin;
}
.library-item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2);
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
}
.library-item:hover, .library-item.is-active {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.library-cover {
  display: grid;
  place-items: center;
  width: 50px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--green-faint);
  font-size: 20px;
  color: var(--green);
}
.library-cover img { width: 100%; height: 100%; object-fit: cover; }
.library-item strong, .library-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-item strong { font-size: 14px; color: var(--ink); }
.library-item small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.library-empty { padding: var(--sp-3); color: var(--muted); font-size: 13px; text-align: center; }

.podcast-admin-link {
  margin-top: auto;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding-top: var(--sp-5);
}

.podcast-workspace {
  min-width: 0;
  position: relative;
}

.podcast-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  height: 72px;
  padding: var(--sp-3) clamp(18px, 3vw, 40px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.podcast-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: min(470px, 55vw);
  height: 46px;
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--muted);
  transition: all var(--duration) var(--ease);
}
.podcast-search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(61, 186, 138, 0.1);
}
.podcast-search span { font-size: 20px; }
.podcast-search input {
  width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit;
  min-width: 0; padding: 0; min-height: 0; box-shadow: none;
}
.podcast-search input::placeholder { color: var(--placeholder); }

.topbar-home {
  margin-left: auto;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  transition: background var(--duration);
}
.topbar-home:hover { background: var(--line); }

.podcast-page, .episode-detail {
  padding: 0 clamp(18px, 3vw, 40px) 80px;
}

.podcast-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 30%) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  min-height: 400px;
  margin: 0 calc(clamp(18px, 3vw, 40px) * -1);
  padding: var(--sp-12) clamp(28px, 5vw, 70px);
  overflow: hidden;
  background: radial-gradient(circle at top right, var(--green-faint), transparent 50%);
}
.podcast-hero-art {
  position: relative;
  z-index: 2;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--green-faint);
  box-shadow: var(--shadow-xl);
}
.podcast-hero-art img { width: 100%; height: 100%; object-fit: cover; }
.podcast-wave {
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  color: var(--green);
  font-size: 80px;
}
.podcast-hero-copy { position: relative; z-index: 2; max-width: 830px; }
.podcast-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
.podcast-eyebrow:before {
  content: ""; width: 24px; height: 2px; background: currentColor;
}
.podcast-hero h1 {
  font-size: clamp(36px, 6vw, 80px);
  line-height: var(--leading-tight);
  margin-bottom: var(--sp-4);
}
.podcast-hero h1 span { color: var(--green); }
.podcast-hero-copy > p:not(.podcast-eyebrow) {
  color: var(--ink-secondary);
  font-size: clamp(16px, 2vw, 20px);
  line-height: var(--leading-relaxed);
  max-width: 720px;
}

.podcast-hero-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-6); }
.podcast-cta, .podcast-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--sp-6);
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 700;
  transition: all var(--duration) var(--ease);
}
.podcast-cta {
  background: var(--green);
  color: var(--on-green);
}
.podcast-cta:hover { transform: scale(1.05); box-shadow: var(--shadow-glow); }
.podcast-app-body .podcast-cta { color: var(--on-green); }
.podcast-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}
.podcast-ghost:hover { background: var(--surface); border-color: var(--green); }

.podcast-hero-stat {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4); padding: var(--sp-4) var(--sp-5);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.podcast-hero-stat > div { min-width: 0; }
.podcast-hero-stat strong { display: block; font-size: 26px; line-height: 1.4; }
.podcast-hero-stat span { font-size: 12px; color: var(--muted); }
.podcast-hero-art.has-latest { aspect-ratio: 16 / 9; }
.latest-title { padding: 22px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.episode-list { display: grid; gap: var(--sp-2); }

.podcast-section { margin-top: var(--sp-12); }
.podcast-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.podcast-section-head h2 { font-size: clamp(24px, 3vw, 36px); }
.podcast-section-head > a { color: var(--muted); font-size: 14px; font-weight: 600; }
.podcast-section-head > a:hover { color: var(--green); }

.show-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
}
.show-card {
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: all var(--duration) var(--ease);
  position: relative;
}
.show-card:hover {
  transform: translateY(-4px);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.show-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--green-faint);
  box-shadow: var(--shadow-sm);
}
.show-cover img { width: 100%; height: 100%; object-fit: cover; }
.show-cover-placeholder { display: grid; place-items: center; height: 100%; font-size: 40px; color: var(--green); }
.show-play {
  position: absolute;
  right: var(--sp-2);
  bottom: var(--sp-2);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-green);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: all var(--duration) var(--ease);
  box-shadow: var(--shadow-sm);
}
.show-card:hover .show-play { opacity: 1; transform: translateY(0) scale(1); }
.show-card-body { padding: var(--sp-3) 0 0; }
.show-card small { color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.show-card h3 { font-size: 16px; margin: var(--sp-1) 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.show-card p {
  color: var(--muted); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

.episode-table-head, .episode-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 90px 70px 44px;
  gap: var(--sp-3);
  align-items: center;
}
.episode-table-head {
  padding: 0 var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.episode-row {
  grid-template-columns: 32px 80px minmax(0, 1fr) 90px 70px 44px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  transition: background var(--duration);
}
.episode-row:hover { background: var(--surface); }
.episode-index { color: var(--muted); font-size: 13px; text-align: center; }
.episode-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--green-faint);
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-thumb-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  opacity: 0;
  transition: opacity var(--duration);
}
.episode-row:hover .episode-thumb-play { opacity: 1; }
.episode-info { min-width: 0; }
.episode-info small { color: var(--green); font-size: 11px; font-weight: 600; display: block; }
.episode-info h3 { font-size: 15px; margin: var(--sp-1) 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-info p { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-source, .episode-duration { color: var(--muted); font-size: 13px; }
.episode-play {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  transition: all var(--duration);
}
.episode-play:hover { background: var(--green); color: var(--on-green); border-color: var(--green); transform: scale(1.1); }

.podcast-back { display: inline-flex; margin: var(--sp-6) 0 var(--sp-4); color: var(--muted); font-size: 14px; font-weight: 600; }
.podcast-back:hover { color: var(--green); }

.show-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: end;
  margin: 0 calc(clamp(18px, 3vw, 40px) * -1);
  padding: var(--sp-10) clamp(28px, 5vw, 70px) var(--sp-8);
  background: linear-gradient(to bottom, var(--surface), var(--bg));
}
.show-hero-cover {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.show-hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.show-hero h1 { font-size: clamp(32px, 5vw, 64px); margin: var(--sp-2) 0 var(--sp-3); }
.show-hero-copy p { color: var(--ink-secondary); font-size: 16px; max-width: 700px; line-height: 1.6; }
.show-actions { display: flex; align-items: center; gap: var(--sp-4); margin-top: var(--sp-5); }
.round-play {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-green);
  display: grid; place-items: center;
  font-size: 20px;
  transition: transform var(--duration);
}
.round-play:hover { transform: scale(1.05); }

.episode-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
  gap: var(--sp-6);
  align-items: start;
}
.episode-player {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.episode-player iframe { width: 100%; height: 100%; border: 0; }
.facebook-fallback { display: grid; place-items: center; height: 100%; padding: var(--sp-6); text-align: center; color: var(--muted); }
.facebook-fallback a { display: inline-flex; margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-5); border-radius: var(--radius-full); background: #1877f2; color: #fff; font-weight: 700; }

.episode-detail-copy { padding: var(--sp-6); background: var(--surface); border-radius: var(--radius-md); }
.episode-detail-copy h1 { font-size: clamp(28px, 4vw, 42px); margin: var(--sp-2) 0 var(--sp-3); }
.episode-detail-copy p { color: var(--ink-secondary); font-size: 16px; line-height: 1.7; }
.episode-meta { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.episode-meta span { padding: 4px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-full); font-size: 12px; color: var(--muted); }

.share-bar { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-6); }
.share-bar a, .share-bar button {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px; font-weight: 600;
  transition: all var(--duration);
}
.share-bar a:hover, .share-bar button:hover { border-color: var(--green); color: var(--green); }
.share-bar .source-link { background: var(--green); color: var(--on-green); border-color: var(--green); }
.share-bar .source-link:hover { opacity: 0.9; color: var(--on-green); }

.podcast-footer {
  display: flex; align-items: center; gap: var(--sp-4);
  margin-top: var(--sp-12); padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.podcast-footer small { margin-left: auto; }

.podcast-empty, .podcast-search-empty {
  grid-column: 1 / -1;
  padding: var(--sp-10);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  text-align: center; color: var(--muted);
}

.latest-badge { position: absolute; top: var(--sp-3); left: var(--sp-3); padding: 4px 10px; background: var(--accent-lime); color: #0b1410; font-size: 11px; font-weight: 700; border-radius: var(--radius-full); z-index: 10; }
.latest-title { position: absolute; bottom: var(--sp-3); left: var(--sp-3); right: var(--sp-3); z-index: 10; }
.latest-title small { color: #fff; font-size: 11px; opacity: 0.8; }
.latest-title strong { color: #fff; font-size: 15px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity var(--duration); font-size: 32px; color: #fff; z-index: 5; }
.podcast-hero-art:hover .latest-play { opacity: 1; }

.podcast-mobile-nav { display: none; }

/* Focus and Reduced Motion */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Breakpoints */
@media (max-width: 1023px) {
  .podcast-app-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .episode-table-head { grid-template-columns: 24px minmax(0, 1fr) 70px 44px; }
  .episode-row { grid-template-columns: 24px 60px minmax(0, 1fr) 70px 44px; }
  .episode-table-head span:nth-child(4), .episode-duration { display: none; }
  .episode-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .podcast-app-shell { display: block; padding: 0; background: var(--bg); }
  .podcast-sidebar { display: none; }
  .podcast-workspace { border-radius: 0; min-height: 100vh; }
  .podcast-topbar { height: auto; min-height: 64px; padding: var(--sp-2) var(--sp-3); flex-wrap: wrap; gap: var(--sp-2); }
  .podcast-mobile-brand { display: flex; flex-shrink: 0; }
  .podcast-search { flex: 1 0 100%; width: 100%; min-width: 0; order: 3; }
  .podcast-topbar .theme-toggle { margin-left: auto; }
  .podcast-mobile-brand { padding: 0; }
  .topbar-home { display: none; }
  .podcast-page, .episode-detail { padding: 0 var(--sp-3) 80px; }
  
  .podcast-hero { grid-template-columns: 1fr; text-align: center; padding: var(--sp-8) var(--sp-4); margin-inline: 0; }
  .podcast-hero-copy { max-width: 100%; }
  .podcast-eyebrow { justify-content: center; }
  .podcast-hero-actions { justify-content: center; }
  
  .show-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: var(--sp-6) var(--sp-4); margin-inline: 0; }
  .show-actions { justify-content: center; }
  
  .show-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--sp-3); gap: var(--sp-3); }
  .show-card { min-width: 70vw; scroll-snap-align: start; }
  
  .episode-table-head { display: none; }
  .episode-row { grid-template-columns: 30px 60px minmax(0, 1fr) 36px; padding: var(--sp-2) 0; }
  .episode-source { display: none; }
  
  .podcast-mobile-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: var(--sp-2) var(--sp-2) env(safe-area-inset-bottom);
  }
  .podcast-mobile-nav a { display: grid; place-items: center; gap: 4px; color: var(--muted); font-size: 11px; padding: var(--sp-1); }
  .podcast-mobile-nav a.is-active { color: var(--green); }
  .podcast-mobile-nav a i, .podcast-mobile-nav a span:first-child { font-size: 20px; }
}

/* Theme-aware colours (light by default, dark via .dark or system preference) */
:root { --on-green: #ffffff; }
html.dark { --on-green: #0b1410; }
html.dark .podcast-hero h1 span { color: var(--accent-lime); }
@media (prefers-color-scheme: dark) {
  html:not(.light):not([data-theme="light"]) { --on-green: #0b1410; }
  html:not(.light):not([data-theme="light"]) .podcast-hero h1 span { color: var(--accent-lime); }
}
