/* =========================================================================
   Layout: container, sections, grids, discovery rails, stacks
   ========================================================================= */

.container {
  width: 100%;
  max-width: var(--rs-container);
  margin-inline: auto;
  padding-inline: var(--rs-gutter);
}

.container--narrow {
  max-width: var(--rs-container-narrow);
}

.container--wide {
  max-width: 1600px;
}

.section {
  padding-block: var(--rs-section-y);
  position: relative;
}

.section--tight {
  padding-block: calc(var(--rs-section-y) * 0.55);
}

/* A page header already carries its own breathing room. */
.page-header + .section {
  padding-top: calc(var(--rs-section-y) * 0.55);
}

/* One ground, three lifts. On a dark page a "subtle" section is a step *up*
   in lightness, not down. */
.section--subtle {
  background: var(--rs-surface);
}

.section--muted {
  background: var(--rs-surface-1);
}

.section--dark {
  background: var(--rs-navy-deep);
}

/* A wash of accent behind a section, used where a band has to feel like an
   event rather than another row of cards. */
.section--glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--rs-glow-blue), var(--rs-glow-lime);
  pointer-events: none;
}

.section--glow > * {
  position: relative;
}

.section--dark a {
  color: var(--rs-blue-bright);
}

.section--dark .section__lead,
.section--dark .text-muted {
  color: var(--rs-text-muted);
}

/* ---------------------------------------------------------- section header */

.section__header {
  max-width: 52rem;
  margin-bottom: var(--rs-space-6);
}

.section__header--center {
  margin-inline: auto;
  text-align: center;
}

/* Title left, action right — the discovery-row header. */
.section__header--row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--rs-space-4);
}

.section__header--row .section__lead {
  max-width: 44rem;
}

.section__header--row > div {
  min-width: 0;
}

.section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--rs-font-display);
  font-size: var(--rs-text-sm);
  font-weight: var(--rs-weight-bold);
  letter-spacing: var(--rs-tracking-wider);
  text-transform: uppercase;
  color: var(--rs-lime);
  margin-bottom: var(--rs-space-2);
}

.section__eyebrow::before {
  content: '';
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  flex-shrink: 0;
}

.section__header--center .section__eyebrow {
  justify-content: center;
}

.section--dark .section__eyebrow {
  color: var(--rs-lime);
}

.section__lead {
  font-size: var(--rs-text-lg);
  color: var(--rs-text-muted);
  margin-top: var(--rs-space-4);
  max-width: 46rem;
}

.section__header--center .section__lead {
  margin-inline: auto;
}

.section__footer {
  margin-top: var(--rs-space-7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--rs-space-4);
}

.section__footer--center {
  justify-content: center;
}

/* ------------------------------------------------------------------ grids */

.grid {
  display: grid;
  gap: var(--rs-space-5);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.grid--split {
  grid-template-columns: 1fr;
  gap: var(--rs-space-8);
  align-items: center;
}

@media (min-width: 60rem) {
  .grid--split {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .grid--sidebar {
    grid-template-columns: minmax(0, 1fr) 21rem;
    align-items: start;
    gap: var(--rs-space-8);
  }
}

/* ----------------------------------------------------------- discovery rail */
/*
 * A horizontally scrolling row of cards with snap points, arrows on desktop
 * and a swipe on touch. The rail bleeds into the page gutter so a card can be
 * cut off at the edge — that half-card is the affordance that says "there is
 * more this way".
 */

.rail {
  position: relative;
}

.rail__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--rail-card, 20rem);
  gap: var(--rs-space-5);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--rs-gutter);
  padding-inline: var(--rs-gutter);
  margin-inline: calc(var(--rs-gutter) * -1);
  padding-block: 0.25rem 1rem;
  scrollbar-width: none;
}

.rail__track::-webkit-scrollbar {
  display: none;
}

.rail__track > * {
  scroll-snap-align: start;
  min-width: 0;
}

/* Two rows deep, continuing across — the video wall. */
.rail__track--rows {
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
}

.rail__controls {
  display: none;
  gap: var(--rs-space-2);
}

.rail__button {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--rs-border-strong);
  background: var(--rs-surface-2);
  color: #fff;
  transition:
    background-color var(--rs-duration-fast) var(--rs-ease),
    border-color var(--rs-duration-fast) var(--rs-ease),
    opacity var(--rs-duration-fast) var(--rs-ease);
}

.rail__button:hover {
  background: var(--rs-lime);
  border-color: var(--rs-lime);
  color: #05070c;
}

.rail__button[disabled] {
  opacity: 0.3;
  cursor: default;
}

.rail__button[disabled]:hover {
  background: var(--rs-surface-2);
  border-color: var(--rs-border-strong);
  color: #fff;
}

@media (hover: hover) and (min-width: 62rem) {
  .rail__controls {
    display: flex;
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--rs-space-4);
}

.stack--lg {
  gap: var(--rs-space-6);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rs-space-3);
  align-items: center;
}

.cluster--between {
  justify-content: space-between;
}

/* --------------------------------------------------------------- utilities */

.text-center {
  text-align: center;
}
.text-muted {
  color: var(--rs-text-muted);
}
.text-sm {
  font-size: var(--rs-text-sm);
}
.text-lg {
  font-size: var(--rs-text-lg);
}
.mt-0 {
  margin-top: 0;
}
.mt-4 {
  margin-top: var(--rs-space-4);
}
.mt-6 {
  margin-top: var(--rs-space-6);
}
.mb-6 {
  margin-bottom: var(--rs-space-6);
}
.full-width {
  width: 100%;
}
.hidden {
  display: none !important;
}
