/* ============================================
   LAYOUTS — Section types & grid utilities
   Shared across all pages.
   ============================================ */

/* --------------------------------------------
   GRID UTILITIES
   Standard column layouts with consistent gap.
   -------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.grid-2--narrow {
  max-width: 900px;
  margin: 0 auto;
}

.grid-2--wide {
  gap: 80px;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .grid-2--wide {
    grid-template-columns: 1fr;
    gap: 48px;
  }

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

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------
   SECTION HEADING COLOURS
   Applied via class on the h2 in HTML.
   -------------------------------------------- */
.section-heading-coral {
  color: var(--color-coral);
}

.section-heading-dark {
  color: var(--color-text-dark);
}

.section-heading-peppermint {
  color: var(--color-peppermint);
}

/* --------------------------------------------
   SECTION SUBTITLE — centred intro text
   -------------------------------------------- */
.section-subtitle {
  color: var(--color-text-muted);
  max-width: 580px;
  margin: 0 auto 50px;
  line-height: 1.7;
}

.section-white .section-subtitle,
.section-coral .section-subtitle {
  color: var(--color-text-dark-muted);
}

/* --------------------------------------------
   BODY TEXT COLOUR — by section background
   Dark sections: light text.
   Light/coral sections: muted dark text.
   -------------------------------------------- */
.section-dark .section-split__content > p {
  color: var(--color-text-light);
}

.section-white .section-split__content > p {
  color: var(--color-text-dark-muted);
}

/* Section-level body text */
.section-split__content > p,
.section-centered > .container > p,
.section-split__content .tagline {
  font-size: var(--fs-body);
  line-height: 1.7;
}

/* --------------------------------------------
   TAGLINE — bold coral accent line
   -------------------------------------------- */
.section-split__content > p.tagline,
.section-centered > .container > p.tagline {
  font-weight: 700;
  color: var(--color-coral);
  margin-top: 16px;
  margin-bottom: 20px;
}

/* ============================================
   SECTION LAYOUT TYPES
   ============================================ */

/* --------------------------------------------
   CENTRED SECTIONS
   Heading + content centred, optional grid below.
   + section-bg-cover for full-bleed background image.
   -------------------------------------------- */
.section-centered {
  padding: var(--section-padding);
  text-align: center;
}

/* Background cover — full-bleed image behind content.
   Pair with section-centered. Image URL + fallback
   colour set inline per section. */
.section-bg-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Background fade — semi-transparent colour wash over
   a bg-cover image. Inherits the section's own
   background-color so the overlay tint matches
   automatically (e.g. section-coral → coral wash). */
.section-bg-fade {
  position: relative;
}

.section-bg-fade::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: inherit;
  opacity: 0.5;
  z-index: 0;
}

.section-bg-fade > .container {
  position: relative;
  z-index: 1;
}

/* Diagonal accent — subtle triangle in bottom-right corner.
   Colour set via --accent-color inline. */
.section-bg-accent {
  background-image: linear-gradient(
    to bottom right,
    transparent 60%,
    var(--accent-color, rgba(233, 106, 94, 0.12)) 60%
  );
}

/* --------------------------------------------
   SPLIT SECTIONS
   Text one side, full-bleed image the other.
   Image pinned to outer edge, top-to-bottom,
   object-fit: cover (natural crop, never distorted).

   Modifiers:
     --reverse  → image on left instead of right
   -------------------------------------------- */

/* Section wrapper */
.section-split {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 580px;
  padding: 80px 0;
}

.section-split--compact {
  min-height: auto;
}

/* Layout wrapper — contains the text, provides container padding */
.section-split__layout {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 max(24px, calc((100vw - 1200px) / 2 + 24px));
}

/* Content — the text column */
.section-split__content {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-split__content > p {
  max-width: 480px;
  margin-bottom: 16px;
}

.section-split__content > p:last-of-type {
  margin-bottom: 31px;
}

.section-split__content > .btn {
  align-self: flex-start;
}

/* Image — fills section height, width scales naturally
   from aspect ratio (never distorted, never scaled up).
   Centre of image pinned to 65% of section width
   (25% for reverse). As window narrows, image slides
   with that anchor point — excess cropped by overflow. */
.section-split__image {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.section-split__image img {
  position: absolute;
  height: 100%;
  width: auto;
  max-width: none;
  top: 0;
  left: 65%;
  transform: translateX(-50%);
  display: block;
}

/* Reverse — image centred at 25% */
.section-split--reverse .section-split__image img {
  left: 25%;
}

.section-split--reverse .section-split__content {
  margin-left: auto;
}

/* --------------------------------------------
   SPLIT — responsive
   Image stays behind text, never stacks.
   Opacity handled by the shared opacity rules above.
   -------------------------------------------- */
@media (max-width: 768px) {
  .section-split {
    min-height: auto;
  }

  .section-split__layout {
    padding: 48px 24px;
  }

  .section-split__content {
    max-width: 100%;
  }
}

/* --------------------------------------------
   SPLIT — image opacity on narrower viewports
   Image overlaps text as the window narrows.
   -------------------------------------------- */
@media (max-width: 1024px) {
  .section-split > .section-split__image {
    opacity: 0.4;
  }
}

@media (max-width: 768px) {
  .section-split > .section-split__image {
    opacity: 0.25;
  }
}

/* --------------------------------------------
   HERO — shared hero overrides
   Used by any page with a .hero section-split.
   -------------------------------------------- */
.hero {
  min-height: 720px;
}

.hero p strong {
  color: white;
  font-weight: 700;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }
}
