/* ==========================================================================
   Himalayan Trails — lead capture modal

   A split panel: photograph on one side, a short honest offer and a two-field
   form on the other. It is deliberately quiet — one entrance, no bounce, no
   countdown, and a visible way out that is not a 10px grey cross.
   ========================================================================== */

.ht-modal-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--ht-z-scrim);
  background: rgb(9 18 14 / 0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--ht-duration-base) var(--ht-ease);
}

.ht-modal-scrim[data-open="true"] {
  opacity: 1;
}

.ht-modal {
  position: fixed;
  z-index: var(--ht-z-drawer);
  top: 50%;
  left: 50%;
  display: grid;
  width: min(56rem, calc(100vw - 1.5rem));
  max-height: min(46rem, calc(100dvh - 1.5rem));
  overflow: hidden auto;
  overscroll-behavior: contain;
  background: var(--ht-paper);
  border-radius: var(--ht-radius-lg);
  box-shadow: 0 40px 90px -30px rgb(9 18 14 / 0.55);

  /* Entrance: a short rise and settle. translate/scale are separate properties
     so the centring transform is never fought over by the animation. */
  translate: -50% -50%;
  scale: 0.97;
  opacity: 0;
  transition:
    opacity var(--ht-duration-base) var(--ht-ease-out),
    scale var(--ht-duration-base) var(--ht-ease-out);
}

.ht-modal[data-open="true"] {
  scale: 1;
  opacity: 1;
}

@media (min-width: 52rem) {
  .ht-modal {
    grid-template-columns: 20rem minmax(0, 1fr);
  }
}

/* ---- Media panel --------------------------------------------------------- */

.ht-modal__media {
  position: relative;
  display: none;
  isolation: isolate;
  background: var(--ht-pine-900);
}

@media (min-width: 52rem) {
  .ht-modal__media {
    display: block;
  }
}

.ht-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ht-modal__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(11 22 17 / 0.15) 40%, rgb(11 22 17 / 0.72) 100%);
}

/* A small letterpress-style stamp — gives the photo a reason to be there
   instead of leaving it as decoration. */
.ht-modal__stamp {
  position: absolute;
  z-index: 1;
  left: var(--ht-space-6);
  bottom: var(--ht-space-6);
  display: grid;
  gap: 0.125rem;
  color: var(--ht-text-inverse);
}

.ht-modal__stamp span {
  font-size: var(--ht-text-2xs);
  font-weight: 600;
  letter-spacing: var(--ht-tracking-caps);
  text-transform: uppercase;
  color: var(--ht-clay-400);
}

.ht-modal__stamp strong {
  font-family: var(--ht-font-display);
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.15;
}

/* ---- Body ---------------------------------------------------------------- */

.ht-modal__body {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.ht-modal__title {
  font-family: var(--ht-font-display);
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.125rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: var(--ht-tracking-tight);
  text-wrap: balance;
}

.ht-modal__lede {
  margin-top: var(--ht-space-3);
  max-width: 46ch;
  color: var(--ht-text-soft);
  line-height: var(--ht-leading-relaxed);
}

.ht-modal__points {
  display: grid;
  gap: var(--ht-space-2);
  margin-top: var(--ht-space-5);
}

.ht-modal__points li {
  display: flex;
  align-items: flex-start;
  gap: var(--ht-space-3);
  font-size: var(--ht-text-base);
  color: var(--ht-text-soft);
}

.ht-modal__points svg {
  flex: none;
  margin-top: 0.2rem;
  color: var(--ht-success);
}

.ht-modal__form {
  display: grid;
  gap: var(--ht-space-4);
  margin-top: var(--ht-space-6);
  padding-top: var(--ht-space-6);
  border-top: 1px solid var(--ht-border-soft);
}

.ht-modal__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ht-space-4);
}

@media (min-width: 30rem) {
  .ht-modal__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ht-modal__optional {
  font-weight: 400;
  color: var(--ht-text-muted);
}

.ht-modal__footnote {
  font-size: var(--ht-text-xs);
  line-height: var(--ht-leading-normal);
  color: var(--ht-text-muted);
}

/* An explicit, readable way to decline — not a hidden 10px cross. */
.ht-modal__decline {
  justify-self: center;
  padding: var(--ht-space-2);
  font-size: var(--ht-text-sm);
  color: var(--ht-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ht-modal__decline:hover {
  color: var(--ht-text);
}

.ht-modal__close {
  position: absolute;
  z-index: 2;
  top: var(--ht-space-3);
  right: var(--ht-space-3);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgb(251 248 243 / 0.9);
  color: var(--ht-text);
  box-shadow: var(--ht-shadow-sm);
  transition: background-color var(--ht-duration-fast) var(--ht-ease);
}

.ht-modal__close:hover {
  background: var(--ht-white);
}

/*
 * On a short laptop screen the panel was scrolling internally, which hid the
 * small print and the decline link below the fold — exactly the two things a
 * visitor should always be able to see. Tighten the rhythm so it fits instead.
 */
@media (max-height: 50rem) {
  .ht-modal__body {
    padding: var(--ht-space-6) var(--ht-space-6) var(--ht-space-5);
  }

  .ht-modal {
    max-height: calc(100dvh - 1rem);
  }

  .ht-modal__title {
    font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  }

  .ht-modal__lede {
    margin-top: var(--ht-space-2);
    max-width: 42ch;
    font-size: var(--ht-text-base);
  }

  .ht-modal__points {
    gap: var(--ht-space-1);
    margin-top: var(--ht-space-4);
    font-size: var(--ht-text-sm);
  }

  .ht-modal__form {
    gap: var(--ht-space-3);
    margin-top: var(--ht-space-4);
    padding-top: var(--ht-space-4);
  }

  .ht-modal__stamp {
    left: var(--ht-space-5);
    bottom: var(--ht-space-5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ht-modal {
    scale: 1;
    transition: opacity 1ms linear;
  }
}

/* A narrower photo column on short-but-wide screens gives the copy a wider
   measure, so the heading and lede each lose a line — cheaper than cutting
   content to make the panel fit. */
@media (min-width: 52rem) and (max-height: 50rem) {
  .ht-modal {
    grid-template-columns: 16rem minmax(0, 1fr);
  }
}

/* ---- Phones ---------------------------------------------------------------
   Without the photo column there is no room for everything, and the panel was
   scrolling with the decline link stranded below the fold. On a phone the offer
   has to be the heading, one line, two fields and a way out — the supporting
   bullets belong on the page, not in an interruption. */
@media (max-width: 32rem) {
  .ht-modal {
    max-height: calc(100dvh - 1.5rem);
  }

  .ht-modal__body {
    padding: var(--ht-space-5);
  }

  .ht-modal__title {
    font-size: 1.375rem;
  }

  .ht-modal__lede {
    margin-top: var(--ht-space-2);
    font-size: var(--ht-text-base);
  }

  .ht-modal__points {
    display: none;
  }

  .ht-modal__form {
    gap: var(--ht-space-3);
    margin-top: var(--ht-space-5);
    padding-top: var(--ht-space-5);
  }

  .ht-modal__close {
    top: var(--ht-space-2);
    right: var(--ht-space-2);
  }
}
