/* ==========================================================================
   Layout — Containers, Grids, Section Backgrounds, Hero
   ========================================================================== */

/* ── Containers ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

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

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

/* ── Sections ── */
.section {
  padding-block: var(--space-section);
}

.section--white {
  background-color: var(--color-white);
}

.section--light {
  background-color: var(--color-bg-light);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--dark {
  background-color: var(--color-dark);
  color: rgba(255, 255, 255, 0.8);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-white);
}

/* ── Full-Bleed Photo Section ── */
.section--photo {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: rgba(255, 255, 255, 0.9);
}

.section--photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(17, 21, 24, 0.7);
  z-index: 1;
}

.section--photo > * {
  position: relative;
  z-index: 2;
}

.section--photo h1,
.section--photo h2,
.section--photo h3 {
  color: var(--color-white);
}

/* ── Grids ── */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid--5 {
  grid-template-columns: repeat(5, 1fr);
}

/* ── Two-Column Layout ── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.split--reverse {
  direction: rtl;
}

.split--reverse > * {
  direction: ltr;
}

/* ── Hero — Photo Background ── */
.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--color-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: calc(var(--header-height) + var(--space-4xl)) 0 var(--space-4xl);
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(100%);
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(17, 21, 24, 0.88) 0%,
    rgba(17, 21, 24, 0.65) 50%,
    rgba(17, 21, 24, 0.75) 100%
  );
}

/* Inner-page hero — shorter than homepage */
.hero--inner {
  min-height: 55vh;
}

/* Orange accent bar on all heroes via pseudo-element */
.hero::after {
  content: '';
  position: absolute;
  right: 0;
  top: 15%;
  bottom: 15%;
  width: 6px;
  background: var(--color-primary);
  z-index: 3;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero h1,
.hero h2,
.hero h3 {
  color: var(--color-white);
}

.hero h1 {
  font-size: var(--fs-display);
}

.hero__content {
  max-width: 720px;
}

.hero__content--center {
  max-width: 800px;
  margin-inline: auto;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }
  .grid--4 {
    grid-template-columns: 1fr;
  }
  .grid--5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .split {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .split--reverse {
    direction: ltr;
  }
  .hero {
    padding: calc(var(--header-height) + var(--space-2xl)) 0 var(--space-2xl);
    min-height: 70vh;
  }
  .hero--inner {
    min-height: 45vh;
  }
}

@media (max-width: 480px) {
  .container {
    padding-inline: var(--space-md);
  }
  .grid--5 {
    grid-template-columns: 1fr;
  }
}
