@layer base, layout, components, utilities, pages;

@layer layout {
  main.site-main {
    padding: 0;
  }

  .container {
    width: min(var(--content-max), 100%);
    margin: 0 auto;
    padding-inline: var(--gutter);
  }

  .container--narrow {
    max-width: clamp(960px, 88vw, 1240px);
  }

  .container--wide {
    max-width: min(var(--hero-max), 100%);
  }

  .site-main > .container {
    width: 100%;
    max-width: min(var(--content-max), 100%);
    margin-inline: auto;
    padding-inline: var(--content-gutter);
  }

  .section {
    position: relative;
    display: grid;
    gap: clamp(18px, 3vw, 28px);
  }

  .section--compact {
    gap: clamp(14px, 2.6vw, 24px);
  }

  .section--related {
    margin-top: clamp(48px, 8vw, 120px);
  }

  @media (max-width: 1024px) {
    .section--related {
      margin-top: clamp(36px, 10vw, 80px);
    }
  }

  @media (max-width: 680px) {
    .section--related {
      margin-top: clamp(28px, 12vw, 60px);
    }
  }

  .section > * {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  /* Carousel elements - exclude from section width rules */
  .front-section .frontCards {
    width: max-content;
  }

  .front-section .frontCards__item {
    width: auto;
  }

  .site-main > .container > .section {
    z-index: 0;
  }

  .site-main > .container > .section::after {
    content: '';
    position: absolute;
    inset: 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: inherit;
    background-color: inherit;
    background-image: inherit;
    background-repeat: inherit;
    background-size: inherit;
    background-position: inherit;
    background-origin: inherit;
    background-clip: inherit;
    background-attachment: inherit;
    z-index: -1;
    pointer-events: none;
  }

  .site-main > .container > .front-section::after,
  .site-main > .container > .section.section--no-bleed::after {
    content: none;
  }

  .site-main > .container > .section > * {
    position: relative;
    z-index: 1;
  }

  .site-main > .container > .hero {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  @media (max-width: 1024px) {
    .site-main > .container {
      padding-inline: clamp(16px, 5vw, 28px);
    }

    .hero.hero--front {
      width: 100vw;
      margin-left: calc(50% - 50vw);
      margin-right: calc(50% - 50vw);
    }
  }
}
