/* ============================================================
   External Link Interstitial
   Hand-authored (not a build output) — mirrors inc/mega-menu/.
   Tokens come from assets/css/theme-tokens.css; nothing redefined here.
   ============================================================ */

.gs-interstitial {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Extra top padding reserves room for the close button, which sits above
     the panel rather than on a white surround. */
  padding: clamp(52px, 9vh, 88px) clamp(16px, 4vw, 48px) clamp(16px, 4vw, 48px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.gs-interstitial.is-open {
  opacity: 1;
  visibility: visible;
}

/* [hidden] is removed by JS on first open. Until then it keeps the dialog out
   of the a11y tree and out of the tab order even though it is in the DOM. */
.gs-interstitial[hidden] { display: none; }

.gs-interstitial__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.gs-interstitial__dialog {
  position: relative;
  width: 100%;
  max-width: 760px;
  border-radius: var(--gs-radius-sm);
  box-shadow: var(--gs-shadow);
  transform: translateY(12px) scale(.98);
  transition: transform .25s ease;
}
.gs-interstitial.is-open .gs-interstitial__dialog {
  transform: translateY(0) scale(1);
}

/* Close sits outside the panel, clear of its top-right corner, in white so it
   reads against the page backdrop rather than the blue. */
.gs-interstitial__close {
  position: absolute;
  top: -36px;
  right: -36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: none;
  border: 0;
  color: var(--gs-white);
  cursor: pointer;
  line-height: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.gs-interstitial__close:hover {
  opacity: .75;
  transform: scale(1.08);
}
.gs-interstitial__close:focus-visible {
  outline: 3px solid var(--gs-orange);
  outline-offset: 3px;
  border-radius: var(--gs-radius-sm);
}

/* The blue panel. Gradient runs slate → brand blue, matching the reference. */
.gs-interstitial__panel {
  display: flex;
  align-items: center;
  gap: clamp(16px, 4vw, 40px);
  padding: clamp(28px, 5vw, 52px) clamp(22px, 4vw, 48px);
  border-radius: var(--gs-radius-sm);
  background: linear-gradient(100deg,
    var(--gs-slate-gray) 0%,
    var(--gs-blue) 52%,
    #0a6dc4 100%);
  color: var(--gs-white);
}

.gs-interstitial__icon {
  flex: 0 0 auto;
  line-height: 0;
  color: var(--gs-white);
}
.gs-interstitial__icon svg {
  width: clamp(64px, 14vw, 120px);
  height: auto;
}

.gs-interstitial__copy p {
  margin: 0;
  font-family: var(--gs-font-display);
  font-size: clamp(1.0625rem, 1vw + .85rem, 1.625rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--gs-white);
  text-wrap: pretty;
}
.gs-interstitial__lead { margin-bottom: 1.15em !important; }

.gs-interstitial__actions {
  display: flex;
  margin-top: 28px;
}

/* Deliberately not .gs-btn: this is a white pill on a blue field and should
   not inherit the orange primary treatment or the --lg chevron. */
.gs-interstitial__continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 34px;
  border-radius: 999px;
  background: var(--gs-white);
  color: var(--gs-blue);
  font-family: var(--gs-font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.gs-interstitial__continue:hover {
  background: var(--gs-light);
  color: var(--gs-blue-dark);
  transform: translateY(-1px);
}
.gs-interstitial__continue:focus-visible {
  outline: 3px solid var(--gs-orange);
  outline-offset: 3px;
}

/* Stack the icon above the copy once the two no longer fit side by side. */
@media (max-width: 600px) {
  .gs-interstitial__panel {
    flex-direction: column;
    text-align: center;
    gap: 18px;
  }
  .gs-interstitial__actions { justify-content: center; }

  /* The container only has 16px of side padding down here, so the desktop
     -36px offset would hang the button past the viewport edge. */
  .gs-interstitial__close {
    top: -41px;
    right: -9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gs-interstitial,
  .gs-interstitial__dialog,
  .gs-interstitial__close,
  .gs-interstitial__continue { transition: none; }
  .gs-interstitial__dialog { transform: none; }
}
