/* --- PAGE HEADER --- */
.page-header {
  background-color: var(--color-primary-dark);
  color: var(--color-white);
  padding: clamp(6rem, 10vw, 8rem) 1.5rem clamp(4rem, 6vw, 5rem);
  text-align: center;
}

.page-header h1 {
  color: #ffffff;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

.page-header p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto;
}

/* --- SERMONS SECTION --- */
.sermons-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background-color: var(--color-bg-light);
  min-height: 50vh;
}

.sermons-container {
  width: var(--container-width-content);
  margin: 0 auto;
}

/* --- TOGGLE CONTROLS --- */
.sermon-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.view-toggle {
  background: transparent;
  border: 2px solid var(--color-primary-dark);
  color: var(--color-primary-dark);
  padding: 0.6rem 1.5rem;
  border-radius: 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle.active, .view-toggle:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
}

/* --- SERMON CARDS GRID --- */
.sermons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 2rem;
}


.sermon-card {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--color-primary-dark);
}

.sermon-card .sermon-meta {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.sermon-card h3 {
  font-size: 1.4rem;
  color: var(--color-text-heading);
  margin-bottom: 0.5rem;
}

.sermon-card .sermon-details {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 2rem;
  flex-grow: 1;
}

.sermon-card .btn-outline {
  display: inline-block;
  text-align: center;
  color: var(--color-white);
  background-color: var(--color-primary-dark);
  padding: 0.8rem 1rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.sermon-card .btn-outline:hover {
  background-color: var(--color-primary-light);
}

/* --- SERIES FOLDERS (For the Library View) --- */
.series-folder {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.series-folder:hover {
  transform: translateY(-5px);
  border-bottom: 4px solid var(--color-primary-light);
}

.series-folder h3 {
  font-size: 1.8rem;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}

.series-folder span {
  font-size: 0.9rem;
  color: #666;
}

/* --- SPOTIFY EMBED PLAYER --- */
.sermon-card .sermon-details {
  font-size: 0.95rem;
  color: #555;
  flex-grow: 1; 
  margin-bottom: 1.5rem;
}

.sermon-card .spotify-embed-container {
  width: 100%;
  margin-top: auto;
  transition: opacity 0.3s ease;
}

.sermon-card .spotify-embed-container:hover {
  opacity: 0.95;
}


/* ==========================================
   CUSTOM DIRECT AUDIO PLAYER
   ========================================== */
.custom-audio-player {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: auto;
  padding-top: 1.2rem;
  width: 100%;
}

.player-cover {
  width: 85px;
  height: 85px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.player-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.hidden-audio {
  display: none;
}

/* Play & Share Row */
.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-play-pause {
  background-color: var(--color-primary-dark);
  color: var(--color-white);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-play-pause:hover {
  transform: scale(1.05);
  background-color: var(--color-primary-light);
}

.btn-play-pause svg {
  width: 20px;
  height: 20px;
}

.btn-share {
  background: transparent;
  border: none;
  color: #666;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-share:hover {
  color: var(--color-primary-dark);
}

/* Progress Bar Row */
.player-progress-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: #777;
  font-family: monospace;
}

.progress-bar {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  /* Fills the range dynamically using the inline style set by JS */
  background-image: linear-gradient(var(--color-primary-dark), var(--color-primary-dark));
  background-size: var(--progress, 0%) 100%;
  background-repeat: no-repeat;
}

/* The draggable dot (Thumb) */
.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary-dark);
  cursor: pointer;
  transition: transform 0.1s;
}

.progress-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary-dark);
  cursor: pointer;
  border: none;
}

.progress-bar:hover::-webkit-slider-thumb {
  transform: scale(1.3);
}
.progress-bar:hover::-moz-range-thumb {
  transform: scale(1.3);
}
