/* Element Podcast (sps) - see article.sps.clickfunnel.podcast.xhtml
   Default look = the podcast widget that used to be pasted into a content field
   (2026-09). Changes against that version:
   - every rule scoped to .podcast-widget (the pasted CSS styled .badge-link,
     .modal-title … page-wide)
   - the clickfunnel theme styles bare <button> (full width, white text !important,
     "border: none !important" on hover/focus) and sets "img { height: auto !important }"
     - the affected rules restate everything, some with !important
   - mouse drag state for the slider, room for the hover lift, reduced motion
   Field32 of the element (own CSS) is emitted AFTER this file and overrides it. */

/* Colour variables on :root as in the pasted version, so CSS written for it (and the
   YouTube element, which reads --pc-border / --pc-radius) keeps working. */
:root {
  --pc-bg: #1a1a24;            /* main background */
  --pc-card-bg: #242432;       /* tiles and player */
  --pc-card-hover: #2e2e3f;    /* tile hover */
  --pc-accent: #ff3e6c;        /* accent / play button */
  --pc-accent-hover: #e0325b;  /* accent hover */
  --pc-text-main: #ffffff;     /* main text */
  --pc-text-sub: #9e9ea0;      /* secondary text / date */
  --pc-border: #323244;        /* borders */
  --pc-radius: 16px;           /* corner radius */
}

.podcast-widget {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  width: 100%;
  max-width: 100%;
  margin: 20px 0;
  background: var(--pc-bg);
  border-radius: var(--pc-radius);
  color: var(--pc-text-main);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .3);
  overflow: hidden;
  border: 1px solid var(--pc-border);
  box-sizing: border-box;
}
.podcast-widget * { box-sizing: border-box; }

/* --- Consent gate ---------------------------------------------------------- */
/* Until consent only the cc-embed placeholder is visible (podcast.js removes is-gated). */
.podcast-widget.is-gated > :not(.podcast-gate) { display: none !important; }
.podcast-widget .podcast-gate[hidden] { display: none; }
.podcast-widget .podcast-gate {
  min-height: 220px;
  --cc-ph-bg: var(--pc-bg); --cc-ph-fg: var(--pc-text-main); --cc-ph-border: transparent;
}
.podcast-widget .podcast-gate .cc-embed__ph { min-height: 220px; border-radius: 0; }

/* --- Header ---------------------------------------------------------------- */
.podcast-widget .podcast-header {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 62, 108, .12) 0%, rgba(26, 26, 36, 0) 100%);
  align-items: center;
}
.podcast-widget .podcast-cover {
  width: 100px;
  height: 100px !important;    /* global img height rule */
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .3);
  flex-shrink: 0;
}
.podcast-widget .podcast-info { flex-grow: 1; min-width: 0; }
.podcast-widget .podcast-title {
  margin: 0 0 6px 0;
  color: var(--pc-text-main);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
}
.podcast-widget .podcast-title:focus { outline: none; }   /* focused by script only (tabindex -1) */
.podcast-widget .audio-element:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; border-radius: 20px; }

.podcast-widget .podcast-desc {
  color: var(--pc-text-sub);
  font-size: .88rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 12px 0;
}
.podcast-widget .podcast-desc:empty { display: none; }

/* !important on the colour: sps.css colours section links with the accent at a
   higher specificity. */
.podcast-widget a.badge-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pc-card-bg);
  color: var(--pc-text-main) !important;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .8rem;
  border: 1px solid var(--pc-border);
  transition: background .2s ease;
}
.podcast-widget a.badge-link[hidden] { display: none; }
.podcast-widget a.badge-link:hover,
.podcast-widget a.badge-link:focus-visible { background: var(--pc-card-hover); }

/* --- Player ---------------------------------------------------------------- */
.podcast-widget .now-playing {
  padding: 0 24px 20px 24px;
  border-bottom: 1px solid var(--pc-border);
}
.podcast-widget .now-playing-card {
  background: var(--pc-card-bg);
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--pc-border);
}
.podcast-widget .now-playing-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--pc-text-main);
}
.podcast-widget .audio-element {
  width: 100%;
  height: 40px;
  outline: none;
}

/* --- Episodes slider ------------------------------------------------------- */
.podcast-widget .episodes-container { padding: 24px; }
.podcast-widget .episodes-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--pc-text-main);
}
/* Native scrolling = touch swipe everywhere; podcast.js adds mouse drag.
   padding-top: room for the hover lift (overflow-x: auto clips vertically too). */
