/*
 * FB Stories ("Heaven's Hub") widget.
 * Values taken from the Faith-Be.fig source, frame "stories" (16:139) at 1440px.
 */

.fb-stories {
  --fb-st-bg: #fbf7f1;
  --fb-st-accent: #ed184b;
  --fb-st-scrim: 60%;

  --fb-st-content: 1238px;
  --fb-st-col-a: 666fr;
  --fb-st-col-b: 531fr;

  background: var(--fb-st-bg);
  padding: 0;
  font-family: "Jost", sans-serif;
}

.fb-stories *,
.fb-stories *::before,
.fb-stories *::after { box-sizing: border-box; }

/* ---------- bento grid ---------- */
.fb-stories__grid {
  display: grid;
  grid-template-columns: var(--fb-st-col-a) var(--fb-st-col-b);
  grid-auto-rows: 250px;
  gap: 48px 41px;
  /* No side padding — the Elementor container that wraps this widget supplies
     the page gutter, so max-width is the grid's own 1238px from the design. */
  max-width: var(--fb-st-content);
  margin: 0 auto;
  padding: 0;
}

/* The first story is the tall featured card. */
.fb-stories__card:first-child {
  grid-row: span 2;
  padding: 50px 50px 44px;
}

.fb-stories__card:first-child .fb-stories__badge { top: 30px; right: 28px; }
.fb-stories__card:first-child .fb-stories__icon { width: 36px; height: 36px; }

.fb-stories__card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 5px;
  padding: 25px 25px 26px;
  background-color: #2a2226;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  text-decoration: none;
  color: #fff;
  isolation: isolate;
}

/* Scrim: transparent at the top, dark at the bottom, so the quote stays legible. */
.fb-stories__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), linear-gradient(180deg, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0.6) 90.6%);
}

/* Every card but the featured one also carries a flat 20% wash. */
.fb-stories__card:not(:first-child)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /*background: rgba(0, 0, 0, .2);*/
}

.fb-stories__badge {
  position: absolute;
  top: 25px;
  right: 25px;
  display: inline-flex;
  color: #fff;
  filter: drop-shadow(1px 1px 8px rgba(0, 0, 0, 0.65));
}

.fb-stories__icon {
  width: 30px;
  height: 30px;
  display: block;
}

.fb-stories__body {
  display: block;
  max-width: 500px;
}

.fb-stories__quote {
  display: block;
  font-family: "Inria Serif", serif;
  font-style: italic;
  font-size: 24px;
  font-weight: 400;
  line-height: 34px;
  letter-spacing: .01em;
  color: #fff;
}

.fb-stories__by {
  display: block;
  margin-top: 12px;
  font-family: "Jost", sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: .01em;
  color: #fff;
}

.fb-stories__card:focus-visible {
  outline: 2px solid var(--fb-st-accent);
  outline-offset: 3px;
}

/* ---------- responsive ---------- */
@media (max-width: 1099px) {
  .fb-stories__grid { grid-auto-rows: 230px; gap: 32px 28px; }
  .fb-stories__quote { font-size: 21px; line-height: 30px; }
  .fb-stories__card:first-child { padding: 32px 32px 30px; }
}

@media (max-width: 767px) {
  .fb-stories__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 230px;
    gap: 20px;
  }
  .fb-stories__card:first-child {
    grid-row: auto;
    padding: 28px 24px 26px;
  }
  .fb-stories__quote { font-size: 20px; line-height: 29px; }
}

/* ---------- video lightbox ---------- */
.fb-stories__lightbox {
  width: min(1100px, 92vw);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  overflow: visible;
  color: #fff;
}

.fb-stories__lightbox::backdrop {
  background: rgba(0, 0, 0, .8);
}

.fb-stories__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

/* Whatever the provider hands back — <video>, <iframe> — fills the stage. */
.fb-stories__stage > :first-child,
.fb-stories__stage iframe,
.fb-stories__stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.fb-stories__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.fb-stories__close:hover,
.fb-stories__close:focus-visible { color: var(--fb-st-accent); }

@media (max-width: 575px) {
  .fb-stories__close { top: -40px; }
}
