/* Approved post-welcome composition only; product screens and category options
   continue to use the existing Ever Wonder styles and routes. */
.gallery-back, .gallery-menu-icon { display: none; }
body.storybook[data-product='experiences'][data-selector-view='landing'] {
  --gallery-header-height: 64px;
  background: radial-gradient(ellipse at 50% 32%, #06101c 0, #020812 45%, #01040b 82%);
}
body[data-product='experiences'][data-selector-view='landing'] .experience-topbar {
  position: relative; top: auto; display: grid; grid-template-columns: 48px minmax(0,1fr) 48px;
  width: min(880px,100%); height: var(--gallery-header-height); min-height: 0;
  margin: 0 auto; padding: 8px 16px; gap: 8px; background: none;
}
body[data-product='experiences'][data-selector-view='landing'] .experience-topbar .ever-wonder-brand { justify-content: center; margin: 0; text-align: center; }
body[data-product='experiences'][data-selector-view='landing'] .experience-topbar .ever-wonder-name { font-size: 17px !important; letter-spacing: .2em; white-space: nowrap; }
body[data-product='experiences'][data-selector-view='landing'] .experience-topbar .ever-wonder-slogan { display: none; }
body[data-product='experiences'][data-selector-view='landing'] .gallery-back,
body[data-product='experiences'][data-selector-view='landing'] .experience-menu-toggle {
  display: grid; place-items: center; min-width: 44px; width: 44px; min-height: 44px; height: 44px;
  padding: 8px; margin: 0; border: 0; border-radius: 50%; color: var(--gold); background: none;
}
body[data-product='experiences'][data-selector-view='landing'] .gallery-back svg { width: 24px; height: 24px; }
body[data-product='experiences'][data-selector-view='landing'] .experience-menu-toggle { border: 1px solid #dfb87a77; width: 36px; height: 36px; min-width: 36px; min-height: 36px; margin-top: 4px; }
body[data-product='experiences'][data-selector-view='landing'] .gallery-menu-icon { display: block; width: 20px; height: 20px; }
body[data-product='experiences'][data-selector-view='landing'] .experience-menu-shell { width: 44px; margin: 0; }
body[data-product='experiences'][data-selector-view='landing'] :is(.experience-logo-media,.experience-menu-label,.ew-header-home) { display: none; }
body[data-product='experiences'][data-selector-view='landing'] .experience-menu { top: calc(100% + 6px); }
body[data-product='experiences'][data-selector-view='landing'] .experience-main { width: 100%; max-width: 100%; padding: 0; }
body[data-product='experiences'][data-selector-view='landing'] .experience-footer { display: none; }
body[data-product='experiences'] #home.approved-gallery { display: block; width: 100%; min-height: 0; margin: 0; padding: 0; scroll-margin-top: var(--gallery-header-height,64px); }
body[data-product='experiences'] .gallery-composition {
  display: grid; grid-template-rows: clamp(120px,20svh,180px) minmax(0,1fr) auto 32px 22px;
  gap: 4px; width: min(880px,100%); height: calc(100svh - var(--gallery-header-height,64px));
  min-height: 0; margin: 0 auto; padding: 0 0 max(8px,env(safe-area-inset-bottom));
}
body[data-product='experiences'] .gallery-heading { position: relative; width: min(100%,440px); height: 100%; margin: auto; isolation: isolate; }
body.storybook[data-product='experiences'] #home-title { position: absolute; inset: 2% 10%; display: grid; place-items: center; margin: 0; padding: 0; }
body[data-product='experiences'] .gallery-heading-artwork { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
body[data-product='experiences'] .gallery-heading-glow { position: absolute; inset: 5% 9%; z-index: -1; border-radius: 50%; background: radial-gradient(ellipse,#f5f2ec12,transparent 68%); animation: gallery-breath 5s ease-in-out infinite; pointer-events: none; }
body[data-product='experiences'] .gallery-heading-magic { position: absolute; inset: -4% 0 -8%; width: 100%; height: 112%; overflow: visible; pointer-events: none; }
body[data-product='experiences'] .gallery-heading-magic stop { stop-color: var(--brand-heading-ink,#f5f2ec); }
body[data-product='experiences'] .gallery-heading-magic [stroke]:not([stroke='none']):not([stroke^='url(']) { stroke: var(--brand-heading-ink,#f5f2ec); }
body[data-product='experiences'] .gallery-heading-magic [fill]:not([fill='none']):not([fill^='url(']) { fill: var(--brand-heading-ink,#f5f2ec); }
@supports ((mask-image: url('')) or (-webkit-mask-image: url(''))) {
  body.storybook[data-product='experiences'] #home-title > .gallery-heading-artwork { opacity: 0; }
  body.storybook[data-product='experiences'] #home-title::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--brand-heading-ink,#f5f2ec);
    -webkit-mask: url('/brand/ever-wonder/bringing-real-magic-home.webp') center / contain no-repeat;
    mask: url('/brand/ever-wonder/bringing-real-magic-home.webp') center / contain no-repeat;
    pointer-events: none;
  }
}
body[data-product='experiences'] .gallery-comet {
  offset-path: path('M92 24C45 43 5 85 24 120C38 145 84 133 77 161C68 198 18 180 34 151C55 114 105 188 184 191C272 196 388 159 378 100C370 52 320 32 307 59C295 83 339 112 363 82C392 44 342 12 310 35');
  offset-rotate: auto; animation: gallery-comet-orbit 5s linear infinite;
}
body[data-product='experiences'] .gallery-twinkle { animation: gallery-twinkle 5s ease-in-out infinite; opacity: .25; }
body[data-product='experiences'] .gallery-twinkle-two { animation-delay: -1.7s; }
body[data-product='experiences'] .gallery-twinkle-three { animation-delay: -3.4s; }
body[data-product='experiences'] .gallery-stage { width: 100%; height: 100%; min-height: 0; container-type: size; }
body[data-product='experiences'] .gallery-track {
  --gallery-card-width: min(72vw,calc((100cqh - 16px)*.75),330px);
  display: flex; align-items: center; gap: 18px; width: 100%; height: 100%; min-height: 0;
  padding: 8px calc((100% - var(--gallery-card-width))/2); overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x pinch-zoom; cursor: grab;
}
body[data-product='experiences'] .gallery-track::-webkit-scrollbar { display: none; }
body[data-product='experiences'] .gallery-track[data-dragging='true'] { cursor: grabbing; }
body[data-product='experiences'] .gallery-card {
  position: relative; display: block; flex: 0 0 var(--gallery-card-width); width: var(--gallery-card-width);
  height: calc(var(--gallery-card-width)*4/3); min-width: 0; min-height: 0; padding: 7px;
  border: 1px solid #dfb87a77; border-radius: 17px 17px 10px 10px; color: var(--gold); background: #020710;
  scroll-snap-align: center; scroll-snap-stop: normal; transform: scale(.91); opacity: .72;
  transition: transform 220ms ease,opacity 220ms ease,border-color 220ms ease; user-select: none; -webkit-user-select: none;
  -webkit-user-drag: none; text-decoration: none;
}
body[data-product='experiences'] .gallery-card[data-selected='true'] { transform: scale(1); opacity: 1; border-color: #dfb87ad9; }
body[data-product='experiences'] .gallery-card-window { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border: 1px solid #dfb87a66; border-radius: 11px 11px 6px 6px; background: #020710; }
body[data-product='experiences'] .gallery-card-window img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
/* The three supplied portrait doors stay whole. Their own image proportions
   determine each card's width; the existing carousel measures real centres. */
body[data-product='experiences'] #approved-experience-gallery .gallery-track {
  --portrait-card-height: min(calc(100cqh - 16px),520px,calc((76vw - 18px) / var(--portrait-max-ratio,.68) + 18px));
  --gallery-card-width: calc((var(--portrait-card-height) - 18px) * .5625 + 18px);
}
body[data-product='experiences'] #approved-experience-gallery .portrait-category-card {
  width: calc((var(--portrait-card-height) - 18px) * var(--portrait-ratio,.5625) + 18px);
  flex-basis: calc((var(--portrait-card-height) - 18px) * var(--portrait-ratio,.5625) + 18px);
  height: var(--portrait-card-height);
  opacity: 1;
}
body[data-product='experiences'] #approved-experience-gallery .portrait-category-card img { object-fit: contain; object-position: center; }
body[data-product='experiences'] #approved-experience-gallery .gallery-caption { min-height: 76px; }
body[data-product='experiences'] #category-choice-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
body[data-product='experiences'] #category-choice-options .category-artwork { aspect-ratio: var(--portrait-ratio,9 / 16); }
body[data-product='experiences'] #category-choice-options .category-artwork img { object-fit: contain; }
body[data-product='experiences'] .gallery-card:nth-child(n) img[src*='journey.webp'] { object-position: 52% 50%; }
body[data-product='experiences'] .gallery-card img[src*='doorcam.webp'] { object-position: 48% 35%; }
body[data-product='experiences'] .gallery-card img[src*='naughty-elf.webp'] { object-position: 44% 50%; }
body[data-product='experiences'] .gallery-card img[src*='reindeer.webp'] { object-position: 64% 50%; }
/* Laura approved an intentional text-only Fairy choice while its artwork is pending. */
body[data-product='experiences'] .gallery-text-only { display: grid; place-items: center; padding: 18px; background: radial-gradient(ellipse at center,#0b1520,#020710 75%); }
body[data-product='experiences'] .gallery-text-title { display: block; max-width: 6ch; margin: 0; color: var(--gold); font-family: var(--font-display); font-size: clamp(24px,8cqw,38px) !important; line-height: 1.12; text-align: center; }
body[data-product='experiences'] .gallery-card-corners { position: absolute; inset: 3px; pointer-events: none; background: linear-gradient(var(--gold),var(--gold)) 0 0/14px 1px no-repeat,linear-gradient(var(--gold),var(--gold)) 0 0/1px 14px no-repeat,linear-gradient(var(--gold),var(--gold)) 100% 0/14px 1px no-repeat,linear-gradient(var(--gold),var(--gold)) 100% 0/1px 14px no-repeat,linear-gradient(var(--gold),var(--gold)) 0 100%/14px 1px no-repeat,linear-gradient(var(--gold),var(--gold)) 0 100%/1px 14px no-repeat,linear-gradient(var(--gold),var(--gold)) 100% 100%/14px 1px no-repeat,linear-gradient(var(--gold),var(--gold)) 100% 100%/1px 14px no-repeat; }
body[data-product='experiences'] .gallery-card-corners::before, body[data-product='experiences'] .gallery-card-corners::after { content: ''; position: absolute; top: 3px; width: 4px; height: 4px; border: 1px solid var(--gold); transform: rotate(45deg); }
body[data-product='experiences'] .gallery-card-corners::before { left: 3px; }
body[data-product='experiences'] .gallery-card-corners::after { right: 3px; }
body[data-product='experiences'] .gallery-caption { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: min(92%,480px); min-height: 90px; margin: auto; text-align: center; }
body.storybook[data-product='experiences'] .gallery-caption h2 { max-width: 22ch; margin: 0; color: var(--gold); font-size: 27px !important; line-height: 1.06; text-wrap: balance; }
body.storybook[data-product='experiences'] .gallery-caption p { max-width: 30ch; margin: 0; color: var(--gold); font-size: 18px !important; line-height: 1.2; text-wrap: balance; }
body[data-product='experiences'] .gallery-progress { display: flex; align-items: center; justify-content: center; gap: 0; min-height: 32px; }
body[data-product='experiences'] .gallery-progress button { position: relative; display: grid; place-items: center; width: 34px; min-width: 0; height: 32px; min-height: 0; margin: 0; padding: 0; border: 0; background: none; }
body[data-product='experiences'] .gallery-progress button::before { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: #dfb87a59; }
body[data-product='experiences'] .gallery-progress button[aria-pressed='true']::before { width: 7px; height: 7px; background: var(--gold); box-shadow: 0 0 8px #dfb87a77; }
body.storybook[data-product='experiences'] .gallery-swipe { margin: 0; color: var(--gold); font-size: 13px !important; line-height: 22px; letter-spacing: .16em; text-align: center; }
body[data-product='experiences'] :is(.gallery-card,.gallery-track,.gallery-progress button,.gallery-back):focus-visible { outline: 1px solid #ffe1a7; outline-offset: 3px; }
@keyframes gallery-comet-orbit { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes gallery-breath { 0%,100% { opacity: .45; } 50% { opacity: .9; } }
@keyframes gallery-twinkle { 0%,38%,70%,100% { opacity: .2; } 47%,57% { opacity: .8; } }
@media (max-height: 650px) and (orientation: portrait) {
  body.storybook[data-product='experiences'][data-selector-view='landing'] { --gallery-header-height: 56px; }
  body[data-product='experiences'][data-selector-view='landing'] .experience-topbar { padding-block: 4px; }
  body[data-product='experiences'] .gallery-composition { grid-template-rows: 120px minmax(0,1fr) auto 28px 18px; gap: 3px; padding-bottom: 4px; }
  body[data-product='experiences'] .gallery-caption { min-height: 78px; gap: 4px; }
  body[data-product='experiences'] #approved-experience-gallery .gallery-caption { min-height: 64px; }
  body.storybook[data-product='experiences'] .gallery-caption h2 { font-size: 22px !important; }
  body.storybook[data-product='experiences'] .gallery-caption p { font-size: 16px !important; }
  body.storybook[data-product='experiences'] .gallery-swipe { font-size: 11px !important; line-height: 18px; }
  body[data-product='experiences'] .gallery-progress,body[data-product='experiences'] .gallery-progress button { min-height: 28px; height: 28px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  body.storybook[data-product='experiences'][data-selector-view='landing'] { --gallery-header-height: 48px; }
  body[data-product='experiences'][data-selector-view='landing'] .experience-topbar { padding-block: 2px; }
  body[data-product='experiences'] .gallery-composition { grid-template-rows: 78px minmax(0,1fr) auto 22px 16px; gap: 2px; padding-bottom: 2px; }
  body[data-product='experiences'] .gallery-stage { width: min(100%,300px); margin-inline: auto; }
  body[data-product='experiences'] .gallery-caption { min-height: 43px; gap: 2px; }
  body[data-product='experiences'] #approved-experience-gallery .gallery-caption { min-height: 43px; }
  body.storybook[data-product='experiences'] .gallery-caption h2 { max-width: none; font-size: 19px !important; }
  body.storybook[data-product='experiences'] .gallery-caption p { max-width: 50ch; font-size: 15px !important; }
  body.storybook[data-product='experiences'] .gallery-swipe { font-size: 10px !important; line-height: 16px; }
  body[data-product='experiences'] .gallery-progress,body[data-product='experiences'] .gallery-progress button { min-height: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-product='experiences'] :is(.gallery-heading-glow,.gallery-comet,.gallery-twinkle) { animation: none; }
  body[data-product='experiences'] .gallery-comet { display: none; }
  body[data-product='experiences'] .gallery-card { transition: none; }
}
@media (max-width:720px), (hover:none) and (pointer:coarse) {
  body[data-product='experiences'] #category-choice-options { grid-template-columns: none; }
}

/* Desktop home has exactly three real doors, each a normal category link.
   Their original proportions share a height that fits the whole row. The
   phone carousel and category submenu cards retain their existing geometry. */
body[data-product='experiences'] #approved-experience-gallery[data-gallery-layout='row'] .gallery-track {
  --portrait-card-height:min(calc(100cqh - 16px),520px,calc((100cqw - 114px)/var(--portrait-row-ratio,1.86) + 18px));
  justify-content:center;padding:8px 12px;overflow-x:hidden;scroll-snap-type:none;cursor:default;
}
body[data-product='experiences'] #approved-experience-gallery[data-gallery-layout='row'] [data-gallery-clone] { display:none; }
body[data-product='experiences'] #approved-experience-gallery[data-gallery-layout='row'] .gallery-swipe { visibility:hidden; }

/* Scrolling desktop submenus also omit wrapping copies; real cards keep
   their original sizing, scroll snapping and drag interaction. */
body[data-product='experiences'] [data-gallery-layout='finite-carousel'] .gallery-card[data-gallery-clone] { display:none; }
