/*
 * Holiday lighting pop-up
 * Self-contained BEM styles. Relies on site fonts (Roboto / Roboto Slab)
 * and brand greens already used across the site.
 *
 * Brand tokens (from style.css):
 *   green        #93ba1a
 *   dark green   #638b07
 *   text         #363636 / #242119
 *   body font    Roboto
 *   heading font Roboto Slab
 *
 * CTA mirrors .link-box01 a (green fill, 3px darker bottom border, hover swap).
 *
 * Ported from base-popup/css/holiday-popup.css. Photo selector targets
 * .holiday-popup__media > picture (Step 1 markup) instead of a bare img.
 */

.holiday-popup {
  --hp-green: #93ba1a;
  --hp-green-dark: #638b07;
  --hp-green-soft: #e4efc0; /* solid light green for close hover (full opacity) */
  --hp-text: #242119;
  --hp-text-muted: #363636;
  --hp-white: #ffffff;
  --hp-overlay: rgba(0, 0, 0, 0.65);
  --hp-dialog-max: 42.1875rem; /* ~675px, matches mockup width */
  --hp-radius: 0;
  /* Above sticky header (9999) and live-chat widget (2147483000). Near 32-bit max. */
  --hp-z: 2147483646;

  position: fixed;
  inset: 0;
  z-index: var(--hp-z);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.holiday-popup.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Dimmed page layer */
.holiday-popup__backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--hp-overlay);
  cursor: pointer;
}

/* Dialog shell */
.holiday-popup__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--hp-dialog-max);
  max-height: min(92vh, 40rem);
  overflow: hidden;
  background-color: var(--hp-white);
  border-bottom: 4px solid var(--hp-green);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(0.75rem) scale(0.98);
  transition: transform 0.25s ease;
}

.holiday-popup.is-open .holiday-popup__dialog {
  transform: translateY(0) scale(1);
}

/* Close control - 44x44 touch target.
   Stacked (image on top): dark translucent chip + white X so it reads on the photo.
   Two-panel desktop overrides below to a quieter transparent control on white. */
.holiday-popup__close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background-color: rgba(0, 0, 0, 0.55);
  color: var(--hp-white);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.holiday-popup__close:hover,
.holiday-popup__close:focus {
  color: var(--hp-green-dark);
  background-color: var(--hp-green-soft);
  outline: none;
}

.holiday-popup__close:focus-visible {
  outline: 2px solid var(--hp-green);
  outline-offset: 2px;
}

.holiday-popup__close-icon {
  display: block;
  font-family: "Roboto", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* Media panel (photo).
   Stacked layout uses aspect-ratio so wide phones/small tablets keep a taller crop
   instead of a short letterbox strip. */
.holiday-popup__media {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  max-height: min(16.5rem, 38vh);
  overflow: hidden;
  background-color: #1a1b2e;
}

.holiday-popup__media > picture {
  display: block;
  width: 100%;
  height: 100%;
}

.holiday-popup__media > picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}

/* Photo artwork has no baked-in logo (unlike the illustrated mockup),
   so we overlay the official logo asset at the bottom of the media panel. */
.holiday-popup__brand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  padding: 1.75rem 0.65rem 0.55rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.82) 100%);
  pointer-events: none;
}

.holiday-popup__brand-logo {
  display: block;
  width: min(100%, 15.5rem);
  height: auto;
  object-fit: contain;
  object-position: left bottom;
}

/* Content panel */
.holiday-popup__content {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.25rem 1.25rem 1.5rem;
  overflow-y: auto;
  text-align: left;
}

.holiday-popup__eyebrow {
  margin: 0 0 0.5rem;
  padding: 0;
  font-family: "Roboto", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hp-green);
}

.holiday-popup__title {
  margin: 0 0 0.75rem;
  padding: 0;
  font-family: "Roboto Slab", serif;
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--hp-text);
}

.holiday-popup__title span {
  display: block;
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  color: var(--hp-green);
  letter-spacing: 0.01em;
}

.holiday-popup__body {
  margin: 0 0 1.25rem;
  padding: 0;
  font-family: "Roboto", sans-serif;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--hp-text-muted);
}

/* CTA - matches .link-box01 a from style.css */
.holiday-popup__cta {
  display: block;
  width: 100%;
  max-width: 14rem;
  margin: 0;
  padding: 0 1.25rem;
  height: 2.5rem;
  border-radius: 3px;
  background-color: var(--hp-green);
  border-bottom: 3px solid var(--hp-green-dark);
  font-family: "Roboto", sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 2.5rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--hp-white);
  transition: background-color 0.4s ease-in-out, border-bottom-color 0.4s ease-in-out, color 0.4s ease-in-out;
}

.holiday-popup__cta:hover,
.holiday-popup__cta:focus {
  background-color: var(--hp-green-dark);
  border-bottom-color: var(--hp-green);
  color: var(--hp-white);
  text-decoration: none;
  outline: none;
}

.holiday-popup__cta:focus-visible {
  outline: 2px solid var(--hp-text);
  outline-offset: 3px;
}

/* Two-panel layout from ~700px */
@media (min-width: 43.75rem) {
  .holiday-popup__dialog {
    flex-direction: row;
    align-items: stretch;
    max-height: min(90vh, 23.5625rem); /* ~377px mockup height */
  }

  .holiday-popup__media {
    flex: 0 0 48%;
    width: 48%;
    height: auto;
    min-height: 100%;
    aspect-ratio: auto; /* stacked aspect-ratio must not clip desktop height */
    max-height: none;
    align-self: stretch;
  }

  .holiday-popup__media > picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .holiday-popup__media > picture img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-position: center center;
  }

  .holiday-popup__brand {
    padding: 2.75rem 0.85rem 0.75rem;
  }

  .holiday-popup__brand-logo {
    width: min(100%, 17.5rem);
  }

  .holiday-popup__content {
    flex: 1 1 52%;
    padding: 1.75rem 2rem 1.75rem 1.75rem;
  }

  /* Quieter close control over the white content column */
  .holiday-popup__close {
    top: 0.35rem;
    right: 0.35rem;
    background-color: transparent;
    color: var(--hp-text);
  }

  .holiday-popup__close:hover,
  .holiday-popup__close:focus {
    color: var(--hp-green-dark);
    background-color: var(--hp-green-soft);
  }

  .holiday-popup__eyebrow {
    font-size: 0.8125rem;
  }

  .holiday-popup__title {
    font-size: 1.75rem;
  }

  .holiday-popup__body {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .holiday-popup,
  .holiday-popup__dialog,
  .holiday-popup__close,
  .holiday-popup__cta {
    transition: none;
  }

  .holiday-popup.is-open .holiday-popup__dialog {
    transform: none;
  }
}
