/* ============================================================
   BFGI — "Latest Updates" section
   Red banner header strip over white content area.
   - Red banner holds eyebrow + title + arrows + "View all"
     (dark overlay bleeds are invisible against brand red)
   - White area below holds image-top cards
   ============================================================ */

:root {
  --bfgi-red:    #e31e24;
  --bfgi-red-d:  #b4151a;
  --bfgi-red-x:  #8f1115;
  --bfgi-ink:    #0b1220;
  --bfgi-ink-2:  #334155;
  --bfgi-muted:  #64748b;
  --bfgi-line:   #e5e8ee;
  --bfgi-bg:     #f6f8fb;
  --bfgi-card:   #ffffff;
  --bfgi-shadow:   0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --bfgi-shadow-h: 0 2px 4px rgba(15,23,42,.06), 0 18px 36px rgba(15,23,42,.12);
}

.bfgi-updates,
.bfgi-updates * { box-sizing: border-box; }

/* ======== Section container (no background, no padding) ======== */
/* z-index: 1 is intentionally LOW so site-wide floating pop-ups like
   .hs-bar (z-index: 10 in footer.php) and the chatbot can appear ABOVE
   this section. We don't need to beat the hero overlay here because the
   red banner visually masks any bleed. */
.bfgi-updates {
  position: relative;
  z-index: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--bfgi-ink);
}

/* ======== RED BANNER (header strip) ======== */
.bfgi-updates__banner {
  position: relative;
  z-index: 2;
  background:
    linear-gradient(90deg, var(--bfgi-red-x) 0%, var(--bfgi-red) 40%, var(--bfgi-red) 100%);
  color: #ffffff;
  overflow: hidden;
}
/* Subtle diagonal shimmer in the banner background for a bit of life */
.bfgi-updates__banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.03) 0 20px,
      rgba(255,255,255,0.00) 20px 40px);
  pointer-events: none;
  z-index: 0;
}

.bfgi-updates__banner-inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Title — editorial: short vertical white accent bar + heading.
   Replaces the AI-template "capsule + glowing dot" eyebrow pattern. */
