/*
 * LBC Sermons — minimal styling.  Namespaced `.lbc-*` to avoid
 * collisions with the Customify theme.
 *
 * Design goals (operator 2026-04-22):
 *   - Body text is black, not mid-gray.
 *   - Metadata block sits on a tinted card (not white) so the block
 *     reads clearly against a white page background.
 *   - Series name shown above the title as a small label line.
 */

.lbc-sermon {
  max-width: 960px;
  margin: 0 auto 2rem;
  font-family: inherit;
  /* color intentionally not set here so the theme's text color applies
     to the title, date, and series label — operator wants those in the
     site's normal heading style.  Meta block below forces its own
     black for the grey labels. */
}

.lbc-sermon__header {
  margin-bottom: 0.75rem;
  text-align: center;
}
/* Beaver Builder wraps each heading in:
     div.fl-module → div.fl-module-content → h2.fl-heading → span.fl-heading-text
   Each of those layers can contribute margin/padding.  Zero them all
   so the three header lines stack flush.  Class selectors beat the
   `h2 { ... }` tag selector, so no !important needed. */
.lbc-sermon__series-module,
.lbc-sermon__title-module,
.lbc-sermon__date-module,
.lbc-sermon__series-module .fl-module-content,
.lbc-sermon__title-module  .fl-module-content,
.lbc-sermon__date-module   .fl-module-content,
.lbc-sermon__series-module .fl-heading,
.lbc-sermon__title-module  .fl-heading,
.lbc-sermon__date-module   .fl-heading,
.lbc-sermon__series-module .fl-heading-text,
.lbc-sermon__title-module  .fl-heading-text,
.lbc-sermon__date-module   .fl-heading-text {
  margin: 0;
  padding: 0;
}

/* Force line-height down to near-font-size so the 77px line-height
   from the operator's custom h2 rule doesn't leave empty air above
   and below each line.  1.05 keeps descenders from clipping. */
.lbc-sermon__title-module .fl-heading {
  line-height: 1.05;
}
.lbc-sermon__series-module .fl-heading,
.lbc-sermon__series-module .fl-heading-text,
.lbc-sermon__date-module   .fl-heading,
.lbc-sermon__date-module   .fl-heading-text {
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 1px;
}

/* Player + preacher photo side-by-side on desktop, stacked on mobile. */
.lbc-sermon__main {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1rem;
}
.lbc-sermon__player-wrap {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.lbc-sermon__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 4px;
}

/* Audio player — sits directly under the video. */
.lbc-sermon__audio-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.lbc-sermon__audio-label {
  font-size: 0.85em;
  font-weight: 600;
  color: #000;
}
.lbc-sermon__audio {
  width: 100%;
}

.lbc-sermon__preacher-card {
  flex: 0 0 180px;
  text-align: center;
}
.lbc-sermon__preacher-photo {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
}
.lbc-sermon__preacher-name {
  margin-top: 0.5rem;
  font-size: 0.95em;
  font-weight: 600;
  color: #000;
}

/* Metadata block — no background, just rows of labels + values.
   Text forced to pure black so the default grey <dt>/<dd> on the
   Customify theme reads clearly against the beige page background. */
.lbc-sermon__meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3em 1em;
  margin: 0.5rem 0 1rem;
  font-size: 0.95em;
  color: #000;
}
.lbc-sermon__meta dt {
  font-weight: 700;
  color: #000;
}
.lbc-sermon__meta dd {
  margin: 0;
  color: #000;
}

.lbc-sermon__downloads {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lbc-sermon__download-btn {
  display: inline-block;
  padding: 0.55em 1.1em;
  border: 1px solid #333;
  background: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9em;
  color: #000;
  font-weight: 500;
}
.lbc-sermon__download-btn:hover {
  background: #eef5f1;
  color: #000;
}

.lbc-error {
  padding: 0.75em 1em;
  background: #fff3cd;
  border: 1px solid #e0c85f;
  color: #4a3a00;
  border-radius: 4px;
}
.lbc-hint {
  padding: 0.75em 1em;
  background: #e8f0fe;
  border: 1px solid #bcd2f7;
  color: #1a3357;
  border-radius: 4px;
  font-size: 0.95em;
}

/* ---- sections (headers for each shortcode block) ---- */
.lbc-section {
  max-width: 1200px;
  margin: 1.5rem auto;
  font-family: inherit;
  color: #000;
}
.lbc-section__title {
  margin: 0 0 0.75rem 0;
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #000;
}

/* ---- horizontal scroller (carousels) ---- */
.lbc-scroller {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding: 0.25rem 0.1rem 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.lbc-scroller > * {
  flex: 0 0 220px;
  scroll-snap-align: start;
}

/* ---- grid (browse all) ---- */
.lbc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
}

/* ---- sermon card ---- */
.lbc-card {
  display: block;
  text-decoration: none;
  color: #000;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.lbc-card:hover, .lbc-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  color: #000;
}
.lbc-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #222;
  background-size: cover;
  background-position: center;
}
.lbc-card__body {
  padding: 0.55rem 0.7rem 0.75rem;
}
.lbc-card__title {
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.3em 0;
  /* clamp to 2 lines so cards stay uniform */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #000;
}
.lbc-card__meta {
  font-size: 0.8em;
  color: #000;
  line-height: 1.35;
}

