/* ================================================================
   CATEGORY EXPLORER — interactive photo switcher
   Mirrors the Guardians explorer (.grd-x) but for rectangular PHOTOS:
   each item's hero photo fills the stage as a crossfading background.
   Used by the Accommodations / Facilities / Dining index pages.
   Pairs with css/guardians.css (reuses .grd-hero / .grd-outro chrome).
   ================================================================ */

.cx-page { position: relative; background: #10160f; color: #f5f3ed; overflow: hidden; }
body.cx-full header { border-bottom-color: transparent !important; }

/* Pull the stage up under the (seamless) header — same trick as .grd-x */
.cx { padding: 0 0 34px; margin-top: -35px; }
@media (min-width: 768px)  { .cx { margin-top: -40px; } }
@media (min-width: 992px)  { .cx { margin-top: -70px; } }
@media (min-width: 1200px) { .cx { margin-top: -100px; } }

.cx-stage {
  position: relative;
  width: 100%;
  height: 100vh; height: 100dvh;
  min-height: 480px;
  overflow: hidden;     /* fallback for older browsers */
  overflow: clip;       /* NOT a scroll container — the scaled .cx-bg can't make
                           focus/scrollIntoView shove the stage sideways */
  background: #10160f;
}

/* Crossfading photo backgrounds (one per item) */
.cx-bg {
  position: absolute; inset: 0;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1s ease, transform 8s ease;
  background-size: cover; background-position: center;
}
.cx-bg.on { opacity: 1; transform: scale(1); }

/* Water Park (embed): เปลี่ยนภาพด้วยเฟดอย่างเดียว — ไม่ซูม (ไม่มี Ken Burns zoom) */
.cx-embed .cx-bg,
.cx-embed .cx-bg.on { transform: none; }
.cx-embed .cx-bg { transition: opacity 1s ease; }

/* Multi-angle card: stacked frames cross-fade (bottom static, top fades in/out) */
.cx-bg-multi { background: none; }
.cx-bg-frame { position: absolute; inset: 0; background-size: cover; background-position: center; }
.cx-bg-frame-top { animation: cxCross 9s ease-in-out infinite; }
@keyframes cxCross { 0%, 8% { opacity: 0; } 42%, 58% { opacity: 1; } 92%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cx-bg-frame-top { animation: none; opacity: 0; } }

/* Scrim for legibility — dark on the left + bottom, clear on the right */
.cx-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8,10,8,.82), rgba(8,10,8,.45) 46%, rgba(8,10,8,.12) 74%, transparent 100%),
    linear-gradient(0deg,  rgba(8,10,8,.60), transparent 46%);
}

