/* =============================================================================
   WestVibe Child — Visual Stories / Luxury Gallery
   BEM prefix: .wv-vs-
   Uses CSS custom properties from :root (injected by westvibe-core plugin).
   ============================================================================= */

/* ── Section wrapper ──────────────────────────────────────────────────────── */
.wv-vs-section {
  position: relative;
  padding: clamp(80px, 10vw, 140px) 0;
  overflow: hidden;
}

/* Background variants */
.wv-vs-section.wv-bg-white     { background: var(--wv-white,   #ffffff); }
.wv-vs-section.wv-bg-ivory     { background: var(--wv-ivory,   #f8f3ea); }
.wv-vs-section.wv-bg-champagne { background: #f5ede0; }
.wv-vs-section.wv-bg-soft-gold { background: #ede3d2; }

/* Decorative ambient gradient */
.wv-vs-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(200, 164, 93, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 10% 90%, rgba(200, 164, 93, 0.05) 0%, transparent 55%);
  pointer-events: none;
}

/* ── Section header ───────────────────────────────────────────────────────── */
.wv-vs-header {
  text-align: center;
  max-width: 660px;
  margin: 0 auto clamp(48px, 6vw, 80px);
}

.wv-vs-description {
  font-family: var(--wv-font-body);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--wv-muted, #9c968c);
  line-height: 1.7;
  margin: 16px auto 0;
  max-width: 520px;
}

/* ── Grid base ────────────────────────────────────────────────────────────── */
.wv-vs-grid {
  display: grid;
  gap: clamp(10px, 1.5vw, 18px);
  /* Default: luxury-mosaic auto-fill */
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: clamp(160px, 18vw, 260px);
  grid-auto-flow: dense;
}

/* ── ────────────────────────────────────────────────────────────────────────
   LAYOUT: luxury-mosaic (default — 12-column asymmetric grid)
   ──────────────────────────────────────────────────────────────────────── */
.wv-vs-layout--luxury-mosaic .wv-vs-card               { grid-column: span 4; grid-row: span 1; }
.wv-vs-layout--luxury-mosaic .wv-vs-card--wide         { grid-column: span 8; grid-row: span 1; }
.wv-vs-layout--luxury-mosaic .wv-vs-card--tall         { grid-column: span 4; grid-row: span 2; }
.wv-vs-layout--luxury-mosaic .wv-vs-card--square       { grid-column: span 6; grid-row: span 2; }
.wv-vs-layout--luxury-mosaic .wv-vs-card--featured     { grid-column: span 8; grid-row: span 2; }

/* ── ────────────────────────────────────────────────────────────────────────
   LAYOUT: editorial-grid (uniform 3-column magazine)
   ──────────────────────────────────────────────────────────────────────── */
.wv-vs-layout--editorial-grid {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: clamp(260px, 28vw, 400px);
}
.wv-vs-layout--editorial-grid .wv-vs-card               { grid-column: span 1; grid-row: span 1; }
.wv-vs-layout--editorial-grid .wv-vs-card--wide,
.wv-vs-layout--editorial-grid .wv-vs-card--featured     { grid-column: span 2; grid-row: span 1; }
.wv-vs-layout--editorial-grid .wv-vs-card--tall         { grid-column: span 1; grid-row: span 2; }
.wv-vs-layout--editorial-grid .wv-vs-card--square       { grid-column: span 2; grid-row: span 2; }

/* ── ────────────────────────────────────────────────────────────────────────
   LAYOUT: cinematic-strip (horizontal scroll)
   ──────────────────────────────────────────────────────────────────────── */
.wv-vs-layout--cinematic-strip {
  display: flex;
  overflow-x: auto;
  overflow-y: visible;
  gap: clamp(10px, 1.5vw, 18px);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(200,164,93,.3) transparent;
  padding-bottom: 12px;
}
.wv-vs-layout--cinematic-strip::-webkit-scrollbar       { height: 4px; }
.wv-vs-layout--cinematic-strip::-webkit-scrollbar-thumb { background: rgba(200,164,93,.4); border-radius: 2px; }

.wv-vs-layout--cinematic-strip .wv-vs-card {
  flex: 0 0 clamp(220px, 28vw, 380px);
  scroll-snap-align: start;
  height: clamp(300px, 38vw, 520px);
}
.wv-vs-layout--cinematic-strip .wv-vs-card--wide,
.wv-vs-layout--cinematic-strip .wv-vs-card--featured {
  flex: 0 0 clamp(360px, 46vw, 600px);
}
.wv-vs-layout--cinematic-strip .wv-vs-card--tall {
  height: clamp(440px, 55vw, 700px);
}

/* ── Card base ────────────────────────────────────────────────────────────── */
.wv-vs-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: var(--wv-radius, 3px);
  background: var(--wv-soft-black, #111);

  /* Subtle luxury border */
  box-shadow: 0 0 0 1px rgba(200, 164, 93, 0.08);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
  will-change: transform;
}

.wv-vs-card:focus-visible {
  outline: 2px solid var(--wv-gold, #c8a45d);
  outline-offset: 3px;
}

/* ── Media layer ──────────────────────────────────────────────────────────── */
.wv-vs-card__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.wv-vs-card__img,
.wv-vs-card__video,
.wv-vs-card__placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.45s ease;
}

/* Secondary / hover image — hidden by default */
.wv-vs-card__img--secondary,
.wv-vs-card__hover-video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Hover video paused by default — JS plays on hover */
.wv-vs-card__hover-video {
  pointer-events: none;
}

/* Placeholder */
.wv-vs-card__placeholder {
  background: var(--wv-soft-black, #111);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wv-vs-card__placeholder-glyph {
  color: rgba(200, 164, 93, 0.18);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 300;
  user-select: none;
}

/* ── Overlay ──────────────────────────────────────────────────────────────── */
.wv-vs-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;

  /* Multi-stop gradient for depth */
  background: linear-gradient(
    to top,
    rgba(5, 5, 5, 0.82) 0%,
    rgba(5, 5, 5, 0.38) 38%,
    rgba(5, 5, 5, 0.05) 65%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.wv-vs-card__overlay-inner {
  padding: clamp(14px, 2.5vw, 24px);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(8px);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Category badge */
.wv-vs-card__category {
  display: inline-block;
  font-family: var(--wv-font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wv-gold, #c8a45d);
  background: rgba(200, 164, 93, 0.15);
  border: 1px solid rgba(200, 164, 93, 0.35);
  padding: 3px 10px;
  border-radius: 2px;
  backdrop-filter: blur(4px);
  width: fit-content;
}

/* Title */
.wv-vs-card__name {
  font-family: var(--wv-font-display);
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
  font-weight: 600;
  color: var(--wv-text-light, #fff);
  line-height: 1.2;
}

/* Description */
.wv-vs-card__desc {
  font-family: var(--wv-font-body);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

/* CTA icon */
.wv-vs-card__cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(200, 164, 93, 0.6);
  border-radius: 50%;
  color: var(--wv-gold, #c8a45d);
  margin-top: 6px;
  transition: background 0.25s ease, color 0.25s ease;
}

.wv-vs-card__link-btn {
  display: inline-flex;
  align-items: center;
  color: var(--wv-gold, #c8a45d);
  margin-top: 4px;
  text-decoration: none;
}

/* Gold corner accent */
.wv-vs-card__corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 28px 28px 0;
  border-color: transparent rgba(200, 164, 93, 0.22) transparent transparent;
  transition: border-color 0.3s ease;
  pointer-events: none;
}

/* ── Hover states (enabled via .wv-vs--hover-on) ─────────────────────────── */
.wv-vs--hover-on .wv-vs-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(200, 164, 93, 0.3), var(--wv-shadow-md, 0 18px 45px rgba(17,17,17,.1));
}

.wv-vs--hover-on .wv-vs-card:hover .wv-vs-card__overlay {
  opacity: 1;
}

.wv-vs--hover-on .wv-vs-card:hover .wv-vs-card__overlay-inner {
  transform: translateY(0);
}

.wv-vs--hover-on .wv-vs-card:hover .wv-vs-card__img--primary {
  transform: scale(1.06);
}

.wv-vs--hover-on .wv-vs-card:hover .wv-vs-card__img--secondary {
  opacity: 1;
}

.wv-vs--hover-on .wv-vs-card:hover .wv-vs-card__corner {
  border-color: transparent rgba(200, 164, 93, 0.55) transparent transparent;
}

.wv-vs--hover-on .wv-vs-card:hover .wv-vs-card__cta-icon {
  background: rgba(200, 164, 93, 0.15);
}

/* ── Always-visible overlay on featured cards ─────────────────────────────── */
.wv-vs-card--featured .wv-vs-card__overlay,
.wv-vs-card--is-featured .wv-vs-card__overlay {
  opacity: 0.6;
}
.wv-vs-card--featured .wv-vs-card__overlay-inner,
.wv-vs-card--is-featured .wv-vs-card__overlay-inner {
  transform: translateY(0);
}
.wv-vs--hover-on .wv-vs-card--featured:hover .wv-vs-card__overlay,
.wv-vs--hover-on .wv-vs-card--is-featured:hover .wv-vs-card__overlay {
  opacity: 1;
}

/* ── CTA row ──────────────────────────────────────────────────────────────── */
.wv-vs-cta {
  display: flex;
  justify-content: center;
  margin-top: clamp(40px, 5vw, 64px);
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.wv-vs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wv-vs-lightbox[hidden] { display: none; }

.wv-vs-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: wvLbFadeIn 0.3s ease;
}

.wv-vs-lightbox__stage {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1100px);
  max-height: 92vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: wvLbSlideUp 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wv-vs-lightbox__media {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: calc(92vh - 80px);
  overflow: hidden;
  border-radius: var(--wv-radius, 3px);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.7);
}

.wv-vs-lightbox__media img {
  max-width: 100%;
  max-height: calc(92vh - 80px);
  object-fit: contain;
  display: block;
}

.wv-vs-lightbox__media video {
  max-width: 100%;
  max-height: calc(92vh - 80px);
  outline: none;
}

.wv-vs-lightbox__caption {
  font-family: var(--wv-font-body);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
  text-align: center;
}

.wv-vs-lightbox__close {
  position: absolute;
  top: -48px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  padding: 0;
  font-family: inherit;
}

.wv-vs-lightbox__close:hover {
  background: rgba(200, 164, 93, 0.25);
  border-color: rgba(200, 164, 93, 0.55);
  color: var(--wv-gold, #c8a45d);
}

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes wvLbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wvLbSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .wv-vs-layout--luxury-mosaic .wv-vs-card          { grid-column: span 6; }
  .wv-vs-layout--luxury-mosaic .wv-vs-card--wide    { grid-column: span 12; }
  .wv-vs-layout--luxury-mosaic .wv-vs-card--tall    { grid-column: span 6; }
  .wv-vs-layout--luxury-mosaic .wv-vs-card--square  { grid-column: span 6; }
  .wv-vs-layout--luxury-mosaic .wv-vs-card--featured{ grid-column: span 12; }

  .wv-vs-layout--editorial-grid { grid-template-columns: repeat(2, 1fr); }
  .wv-vs-layout--editorial-grid .wv-vs-card--wide,
  .wv-vs-layout--editorial-grid .wv-vs-card--featured,
  .wv-vs-layout--editorial-grid .wv-vs-card--square { grid-column: span 2; }
}

@media (max-width: 640px) {
  .wv-vs-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: clamp(140px, 42vw, 210px);
  }

  /* In luxury-mosaic at mobile — all cards span 1 col, featured spans 2 */
  .wv-vs-layout--luxury-mosaic .wv-vs-card,
  .wv-vs-layout--luxury-mosaic .wv-vs-card--wide,
  .wv-vs-layout--luxury-mosaic .wv-vs-card--tall,
  .wv-vs-layout--luxury-mosaic .wv-vs-card--square  { grid-column: span 1; grid-row: span 1; }
  .wv-vs-layout--luxury-mosaic .wv-vs-card--featured { grid-column: span 2; grid-row: span 1; }

  /* editorial-grid → single col at mobile */
  .wv-vs-layout--editorial-grid { grid-template-columns: 1fr; }
  .wv-vs-layout--editorial-grid .wv-vs-card,
  .wv-vs-layout--editorial-grid .wv-vs-card--wide,
  .wv-vs-layout--editorial-grid .wv-vs-card--featured,
  .wv-vs-layout--editorial-grid .wv-vs-card--square,
  .wv-vs-layout--editorial-grid .wv-vs-card--tall  { grid-column: span 1; grid-row: span 1; }

  /* Overlay always visible at mobile (no hover) */
  .wv-vs-card__overlay { opacity: 1; }
  .wv-vs-card__overlay-inner { transform: translateY(0); }
}

/* ── Reduced-motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .wv-vs-card,
  .wv-vs-card__img,
  .wv-vs-card__overlay,
  .wv-vs-card__overlay-inner {
    transition: none;
  }

  @keyframes wvLbFadeIn  { from { opacity: 1; } }
  @keyframes wvLbSlideUp { from { opacity: 1; transform: none; } }
}
