/* ====================================================================
   Homepage
   ================================================================= */

/* ===== Shows grid =================================================== */
.harmura-podcast-home.grid {
  max-width: var(--maxw);
  margin: 22px auto 56px;
  padding: 0 var(--pad-x);
  display: grid;
  grid-template-columns: 1fr;         /* phone: single column */
  gap: 18px;
}

@media (min-width: 768px) {           /* tablet+ */
  .harmura-podcast-home.grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Card (grid so footers line up) =============================== */
.harmura-podcast-home .card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto; /* cover | bar | body | footer */
  background: rgb(0 0 0 / 14%);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: visible;
  box-shadow: var(--shadow);
}
.harmura-podcast-home .card:hover { z-index: 2; }

/* ===== Layered cover =============================================== */
.harmura-podcast-home .cover {
  /* helpers */
  --cover-radius: 16px;
  --cover-pad: clamp(6px, 1.2vw, 12px);
  --cover-pos-x: 50%;
  --cover-pos-y: 50%;
  --cover-offset-x: 0px;
  --cover-offset-y: 0px;

  position: relative;
  aspect-ratio: 1200 / 630;
  overflow: hidden;                    /* clip hover zoom */
  background: #0b0b0b;
  border-top-left-radius: var(--cover-radius);
  border-top-right-radius: var(--cover-radius);
  isolation: isolate;                  /* keep overlay stacking local */
  contain: paint;                      /* avoid paint bleed on zoom */
}

/* map alignment attribute -> variables (nudges still apply) */
.harmura-podcast-home .cover[data-cover-align="top"]    { --cover-pos-y: 0%; }
.harmura-podcast-home .cover[data-cover-align="center"] { --cover-pos-y: 50%; }

/* Make the whole window clickable */
.harmura-podcast-home .cover a { position: relative; display: block; width: 100%; height: 100%; }

/* Reset any global img quirks inside cover */
.harmura-podcast-home .cover img { border: 0; margin: 0; padding: 0; }

/* Base art (square source), sized to the opening */
.harmura-podcast-home .cover__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;                   /* crop square to 1200:630 */
  object-position:
    calc(var(--cover-pos-x) + var(--cover-offset-x))
    calc(var(--cover-pos-y) + var(--cover-offset-y));
  background: #000;
  transform: translateZ(0) scale(1);
  transform-origin: 50% 50%;
  transition: transform .38s cubic-bezier(.22,.61,.36,1), filter .38s cubic-bezier(.22,.61,.36,1);
  filter: contrast(1.04) saturate(.96) brightness(.96);
  will-change: transform;
  z-index: 0;
}

/* Logo overlay (static, inside rounded window) */
.harmura-podcast-home .cover__logo {
  position: absolute;
  right: var(--cover-pad);
  bottom: var(--cover-pad);
  width: 33%;
  max-width: calc(100% - (var(--cover-pad) * 2));
  height: auto;
  pointer-events: none;                /* clicks go to the link */
  z-index: 1;
  /* optional polish:
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); */
}

/* Hover: gentle zoom (logo stays pinned) */
.harmura-podcast-home .card:hover .cover__img {
  transform: scale(1.03);
  filter: contrast(1.08) saturate(1) brightness(1);
}
@media (max-width: 640px) {
  .harmura-podcast-home .card:hover .cover__img { transform: scale(1.02); }
}

/* Respect reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  .harmura-podcast-home .cover__img { transition: none !important; }
}

/* ===== Accent bar =================================================== */
.harmura-podcast-home .bar {
  height: 12px;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--accent) 28%, transparent),
    color-mix(in srgb, var(--accent) 10%, transparent)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== Body (flexible) ============================================= */
.harmura-podcast-home .body { padding: 14px 14px 10px; min-height: 0; }
.harmura-podcast-home .label {
  display: block;
  margin: 0 0 6px;
  color: var(--accent);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-variant-caps: all-small-caps;
}
.harmura-podcast-home .title { margin: 0 0 6px; font-family: var(--font-serif); font-size: 22px; line-height: 1.25; }
.harmura-podcast-home .summary { margin: 1rem 0; color: var(--muted); }

/* ===== Footer row (aligned across columns) ========================= */
.harmura-podcast-home .card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px;
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 3%);
}
.harmura-podcast-home .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== RSS icon ==================================================== */
.harmura-podcast-home .rss {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  color: #d7e5dd; text-decoration: none;
}
.harmura-podcast-home .rss:hover {
  color: #ffffff;
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
  background: rgba(255, 255, 255, 0.10);
}
.harmura-podcast-home .rss svg { width: 20px; height: 20px; }



/* ====================================================================
   Show Page
   ================================================================= */

:root { --harmura-podcast-show-width: 60rem; }

.harmura-podcast-show-page .container { max-width: var(--harmura-podcast-show-width); }

