/*! AlpenPura · photo tour per chalet (Oct 2026) · js/ap-tour.js
 * Chalet Steinbock + Chalet Gams (DE/EN/NL). All photos are real <img> elements in
 * the HTML (Google Images, AI search), grouped by room inside a <dialog>; they load
 * only when the tour is opened. Entry points: button on the header photo and the
 * room photos ("Raum für Raum"). A photo opens the shared lightbox (ap-carousel.js).
 * Also: chalet name as a small line inside the H1 of the chalet pages, and the
 * room details list (.ap-spec) for bedrooms and bathrooms. */

/* ── Chalet name above the headline (inside the H1, styled like the eyebrow) ── */
.ap-hero-split h1 .ap-kicker {
  display: block; margin: 0 0 16px; font: 500 10px/1.7 'Inter', sans-serif; font-style: normal;
  letter-spacing: .28em; text-transform: uppercase; color: var(--gold, #A08060);
  animation: apFade 1.2s ease .1s both;
}
.ap-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Button on the header photo ── */
.ap-tour-open {
  position: absolute; left: 16px; bottom: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 2px;
  background: rgba(251, 250, 248, .94); color: var(--on-s, #1B1C1C); text-decoration: none;
  font: 500 10px/1 'Inter', sans-serif; letter-spacing: .18em; text-transform: uppercase;
  box-shadow: 0 8px 22px -10px rgba(20, 18, 14, .55); transition: background .25s, color .25s;
}
.ap-tour-open .material-symbols-outlined { font-size: 16px; }
.ap-tour-open:hover, .ap-tour-open:focus-visible { background: var(--pine, #1E2B1F); color: #fff; outline: none; }

/* ── Room photos on the page open the tour at their room ── */
.ap-tour-link { display: block; position: relative; width: 100%; height: 100%; color: inherit; }
.ap-tour-link:focus-visible { outline: 2px solid var(--gold, #A08060); outline-offset: 3px; }
.ap-tour-more {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 9px; border-radius: 2px; background: rgba(20, 18, 14, .58); color: #fff;
  font: 500 10px/1 'Inter', sans-serif; letter-spacing: .1em; pointer-events: none;
}
.ap-tour-more .material-symbols-outlined { font-size: 14px; }

/* ── The tour (full-screen dialog) ── */
dialog.ap-tour {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: var(--surface, #FBFAF8); color: var(--on-s, #1B1C1C);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
dialog.ap-tour::backdrop { background: rgba(20, 18, 14, .5); }
.ap-tour-head { position: sticky; top: 0; z-index: 3; background: rgba(251, 250, 248, .97); border-bottom: 1px solid var(--o-soft, #D1C4BA); }
.ap-tour-top { max-width: 1180px; margin: 0 auto; padding: 18px 24px 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ap-tour-h { margin: 0; font: 300 1.4rem/1.2 'Noto Serif', serif; color: var(--on-s, #1B1C1C); }
.ap-tour-h span { display: block; margin-bottom: 6px; font: 500 10px/1 'Inter', sans-serif; letter-spacing: .24em; text-transform: uppercase; color: var(--gold, #A08060); }
.ap-tour-x {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--o-soft, #D1C4BA); color: var(--on-s, #1B1C1C); text-decoration: none; transition: background .25s, color .25s, border-color .25s;
}
.ap-tour-x:hover, .ap-tour-x:focus-visible { background: var(--pine, #1E2B1F); border-color: var(--pine, #1E2B1F); color: #fff; outline: none; }
.ap-tour-nav { max-width: 1180px; margin: 0 auto; padding: 0 24px; display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; }
.ap-tour-nav::-webkit-scrollbar { display: none; }
.ap-tour-nav a {
  flex: none; padding: 10px 0 12px; border-bottom: 2px solid transparent; color: var(--on-v, #4D453D); text-decoration: none;
  font: 500 10px/1 'Inter', sans-serif; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; transition: color .2s, border-color .2s;
}
.ap-tour-nav a span { margin-left: 6px; color: var(--outline, #7F756C); letter-spacing: .04em; }
.ap-tour-nav a:hover, .ap-tour-nav a:focus-visible, .ap-tour-nav a[aria-current="true"] { color: var(--on-s, #1B1C1C); border-bottom-color: var(--gold, #A08060); outline: none; }
.ap-tour-body { max-width: 1180px; margin: 0 auto; padding: 8px 24px 80px; }
.ap-tour-sec { padding-top: 36px; }
.ap-tour-sec h3 { margin: 0 0 16px; display: flex; align-items: baseline; gap: 12px; font: 300 1.3rem/1.25 'Noto Serif', serif; color: var(--on-s, #1B1C1C); }
.ap-tour-sec h3 small { font: 500 10px/1 'Inter', sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--outline, #7F756C); }
.ap-tour-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
.ap-tour-grid > li.is-wide { grid-column: 1 / -1; }
.ap-tour-grid figure { margin: 0; }
.ap-tour-ph { display: block; position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 3px; background: var(--s-low, #F6F3F0); cursor: zoom-in; }
.ap-tour-grid > li.is-wide .ap-tour-ph { aspect-ratio: 16 / 9; }
.ap-tour-ph img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.25, .46, .45, .94), filter .4s; }
.ap-tour-ph:hover img { transform: scale(1.03); }
.ap-tour-ph:focus-visible { outline: 2px solid var(--gold, #A08060); outline-offset: 3px; }
.ap-tour-grid figcaption { margin-top: 9px; font: 300 .86rem/1.55 'Manrope', sans-serif; color: var(--on-v, #4D453D); }
@media (max-width: 640px) {
  .ap-tour-top { padding: 14px 16px 6px; }
  .ap-tour-h { font-size: 1.15rem; }
  .ap-tour-nav { padding: 0 16px; gap: 20px; }
  .ap-tour-body { padding: 0 16px 64px; }
  .ap-tour-sec { padding-top: 28px; }
  .ap-tour-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ap-tour-grid > li.is-wide .ap-tour-ph { aspect-ratio: 3 / 2; }
  .ap-tour-open { left: 12px; bottom: 12px; padding: 10px 13px; }
}
/* ── Room details (bedrooms, bathrooms): fine hairline list in the CI instead of boxes ──
 * <dl class="ap-spec"><div><dt><span class="ap-spec-n">01</span> Schlafzimmer</dt><dd>…</dd></div></dl>
 * Numeral in Noto Serif italic (like the room numerals I, II, III), label as eyebrow,
 * details in Manrope. Extras ("+") in the muted outline colour. */
.ap-spec { margin: 28px 0 0; padding: 0; border-top: 1px solid var(--o-soft, #D1C4BA); }
.ap-spec > div, .ap-spec-extra { margin: 0; padding: 17px 0 18px 48px; border-bottom: 1px solid var(--o-soft, #D1C4BA); }
.ap-spec dt, .ap-spec-extra {
  display: flex; align-items: baseline; /* numeral and label on one baseline */
  margin: 0; font: 500 10px/1.7 'Inter', sans-serif; letter-spacing: .22em; text-transform: uppercase;
  color: var(--primary, #6C5943);
}
.ap-spec-n {
  flex: none; width: 48px; margin-left: -48px;
  font: italic 300 1.05rem/1 'Noto Serif', serif; letter-spacing: .06em; text-transform: none; color: var(--gold, #A08060);
}
.ap-spec dd { margin: 6px 0 0; font: 300 .92rem/1.6 'Manrope', sans-serif; color: var(--on-v, #4D453D); }
.ap-spec .is-extra dt, .ap-spec-extra { color: var(--outline, #7F756C); }
.ap-spec .is-extra .ap-spec-n, .ap-spec-extra .ap-spec-n { font-style: normal; font-size: 1.15rem; }
@media (max-width: 640px) {
  .ap-spec { margin-top: 24px; }
  .ap-spec > div, .ap-spec-extra { padding: 15px 0 16px 40px; }
  .ap-spec-n { width: 40px; margin-left: -40px; }
}

/* Without JavaScript the tour still opens through the link target */
html:not(.ap-tour-js) dialog.ap-tour:target, html:not(.ap-tour-js) dialog.ap-tour:has(:target) { display: block; z-index: 9999; }
@media (prefers-reduced-motion: reduce) { .ap-tour-ph img { transition: none; } .ap-tour-ph:hover img { transform: none; } }
