/* ==========================================================================
   Light Generation Ministry — Podcast Module
   Location: assets/css/podcasts.css
   Depends on: assets/css/variables.css, assets/css/main.css (.container,
   .lgm-section, .lgm-btn, .lgm-card design tokens)

   Only enqueued on /media/podcasts (archive) and single podcast pages —
   see app/Podcasts/Assets.php. Every other page never loads this file.
   ========================================================================== */

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.lgm-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--lgm-space-md);
  color: var(--lgm-medium-grey);
  font-size: 0.85rem;
}

.lgm-breadcrumbs a {
  color: var(--lgm-medium-grey);
}

.lgm-breadcrumbs a:hover {
  color: var(--lgm-ancient-red);
}

/* ==========================================================================
   Archive hero + search
   ========================================================================== */

.lgm-podcast-hero {
  padding: var(--lgm-space-xl) 0 var(--lgm-space-lg);
  background: var(--lgm-off-white);
}

.lgm-podcast-hero h1 {
  margin-bottom: var(--lgm-space-xs);
}

.lgm-podcast-hero-desc {
  max-width: 640px;
  color: var(--lgm-dark-grey);
  margin-bottom: var(--lgm-space-md);
}

.lgm-podcast-search {
  display: flex;
  max-width: 480px;
  gap: 8px;
}

.lgm-podcast-search input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--lgm-border);
  border-radius: var(--lgm-radius-md);
  font-family: var(--lgm-font-body);
  font-size: 0.95rem;
}

.lgm-podcast-search input[type="search"]:focus-visible {
  outline: none;
  border-color: var(--lgm-ancient-red);
  box-shadow: var(--lgm-shadow-focus);
}

.lgm-podcast-search button {
  padding: 12px 20px;
  border: none;
  border-radius: var(--lgm-radius-md);
  background: var(--lgm-ancient-red);
  color: var(--lgm-white);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--lgm-transition-fast);
}

.lgm-podcast-search button:hover {
  background: var(--lgm-ancient-red-hover);
}

/* ==========================================================================
   Grid + cards
   ========================================================================== */

.lgm-podcast-grid-section {
  padding-top: var(--lgm-space-lg);
}

.lgm-podcast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--lgm-space-lg);
}

.lgm-podcast-card {
  border-radius: var(--lgm-radius-card);
  border: 1px solid var(--lgm-border);
  box-shadow: var(--lgm-shadow-sm);
  overflow: hidden;
  background: var(--lgm-white);
  transition: transform var(--lgm-transition-fast), box-shadow var(--lgm-transition-fast);
}

.lgm-podcast-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--lgm-shadow-card);
}

.lgm-podcast-card-art {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--lgm-ancient-red) 0%, var(--lgm-ancient-red-bright) 100%);
}

.lgm-podcast-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.lgm-podcast-card:hover .lgm-podcast-card-art img {
  transform: scale(1.06);
}

.lgm-podcast-card-art-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.7);
}

.lgm-podcast-card-art-fallback .lgm-icon {
  width: 48px;
  height: 48px;
}

.lgm-podcast-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 20, 0.35);
  color: var(--lgm-white);
  opacity: 0;
  transition: opacity var(--lgm-transition-fast);
}

.lgm-podcast-card-play .lgm-icon {
  width: 44px;
  height: 44px;
}

.lgm-podcast-card:hover .lgm-podcast-card-play {
  opacity: 1;
}

.lgm-podcast-card-body {
  padding: var(--lgm-space-md);
}

.lgm-podcast-card-category {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: var(--lgm-radius-pill);
  background: var(--lgm-off-white);
  color: var(--lgm-ancient-red);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lgm-podcast-card-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.lgm-podcast-card-title a {
  color: var(--lgm-heading-color);
}

.lgm-podcast-card-title a:hover {
  color: var(--lgm-ancient-red);
}

.lgm-podcast-card-speaker {
  margin: 0 0 var(--lgm-space-sm);
  color: var(--lgm-medium-grey);
  font-size: 0.9rem;
}

.lgm-podcast-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--lgm-space-sm);
  color: var(--lgm-medium-grey);
  font-size: 0.85rem;
}

