/**
 * Home page sections.
 *
 * Sizes here are the handoff's 1440px values. Where a value is a bare pixel
 * number it is because the design fixes it (a 110px play button, a 300px life
 * card); where it scales, it clamps to the design value at 1440px.
 */

/* ---------------------------------------------------------------
 * 2 — Welcome
 * ------------------------------------------------------------- */
/* More air than the shared --pad rhythm gives: the statement is the first
 * thing under the hero and the design lets it breathe. */
.sbs-welcome {
  padding-top: var(--sbs-section-y-xl);
  padding-bottom: var(--sbs-section-y-xl);
}

.sbs-welcome .sbs-eyebrow {
  margin-bottom: 56px;
}

.sbs-welcome__link {
  margin-top: 64px;
  color: var(--sbs-white);
}

.sbs-welcome__link:hover {
  color: var(--sbs-gold-light);
}

/* ---------------------------------------------------------------
 * 3 — Alternating rows
 *
 * The row itself is styled in components.css, next to the partial both this
 * page and content template A render. Only the home variant's height is here.
 * ------------------------------------------------------------- */
.sbs-rows--home .sbs-rows__row,
.sbs-rows--home .sbs-rows__media {
  min-height: var(--sbs-row-min-h);
}

/* ---------------------------------------------------------------
 * 4 — Promo band
 * ------------------------------------------------------------- */
.sbs-promo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--sbs-hero-h);
  overflow: hidden;
}

.sbs-promo__media {
  position: absolute;
  inset: 0;
  opacity: 0.72;
}

.sbs-promo__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sbs-promo__heading {
  max-width: 22ch;
  font-size: var(--sbs-h2-xl);
  font-weight: var(--sbs-w-light);
  line-height: var(--sbs-lh-tight);
  color: var(--sbs-white);
}

/* The play button and the arrow buttons are the only circles in the system. */
.sbs-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  margin-top: 56px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  color: var(--sbs-white);
  font-size: 26px;
  /* The glyph's own bearing sits it left of centre. */
  padding-left: 6px;
  transition: background-color var(--sbs-dur) var(--sbs-ease),
    color var(--sbs-dur) var(--sbs-ease),
    border-color var(--sbs-dur) var(--sbs-ease);
}

.sbs-play:hover {
  background: var(--sbs-white);
  border-color: var(--sbs-white);
  color: var(--sbs-ink);
}

/* ---------------------------------------------------------------
 * 5 — Values
 * ------------------------------------------------------------- */
.sbs-values__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 72px;
}

.sbs-values__heading {
  max-width: 34ch;
  font-size: var(--sbs-h2);
  font-weight: var(--sbs-w-medium);
  line-height: var(--sbs-lh-tight);
}

.sbs-values__count {
  flex: 0 0 auto;
  margin: 0;
}

.sbs-values__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 var(--sbs-gap-values);
  list-style: none;
  margin: 0;
  padding: 0;
}

.sbs-values__item {
  padding: 28px 0 32px;
  border-top: 1px solid var(--sbs-grey-200);
}

.sbs-values__number {
  display: block;
  margin-bottom: 14px;
  font-family: var(--sbs-font-mono);
  font-size: 24px;
  color: var(--sbs-gold);
}

.sbs-values__name {
  margin-bottom: 8px;
  font-size: 21px;
  font-weight: var(--sbs-w-regular);
}

.sbs-values__text {
  margin: 0;
  font-size: var(--sbs-body-xs);
  line-height: 1.6;
  color: var(--sbs-grey-600);
}

/* ---------------------------------------------------------------
 * 6 — News carousel
 *
 * The track is a scroll container with snap points, so it is usable before
 * carousel.js runs and on any device without a pointer.
 * ------------------------------------------------------------- */
.sbs-news {
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

.sbs-news__head {
  margin-bottom: 64px;
}

.sbs-news__head .sbs-eyebrow {
  margin-bottom: 24px;
}

.sbs-news__heading {
  font-size: var(--sbs-h2-xl);
  font-weight: var(--sbs-w-medium);
  line-height: var(--sbs-lh-tight);
}

/* Side padding equal to half the leftover width lets the FIRST and LAST
 * slides reach the centre — without it the carousel cannot show slide one
 * centred, and the faded-neighbour effect never appears at either end. */
.sbs-news__track {
  display: flex;
  gap: var(--sbs-gap-news);
  padding: 0 max(var(--sbs-gutter), calc(50% - 450px));
  scroll-padding-inline: var(--sbs-gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  text-align: left;
}

.sbs-news__track::-webkit-scrollbar {
  display: none;
}

.sbs-news__slide {
  position: relative;
  flex: 0 0 900px;
  max-width: 78vw;
  scroll-snap-align: center;
  transition: opacity var(--sbs-dur-slow) var(--sbs-ease);
}

/* Neighbours sit back at half opacity, but only once carousel.js is actually
 * marking the centre slide — it adds `is-centred`. Dimming by default would
 * leave every slide permanently faded if the script never ran. */
.sbs-news.is-centred .sbs-news__slide {
  opacity: 0.5;
}

.sbs-news.is-centred .sbs-news__slide.is-active {
  opacity: 1;
}

.sbs-news__media {
  aspect-ratio: 3 / 2;
}

.sbs-news__media img {
  transition: transform var(--sbs-dur-slow) var(--sbs-ease);
}

.sbs-news__slide:hover .sbs-news__media img {
  transform: scale(1.03);
}

/* The headline sits on the photograph, not under it. */
.sbs-news__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 48px 44px 40px;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, rgba(17, 17, 17, 0.78) 100%);
}

