/**
 * Turquoise Weddings — Immersive Wedding CSS
 *
 * Scoped to body.tw-wedding-immersive to avoid leaking into other pages.
 * Cinematic hero, Pinterest-style CSS columns masonry gallery,
 * skeleton loading, scroll reveal, luxury hover micro-interactions.
 */

/* ─────────────────────────────────────────────
   VARIABLES
   ───────────────────────────────────────────── */
body.tw-wedding-immersive {
  --tw-w-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --tw-w-sans: 'Montserrat', -apple-system, sans-serif;
  --tw-w-display: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --tw-w-blue: #014f7b;
  --tw-w-cream: #faf9f6;
  --tw-w-text: #2c2c2c;
  --tw-w-muted: #6b6b6b;
  --tw-w-radius: 22px;
  --tw-w-gap: 18px;
  --tw-w-silk: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ─────────────────────────────────────────────
   GLOBAL OVERRIDES (scoped)
   ───────────────────────────────────────────── */
body.tw-wedding-immersive {
  background: var(--tw-w-cream);
}

body.tw-wedding-immersive .tw-wedding-main {
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════
   HERO — full-bleed cinematic
   ═══════════════════════════════════════════════ */
body.tw-wedding-immersive .tw-whero {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  height: clamp(55vh, 80vh, 90vh);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.tw-wedding-immersive .tw-whero--no-image {
  height: auto;
  min-height: 40vh;
  background: var(--tw-w-blue);
}

/* Hero image */
body.tw-wedding-immersive .tw-whero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

body.tw-wedding-immersive .tw-whero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Gradient overlay */
body.tw-wedding-immersive .tw-whero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.02) 40%,
    rgba(0, 0, 0, 0.05) 60%,
    rgba(0, 0, 0, 0.45) 100%
  );
  pointer-events: none;
}

/* Title stack */
body.tw-wedding-immersive .tw-whero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 900px;
}

body.tw-wedding-immersive .tw-whero__content--dark .tw-whero__title {
  color: #fff;
}
body.tw-wedding-immersive .tw-whero__content--dark .tw-whero__subline {
  color: rgba(255, 255, 255, 0.8);
}

body.tw-wedding-immersive .tw-whero__title {
  font-family: var(--tw-w-display);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25);
}

body.tw-wedding-immersive .tw-whero__subline {
  font-family: var(--tw-w-sans);
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  margin: 16px 0 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Scroll cue (CSS only) */
body.tw-wedding-immersive .tw-whero__scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

body.tw-wedding-immersive .tw-whero__scroll-text {
  font-family: var(--tw-w-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

body.tw-wedding-immersive .tw-whero__scroll-line {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
}

body.tw-wedding-immersive .tw-whero__scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  animation: tw-scroll-pulse 2s ease-in-out infinite;
}

@keyframes tw-scroll-pulse {
  0%   { top: -100%; }
  50%  { top: 100%; }
  100% { top: 100%; }
}

/* ═══════════════════════════════════════════════
   CONTENT BODY — editorial rhythm
   ═══════════════════════════════════════════════ */
body.tw-wedding-immersive .tw-wcontent {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) 24px;
  font-family: var(--tw-w-serif);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.75;
  color: var(--tw-w-text);
}

/* Headings inside content */
body.tw-wedding-immersive .tw-wcontent h2 {
  font-family: var(--tw-w-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 600;
  color: var(--tw-w-blue);
  letter-spacing: 0.02em;
  margin: clamp(48px, 6vw, 80px) 0 24px;
  line-height: 1.2;
}

body.tw-wedding-immersive .tw-wcontent h3 {
  font-family: var(--tw-w-serif);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 600;
  color: var(--tw-w-text);
  margin: clamp(36px, 4vw, 56px) 0 16px;
  line-height: 1.3;
}

/* Paragraphs */
body.tw-wedding-immersive .tw-wcontent p {
  margin: 0 0 1.5em;
}

/* ── Separator / spacer ── */
body.tw-wedding-immersive .tw-wcontent .wp-block-separator {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(1, 79, 123, 0.15), transparent);
  margin: clamp(40px, 6vw, 72px) auto;
  max-width: 200px;
}

/* ═══════════════════════════════════════════════
   MASONRY GALLERY — Pinterest-style CSS columns
   ═══════════════════════════════════════════════ */

/* ── Gallery container ── */
body.tw-wedding-immersive .tw-wed-gallery {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px clamp(48px, 8vw, 96px);
  column-count: 3;
  column-gap: var(--tw-w-gap);
}

/* ── Individual card ── */
body.tw-wedding-immersive .tw-wed-card {
  break-inside: avoid;
  margin: 0 0 var(--tw-w-gap);
  border-radius: var(--tw-w-radius);
  overflow: hidden;
  position: relative;
  background: var(--tw-w-cream);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.05),
    0 1px 4px rgba(0, 0, 0, 0.03);
  transition:
    transform 380ms var(--tw-w-silk),
    box-shadow 380ms var(--tw-w-silk),
    border-color 380ms var(--tw-w-silk);
}

/* ── Card image: natural height, no cropping ── */
body.tw-wedding-immersive .tw-wed-card__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0; /* container handles rounding via overflow:hidden */
  cursor: zoom-in;
  transition:
    transform 400ms var(--tw-w-silk),
    filter 400ms var(--tw-w-silk);
  will-change: transform;
}

