/* ── Sermons hero banner ───────────────────────────────────── */
.sermons-hero {
  position: relative;
  min-height: 380px;
  background-image: url('https://images.unsplash.com/photo-1529070538774-1843cb3265df?w=1920&q=80');
  background-size: cover;
  background-position: center 50%;
  display: flex;
  align-items: flex-end;
}

.sermons-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(30, 30, 36, 0.30) 0%,
    rgba(30, 30, 36, 0.80) 70%,
    rgba(30, 30, 36, 0.97) 100%
  );
}

.sermons-hero__content {
  position: relative;
  z-index: 1;
  padding-bottom: 2.5rem;
  padding-top: 2.5rem;
  text-align: center;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sermons-hero__content h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  color: #ffffff;
}

.sermons-hero__content p {
  margin: 0;
  color: rgba(237, 232, 223, 0.82);
  font-size: 1.05rem;
  max-width: 520px;
}

@media (max-width: 600px) {
  .sermons-hero {
    min-height: 260px;
  }
  .sermons-hero__content h1 {
    font-size: 1.75rem;
  }
}

.page-sermons,
.page-sermon {
  padding: 40px 0;
}

.sermons-upcoming,
.sermons-player,
.sermons-youtube {
  margin-bottom: 1rem;
}

.sermons-player {
  padding: 1.25rem;
}

.sermons-player__header {
  margin-bottom: 0.9rem;
}

.sermons-player__header h2 {
  margin: 0;
}

.sermons-player__header p {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
}

.sermons-player__frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f1c2e;
  border-radius: 12px;
  overflow: hidden;
}

.sermons-player__frame-wrap iframe,
.sermons-player__frame-wrap > div,
.sermons-player__frame-wrap > div > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sermons-youtube h2 {
  margin: 0;
}

.sermons-youtube p,
.page-sermons .page-intro p {
  color: var(--text-muted);
}

/* ── Upcoming / Live section ───────────────────────────────── */
.sermons-upcoming {
  padding: 1.5rem;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
}

.sermons-upcoming h2 {
  margin: 0 0 0.3rem;
}

.sermons-upcoming__sub {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.sermons-upcoming__badge {
  display: inline-block;
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  color: #E05560;
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.sermons-upcoming__badge--live {
  background: rgba(var(--accent-rgb), 0.32);
  color: #ff6b6b;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

.sermons-upcoming__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.upcoming-card {
  padding: 0;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.upcoming-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 18, 71, 0.16);
}

.upcoming-card__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.upcoming-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.upcoming-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upcoming-card__live-dot {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.upcoming-card__info {
  padding: 0.9rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.upcoming-card__info h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.upcoming-card__time {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.upcoming-card__btn {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.82rem;
  padding: 0.45rem 1.1rem;
}

@media (max-width: 600px) {
  .sermons-upcoming__grid {
    grid-template-columns: 1fr;
  }
}

/* ── YouTube gallery section ───────────────────────────────── */

@media (max-width: 768px) {
  .sermon-filters {
    grid-template-columns: 1fr;
  }
}

/* ── YouTube gallery section ───────────────────────────────── */
.sermons-youtube {
  padding: 1.5rem;
}

.sermons-youtube__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sermons-youtube__header h2 {
  margin: 0;
}

.sermons-youtube__header p {
  margin: 0;
}

.sermons-past-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}

.past-sermon-card {
  padding: 0;
  overflow: hidden;
}

.past-sermon-card__link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.past-sermon-card img,
.past-sermon-card .placeholder {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}
.past-sermon-card .placeholder {
  position: relative;
  place-items: end start;
  padding: 1rem;
  /* Placeholder shown when sermon has no featured image. Set a WP featured image to override. */
  background: linear-gradient(180deg, rgba(30, 30, 36, 0.5), rgba(30, 30, 36, 0.8));
  background-color: var(--color-dark, #1e1e24);
}

.past-sermon-card .placeholder span {
  background: rgba(237, 232, 223, 0.92);
  color: var(--brand-navy);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 800;
}

.past-sermon-card__body {
  padding: 0.9rem 1rem 1rem;
}

.past-sermon-card__body h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.past-sermon-card__date {
  margin: 0.35rem 0 0;
  font-weight: 700;
  color: var(--accent);
}

/* ── Single sermon detail ──────────────────────────────────── */
.sermon-detail {
  margin-top: 1rem;
}

.sermon-detail__header {
  margin-bottom: 1.25rem;
}

.sermon-detail__eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.sermon-detail__meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

.sermon-detail__series {
  font-weight: 700;
  color: var(--accent);
}

.sermon-detail__player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f1c2e;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.sermon-detail__player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sermon-detail__audio {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sermon-detail__audio audio {
  width: 100%;
}

.sermon-detail__audio-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.sermon-detail__no-media {
  color: var(--text-soft);
  font-style: italic;
}

.sermon-detail__body {
  margin: 1rem 0;
}

.sermon-detail__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* Override plugin's default styles to match theme */
.sermons-youtube__gallery .epyt-gallery-wrap {
  margin-top: 0 !important;
}

.sermons-youtube__gallery .epyt-gallery-thumb-outer {
  border-radius: 10px;
  overflow: hidden;
}

.sermons-youtube__gallery .epyt-gallery-title {
  color: var(--text-main) !important;
  font-size: 0.9rem;
}

.sermons-youtube__gallery .epyt-gallery-nav a {
  color: var(--accent) !important;
  font-weight: 700;
}

@media (max-width: 768px) {
  .sermons-youtube__header {
    align-items: flex-start;
  }

  .sermons-past-grid {
    grid-template-columns: 1fr;
  }
}