/* ===== Show intro (under hero) ===================================== */
.show-intro { margin: 0 0.5rem 2rem; }

/* control the overall width of the hanging panel */
.show-intro .container { padding-top: 2rem; }

/* unified panel that “hangs” from the hero */
.show-intro .intro-grid {
  display: grid;
  grid-template-columns: 1fr;          /* mobile stack */
  gap: 22px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  border-top: 0;                        /* weld to hero’s bottom border */
  border-radius: 0 0 12px 12px;
  margin-top: -1px;                     /* pull up to touch the hero line */
  padding-left: 1.125rem;
  padding-right: 1.125rem;
  padding-bottom: 1.125rem;
}

/* remove per-column chrome; the panel provides it */
.show-intro .intro-copy,
.show-intro .listen-card { background: transparent; border: 0; padding: 0; }

/* copy column */
.show-intro .lede { margin: 0 0 0.85rem; font-weight: 800; }
.show-intro .summary > * + * { margin-top: 0.9rem; }

/* services column */
.show-intro .listen-title {
  margin: 0 0 8px; font-size: 0.95rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.show-intro .service-badges {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 6px;
}
.show-intro .service-badges li { margin: 0; }
.show-intro .badge { display: inline-block; font-weight: 800; color: var(--accent); text-decoration: none; }
.show-intro .badge:hover { color: var(--accent-hover); text-decoration: underline; }

/* RSS link sits quietly under the list */
.show-intro .rss-advanced {
  display: inline-block; margin-top: 10px; font-size: 0.92rem;
  color: var(--muted); text-decoration: none;
}
.show-intro .rss-advanced:hover { color: var(--ink); text-decoration: underline; }

/* Tablet: more breathing room */
@media (min-width: 720px) {
  .show-intro .intro-grid {
    gap: 26px;
    padding-left: 1.4rem; padding-right: 1.4rem; padding-bottom: 1.4rem;
  }
}

/* Desktop: 2/3 copy + 1/3 services; services on the left, copy on the right */
@media (min-width: 768px) {
  .show-intro .intro-grid { grid-template-columns: 1fr 1fr; align-items: start; gap: 28px; }
  .show-intro .listen-card { order: 1; }   /* keep services left */
  .show-intro .intro-copy  { order: 2; }   /* copy right */
  .show-intro .service-badges { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
}

/* Phones-only: service links inline, wrapping row */
@media (max-width: 719.98px) {
  .show-intro .service-badges { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
  .show-intro .service-badges li { margin: 0; }
  .show-intro .badge { display: inline; }  /* tighter inline flow */
}



/* ====================================================================
   Show: Seasons & Episodes
   (phone → small tablet → iPad/desktop)
   ==================================================================== */

.show-episodes { margin: 0 auto 2.25rem; }

/* --- header / season filter ---------------------------------------- */
.episodes-head { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
section.harmura-podcast-show-page .episodes-head .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 1rem; border: 0; background: transparent;
}
.episodes-head h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(1.35rem, 2.4vw, 1.8rem); line-height: 1.2; }
.season-filter { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.season-label, .season-count { font-size: 0.95rem; color: var(--muted); }
.season-select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
}
.season-select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 1px; }

/* --- episode list --------------------------------------------------- */
.show-episodes .container { max-width: var(--harmura-podcast-show-width); padding: 0; }

.episode-list {
  list-style: none;
  margin: 14px 0.5rem 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
.episode-card[hidden] { display: none !important; }

ol#episode-list {
  margin-block-start: 0; margin-block-end: 0; padding-inline-start: 0;
  background: rgba(0, 0, 0, 0.16);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
}

/* --- card shell (phone-first) -------------------------------------- */
/* Phone: 2 columns so image sits left (25%) and header text to its right */
.ep {
  display: grid;
  grid-template-columns: 25% 1fr;
  gap: 0 14px;
  padding: 14px;
  align-items: start;
  grid-auto-flow: row dense;            /* pack rows tightly */
  grid-auto-rows: auto;
}

/* soft divider between episode cards */
.episode-card + .episode-card { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }

/* Media (square art) */
.ep-media {
  margin: 0; border-radius: 8px; overflow: hidden; background: #000;
  grid-column: 1;
  grid-row: 1 / span 2;                 /* phone default (see phone fix below) */
  aspect-ratio: 1 / 1;
}
.ep-media img { display: block; width: 100%; height: auto; }

/* Body: children participate directly in the .ep grid */
.ep-body { min-width: 0; display: contents; }

/* Phone: header bits to the right of the image */
.ep-num, .ep-meta, .ep-title, .ep-subtitle { grid-column: 2; }

/* Phone: summary spans full width below header rows */
.ep-summary { grid-column: 1 / -1; }

/* Meta row styling */
.ep-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  font-size: 0.95rem; color: var(--muted);
}
.ep-tag { font-weight: 700; font-size: clamp(0.75rem, 1.5vw, 2.125rem); }
.ep-dot { opacity: 0.7; }
.ep-date { opacity: 0.9; }

