/* NM Lodge Hero — mobile-first expanding lodge selector */

:root {
  --nm-navy: #0b1f3a;
  --nm-navy-800: #0e2a52;
  --nm-gold: #c6a24a;
  --nm-gold-soft: rgba(198, 162, 74, 0.85);
  --nm-ivory: #faf7ef;
  --nm-ink: #1a2433;
  --nm-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --nm-sans: "Manrope", "Segoe UI", sans-serif;
  --nm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nm-panel-h: min(38vh, 320px);
}

body.has-nm-lodge-hero .wp-block-post-title,
body.has-nm-lodge-hero h1.wp-block-post-title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Pull hero flush under the site header (TT5 page padding). */
body.has-nm-lodge-hero main.wp-block-group,
body.has-nm-lodge-hero main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.has-nm-lodge-hero main > .wp-block-group {
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.has-nm-lodge-hero .entry-content,
body.has-nm-lodge-hero .wp-block-post-content {
  margin-top: 0 !important;
}

body.has-nm-lodge-hero .entry-content > .nm-lodge-hero,
body.has-nm-lodge-hero .wp-block-post-content > .nm-lodge-hero {
  margin-top: 0;
}

.nm-lodge-hero {
  --nm-active: 0;
  --nm-header-offset: 7.5rem;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.85rem;
  width: 100vw;
  max-width: 100vw;
  min-height: calc(100svh - var(--nm-header-offset));
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 0;
  padding: 1.25rem 0 max(1rem, env(safe-area-inset-bottom));
  color: var(--nm-ivory);
  overflow: hidden;
  background: var(--nm-navy);
  box-sizing: border-box;
}

/* Mobile: avoid 100vw/padding breakout math that leaves a left white strip */
@media (max-width: 960px) {
  .nm-lodge-hero {
    --nm-header-offset: 3.75rem;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .nm-lodge-hero__track {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    scroll-padding-inline: 1rem;
  }
}

.nm-lodge-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.nm-lodge-hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 45%;
  transform: scale(1.08);
  animation: nm-kenburns 28s var(--nm-ease) infinite alternate;
  will-change: transform;
}

.nm-lodge-hero__bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 16, 30, 0.55) 0%, rgba(6, 16, 30, 0.28) 38%, rgba(6, 16, 30, 0.72) 72%, rgba(6, 16, 30, 0.92) 100%),
    radial-gradient(120% 80% at 50% 0%, rgba(11, 31, 58, 0.35), transparent 55%);
  pointer-events: none;
}

@keyframes nm-kenburns {
  from {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.14) translate3d(-2%, 1.5%, 0);
  }
}

.nm-lodge-hero__content {
  position: relative;
  z-index: 2;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  max-width: 40rem;
}

.nm-lodge-hero__brand {
  margin: 0 0 0.45rem;
  font-family: var(--nm-serif);
  font-size: clamp(1.85rem, 7.5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--nm-ivory);
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
}

.nm-lodge-hero__tagline {
  margin: 0 0 0.85rem;
  max-width: 28rem;
  font-family: var(--nm-sans);
  font-size: clamp(0.9rem, 2.6vw, 1.1rem);
  font-weight: 500;
  line-height: 1.4;
  color: rgba(250, 247, 239, 0.88);
}

@media (max-width: 767px) and (max-height: 900px) {
  .nm-lodge-hero {
    --nm-panel-h: min(34vh, 280px);
    gap: 0.65rem;
    padding-top: 0.85rem;
  }

  .nm-lodge-hero__brand {
    font-size: clamp(1.65rem, 7vw, 2.25rem);
  }

  .nm-lodge-hero__tagline {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.65rem;
  }

  .nm-lodge-hero__cta {
    min-height: 2.4rem;
    padding: 0.55rem 0.95rem;
    font-size: 0.85rem;
  }

  .nm-lodge-hero__hint {
    font-size: 0.65rem;
  }
}

