/* A light teal at the edges keeps the photographs' own colours visible. The
   quieter, more neutral shade in the centre sits beneath the existing words. */
section.is-final-cta > .img-background-overlay,
.editorial-closing > .editorial-closing-shade,
.private-page .closing-image > .closing-overlay {
  background: linear-gradient(90deg,
    rgb(0 47 50 / 30%),
    rgb(5 28 29 / var(--closing-left-shade, 48%)) 25%,
    rgb(5 28 29 / 55%) 38% 68%,
    rgb(5 28 29 / 45%) 80%,
    rgb(0 47 50 / 16%));
}

.private-page .closing-image {
  --closing-left-shade: 51%;
}

section.is-final-cta[data-home-closer] > .img-background-overlay {
  background: linear-gradient(90deg,
    rgb(0 62 65 / 35%),
    rgb(0 50 53 / 54%) 25%,
    rgb(0 50 53 / 60%) 38% 68%,
    rgb(0 50 53 / 49%) 80%,
    rgb(0 62 65 / 23%));
}

/* The private invitation's small gold line sometimes crosses the bright sky
   between the palms. Feather the shade just behind its letters. */
.private-page .closing-image .closing-content > .eyebrow {
  position: relative;
  isolation: isolate;
}

.private-page .closing-image .closing-content > .eyebrow::before {
  content: "";
  position: absolute;
  inset: -.5em -1.4em;
  z-index: -1;
  pointer-events: none;
  background: rgb(4 23 24 / 72%);
  border-radius: 1.35em;
  filter: blur(.52em);
}

section.is-final-cta > .container {
  min-height: clamp(25rem, 34vw, 36.25rem);
  padding: clamp(4rem, 6vw, 6rem) clamp(1.5rem, 5.2vw, 6rem);
}

section.is-final-cta .col-10 {
  width: 100%;
  padding-inline: 0;
}

section.is-final-cta .text_wrap {
  gap: clamp(1.5rem, 2.45vw, 2.25rem);
}

section.is-final-cta .h2 {
  max-width: min(25ch, 59rem);
  margin: 0 auto;
  font-size: clamp(2.5rem, 4.25vw, 4.5rem);
  line-height: 1.08;
  text-wrap: balance;
}

section.is-final-cta .subheading,
.editorial-closing .editorial-closing-content > p:not(.eyebrow),
.private-page .closing-image .closing-content > p:not(.eyebrow) { font-weight: 300; }

section.is-final-cta .subheading {
  max-width: 40ch;
  margin: 0;
  font-size: clamp(1.4rem, 2.35vw, 2.45rem);
  line-height: 1.35;
  text-wrap: balance;
}

section.is-final-cta .button_wrap {
  padding-top: .375rem;
}

section.is-final-cta .booking-button.color-teal {
  background-color: var(--swatch--almost-white);
  color: var(--swatch--teal);
}

section.is-final-cta .booking-button.color-teal :is(.button-text, .icon-button-arrow) {
  color: inherit;
}

section.is-final-cta .booking-button.color-teal:is(:hover, :focus-visible) {
  background-color: var(--swatch--almost-white);
  color: var(--swatch--teal);
}

section.is-final-cta .button_wrap a:focus-visible {
  outline: 2px solid white;
  outline-offset: 4px;
}

/* When copy can span most of the image width, keep the reading area steady
   and let the photograph open up towards the top and bottom instead. */
@media (max-width: 1263px) {
  section.is-final-cta > .img-background-overlay,
  .editorial-closing > .editorial-closing-shade,
  .private-page .closing-image > .closing-overlay {
    background: linear-gradient(180deg,
      rgb(0 47 50 / 22%),
      rgb(5 28 29 / 51%) 20%,
      rgb(5 28 29 / 61%) 32% 72%,
      rgb(5 28 29 / 46%) 83%,
      rgb(0 47 50 / 22%));
  }
  section.is-final-cta[data-home-closer] > .img-background-overlay {
    background: linear-gradient(180deg,
      rgb(0 62 65 / 28%),
      rgb(0 50 53 / 55%) 20%,
      rgb(0 50 53 / 65%) 32% 72%,
      rgb(0 50 53 / 51%) 83%,
      rgb(0 62 65 / 27%));
  }
}

@media (max-width: 700px) {
  section.is-final-cta > .container {
    min-height: 23.5rem;
    padding-block: 3.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  section.is-final-cta [animate="slide-up"] {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  section.is-final-cta .button_wrap :is(a, .button-text, .icon-button-arrow) {
    transition: none !important;
    transform: none !important;
  }
}

/* Active public pages share one photo invitation across CMS and editorial layouts. */
@media screen {
  body[data-hero-size] :is(section.is-final-cta, section.editorial-closing) {
    --closing-title-gap: clamp(1.25rem, 2.1vw, 1.75rem);
    --closing-action-gap: clamp(1.75rem, 2.7vw, 2.25rem);

    & > :is(.container, .editorial-closing-content) {
      box-sizing: border-box;
      width: 100%;
      max-width: none;
      min-height: clamp(23.5rem, 35vw, 36.25rem);
      padding: clamp(3.75rem, 7vw, 7rem) clamp(1.25rem, 5.2vw, 6rem);
    }

    & .text_wrap, & > .editorial-closing-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0;
      text-align: center;
    }

    & h2 {
      max-width: min(25ch, 59rem);
      margin: 0 auto;
      font: 400 clamp(2.5rem, 4.25vw, 4.5rem)/1.08 'Value Serif', Georgia, serif;
      letter-spacing: -.025em;
      text-wrap: balance;
    }

    & :is(.subheading, .editorial-closing-content > p) {
      max-width: 46ch;
      margin: var(--closing-title-gap) auto 0;
      font: 300 clamp(1.25rem, 1.9vw, 1.5rem)/1.5 Haffer, Arial, sans-serif;
      text-wrap: balance;
    }

    & .subheading:empty { display: none; }

    & :is(.button_wrap, .editorial-actions) {
      display: flex;
      flex-flow: row wrap;
      align-items: center;
      justify-content: center;
      gap: .75rem;
      width: fit-content;
      max-width: 100%;
      margin: var(--closing-action-gap) auto 0;
      padding: 0;
    }

    & :is(.button_wrap, .editorial-actions) > a {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 1rem;
      box-sizing: border-box;
      width: fit-content;
      max-width: 100%;
      min-width: 0;
      min-height: 3.125rem;
      height: auto;
      margin: 0;
      padding: .75rem 1.5rem;
      border: 1px solid var(--swatch--almost-white);
      border-radius: 100px;
      font: 400 1rem/1.2 'Value Serif', Georgia, serif;
      background-color: var(--swatch--almost-white);
      color: var(--swatch--teal);
    }

    & :is(.button_wrap, .editorial-actions) > a.is-outline {
      background-color: transparent;
      color: var(--swatch--almost-white);
    }

    & a > .code-embed:has(> style:only-child) { display: none; }
    & a .button-text { color: inherit; font: inherit; }
    & a .icon-button-arrow { width: 1rem; flex: none; color: inherit; }
    & a:focus-visible { outline: 2px solid white; outline-offset: 4px; }

    @media (max-width: 700px) {
      & :is(.button_wrap, .editorial-actions) > a { gap: .75rem; padding-inline: 1.125rem; }
      & .editorial-actions:has(> a + a) {
        width: min(100%, 20rem);
        flex-direction: column;
        align-items: stretch;
      }
      & .editorial-actions:has(> a + a) > a { width: 100%; }
    }
  }
}