.lgm-podcast-card-meta .lgm-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.lgm-podcast-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: var(--lgm-space-sm);
  border-top: 1px solid var(--lgm-border);
}

.lgm-podcast-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--lgm-off-white);
  color: var(--lgm-heading-color);
  cursor: pointer;
  transition: background-color var(--lgm-transition-fast), color var(--lgm-transition-fast), transform var(--lgm-transition-fast);
}

.lgm-podcast-card-action .lgm-icon {
  width: 15px;
  height: 15px;
}

.lgm-podcast-card-action:hover {
  background: var(--lgm-ancient-red);
  color: var(--lgm-white);
  transform: scale(1.08);
}

.lgm-podcast-bookmark[aria-pressed="true"] {
  background: var(--lgm-gold);
  color: var(--lgm-navy);
}

.lgm-podcast-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--lgm-space-xl);
}

.lgm-podcast-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--lgm-radius-md);
  border: 1px solid var(--lgm-border);
  color: var(--lgm-heading-color);
}

.lgm-podcast-pagination .page-numbers.current {
  background: var(--lgm-ancient-red);
  border-color: var(--lgm-ancient-red);
  color: var(--lgm-white);
}

.lgm-podcast-empty {
  text-align: center;
  color: var(--lgm-medium-grey);
  padding: var(--lgm-space-xl) 0;
}

/* ==========================================================================
   Custom audio player (single podcast page)
   Slim single-row layout: artwork, title/byline, then play/time/
   progress/duration/speed/more — all in one line, like the reference.
   Background reuses --lgm-header-bg (the nav bar's own color) rather
   than a new color, per the brand guide's "reuse existing tokens" rule
   — see the lgm-header dependency noted in app/Podcasts/Assets.php.
   ========================================================================== */

.lgm-player {
  display: flex;
  align-items: center;
  gap: var(--lgm-space-md);
  margin-top: var(--lgm-space-lg);
  padding: 10px 16px;
  border-radius: var(--lgm-radius-lg);
  background: var(--lgm-header-bg);
  color: var(--lgm-white);
}

.lgm-player-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: var(--lgm-radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
}

.lgm-player-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lgm-player-art .lgm-icon {
  width: 20px;
  height: 20px;
}

.lgm-player-info {
  flex: none;
  max-width: 220px;
  min-width: 0;
}

.lgm-player-title {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.95rem;
}

.lgm-player-byline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.lgm-player-subscribe {
  color: var(--lgm-royal-blue);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.lgm-player-subscribe:hover {
  color: var(--lgm-white);
}

.lgm-player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.lgm-player-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--lgm-white);
  cursor: pointer;
  transition: background-color var(--lgm-transition-fast), transform var(--lgm-transition-fast);
}

.lgm-player-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lgm-player-btn .lgm-icon {
  width: 15px;
  height: 15px;
}

.lgm-player-toggle {
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--lgm-white);
}

.lgm-player-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: none;
}

.lgm-player-toggle .lgm-icon {
  width: 18px;
  height: 18px;
}

.lgm-player-time {
  flex: none;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.75);
}

.lgm-player-progress {
  position: relative;
  flex: 1;
  min-width: 60px;
  height: 4px;
  border-radius: var(--lgm-radius-pill);
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.lgm-player-progress-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: var(--lgm-radius-pill);
  background: var(--lgm-royal-blue);
  transition: width 100ms linear;
}

.lgm-player-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lgm-white);
  box-shadow: var(--lgm-shadow-sm);
  transform: translate(-50%, -50%);
  transition: left 100ms linear;
}

.lgm-player-speed {
  flex: none;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--lgm-radius-pill);
  background: transparent;
  color: var(--lgm-white);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

/* "More options" — the ⋯ button and its popover, holding the
   secondary controls (skip back/forward, mute) so the main row stays
   slim, matching the reference's own "⋯" menu. */
.lgm-player-more {
  position: relative;
  flex: none;
}

