/* Desktop: set local --header-h to 5px so the heroâ†’grid gap is tight */
@media (min-width: 992px) {
  main.with-sticky-offset { --header-h: 5px; }
}

/* Desktop: ensure exact 10px gap between hero and grid */
@media (min-width: 992px) {
  /* keep hero margin as the only vertical separator */
  .collection-hero { margin-bottom: 10px !important; }

  /* remove any extra top spacing the first section might add */
  main.with-sticky-offset > section:first-of-type {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* defensive: if your theme's .section-tight adds padding, zero it here for the first section */
  main.with-sticky-offset > #viewGrid.section-tight,
  main.with-sticky-offset > #viewFlipbook.section-tight {
    padding-top: 0 !important;
  }
}

/* Desktop hero-to-grid spacing fix */
@media (min-width: 992px) {
  .with-sticky-offset {
    padding-top: var(--header-h); /* keep nav offset */
  }
  .collection-hero {
    margin-bottom: 10px; /* exact gap between hero and grid */
  }
}

/* Hide hero slider on tablets & mobile */
@media (max-width: 991px) {
  .swiper-container.swiper-container-alt {
    display: none !important;
  }
}

.hero-bg {
  background: var(--hero-bg, none) center/cover no-repeat;
}

:root{--header-h:80px}
.with-sticky-offset{padding-top:var(--header-h)}

/* collection.css â€” unified styles for grid+lightbox (desktop) and flipbook (mobile/tablet) */

/* Tight top spacing */
.page-top-spacer { padding-top: 1.25rem; }

/* --- Grid styles (desktop) --- */
.card-equal .image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  background-size: cover;
  background-position: center;
  cursor: default;
}
/* Hide the flipbook section on desktop by default; JS will toggle if needed */
#viewFlipbook { display: none; }

/* --- Flipbook styles (mobile/tablet) --- */
#flipbookWrap { width: 100%; overflow: hidden; position: relative; margin: 0 auto; }
#flipbook { margin: 0 auto; }
.page { width: 480px; height: 700px; background: var(--hero-bg, none) center/cover no-repeat; overflow: hidden; display: flex; flex-direction: column; }
.page figure { position: relative; width: 100%; height: 100%; margin: 0; display: flex; flex-direction: column; }
.page img { width: 100%; height: 100%; object-fit: cover; flex: 1 1 auto; }

.page figcaption {
  flex: 0 0 auto; font-size: .9rem; line-height: 1.35;
  color: #111; background: #fff; padding: .5rem .75rem; border-top: 1px solid #eee;
}

#thumbs { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1rem; }
#thumbs button { border: 0; padding: 0; background: transparent; cursor: pointer; }
#thumbs img { width: 80px; height: 106px; object-fit: cover; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
#thumbs button[aria-current="true"] img { outline: 3px solid #6c5ce7; outline-offset: 2px; }

#tapPrev, #tapNext { position: absolute; top: 0; bottom: 0; width: 22%; z-index: 5; display: none; }
#tapPrev { left: 0; }
#tapNext { right: 0; }

/* Peel tutorial overlay */
#peelTutor {
  position: absolute; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.7));
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  touch-action: none;
}
#peelTutor.show { display: flex; }
#peelTutor .hint {
  position: absolute; right: 12px; top: 12px;
  color: #fff; font-size: 14px; line-height: 1.35; max-width: 70vw;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  padding: .5rem .65rem; border-radius: .5rem; background: rgba(0,0,0,.25);
}

@media (max-width: 991px) {
  /* Mobile/Tablet: show flipbook, hide grid */
  #viewGrid { display: none; }
  #viewFlipbook { display: block; }

  #thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; gap: .5rem; overflow-x: auto; overflow-y: hidden; padding: .5rem .75rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  #thumbs::-webkit-scrollbar { display: none; }
  #thumbs button { scroll-snap-align: start; }
  #thumbs img { height: 84px; width: auto; aspect-ratio: 3 / 4; }

  .page { width: 320px; height: auto; }
  .page figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
    color: #fff; border-top: 0; padding: .75rem .9rem; font-size: .95rem;
    opacity: .95; transition: opacity .2s;
  }
  .page figcaption.is-hidden { opacity: 0; pointer-events: none; }
  #tapPrev, #tapNext { display: block; }
}


/* --- Mobile gap below sticky nav (robust) --- */
/* Mobile gap tweak */
@media (max-width: 991px) {
  :root { --mobile-gap: 12px; } /* tweak this value as desired */
  main.with-sticky-offset { padding-top: calc(var(--header-h) + var(--mobile-gap)) !important; }
  /* Also add padding to the first visible section for extra safety */
  #viewFlipbook, #viewGrid { padding-top: var(--mobile-gap); }
}