.podcast-widget .episodes-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  align-items: stretch;
  scrollbar-width: thin;
  scrollbar-color: var(--pc-border) transparent;
}
.podcast-widget .episodes-grid::-webkit-scrollbar { height: 8px; }
.podcast-widget .episodes-grid::-webkit-scrollbar-thumb { background: var(--pc-border); border-radius: 4px; }
.podcast-widget .episodes-grid.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.podcast-widget .episodes-grid.is-dragging .episode-tile { cursor: grabbing; }

.podcast-widget .episode-tile {
  position: relative;
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--pc-card-bg);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  outline: none;
}
.podcast-widget .episode-tile:hover {
  background: var(--pc-card-hover);
  border-color: var(--pc-border);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, .2);
}
.podcast-widget .episode-tile:focus-visible { border-color: var(--pc-accent); box-shadow: 0 0 0 2px var(--pc-accent); }
.podcast-widget .episode-tile.active {
  border-color: var(--pc-accent);
  background: rgba(255, 62, 108, .1);
}

.podcast-widget .episode-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #111;
}
.podcast-widget .episode-tile-img {
  display: block;
  width: 100%;
  height: 100% !important;     /* global img height rule */
  object-fit: cover;
}
.podcast-widget .play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.podcast-widget .episode-tile:hover .play-overlay,
.podcast-widget .episode-tile:focus-visible .play-overlay,
.podcast-widget .episode-tile.active .play-overlay { opacity: 1; }
.podcast-widget .tile-play-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--pc-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
}
.podcast-widget .tile-play-btn i { color: #fff; }

/* (i) on the tile. A <button>: every state restated against the theme. */
.podcast-widget .info-btn,
.podcast-widget .info-btn:hover,
.podcast-widget .info-btn:focus,
.podcast-widget .info-btn:active {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .65);
  border: 1px solid rgba(255, 255, 255, .2) !important;
  box-shadow: none;
  font-size: .85rem;
  font-weight: bold;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.podcast-widget .info-btn:hover,
.podcast-widget .info-btn:focus-visible { background: var(--pc-accent); transform: scale(1.1); }
.podcast-widget .info-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.podcast-widget .info-btn-ico { color: #fff; }

.podcast-widget .episode-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  justify-content: space-between;
}
.podcast-widget .episode-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pc-text-main);
  line-height: 1.35;
  word-break: break-word;
}
.podcast-widget .episode-meta {
  font-size: .8rem;
  color: var(--pc-text-sub);
  margin: 8px 0 0;
}
.podcast-widget .episodes-grid > .episode-meta { margin: 0 16px 0 0; align-self: center; }

/* --- Popup ----------------------------------------------------------------- */
.podcast-widget .episode-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.podcast-widget .episode-modal.open { display: flex; }
.podcast-widget .episode-modal-content {
  background: var(--pc-card-bg);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color: var(--pc-text-main);
}
.podcast-widget .modal-close,
.podcast-widget .modal-close:hover,
.podcast-widget .modal-close:focus,
.podcast-widget .modal-close:active {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0 solid transparent !important;
  box-shadow: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
/* colour on the span: sps.css forces button text white with !important */
.podcast-widget .modal-close span { color: var(--pc-text-sub); transition: color .2s ease; }
.podcast-widget .modal-close:hover span,
.podcast-widget .modal-close:focus-visible span { color: var(--pc-accent); }
.podcast-widget .modal-close:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
.podcast-widget .modal-meta {
  font-size: .85rem;
  color: var(--pc-text-sub);
  margin-bottom: 8px;
}
.podcast-widget .modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  line-height: 1.3;
  padding-right: 32px;
  color: var(--pc-text-main);
}
.podcast-widget .modal-desc {
  font-size: .95rem;
  line-height: 1.6;
  color: #e0e0e0;
}
.podcast-widget .modal-desc p { margin: 0 0 .8em; color: #e0e0e0; }
.podcast-widget .modal-desc a { color: var(--pc-accent) !important; }
/* the theme draws its own bullets on "section ul > li" - plain list here */
.podcast-widget .modal-desc ul { list-style: disc; padding-left: 1.3em; margin: 0 0 .8em; }
.podcast-widget .modal-desc ul > li { list-style: inherit; min-height: 0; padding-left: 0; margin-bottom: .3em; }
.podcast-widget .modal-desc ul > li::before { content: none; }

@media (max-width: 600px) {
  .podcast-widget .podcast-header { flex-direction: column; text-align: center; }
  .podcast-widget .episode-tile { flex: 0 0 220px; }
}

@media (prefers-reduced-motion: reduce) {
  .podcast-widget .episode-tile, .podcast-widget .play-overlay, .podcast-widget .info-btn { transition: none; }
  .podcast-widget .episode-tile:hover, .podcast-widget .info-btn:hover { transform: none; }
}