/* ---- series card ---- */
.lbc-series-card {
  display: block;
  text-decoration: none;
  color: #000;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.lbc-series-card:hover, .lbc-series-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  color: #000;
}
.lbc-series-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #222;
  background-size: cover;
  background-position: center;
}
.lbc-series-card__title {
  font-weight: 600;
  padding: 0.5rem 0.7rem 0.1rem;
  color: #000;
}
.lbc-series-card__meta {
  padding: 0 0.7rem 0.6rem;
  font-size: 0.8em;
  color: #000;
}

/* ---- search form + results ---- */
.lbc-search {
  max-width: 1200px;
  margin: 1.5rem auto;
  font-family: inherit;
  color: #000;
}
.lbc-search__form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem;
  background: #f6f6f6;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.lbc-search__row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.lbc-search__row--text .lbc-search__input {
  flex: 1 1 280px;
  min-width: 0;
}
.lbc-search__input {
  padding: 0.55em 0.8em;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 1em;
  color: #000;
  background: #fff;
}
.lbc-search__submit {
  padding: 0.55em 1.2em;
  border: 1px solid #333;
  background: #fff;
  color: #000;
  border-radius: 4px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
}
.lbc-search__submit:hover {
  background: #eef5f1;
}
.lbc-search__clear {
  align-self: center;
  padding: 0.45em 0.8em;
  font-size: 0.85em;
  color: #555;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 4px;
}
.lbc-search__clear:hover {
  color: #000;
  border-color: #bbb;
  background: #fff;
}
.lbc-search__row--filters {
  gap: 0.75rem;
}
.lbc-search__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8em;
  color: #333;
  flex: 1 1 150px;
  min-width: 0;
}
.lbc-search__field > span {
  font-weight: 600;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.78em;
}
.lbc-search__field select,
.lbc-search__field input[type="date"] {
  padding: 0.45em 0.55em;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #000;
  font-size: 0.95em;
  font-family: inherit;
  min-height: 2.1em;
}
.lbc-search__count {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.9em;
  color: #000;
}
.lbc-search__results {
  min-height: 120px;
  transition: opacity 150ms ease;
}
.lbc-search__results--loading {
  opacity: 0.5;
}

/* ---- watch page back button ---- */
.lbc-sermon__nav {
  margin: 1.5rem 0 0.5rem;
  display: flex;
  justify-content: center;
}
.lbc-sermon__back-btn {
  display: inline-block;
  padding: 0.55em 1.1em;
  border: 1px solid #333;
  background: #fff;
  color: #000;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 500;
}
.lbc-sermon__back-btn:hover, .lbc-sermon__back-btn:focus {
  background: #eef5f1;
  color: #000;
}

/* ---- series detail page (header + sermon list) ---- */
.lbc-series-detail {
  max-width: 1200px;
  margin: 1.5rem auto;
  font-family: inherit;
  color: #000;
}
.lbc-series-detail__header {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.lbc-series-detail__img {
  flex: 0 0 320px;
  width: 320px;
  aspect-ratio: 16 / 9;
  background-color: #222;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
}
.lbc-series-detail__meta {
  flex: 1 1 auto;
  min-width: 0;
}
.lbc-series-detail__title {
  margin: 0 0 0.25em 0;
  color: #840000;
  font-size: 2em;
}
.lbc-series-detail__count {
  margin: 0;
  color: #000;
  font-size: 0.95em;
}
@media (max-width: 640px) {
  .lbc-series-detail__img {
    flex: 0 0 100%;
    width: 100%;
  }
  .lbc-series-detail__title {
    font-size: 1.4em;
  }
}

/* ---- pagination ---- */
.lbc-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 1.2rem auto;
  font-size: 0.95em;
}
.lbc-pagination__num,
.lbc-pagination__btn {
  display: inline-block;
  padding: 0.35em 0.7em;
  min-width: 2em;
  text-align: center;
  border: 1px solid #bbb;
  background: #fff;
  color: #000;
  border-radius: 4px;
  text-decoration: none;
}
.lbc-pagination__num:hover,
.lbc-pagination__btn:hover {
  background: #eef5f1;
  color: #000;
}
.lbc-pagination__num--current {
  background: #840000;
  color: #fff;
  border-color: #840000;
  font-weight: 700;
}
.lbc-pagination__gap {
  padding: 0 0.25em;
  color: #555;
}

/* ---- series-detail inline player + card area ---- */
.lbc-series-detail__player {
  margin-bottom: 1.5rem;
  /* scroll-margin so anchor (#lbc-series-player) lands with a little
     breathing room below the site header instead of glued to the top */
  scroll-margin-top: 1rem;
}

/* ---- series default image (layered background fallback) ---- */
.lbc-series-card__img,
.lbc-series-detail__img {
  /* When the series-specific image 404s, browsers treat it as
     transparent and the SECOND (default) background shows through.
     See `public/img/series-default.svg` and _render_series_strip(). */
  background-color: #2a0a0a;
}

/* Mobile: stack the preacher photo below the video. */
@media (max-width: 640px) {
  .lbc-sermon__preacher-card {
    flex: 1 1 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  .lbc-sermon__preacher-photo {
    width: 72px;
    max-width: 72px;
  }
  .lbc-sermon__preacher-name {
    margin-top: 0;
  }
}