.bfgi-updates__title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #ffffff;
  flex: 1 1 auto;
  min-width: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.bfgi-updates__title-accent {
  display: inline-block;
  width: 4px;
  height: 28px;
  background: #ffffff;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Actions on the right side of banner */
.bfgi-updates__actions {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.bfgi-updates__nav {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: 999px;
  padding: 3px;
}
.bfgi-updates__arrow {
  appearance: none;
  width: 34px; height: 34px;
  border: 0; background: transparent;
  color: #ffffff;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.bfgi-updates__arrow:hover,
.bfgi-updates__arrow:focus-visible {
  background: #ffffff;
  color: var(--bfgi-red);
  outline: none;
}
.bfgi-updates__arrow:active { transform: scale(0.94); }
.bfgi-updates__arrow svg { display: block; }
.bfgi-updates__nav-divider {
  width: 1px; height: 18px;
  background: rgba(255,255,255,0.3);
  display: inline-block;
}

.bfgi-updates__all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  padding: 8px 2px;
  position: relative;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.bfgi-updates__all::after {
  content: "";
  position: absolute;
  left: 2px; right: 22px; bottom: 4px;
  height: 2px;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s ease;
}
.bfgi-updates__all:hover { color: #ffffff; text-decoration: none; }
.bfgi-updates__all:hover::after { transform: scaleX(1); }
.bfgi-updates__all svg { transition: transform .2s ease; }
.bfgi-updates__all:hover svg { transform: translateX(3px); }

/* ======== WHITE content area (cards) ======== */
.bfgi-updates__content {
  position: relative;
  z-index: 1;
  background: var(--bfgi-bg);
  padding: 40px 0 56px;
}
.bfgi-updates__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ======== Mosaic grid: 1 featured + 2x2 sub cards ========
   Uses a 4-column grid where the featured card spans the left 2 columns
   and both rows, and the 4 sub cards fill the right 2 columns across
   2 rows. Row heights are equal, so the featured naturally renders at
   roughly 2x the sub-card height — a classic editorial layout. */
.bfgi-updates__mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  min-height: 560px;        /* reserves space so the featured image reads as "big" */
}
.bfgi-updates__card--featured {
  grid-column: 1 / 3;        /* left 2 columns */
  grid-row: 1 / 3;           /* full height (both rows) */
}
.bfgi-updates__card--sub:nth-child(2) { grid-column: 3 / 4; grid-row: 1; }
.bfgi-updates__card--sub:nth-child(3) { grid-column: 4 / 5; grid-row: 1; }
.bfgi-updates__card--sub:nth-child(4) { grid-column: 3 / 4; grid-row: 2; }
.bfgi-updates__card--sub:nth-child(5) { grid-column: 4 / 5; grid-row: 2; }

/* Graceful fallback: when fewer than 5 items exist, let items flow. */
.bfgi-updates__mosaic--n1 { grid-template-columns: 1fr; grid-template-rows: auto; min-height: 0; }
.bfgi-updates__mosaic--n1 .bfgi-updates__card--featured { grid-column: 1; grid-row: 1; }
.bfgi-updates__mosaic--n2 { grid-template-rows: auto; min-height: 0; }
.bfgi-updates__mosaic--n2 .bfgi-updates__card--featured { grid-row: 1; }
.bfgi-updates__mosaic--n2 .bfgi-updates__card--sub:nth-child(2) { grid-column: 3 / 5; }
.bfgi-updates__mosaic--n3 .bfgi-updates__card--sub:nth-child(3) { grid-row: 2; grid-column: 3 / 5; }

/* With arrows gone (no scroll), hide the banner nav controls.
   "View all" still takes users to the full archive. */
.bfgi-updates__nav { display: none !important; }

.bfgi-updates__card {
  display: flex;
  flex-direction: column;
  background: var(--bfgi-card);
  border: 1px solid var(--bfgi-line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--bfgi-shadow);
  transition: transform .22s cubic-bezier(.2,.8,.2,1),
              box-shadow .22s cubic-bezier(.2,.8,.2,1),
              border-color .22s;
  min-width: 0;              /* grid cells need this so text can ellipsize */
}
.bfgi-updates__card:hover,
.bfgi-updates__card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--bfgi-shadow-h);
  border-color: transparent;
  text-decoration: none;
  outline: none;
}

.bfgi-updates__media {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #e9eef5;
  overflow: hidden;
}
/* Featured card: image fills the available height instead of being
   limited to a fixed aspect-ratio — the body sits at the bottom. */
.bfgi-updates__card--featured {
  position: relative;
}
.bfgi-updates__card--featured .bfgi-updates__media {
  flex: 1 1 auto;
  aspect-ratio: auto;
  min-height: 0;
}
/* Sub cards: shorter image so title + read-more fit in the small cell */
.bfgi-updates__card--sub .bfgi-updates__media {
  aspect-ratio: 16 / 9;
}
.bfgi-updates__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.bfgi-updates__card:hover .bfgi-updates__media img { transform: scale(1.05); }
.bfgi-updates__media-ph {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #e9eef5 0%, #f3f6fb 100%);
}

.bfgi-updates__date {
  position: absolute;
  top: 12px; right: 12px;
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 6px 10px 7px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(15,23,42,.08);
  line-height: 1;
  min-width: 44px;
}
.bfgi-updates__date .d {
  font-size: 15px; font-weight: 800; color: var(--bfgi-ink);
  letter-spacing: -0.02em;
}
.bfgi-updates__date .m {
  font-size: 10px; font-weight: 700; color: var(--bfgi-red);
  margin-top: 2px; text-transform: uppercase; letter-spacing: 0.1em;
}

.bfgi-updates__body {
  padding: 18px 20px 20px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 0 0 auto;
}
/* Featured body stretches so the "Read more" pins to the bottom of the
   tall left column. */
.bfgi-updates__card--featured .bfgi-updates__body {
  padding: 24px 26px 26px;
  gap: 12px;
}
/* Sub cards: tighter padding so the small cell doesn't look empty */
.bfgi-updates__card--sub .bfgi-updates__body {
  padding: 14px 16px 16px;
  gap: 8px;
}
.bfgi-updates__card-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--bfgi-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Featured title: larger, up to 3 lines */
.bfgi-updates__card--featured .bfgi-updates__card-title {
  font-size: clamp(20px, 1.6vw, 26px);
  -webkit-line-clamp: 3;
  line-height: 1.22;
}
/* Sub card title: compact, 2 lines */
.bfgi-updates__card--sub .bfgi-updates__card-title {
  font-size: 14px;
  -webkit-line-clamp: 2;
  line-height: 1.3;
}
.bfgi-updates__card:hover .bfgi-updates__card-title { color: var(--bfgi-red); }

.bfgi-updates__card-summary {
  margin: 0;
  font-size: 13.5px;
  color: var(--bfgi-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bfgi-updates__read {
  margin-top: auto;
  padding-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bfgi-red);
}
.bfgi-updates__read svg { transition: transform .2s ease; }
.bfgi-updates__card:hover .bfgi-updates__read svg { transform: translateX(4px); }

/* ======== Breakpoints ======== */
/* Tablet: shrink the whole grid a bit and reduce min-height */
@media (max-width: 1199px) and (min-width: 900px) {
  .bfgi-updates__mosaic { min-height: 480px; gap: 16px; }
  .bfgi-updates__card--featured .bfgi-updates__card-title { font-size: 20px; }
}

/* Medium screens: featured on top (full width), 4 subs in 2x2 below */
@media (max-width: 899px) and (min-width: 600px) {
  .bfgi-updates__content { padding: 32px 0 48px; }
  .bfgi-updates__mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    min-height: 0;
    gap: 16px;
  }
  .bfgi-updates__card--featured { grid-column: 1 / 3; grid-row: 1; }
  .bfgi-updates__card--featured .bfgi-updates__media { aspect-ratio: 16 / 9; }
  .bfgi-updates__card--sub:nth-child(2) { grid-column: 1; grid-row: 2; }
  .bfgi-updates__card--sub:nth-child(3) { grid-column: 2; grid-row: 2; }
  .bfgi-updates__card--sub:nth-child(4) { grid-column: 1; grid-row: 3; }
  .bfgi-updates__card--sub:nth-child(5) { grid-column: 2; grid-row: 3; }
}

/* Mobile: single column, featured first, subs stacked below */
@media (max-width: 599px) {
  /* Compact single-row banner on mobile. */
  .bfgi-updates__banner-inner {
    padding: 14px 16px;
    gap: 12px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .bfgi-updates__title {
    font-size: 18px;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .bfgi-updates__title-accent { width: 3px; height: 22px; }
  .bfgi-updates__actions      { gap: 0; flex-shrink: 0; }
  .bfgi-updates__all          { font-size: 12.5px; padding: 6px 2px; }

  .bfgi-updates__content { padding: 20px 0 28px; }
  .bfgi-updates__inner   { padding: 0 14px; }

  /* Collapse the mosaic to a single column, 2 sub cards per row. */
  .bfgi-updates__mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    min-height: 0;
    gap: 12px;
  }
  .bfgi-updates__card--featured { grid-column: 1 / 3; grid-row: 1; }
  .bfgi-updates__card--featured .bfgi-updates__media { aspect-ratio: 16 / 10; }
  .bfgi-updates__card--sub:nth-child(2) { grid-column: 1; grid-row: 2; }
  .bfgi-updates__card--sub:nth-child(3) { grid-column: 2; grid-row: 2; }
  .bfgi-updates__card--sub:nth-child(4) { grid-column: 1; grid-row: 3; }
  .bfgi-updates__card--sub:nth-child(5) { grid-column: 2; grid-row: 3; }

  .bfgi-updates__card    { border-radius: 12px; }
  .bfgi-updates__card-title   { font-size: 15px; }
  .bfgi-updates__card--featured .bfgi-updates__card-title { font-size: 17px; }
  .bfgi-updates__card--sub .bfgi-updates__card-title { font-size: 12.5px; }
  .bfgi-updates__card--sub .bfgi-updates__body { padding: 10px 12px 12px; gap: 6px; }
  .bfgi-updates__card-summary { -webkit-line-clamp: 2; font-size: 13px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bfgi-updates__eyebrow-dot             { animation: none; }
  .bfgi-updates__card                    { transition: box-shadow .1s, border-color .1s; }
  .bfgi-updates__card:hover              { transform: none; }
  .bfgi-updates__media img               { transition: none; }
  .bfgi-updates__card:hover .bfgi-updates__media img { transform: none; }
  .bfgi-updates__track                   { scroll-behavior: auto; }
  .bfgi-updates__all svg,
  .bfgi-updates__read svg                { transition: none; }
}
