/* ============================================================================
   SALON EN VOGUE — PHASE 2 UI/UX UPGRADE
   Loaded last (after style.css + all fixes-*.css) so these rules win.
   Scope: gallery/lightbox (P0), buttons + sticky mobile CTA (P1),
          image/CLS polish (P2), motion polish (P3).
   Brand tokens only. No em/en-dashes. No new color families.
   Created 2026-07-12.
   ============================================================================ */


/* ============================================================================
   P0 — GALLERY / LIGHTBOX  (/realisations/)
   ============================================================================ */

/* --- P0.1  Tap-swallow fix (data-mandated) --------------------------------
   iOS Safari gives inline SVG a default pointer-events of visiblePainted,
   so a tap that lands on the transparent interior of the chevron/close glyph
   was ambiguous and the "next/prev/close" button did not always fire, which
   is what drove the rage-clicks in the session recordings. Making every inner
   glyph transparent to pointer events guarantees the <button> is the only hit
   target. ------------------------------------------------------------------- */
.lightbox-modal__nav svg,
.lightbox-modal__nav polyline,
.lightbox-modal__nav line,
.lightbox-modal__close svg,
.lightbox-modal__close line,
.lightbox-modal__book-btn svg,
.gallery-item__overlay svg {
  pointer-events: none;
}

/* --- P0.2  Tap targets >= 44px (data-mandated, WCAG 2.5.5) ----------------
   The mobile lightbox nav was 42px and the close was 40px. Bring both to
   48px on small screens; desktop values already clear 44px. ----------------- */
@media (max-width: 767px) {
  .lightbox-modal__nav {
    width: 48px;
    height: 48px;
  }

  .lightbox-modal__close {
    width: 46px;
    height: 46px;
    top: var(--space-2);
    right: var(--space-2);
  }
}

/* The invisible zoom trigger over each tile must also be a comfortable
   target and must sit above the caption/overlay so the whole tile is
   tappable. ---------------------------------------------------------------- */
.gallery-item__zoom-link {
  min-height: 44px;
  min-width: 44px;
  z-index: 3;
}

/* --- P0.3  Lightbox loading state (perceived-perf for the blank frame) -----
   Neighbours are preloaded in gallery.js, but a not-yet-cached advance can
   still flash empty. A brand-gold spinner reassures the user the next image
   is coming. Toggled by the .is-loading class on the modal (added in JS). --- */
.lightbox-modal__media {
  position: relative;
}

.lightbox-modal__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.lightbox-modal.is-loading .lightbox-modal__spinner {
  opacity: 1;
  animation: sev-lb-spin 0.7s linear infinite;
}

@keyframes sev-lb-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- P0.4  Hover micro-interaction polish ---------------------------------
   The existing hover (image scale 1.04 + caption slide-up + overlay fade) is
   kept. Add a faint frosted veil behind the zoom glyph so the icon reads on
   busy photos, and a gentle tinted lift on the whole tile. Hover-only, so no
   scroll-time backdrop-filter cost. ---------------------------------------- */
.gallery-item {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

@media (hover: hover) {
  .gallery-item:hover {
    box-shadow: 0 14px 34px -18px rgba(58, 46, 40, 0.55);
  }

  .gallery-item__overlay {
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .gallery-item__overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* --- P0.5  Focus-visible on gallery + lightbox controls (a11y) ------------- */
.gallery-item__zoom-link:focus-visible,
.filter-btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.lightbox-modal__nav:focus-visible,
.lightbox-modal__close:focus-visible,
.lightbox-modal__book-btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* --- P0.6  Reduced motion: kill the spinner + hover scale ------------------ */
@media (prefers-reduced-motion: reduce) {
  .lightbox-modal.is-loading .lightbox-modal__spinner {
    animation: none;
  }

  .gallery-item:hover img {
    transform: none;
  }

  .lightbox-modal__img {
    transition: none;
  }
}


/* ============================================================================
   P1 — BUTTONS + STICKY MOBILE CTA
   The site's primary CTA system is .btn (sharp corners, radius 0). The gold
   primary (.btn--gold) and outline secondary (.btn--secondary) already exist;
   the real gaps were a missing focus ring and no tactile press. Everything
   below keeps the established look and the single sharp-radius system.
   ============================================================================ */

/* --- P1.1  Visible keyboard focus on every CTA (a11y) ---------------------- */
.btn:focus-visible,
.sev-phone-cta:focus-visible,
.instagram-handle:focus-visible,
.desc-block__link:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* --- P1.2  Tactile press feedback ------------------------------------------ */
.btn:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .btn:active {
    transform: none;
  }
}

/* --- P1.3  Sticky mobile "Réserver" bar (< 768px only) --------------------- */
.sev-sticky-cta {
  display: none;
}

@media (max-width: 767px) {
  .sev-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
    background-color: var(--color-cream);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -6px 20px -8px rgba(58, 46, 40, 0.30);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Reserve space so the fixed bar never covers footer content. */
  body.has-sticky-cta {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  /* Slide the bar away while the fullscreen menu is open. */
  body.nav-open .sev-sticky-cta {
    transform: translateY(130%);
    pointer-events: none;
  }
}

.sev-sticky-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0;
  border: 1px solid transparent;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.sev-sticky-cta__btn--reserve {
  background-color: var(--color-gold);
  color: var(--color-accent);
  border-color: var(--color-gold);
}

.sev-sticky-cta__btn--reserve:active {
  background-color: var(--color-gold-dark);
  transform: scale(0.98);
}

.sev-sticky-cta__btn--tel {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-gold);
}

.sev-sticky-cta__btn--tel:active {
  background-color: var(--color-gold-light);
  transform: scale(0.98);
}

.sev-sticky-cta__btn--tel svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.sev-sticky-cta__btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  .sev-sticky-cta {
    transition: none;
  }

  .sev-sticky-cta__btn--reserve:active,
  .sev-sticky-cta__btn--tel:active {
    transform: none;
  }
}
