/* Custom styles beyond Tailwind utility classes */

/* Smooth scroll for anchor navigation — respect reduced-motion preference */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Honor reduced motion across all transitions/animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Global keyboard focus ring — mouse clicks stay clean, keyboard users get clarity */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #b45309; /* amber-700 */
  outline-offset: 3px;
  border-radius: 2px;
}
/* Navbar transparent state: use amber-300 for contrast against dark hero gradient */
.navbar:not(.scrolled) a:focus-visible,
.navbar:not(.scrolled) button:focus-visible {
  outline-color: #fcd34d; /* amber-300 */
}

/* Navbar transition: transparent → solid on scroll */
.navbar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.navbar.scrolled {
  background-color: #faf8f4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  color: #1c1917; /* stone-900 */
}

.navbar.scrolled a:hover {
  color: #d97706; /* amber-600 */
}

.navbar.scrolled .border-white\/40 {
  border-color: #d6d3d1; /* stone-300 */
}

.navbar.scrolled .border-white\/40:hover {
  background-color: #fafaf9; /* stone-50 */
}

/* Warm cream page background (instead of pure white) */
body {
  background-color: #faf8f4;
}

/* Hero background — responsive WebP served via image-set */
.hero-bg {
  background-image: url('/images/hero-900.webp');
}
@media (min-width: 900px) {
  .hero-bg {
    background-image: url('/images/hero-1600.webp');
  }
}

/* Fraunces display serif: tighter tracking, optical size tuned for headlines */
.font-serif {
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  letter-spacing: -0.015em;
}

h1.font-serif,
h2.font-serif {
  letter-spacing: -0.025em;
}

/* Gallery lightbox overlay */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-height: 85vh;
  max-width: 92vw;
  object-fit: contain;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
}

/* Chat widget */
.chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
}

.chat-panel {
  display: none;
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 380px;
  max-height: 500px;
  z-index: 40;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.chat-panel.open {
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .chat-panel {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 4.5rem;
    max-height: 70vh;
  }
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.3s ease;
  background-color: #e7e5e4; /* stone-200 — subtle placeholder before load */
}

@media (hover: hover) {
  .gallery-grid img:hover {
    opacity: 0.92;
    transform: scale(1.015);
  }
}

/* Gallery category tabs */
.gallery-tabs button {
  transition: color 0.2s ease, border-color 0.2s ease;
}

.gallery-tabs button.active {
  color: #b45309; /* amber-700 */
  border-bottom: 2px solid #b45309;
}

/* Virtual tour 16:9 responsive container */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  overflow: hidden;
  border-radius: 0.75rem;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Mobile menu overlay */
.mobile-menu {
  display: none;
}

.mobile-menu.open {
  display: flex;
  flex-direction: column;
}

/* Lightbox nav buttons */
.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: white;
  font-size: 2rem;
  line-height: 1;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-btn.prev {
  left: 1rem;
}

.lightbox-btn.next {
  right: 1rem;
}

.lightbox-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile lightbox tweaks: larger tap targets, edge padding */
@media (max-width: 640px) {
  .lightbox img {
    max-height: 75vh;
    max-width: 96vw;
  }
  .lightbox-btn {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 2.25rem;
  }
  .lightbox-btn.prev { left: 0.5rem; }
  .lightbox-btn.next { right: 0.5rem; }
  .lightbox-caption {
    bottom: max(1rem, env(safe-area-inset-bottom));
    max-width: 90vw;
  }
}

/* Focus indicators for lightbox controls */
.lightbox-btn:focus-visible,
.lightbox-close:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Focus indicators for gallery images */
.gallery-grid img:focus-visible {
  outline: 2px solid #d97706; /* amber-600 */
  outline-offset: 2px;
}

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.875rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.25rem 1rem;
  border-radius: 0.5rem;
}