.sbs-news__title {
  max-width: 20ch;
  font-size: clamp(26px, 3.2vw, 46px);
  font-weight: var(--sbs-w-medium);
  line-height: 1.15;
  color: var(--sbs-white);
}

.sbs-news__arrows {
  margin-top: 56px;
}

.sbs-news__actions {
  justify-content: center;
  margin-top: 40px;
  padding: 0 var(--sbs-gutter);
}

/* ---------------------------------------------------------------
 * 7 — Life on campus
 * ------------------------------------------------------------- */
.sbs-life {
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

.sbs-life__head {
  margin-bottom: 64px;
}

.sbs-life__head .sbs-eyebrow {
  margin-bottom: 24px;
}

.sbs-life__heading {
  max-width: 30ch;
  margin-inline: auto;
  font-size: var(--sbs-h2-md);
  font-weight: var(--sbs-w-medium);
  line-height: var(--sbs-lh-tight);
  color: var(--sbs-white);
}

.sbs-life__track {
  display: flex;
  gap: var(--sbs-gap-card);
  /* The track still scrolls off the right edge of the screen — that bleed is
   * the design. Only its START is pulled in to the content column, so the
   * first card lines up under the heading above it. */
  padding: 0 var(--sbs-gutter);
  /* Without this, `scroll-snap-align: start` parks the first card flush
   * against the viewport edge — snapping aligns to the scrollport, which
   * includes the padding, so the page margin is scrolled away. */
  scroll-padding-inline: var(--sbs-gutter);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  text-align: left;
}

.sbs-life__track::-webkit-scrollbar {
  display: none;
}

.sbs-life__card {
  flex: 0 0 300px;
  height: 600px;
  scroll-snap-align: start;
}

.sbs-life__media {
  position: absolute;
  inset: 0;
}

.sbs-life__arrows {
  margin-top: 48px;
}

/* ---------------------------------------------------------------
 * 8 — Apply CTA
 * ------------------------------------------------------------- */
.sbs-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--sbs-hero-h);
  overflow: hidden;
}

.sbs-cta__media {
  position: absolute;
  inset: 0;
  opacity: 0.7;
}

.sbs-cta__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sbs-cta__body .sbs-eyebrow {
  margin-bottom: 28px;
}

.sbs-cta__heading {
  max-width: 22ch;
  font-size: clamp(32px, 5.8vw, 72px);
  font-weight: var(--sbs-w-medium);
  line-height: var(--sbs-lh-tight);
  color: var(--sbs-white);
}

.sbs-cta__text {
  max-width: 52ch;
  margin: 28px 0 40px;
  color: rgba(255, 255, 255, 0.82);
}

/* ---------------------------------------------------------------
 * 9 — Donate
 * ------------------------------------------------------------- */
.sbs-donate__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.sbs-donate__heading {
  margin-bottom: 28px;
  font-size: var(--sbs-h2-sm);
  font-weight: var(--sbs-w-medium);
  line-height: var(--sbs-lh-tight);
}

.sbs-donate__text {
  max-width: 46ch;
  margin-bottom: 40px;
}

.sbs-donate__media {
  height: 520px;
}

/* ---------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .sbs-values__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0 48px;
  }
}

@media (max-width: 900px) {
  .sbs-rows--home .sbs-rows__row,
  .sbs-rows--home .sbs-rows__media {
    min-height: 0;
  }

  .sbs-rows__media {
    aspect-ratio: 4 / 3;
  }

  .sbs-values__head {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 48px;
  }

  .sbs-values__list {
    grid-template-columns: 1fr;
  }

  .sbs-donate__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .sbs-donate__media {
    height: 360px;
  }

  .sbs-news__slide {
    flex-basis: 86vw;
    max-width: 86vw;
  }

  .sbs-news__track {
    padding-inline: var(--sbs-page-x);
  }

  .sbs-news__caption {
    padding: 32px 24px 26px;
  }

  .sbs-promo,
  .sbs-cta {
    height: auto;
    padding: var(--sbs-section-y) 0;
  }

  .sbs-play {
    width: 84px;
    height: 84px;
    margin-top: 40px;
    font-size: 20px;
  }
}

@media (max-width: 560px) {
  .sbs-life__card {
    flex-basis: 74vw;
    height: 460px;
  }
}