.lgm-player-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 180px;
  padding: 8px;
  border-radius: var(--lgm-radius-md);
  background: var(--lgm-white);
  box-shadow: var(--lgm-shadow-lg);
}

.lgm-player-more-menu[hidden] {
  display: none;
}

.lgm-player-more-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--lgm-radius-sm);
  background: transparent;
  color: var(--lgm-heading-color);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--lgm-transition-fast);
}

.lgm-player-more-menu button:hover {
  background: var(--lgm-off-white);
}

.lgm-player-more-menu .lgm-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--lgm-ancient-red);
}

/* ==========================================================================
   Single page: meta row, title, actions, panels
   ========================================================================== */

.lgm-podcast-single {
  padding-top: var(--lgm-space-lg);
  padding-bottom: var(--lgm-space-xl);
}

.lgm-podcast-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--lgm-space-sm);
  margin-top: var(--lgm-space-lg);
}

.lgm-podcast-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lgm-podcast-tag {
  padding: 4px 12px;
  border-radius: var(--lgm-radius-pill);
  background: var(--lgm-off-white);
  color: var(--lgm-heading-color);
  font-size: 0.85rem;
}

.lgm-podcast-listen-on {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--lgm-medium-grey);
  font-size: 0.85rem;
}

.lgm-podcast-listen-on a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lgm-off-white);
  color: var(--lgm-heading-color);
  transition: background-color var(--lgm-transition-fast), color var(--lgm-transition-fast);
}

.lgm-podcast-listen-on a:hover {
  background: var(--lgm-ancient-red);
  color: var(--lgm-white);
}

.lgm-podcast-listen-on .lgm-icon {
  width: 16px;
  height: 16px;
}

.lgm-podcast-title {
  margin-top: var(--lgm-space-md);
  font-size: clamp(2rem, 4vw, 3rem);
}

.lgm-podcast-date {
  color: var(--lgm-medium-grey);
  margin-bottom: var(--lgm-space-md);
}

.lgm-podcast-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--lgm-space-xl);
}

.lgm-podcast-action-row .lgm-icon {
  width: 16px;
  height: 16px;
}

.lgm-podcast-body {
  max-width: 760px;
}

.lgm-podcast-description {
  margin-bottom: var(--lgm-space-lg);
  line-height: 1.8;
}

.lgm-podcast-panel {
  padding: var(--lgm-space-md);
  margin-bottom: var(--lgm-space-md);
  border-radius: var(--lgm-radius-lg);
  background: var(--lgm-off-white);
}

.lgm-podcast-panel h2 {
  font-size: 1.15rem;
  margin: 0 0 var(--lgm-space-sm);
}

.lgm-podcast-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lgm-podcast-panel-header h2 {
  margin: 0;
}

.lgm-podcast-print {
  border: none;
  background: transparent;
  color: var(--lgm-ancient-red);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.lgm-podcast-notes ul,
.lgm-podcast-notes ol {
  padding-left: 20px;
}

.lgm-podcast-transcript-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--lgm-heading-color);
  font-family: var(--lgm-font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.lgm-podcast-transcript-toggle .lgm-icon {
  width: 16px;
  height: 16px;
  transition: transform 250ms ease;
}

.lgm-podcast-transcript-toggle[aria-expanded="true"] .lgm-icon {
  transform: rotate(180deg);
}

.lgm-podcast-transcript {
  margin-top: var(--lgm-space-sm);
  padding-top: var(--lgm-space-sm);
  border-top: 1px solid var(--lgm-border);
  line-height: 1.8;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991.98px) {
  .lgm-podcast-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .lgm-podcast-grid {
    grid-template-columns: 1fr;
  }

  .lgm-player {
    flex-wrap: wrap;
  }

  .lgm-player-info {
    max-width: none;
    flex: 1;
  }

  .lgm-player-controls {
    flex-wrap: wrap;
    flex-basis: 100%;
  }

  .lgm-player-progress {
    order: 10;
    flex-basis: 100%;
  }

  .lgm-podcast-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