/* Holiday Gifts grid: preserve collage layout, reduce “zoom” feel */
#bespokeGrid .image {
  background-size: cover !important;     /* keep collage look */
  background-position: center !important;
  transform: none !important;            /* prevents -scale zoom if applied */
  top: 0 !important;
  height: 100% !important;
}

/* Holiday Gifts: subtly reduce image scale without breaking layout */
#bespokeGrid .image {
  background-size: 85% auto;
  background-position: center;
}

/* Center captions under cards */
#bespokeGrid .card-caption {
  text-align: center;
}

#bespokeGrid .card-caption {
  margin-top: 10px;
}

#bespokeGrid .card-caption {
  text-transform: uppercase;
}

/* Make page turns feel smoother on mobile */
#flipbookWrap {
  touch-action: pan-y;            /* allow vertical scrolling, reduce horizontal interference */
  -webkit-user-select: none;
  user-select: none;
}

/* Tap zones should not trigger selection/zoom */
#tapPrev, #tapNext {
  touch-action: manipulation;
}

.bg-black {
  background-color: #000 !important;
}

.text-white {
  color: #fff !important;
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

.formal-intro-section {
  background-color: #000;
  color: #fff;
  padding: 2rem 0;
}

.formal-intro-section h2 {
  margin-bottom: 1rem;
}

.formal-intro-section p {
  margin-bottom: 0;
  font-size: 1.125rem; /* Optional: slightly larger than default */
}


/* Visually hidden (SEO + accessibility friendly): keeps text in DOM without showing it */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Make the whole promo tile clickable */
.promo-link{
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
}

/* Optional: nice hover affordance */
.promo-link:hover{
  text-decoration: none;
}
.promo-link:hover .underline{
  text-decoration: underline;
}

/* Hide formal intro text on mobile & tablet */
@media (max-width: 991px) {
  .formal-intro-section {
    display: none !important;
  }
}

/* Permanently hide captions on mobile (even if captions are enabled elsewhere) */
@media (max-width: 991px) {
  .page figcaption {
    display: none !important;
  }
}

#viewFlipbook .page figcaption { display: none !important; }

/* ================================
   Formal story sections (site-typography aligned)
   ================================ */

.formal-story {
  background: #fff;
}

/* Spacing to match your section rhythm */
.formal-content-section {
  padding: 80px 0;
}

.formal-text-box {
  padding: 0;
}

/* Image presentation */
.formal-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Quote section */
.formal-quote-section {
  background: #f8f8f8;
  padding: 60px 0;
}

.formal-quote {
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.6;
  color: #333;
  text-align: center;
}

/* Process section */
.formal-process-section {
  background: #fafafa;
  padding: 80px 0;
}

.formal-process-step {
  background: #fff;
  padding: 28px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  height: 100%;
}

.formal-process-step p {
  color: #666;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
  .formal-content-section,
  .formal-process-section {
    padding: 50px 0;
  }

  .formal-quote {
    font-size: 1.25rem;
  }
}


/* ================================
   Formal slider (Owl Carousel)
   ================================ */

.formal-slider-section {
  background: #f8f8f8;
  padding: 60px 0;
}

.formal-carousel .formal-slide {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.formal-carousel .slide-media {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.formal-carousel .slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.formal-carousel .slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity .2s ease;
}

.formal-carousel .formal-slide:hover .slide-caption {
  opacity: 1;
}

.formal-carousel .owl-nav button.owl-prev,
.formal-carousel .owl-nav button.owl-next {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(0,0,0,.55) !important;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.formal-carousel .owl-nav button.owl-prev:hover,
.formal-carousel .owl-nav button.owl-next:hover {
  background: rgba(0,0,0,.75) !important;
}

@media (max-width: 991px) {
  .formal-slider-section { padding: 35px 0; }
  .formal-carousel .slide-caption { display: none; }
}


/* ================================
   Full-bleed formal slider
   ================================ */

.formal-slider-fullbleed {
  width: 100%;
  padding: 0;
  background: #f8f8f8;
}

.formal-slider-fullbleed .formal-carousel {
  padding: 30px 0;
}

.formal-carousel .owl-stage-outer {
  padding: 0;
}

.formal-carousel .owl-nav {
  position: absolute;
  top: 50%;
  left: 12px;
  right: 12px;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.formal-carousel .owl-nav button.owl-prev,
.formal-carousel .owl-nav button.owl-next {
  pointer-events: auto;
}

/* Runway motion: force linear easing */
.formal-carousel .owl-stage {
  transition-timing-function: linear !important;
}

@media (max-width: 768px) {
  #viewGrid,
  .formal-story,
  .formal-slider-section {
    display: block !important;
  }
}
