/* Stellario Tiramisu — styles shared by the marketing pages
   (/, /our-story/, /gallery/, /care-guide/, /enquire/).
   Load after /shop/assets/shop.css, which supplies the colour tokens, the body base and the
   site header / footer. Page layout itself is done with Tailwind utilities. */

/* Marketing pages end on a full-bleed section, so the footer sits flush against it. */
.sw-footer { margin-top: 0; }

/* The first section fills the screen under the sticky header. */
.page-fill { min-height: calc(100vh - var(--sw-header-h)); }

/* Images carry width/height attributes (so lazy loading has a box to work with);
   never let those stretch a photo. Tailwind sizing utilities still win. */
main img { max-width: 100%; height: auto; }

/* ── Sections ── */

.hero-bg {
  background-color: #EDE3C8;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(107, 48, 22, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(107, 48, 22, 0.05) 0%, transparent 50%);
}

.card-hover { transition: transform 0.4s ease, box-shadow 0.4s ease; }
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(107, 48, 22, 0.18);
}

.img-reveal { overflow: hidden; }
.img-reveal img { transition: transform 0.6s ease; }
.img-reveal:hover img { transform: scale(1.04); }

.divider {
  width: 48px;
  height: 1px;
  background: #6B3016;
  margin: 0 auto;
}

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

.fade-up { animation: fadeUp 0.9s ease both; }
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

/* ── Gallery ── */

.gallery-mosaic {
  column-count: 3;
  column-gap: 1rem;
}

@media (max-width: 900px) {
  .gallery-mosaic { column-count: 2; column-gap: 0.75rem; }
}

@media (max-width: 480px) {
  .gallery-mosaic { column-count: 2; column-gap: 0.5rem; }
}

.gallery-tile {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  box-shadow: 0 6px 18px rgba(107, 48, 22, 0.08);
  transition: box-shadow 0.4s ease;
  display: block;
}

/* Scroll reveal: tiles are visible unless the page script has opted in (.js-reveal on the grid). */
.js-reveal .gallery-tile {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease, transform 0.9s ease, box-shadow 0.4s ease;
}

@media (max-width: 900px) {
  .gallery-tile { margin-bottom: 0.75rem; }
}

@media (max-width: 480px) {
  .gallery-tile { margin-bottom: 0.5rem; }
}

.js-reveal .gallery-tile.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-tile img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
  will-change: transform;
}

.gallery-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(44, 26, 14, 0) 50%, rgba(44, 26, 14, 0.35) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-tile:hover { box-shadow: 0 18px 36px rgba(107, 48, 22, 0.22); }
.gallery-tile:hover img { transform: scale(1.05); filter: saturate(1.1); }
.gallery-tile:hover::after { opacity: 1; }

/* Decorative cream "stamp" badge */
.gallery-stamp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border: 1px solid rgba(107, 48, 22, 0.25);
  border-radius: 999px;
  background: rgba(245, 240, 228, 0.6);
}

.gallery-stamp .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6B3016;
  animation: stamp-pulse 2.4s ease-in-out infinite;
}

@keyframes stamp-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ── Lightbox ── */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(20, 11, 6, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* visibility flips only once the fade-out has finished */
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

#lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.4s ease, visibility 0s;
}

#lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 1100px);
  max-height: 84vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.96);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#lightbox.is-open #lightbox-img {
  opacity: 1;
  transform: scale(1);
}

/* Between photos: out of sight until the next file has loaded. */
#lightbox.is-open #lightbox-img.is-loading {
  opacity: 0;
  transition-duration: 0.15s;
}

/* The controls sit above the photo: on phones and tablets it runs underneath them. */
.lightbox-btn {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(20, 11, 6, 0.55);
  border: 1px solid rgba(245, 240, 228, 0.3);
  color: #F5F0E4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.lightbox-btn:hover {
  background: rgba(20, 11, 6, 0.8);
  border-color: rgba(245, 240, 228, 0.6);
  transform: scale(1.06);
}

.lightbox-btn.prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-btn.next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-btn.close { top: 24px; right: 24px; }

.lightbox-btn.prev:hover { transform: translateY(-50%) scale(1.06); }
.lightbox-btn.next:hover { transform: translateY(-50%) scale(1.06); }

.lightbox-btn:focus-visible { outline-color: #F5F0E4; }

.lightbox-counter {
  position: absolute;
  z-index: 2;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Lato', sans-serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(245, 240, 228, 0.5);
}

@media (max-width: 640px) {
  .lightbox-btn.prev { left: 12px; }
  .lightbox-btn.next { right: 12px; }
  .lightbox-btn.close { top: 12px; right: 12px; }
}

/* ── Enquiry: "message sent" dialog ── */

#success-modal {
  position: fixed;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#success-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease, visibility 0s;
}

#success-modal-inner {
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

#success-modal.is-open #success-modal-inner { transform: scale(1); }

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .fade-up { animation: none; }

  .card-hover,
  .img-reveal img,
  .gallery-tile,
  .js-reveal .gallery-tile,
  .gallery-tile img,
  .gallery-tile::after,
  .lightbox-btn,
  #lightbox,
  #lightbox.is-open,
  #lightbox-img,
  #lightbox.is-open #lightbox-img.is-loading,
  #success-modal,
  #success-modal.is-open,
  #success-modal-inner { transition: none; }

  .js-reveal .gallery-tile { opacity: 1; transform: none; }

  .card-hover:hover,
  .img-reveal:hover img,
  .gallery-tile:hover img,
  #lightbox-img,
  #success-modal-inner { transform: none; }

  .lightbox-btn:hover { transform: none; }
  .lightbox-btn.prev:hover,
  .lightbox-btn.next:hover { transform: translateY(-50%); }

  .gallery-stamp .dot { animation: none; opacity: 1; transform: none; }
}