.nm-lodge-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.nm-lodge-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--nm-gold);
  color: #211a0a;
  font-family: var(--nm-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 0.2s var(--nm-ease), background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nm-lodge-hero__cta:hover,
.nm-lodge-hero__cta:focus-visible {
  background: #d4b45a;
  color: #211a0a;
  text-decoration: none;
  transform: translateY(-1px);
}

.nm-lodge-hero__cta--ghost {
  background: transparent;
  border-color: rgba(250, 247, 239, 0.45);
  color: var(--nm-ivory);
}

.nm-lodge-hero__cta--ghost:hover,
.nm-lodge-hero__cta--ghost:focus-visible {
  background: rgba(250, 247, 239, 0.08);
  border-color: var(--nm-gold);
  color: var(--nm-ivory);
}

.nm-lodge-hero__strip {
  position: relative;
  z-index: 2;
  width: 100%;
}

.nm-lodge-hero__track {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
  width: 100%;
  height: var(--nm-panel-h);
  padding: 0 max(1rem, calc((100vw - 78vw) / 2));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(1rem, calc((100vw - 78vw) / 2));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}

.nm-lodge-hero__track::-webkit-scrollbar {
  display: none;
}

.nm-lodge-hero__panel {
  position: relative;
  flex: 0 0 78vw;
  width: 78vw;
  max-width: 22rem;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  scroll-snap-align: center;
  text-decoration: none;
  color: inherit;
  isolation: isolate;
  transition:
    flex-basis 0.45s var(--nm-ease),
    width 0.45s var(--nm-ease),
    box-shadow 0.35s ease,
    transform 0.35s var(--nm-ease);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.nm-lodge-hero__panel:focus {
  outline: none;
}

.nm-lodge-hero__panel:focus-visible {
  outline: 2px solid var(--nm-gold);
  outline-offset: 3px;
}

.nm-lodge-hero__panel.is-active {
  flex-basis: 86vw;
  width: 86vw;
  z-index: 2;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.nm-lodge-hero__panel-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.nm-lodge-hero__panel-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(6, 16, 30, 0.88) 100%);
  pointer-events: none;
  z-index: 1;
}

.nm-lodge-hero__panel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.02);
  transition: transform 0.7s var(--nm-ease), filter 0.4s ease;
  filter: saturate(0.92) brightness(0.92);
}

.nm-lodge-hero__panel.is-active .nm-lodge-hero__panel-media img {
  transform: scale(1.12);
  filter: saturate(1.05) brightness(1);
}

.nm-lodge-hero__panel-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 0.95rem 1.05rem;
  transform: translateY(0.35rem);
  opacity: 0.72;
  transition: opacity 0.35s ease, transform 0.45s var(--nm-ease);
}

.nm-lodge-hero__panel.is-active .nm-lodge-hero__panel-label {
  opacity: 1;
  transform: translateY(0);
}

.nm-lodge-hero__panel-name {
  font-family: var(--nm-serif);
  font-size: clamp(1.05rem, 3.8vw, 1.35rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--nm-ivory);
}

.nm-lodge-hero__panel-number {
  font-family: var(--nm-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nm-gold);
}

.nm-lodge-hero__hint {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 1rem;
  font-family: var(--nm-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 247, 239, 0.55);
  text-align: center;
}

.nm-lodge-hero__hint-desktop {
  display: none;
}

/* Desktop accordion */
@media (min-width: 768px) {
  .nm-lodge-hero {
    --nm-header-offset: 11rem;
    gap: 1.15rem;
    padding-top: 1.5rem;
    padding-bottom: 1.35rem;
    --nm-panel-h: min(40vh, 420px);
  }

  .nm-lodge-hero__content {
    max-width: 46rem;
    padding-inline: clamp(1.5rem, 4vw, 3.5rem);
  }

  .nm-lodge-hero__brand {
    font-size: clamp(3rem, 5.5vw, 4.5rem);
  }

  .nm-lodge-hero__tagline {
    font-size: 1.15rem;
    max-width: 32rem;
  }

  .nm-lodge-hero__hint-mobile {
    display: none;
  }

  .nm-lodge-hero__hint-desktop {
    display: inline;
  }

  .nm-lodge-hero__track {
    gap: 0.45rem;
    padding: 0 clamp(1.5rem, 4vw, 3.5rem);
    overflow: hidden;
    scroll-snap-type: none;
  }

  .nm-lodge-hero__panel {
    flex: 1 1 0;
    width: auto;
    max-width: none;
    min-width: 0;
    scroll-snap-align: none;
    transition:
      flex-grow 0.55s var(--nm-ease),
      flex-basis 0.55s var(--nm-ease),
      box-shadow 0.35s ease;
  }

  .nm-lodge-hero__panel.is-active {
    flex: 3.6 1 0;
    width: auto;
  }

  .nm-lodge-hero__panel:not(.is-active) .nm-lodge-hero__panel-label {
    opacity: 0;
    transform: translateY(0.75rem);
  }

  .nm-lodge-hero__panel:not(.is-active):hover .nm-lodge-hero__panel-label,
  .nm-lodge-hero__panel:not(.is-active):focus-visible .nm-lodge-hero__panel-label {
    opacity: 0.9;
    transform: translateY(0.2rem);
  }

  .nm-lodge-hero__panel-name {
    font-size: clamp(1rem, 1.35vw, 1.35rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 1100px) {
  .nm-lodge-hero {
    --nm-panel-h: min(42vh, 460px);
  }

  .nm-lodge-hero__panel.is-active {
    flex: 4.2 1 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nm-lodge-hero__bg-img {
    animation: none;
    transform: scale(1.04);
  }

  .nm-lodge-hero__panel,
  .nm-lodge-hero__panel-media img,
  .nm-lodge-hero__panel-label,
  .nm-lodge-hero__cta {
    transition: none !important;
  }

  .nm-lodge-hero__panel.is-active .nm-lodge-hero__panel-media img,
  .nm-lodge-hero__panel-media img {
    transform: none;
  }
}