/* Titles */
.ep-title {
  margin: 0.25rem 0 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
  line-height: 1.2;
}
.ep-subtitle { margin: 1rem 0 0.35rem; color: var(--muted); font-weight: 600; }

/* Actions: phone places them at the bottom, full width */
.ep-actions {
  display: flex; align-items: flex-start; flex-wrap: wrap;
  gap: 10px 14px; grid-column: 1 / -1; margin-top: 10px;
}
.ep-actions .button { margin: 0 auto; display: block; width: 100%; text-align: center; }
.listen-title { margin-bottom: 0; padding-bottom: 0; }
.ep-services {
  list-style: none; margin: 0; padding: 0;
  display: inline-flex; gap: 10px; flex-wrap: wrap; font-size: 0.95rem;
}
.ep-services a { color: var(--accent); font-weight: 800; text-decoration: none; }
.ep-services a:hover { color: var(--accent-hover); text-decoration: underline; }

/* --- small tablets (560–767.98px): same as phone, just roomier ------- */
@media (min-width: 560px) and (max-width: 767.98px) {
  .ep { gap: 16px; padding: 16px; }
  .ep-media { aspect-ratio: 1 / 1; }
}

/* --- iPad+ (≥768px): 3 columns with explicit areas ------------------ */
@media (min-width: 768px) {
  .episode-list { gap: 18px; }
  .ep-services { display: block; }

  .ep {
    /* 25% | 1fr | ~20% */
    grid-template-columns:
      minmax(140px, 25%)
      minmax(0, 1fr)
      minmax(180px, 20%);
    gap: 0 20px;
    padding: 18px;

    /* four tidy rows for the middle stack */
    grid-template-rows: auto auto auto auto;

    /* named areas prevent accidental gaps */
    grid-template-areas:
      "media num     actions"
      "media title   actions"
      "media meta    actions"
      "media summary actions";
  }

  /* map elements to areas (keep .ep-body as display:contents) */
  .ep-media   { grid-area: media; }
  .ep-num     { grid-area: num; }
  .ep-title   { grid-area: title; }
  .ep-meta    { grid-area: meta; }
  .ep-summary { grid-area: summary; }

  .ep-actions {
    grid-area: actions;
    align-self: start;
    margin-top: 0;
    flex-direction: column;            /* button then services */
  }
}

/* --- roomy desktop (≥1180px) --------------------------------------- */
@media (min-width: 1180px) {
  .episode-list { gap: 20px; }
  .ep { padding: 20px; }
}

/* --- PHONE FIX (<768px): pin header rows beside the image ----------- */
/* Note: this also closes a 1px “dead zone” by matching the small-tablet breakpoint. */
@media (max-width: 767.98px) {
  .ep { grid-template-columns: 25% 1fr; grid-auto-flow: row dense; }

  /* cover spans all three header rows (num, title, meta) */
  .ep-media { grid-column: 1; grid-row: 1 / span 3; }

  /* right of the image: num → title → meta */
  .ep > .ep-num   { grid-column: 2; grid-row: 1; }
  .ep > .ep-title { grid-column: 2; grid-row: 2; }
  .ep > .ep-meta  { grid-column: 2; grid-row: 3; }

  /* summary remains full width below the header rows */
  .ep-summary { grid-column: 1 / -1; }
}



/* === Minimal modal ================================================== */
.harmura-podcast-modal { position: fixed; inset: 0; z-index: 9999; }
.harmura-podcast-modal.is-hidden { display: none; }

.harmura-podcast-modal__backdrop {
  position: absolute; 
  inset: 0; 
  border: 0; 
  padding: 0;
  background: color-mix(in srgb, #000 72%, transparent);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

/* Dialog: just enough to float the player */
.harmura-podcast-modal__dialog {
  position: relative;
  margin: 6vh auto 0;
  width: min(725px, calc(100vw - 28px));
  padding-top:40px;
  --embed-h: 170px;
}

/* Close button: small "X" */
.harmura-podcast-modal__close {
  position: absolute; top: 6px; right: -25px;
  width: 32px; 
  height: 32px; 
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.75);
  color: var(--ink);
  font-size: 20px; 
  line-height: 1; 
  cursor: pointer;
}
.harmura-podcast-modal__close:hover { background: rgba(255,255,255,0.08); }

/* Iframe fills; height tuned for audio players; override with --embed-h if needed */
.harmura-podcast-modal__dialog iframe {
  display: block; width: 100%;
  height: var(--embed-h, clamp(180px, 26vh, 280px));
  border: 0; border-radius: 8px;
  background: #000;
}

/* Freeze the page exactly where it is when modal opens */
body.harmura-podcast-modal-open {
  position: fixed;
  width: 100%;
  overflow: hidden;      /* belt + suspenders */
}