/* ---- Info panel ---- */
.cx-info { position: absolute; left: 6%; top: 50%; transform: translateY(-50%); max-width: 46%; color: #fff; z-index: 3; }
.cx-no { font-size: 64px; font-weight: 800; line-height: 1; color: rgba(255,255,255,.14); margin-bottom: -14px; }
.cx-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: #c9b384; margin-bottom: 12px; }
.cx-eyebrow::before { content: ""; width: 24px; height: 1px; background: #c9b384; }
.cx-name { font-size: clamp(30px, 5.4vw, 56px); font-weight: 300; letter-spacing: .5px; line-height: 1.05; margin: 0 0 14px; text-shadow: 0 4px 24px rgba(0,0,0,.5); }
.cx-name a { color: #fff; text-decoration: none; transition: color .2s; }
.cx-name a:hover { color: #c9b384; }
.cx-meta { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.72); margin: 0 0 14px; }
.cx-desc { font-size: 14px; line-height: 1.7; color: rgba(255,255,255,.85); margin: 0 0 22px; max-width: 440px; }
.cx-cta { display: inline-flex; align-items: center; gap: 10px; padding: 13px 28px; background: #c9b384; color: #2a3026; font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; text-decoration: none; border-radius: 2px; transition: gap .3s ease, background .3s ease; }
.cx-cta:hover { background: #fff; color: #2a3026; text-decoration: none; gap: 14px; }

/* Staggered swap-in animation when the active item changes */
.cx-info.swap .cx-no      { animation: cxIn .55s 0s   both; }
.cx-info.swap .cx-eyebrow { animation: cxIn .55s .06s both; }
.cx-info.swap .cx-name    { animation: cxIn .55s .12s both; }
.cx-info.swap .cx-meta    { animation: cxIn .55s .16s both; }
.cx-info.swap .cx-desc    { animation: cxIn .55s .20s both; }
.cx-info.swap .cx-cta     { animation: cxIn .55s .26s both; }
@keyframes cxIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ---- Arrows ---- */
.cx-arrows { position: absolute; top: 46%; transform: translateY(-50%); z-index: 4; width: 100%; display: flex; justify-content: space-between; padding: 0 12px; pointer-events: none; }
.cx-arrows button { pointer-events: auto; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.25); color: #fff; font-size: 18px; cursor: pointer; display: grid; place-items: center; transition: .2s; }
.cx-arrows button:hover { background: #fff; color: #2a3026; }

/* ---- Thumbnail rail ---- */
.cx-rail { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; align-items: flex-end; gap: 9px; justify-content: center; padding: 18px 14px 0; z-index: 4; overflow-x: auto; overflow-y: visible; }
.cx-rail::-webkit-scrollbar { display: none; }
.cx-card { position: relative; flex: none; width: 92px; height: 64px; border-radius: 10px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: rgba(255,255,255,.08); transition: transform .3s cubic-bezier(.34,1.4,.5,1), border-color .3s, opacity .3s; opacity: .62; }
.cx-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cx-card .nm { position: absolute; left: 0; right: 0; bottom: 0; font-size: 8px; letter-spacing: .4px; text-transform: uppercase; text-align: center; color: #fff; padding: 3px 2px; background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); }
.cx-card:hover { opacity: 1; transform: translateY(-5px); }
.cx-card.on { opacity: 1; border-color: #c9b384; transform: translateY(-7px); }

.cx-hint { text-align: center; font-size: 12px; color: #7a7060; margin: 16px 0 0; }

/* ---- Hero / outro overrides (so the intro sits flush below the stage) ---- */
body.cx-full .grd-hero { min-height: auto; margin-top: 0; padding: 48px 24px 64px; }
@media (max-width: 991px) { body.cx-full .grd-hero { min-height: auto; padding-top: 44px; } }
.cx-page .grd-hero {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(96,112,87,.30) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(201,179,132,.18) 0%, transparent 55%),
    linear-gradient(180deg, #14180f 0%, #10160f 100%);
}

/* ---- Embed mode (e.g. water-park zones): drop the seamless-header pull-up
       so the explorer sits inline, mid-page, instead of tucking under a nav ---- */
.cx.cx-embed { margin-top: 0 !important; }

/* ---- Zone label (top-centre of the stage, embed mode) ---- */
.cx-zone {
  position: absolute; top: 6%; left: 0; right: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; pointer-events: none; padding: 0 16px;
}
.cx-zone-no { font-size: 13px; font-weight: 700; letter-spacing: 3px; color: #c9b384; }
.cx-zone-name { font-size: clamp(22px, 3.4vw, 38px); font-weight: 300; letter-spacing: 4px; color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.5); }
.cx-zone-tag { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.72); max-width: 80%; }

/* ---- Mobile ---- */
@media (max-width: 767px) {
  .cx { padding: 0 0 28px; }
  .cx-stage { min-height: 0; }
  .cx-scrim { background: linear-gradient(0deg, rgba(8,10,8,.88) 28%, rgba(8,10,8,.22) 62%, rgba(8,10,8,.4)); }
  .cx-info { left: 0; right: 0; top: auto; bottom: 116px; transform: none; max-width: none; padding: 0 22px; text-align: center; }
  .cx-no { font-size: 44px; margin-bottom: -8px; }
  .cx-eyebrow { justify-content: center; }
  .cx-name { font-size: 30px; }
  .cx-meta { display: none; }
  .cx-desc { margin: 0 auto 18px; max-width: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .cx-arrows { display: none; }
  .cx-rail { bottom: 14px; justify-content: flex-start; }
}