/* ── Skeleton loading shimmer ── */
body.tw-wedding-immersive .tw-wed-card--skeleton {
  min-height: 200px;
  background:
    linear-gradient(
      110deg,
      var(--tw-w-cream) 0%,
      #f0ede8 18%,
      #e8e4de 36%,
      #f0ede8 54%,
      var(--tw-w-cream) 72%,
      var(--tw-w-cream) 100%
    );
  background-size: 200% 100%;
  animation: tw-wed-shimmer 1.6s ease-in-out infinite;
}

body.tw-wedding-immersive .tw-wed-card--skeleton .tw-wed-card__img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Image loaded — fade in */
body.tw-wedding-immersive .tw-wed-card:not(.tw-wed-card--skeleton) .tw-wed-card__img {
  opacity: 1;
}

@keyframes tw-wed-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Luxury hover — desktop only ── */
@media (hover: hover) and (pointer: fine) {
  body.tw-wedding-immersive .tw-wed-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(1, 79, 123, 0.12);
    box-shadow:
      0 16px 48px rgba(0, 0, 0, 0.10),
      0 6px 20px rgba(0, 0, 0, 0.06);
  }

  body.tw-wedding-immersive .tw-wed-card:hover .tw-wed-card__img {
    transform: scale(1.03);
    filter: brightness(1.02);
  }
}

/* ── Mobile press feedback ── */
@media (hover: none) {
  body.tw-wedding-immersive .tw-wed-card:active,
  body.tw-wedding-immersive .tw-wed-card.tw-wed-card--pressed {
    transform: scale(0.99);
  }

  body.tw-wedding-immersive .tw-wed-card:active .tw-wed-card__img,
  body.tw-wedding-immersive .tw-wed-card.tw-wed-card--pressed .tw-wed-card__img {
    transform: scale(1.01);
  }
}

/* ═══════════════════════════════════════════════
   SCROLL REVEAL — cinematic entrance
   JS adds .tw-reveal to cards, .tw-reveal--visible on intersection.
   ═══════════════════════════════════════════════ */

/* Start state: hidden */
body.tw-wedding-immersive .tw-reveal {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition:
    opacity 0.8s var(--tw-w-silk),
    transform 0.9s var(--tw-w-silk);
}

/* Revealed state */
body.tw-wedding-immersive .tw-reveal--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger masonry cards for a cascade effect.
   CSS columns fill top-to-bottom then left-to-right,
   so sequential nth-child stagger creates a natural waterfall. */
body.tw-wedding-immersive .tw-wed-gallery .tw-reveal:nth-child(3n+2) {
  transition-delay: 0.06s;
}
body.tw-wedding-immersive .tw-wed-gallery .tw-reveal:nth-child(3n+3) {
  transition-delay: 0.12s;
}

/* ═══════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════ */
.tw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  cursor: zoom-out;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.tw-lightbox--open {
  opacity: 1;
  visibility: visible;
}

.tw-lightbox__img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.4);
  cursor: default;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.tw-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.25s;
  z-index: 2;
}

.tw-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.tw-lightbox__close svg {
  width: 20px;
  height: 20px;
}

.tw-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  font-size: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.25s;
  z-index: 2;
}

.tw-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-50%) scale(1.08);
}

.tw-lightbox__nav svg {
  width: 20px;
  height: 20px;
}

.tw-lightbox__nav--prev {
  left: 20px;
}

.tw-lightbox__nav--next {
  right: 20px;
}

.tw-lightbox__counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--tw-w-sans, 'Montserrat', sans-serif);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.55);
  z-index: 2;
}

/* ─────────────────────────────────────────────
   MOBILE RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
  body.tw-wedding-immersive .tw-whero {
    height: clamp(50vh, 65vh, 70vh);
  }

  body.tw-wedding-immersive .tw-whero__title {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
  }

  body.tw-wedding-immersive .tw-wcontent {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Masonry: 2 columns on tablet */
  body.tw-wedding-immersive .tw-wed-gallery {
    column-count: 2;
    column-gap: 14px;
    padding-left: 16px;
    padding-right: 16px;
  }

  body.tw-wedding-immersive .tw-wed-card {
    margin-bottom: 14px;
    border-radius: 16px;
  }

  .tw-lightbox__nav--prev { left: 10px; }
  .tw-lightbox__nav--next { right: 10px; }
  .tw-lightbox__nav { width: 40px; height: 40px; }
  .tw-lightbox__close { top: 12px; right: 12px; }
}

@media (max-width: 480px) {
  body.tw-wedding-immersive .tw-whero {
    height: 55vh;
  }

  body.tw-wedding-immersive .tw-whero__scroll {
    display: none;
  }

  /* Masonry: 1 column on phone */
  body.tw-wedding-immersive .tw-wed-gallery {
    column-count: 1;
    column-gap: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  body.tw-wedding-immersive .tw-wed-card {
    margin-bottom: 16px;
    border-radius: 14px;
  }
}

/* ─────────────────────────────────────────────
   PREFERS-REDUCED-MOTION
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  body.tw-wedding-immersive .tw-whero__scroll-line::after {
    animation: none;
  }

  /* Disable scroll reveal animation — show immediately */
  body.tw-wedding-immersive .tw-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* Disable hover animations on masonry cards */
  body.tw-wedding-immersive .tw-wed-card {
    transition: none;
  }

  body.tw-wedding-immersive .tw-wed-card__img {
    transition: none;
    transform: none !important;
  }

  /* Disable skeleton shimmer */
  body.tw-wedding-immersive .tw-wed-card--skeleton {
    animation: none;
  }

  .tw-lightbox,
  .tw-lightbox__img,
  .tw-lightbox__close,
  .tw-lightbox__nav {
    transition: none;
  }
}
