/* ── Active nav link ──────────────────────────────────────────── */
.nav__links a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

/* ── Gallery header (purple zone) ────────────────────────────── */
.gallery-header {
  position: relative;
  overflow: hidden;
  background: var(--primary);
  padding-block:
    calc(var(--nav-h) + clamp(3.5rem, 7vw, 5.5rem))
    clamp(3.5rem, 7vw, 5.5rem);
}

/* Top-right decorative ring */
.gallery-header::before {
  content: '';
  position: absolute;
  inset-inline-end: -180px;
  inset-block-start: -180px;
  width: 560px;
  height: 560px;
  border: 72px solid oklch(1 0 0 / 0.09);
  border-radius: 50%;
  pointer-events: none;
}

/* Bottom-left accent ring */
.gallery-header::after {
  content: '';
  position: absolute;
  inset-inline-start: -100px;
  inset-block-end: -100px;
  width: 340px;
  height: 340px;
  border: 48px solid oklch(0.50 0.22 22 / 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.gallery-header__inner {
  position: relative;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(1.75rem, 5vw, 4rem);
}

.gallery-header__title {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: white;
  text-wrap: balance;
  margin-bottom: 0.75rem;
}

.gallery-header__occasions {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--primary-light);
  letter-spacing: 0.005em;
}

/* ── Sections ─────────────────────────────────────────────────── */
.gallery-section {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.gallery-section__inner {
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 4vw, 2.5rem);
}

.gallery-section__title {
  font-size: clamp(1.375rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--ink);
  margin-bottom: 1rem;
}

/* Special section overrides */
.gallery-section--special {
  background: var(--primary);
}

.gallery-section--special .gallery-section__title {
  color: white;
}

.gallery-section--special .gallery-section__desc {
  color: var(--primary-light);
}

.gallery-section__desc {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
  text-wrap: pretty;
  margin-top: -0.5rem;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

/* ── Cake image ───────────────────────────────────────────────── */
.cake-img {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  transition: box-shadow 0.35s var(--ease-quart);
  cursor: zoom-in;
}

/* Subtle inset border to define photo edges on white bg */
.cake-img::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.06);
  pointer-events: none;
}

.cake-img:focus-visible {
  box-shadow: 0 4px 16px oklch(0.17 0.015 300 / 0.08);
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}

.cake-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-expo);
}

@media (hover: hover) {
  .carousel__slide:hover .cake-img {
    box-shadow: 0 4px 16px oklch(0.17 0.015 300 / 0.08);
  }
  .carousel__slide:hover .cake-photo {
    transform: scale(1.04);
  }
}

@media (hover: none) and (pointer: coarse) {
  .cake-img:active {
    box-shadow: 0 4px 16px oklch(0.17 0.015 300 / 0.08);
  }
  .cake-img:active .cake-photo {
    transform: scale(1.02);
  }
}

/* ── Lightbox ─────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    max(1.5rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom))
    max(1.5rem, env(safe-area-inset-left));
  background: oklch(0 0 0 / 0.92);
  border: none;
  cursor: zoom-out;
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox::backdrop {
  background: transparent;
}

@keyframes lb-in      { from { opacity: 0; }                          to { opacity: 1; } }
@keyframes lb-out     { from { opacity: 1; }                          to { opacity: 0; } }
@keyframes lb-img-in  { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: scale(1); } }
@keyframes lb-img-out { from { opacity: 1; transform: scale(1); }    to { opacity: 0; transform: scale(0.88); } }

.lightbox[open]:not(.lightbox--closing) { animation: lb-in 0.22s var(--ease-expo) both; }
.lightbox[open]:not(.lightbox--closing) .lightbox__img { animation: lb-img-in 0.32s var(--ease-expo) both; }
.lightbox--closing { animation: lb-out 0.16s var(--ease-quart) both; }
.lightbox--closing .lightbox__img { animation: lb-img-out 0.16s var(--ease-quart) both; }

.lightbox__img {
  display: block;
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 6px;
  cursor: default;
  box-shadow: 0 32px 100px oklch(0 0 0 / 0.6);
}

.lightbox__close {
  position: fixed;
  top: max(1.25rem, env(safe-area-inset-top));
  right: max(1.25rem, env(safe-area-inset-right));
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: none;
  background: oklch(1 0 0 / 0.15);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease-quart);
}

@media (hover: hover) {
  .lightbox__close:hover { background: oklch(1 0 0 / 0.28); }
}
@media (hover: none) and (pointer: coarse) {
  .lightbox__close:active { background: oklch(1 0 0 / 0.28); }
}

.lightbox__close:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

/* ── Carousel ─────────────────────────────────────────────────── */
.carousel {
  position: relative;
}

.carousel__viewport {
  overflow: hidden;
  border-radius: 8px;
}

.carousel__track {
  display: flex;
  transition: transform 0.45s var(--ease-expo);
  will-change: transform;
}

.carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
}

.carousel__slide .cake-img {
  height: clamp(260px, 40vw, 520px);
  border-radius: 0;
}

.carousel__counter {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  background: oklch(0 0 0 / 0.45);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  pointer-events: none;
  letter-spacing: 0.02em;
  z-index: 1;
}

.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.carousel__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  flex-shrink: 0;
  transition:
    background    0.2s var(--ease-quart),
    border-color  0.2s var(--ease-quart),
    color         0.2s var(--ease-quart);
}

.carousel__btn:is(:hover, :focus-visible) {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  outline: none;
}

.carousel__btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.carousel__btn:active { transform: scale(0.93); }

.carousel__dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition:
    background 0.2s var(--ease-quart),
    transform  0.2s var(--ease-quart);
}

.carousel__dot.is-active {
  background: var(--primary);
  transform: scale(1.5);
}

.carousel__dot:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ── Special CTA ──────────────────────────────────────────────── */
.special-cta {
  display: flex;
  align-items: center;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
}

.special-cta__left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.special-cta__text {
  color: var(--primary-light);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  font-weight: 500;
  text-wrap: pretty;
}

.special-cta__fb {
  font-size: 0.875rem;
  color: oklch(1 0 0 / 0.6);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.18s var(--ease-quart);
}

.special-cta__fb:hover { color: oklch(1 0 0 / 0.9); }

.special-cta__fb:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.625rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--accent);
  color: white;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background 0.2s var(--ease-quart),
    box-shadow 0.2s var(--ease-quart);
}

.btn-primary:is(:hover, :focus-visible) {
  background: var(--accent-h);
  box-shadow: 0 4px 16px oklch(0.50 0.22 22 / 0.28);
  outline: none;
}

.btn-primary:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

.btn-primary:active { box-shadow: none; }

/* ── Scroll-reveal ────────────────────────────────────────────── */
/* Added by JS — carousels are visible by default (no JS = fully visible) */
.carousel.will-animate {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity   0.5s var(--ease-expo),
    transform 0.5s var(--ease-expo);
}

.carousel.will-animate.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 599px) {
  .special-cta {
    flex-direction: column;
    align-items: flex-start;
  }
  .special-cta__text { min-width: 0; }
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .carousel__track { transition: none; }
  .carousel.will-animate {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .carousel__btn:active { transform: none; }
  .carousel__btn,
  .carousel__dot,
  .cake-photo,
  .cake-img,
  .btn-primary,
  .lightbox__close { transition: none; }
  .gallery-header__title,
  .lightbox[open]:not(.lightbox--closing),
  .lightbox[open]:not(.lightbox--closing) .lightbox__img,
  .lightbox--closing,
  .lightbox--closing .lightbox__img { animation: none; }
}
