/* The Palace Venue - light theme + motion.
   Bump the ?v= query in index.html whenever this file or motion.js changes (server caches non-HTML for 1 day). */

:root {
  --cream: #faf7f2;
  --cream-warm: #f4efe6;
  --ink: #33000f; /* headings on cream use the brand wine */
  --ink-soft: #5b4a50;
  --gold-ink: #7d5f10; /* gold readable on cream (AA) */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --soft: cubic-bezier(.25, .46, .45, .94); /* gentle ease-out for entrances */
  --reveal: 1.4s;
}

/* ---------- Light sections ---------- */
.theme-light {
  background: var(--cream);
  isolation: isolate;
}
#contact.theme-light { background: var(--cream-warm); }

.theme-light > * { position: relative; z-index: 1; }

/* Off-screen reveal offsets must never create horizontal scroll (clip keeps position: sticky working) */
html, body, main { overflow-x: clip; }

/* ---------- Section "curtain" transitions ---------- */
/* Hero stays pinned; every following section slides up over the previous one with rounded top corners. */
#home { position: sticky !important; top: 0; }
#home > a[aria-label="Scroll down"] { bottom: 4rem; }

/* ---------- Hero sizing: fits the visible viewport on any device ---------- */
#home {
  min-height: 100vh;                 /* fallback */
  min-height: min(100svh, 1100px);   /* svh = visible height without the mobile browser bars; capped on very tall screens */
}
#home .z-10 {
  padding-top: clamp(5.5rem, 13svh, 9rem);   /* clears the fixed header */
  padding-bottom: clamp(4rem, 10svh, 6rem);  /* leaves room for the scroll arrow and the next section's peek */
}
#home h1 { font-size: clamp(2.375rem, min(7.5vw, 9.5svh), 4.25rem); line-height: 1.15; }
#home .z-10 > .inline-flex { margin-bottom: clamp(.75rem, 3svh, 2rem); }
#home .z-10 > :nth-child(4),
#home .z-10 > :nth-child(5) { margin-top: clamp(1rem, 4.5svh, 3.5rem); }
#home .z-10 > :nth-child(3) { margin-top: clamp(.5rem, 2svh, 1rem); }
/* If the content is still taller than the screen (short landscape phones), stop pinning so nothing is unreachable (class set from motion.js) */
#home.hero-flow { position: relative !important; }
@media (max-height: 520px) { #home > a[aria-label="Scroll down"] { display: none; } }
main section[id]:not(#home) {
  position: relative;
  margin-top: -2rem;
  border-radius: 2rem 2rem 0 0;
  transform-origin: 50% 0;
  padding-block: 7rem !important;
}
@media (max-width: 767px) { main section[id]:not(#home) { padding-block: 5rem !important; border-radius: 1.5rem 1.5rem 0 0; margin-top: -1.5rem; } }
#services { background: rgb(var(--wine-logo)); }
footer { position: relative; margin-top: -2rem; border-radius: 2rem 2rem 0 0; padding-top: 2rem; transform-origin: 50% 0; }
/* First section starts exactly at the hero fold: no cream edge visible on the first screen */
main section#who-we-are { margin-top: 0 !important; }

/* Text */
.theme-light .text-cream-champagne { color: var(--ink); }
.theme-light .text-on-surface-variant { color: var(--ink-soft); }
.theme-light .text-on-surface-variant\/80 { color: #6b5a60; }
.theme-light .text-on-surface { color: #1a1a1a; }
.theme-light .text-secondary,
.theme-light .text-gold-light,
.theme-light .text-secondary\/70 { color: var(--gold-ink); }
.theme-light .text-outline { color: #6f5f64; }
.theme-light .text-gold-antique\/60 { color: #b48b1e; }
.theme-light .group:hover .group-hover\:text-gold-light { color: var(--gold-ink); }
.theme-light .hover\:text-secondary:hover { color: var(--ink); }

/* Cards, chips, icon wells */
.theme-light .bg-surface-container-low {
  background: #fff;
  border: 1px solid rgba(201, 158, 50, .3);
  box-shadow: 0 10px 30px -5px rgba(61, 7, 30, .08);
}
.theme-light .bg-surface-container-high\/90,
.theme-light .bg-surface-container-high\/60 { background: var(--cream-warm); }
.theme-light .bg-surface-container-high { background: var(--cream-warm); }
.theme-light .hover\:bg-surface-container:hover { background: var(--cream-warm); }
.theme-light .bg-primary-container\/40 { background: rgba(74, 12, 36, .08); }
.theme-light .bg-surface-container-lowest\/60 { background: #fff; }
.theme-light [data-photo-slot] { background: #fff; border-color: rgba(201, 158, 50, .5); }
.theme-light .hover\:bg-gold-bright:hover { background: #d4af37; }
.theme-light .hover\:text-surface-container-lowest:hover { color: #1a1a1a; }
.theme-light iframe { filter: none !important; opacity: 1 !important; }

/* Wine accent strip stays dark on the light page */
.theme-light .keep-dark .text-cream-champagne { color: #faf7f2; }
.theme-light .keep-dark .text-gold-light { color: #f3e5ab; }
.theme-light .keep-dark .text-secondary { color: #efc051; }
.theme-light .keep-dark .bg-surface-container-lowest\/60 { background: rgba(14, 14, 14, .6); }

/* ---------- Hover polish (transform, not translate, so it does not fight the reveal) ---------- */
/* Hover transitions for these cards live in the [data-reveal] transition list below (an id selector here would override it and kill the fade-in). */
#who-we-are .grid > div:hover,
#services .grid > div:hover { transform: translateY(-4px); }
#services .grid > div:hover { box-shadow: 0 10px 40px -8px rgba(212, 175, 55, .28); }
#who-we-are .grid > div:hover { box-shadow: 0 14px 34px -8px rgba(61, 7, 30, .18); }

/* Book Now: always the most visible button; add a slow shine */
a[href^="tel:"].rounded-full { overflow: hidden; }
a[href^="tel:"].rounded-full::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .4), transparent);
  transform: skewX(-20deg); pointer-events: none;
}
a[href^="tel:"].rounded-full > * { position: relative; z-index: 2; }

/* ---------- Header ---------- */
.site-header > div:first-child { transition: height .35s var(--ease); }
.site-header > div:first-child { height: 7rem; }
.site-header.scrolled > div:first-child { height: 5.25rem; }
@media (max-width: 767px) { .site-header > div:first-child { height: 5.5rem; } .site-header.scrolled > div:first-child { height: 4.5rem; } }
/* Brand wine sampled from the logo's background (most frequent exact pixel color: #33000f). Transparent at the top, flat solid wine once scrolled. No gradients. */
:root { --wine-logo: 51, 0, 15; } /* #33000f: the most frequent exact color in logo.png's background */
header.site-header {
  position: fixed;
  background-color: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom-color: transparent;
  box-shadow: none;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease), backdrop-filter .4s var(--ease);
}
header.site-header.scrolled {
  background-color: rgb(var(--wine-logo));
  border-bottom-color: rgba(201, 158, 50, .35);
}
/* Mobile dropdown open: solid wine at any scroll position; the panel itself is transparent so bar and dropdown match */
header.site-header #mobile-menu { background-color: transparent; border-color: rgba(201, 158, 50, .35); }
header.site-header:has(#mobile-menu:not(.hidden)) {
  background-color: rgb(var(--wine-logo));
  border-bottom-color: rgba(201, 158, 50, .35);
}


/* ---------- Motion (skipped entirely for reduced-motion users) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Hero: Ken Burns on scale, parallax uses translate (set from JS) */
  #home [role="img"] { scale: 1; translate: none; } /* video shown at 1:1, no zoom or parallax */
  .js #home .z-10 > * { opacity: 0; animation: rise 1.5s var(--soft) forwards; }
  .js #home .z-10 > :nth-child(1) { animation-delay: .2s; }
  .js #home .z-10 > :nth-child(2) { animation-delay: .5s; }
  .js #home .z-10 > :nth-child(3) { animation-delay: .8s; }
  .js #home .z-10 > :nth-child(4) { animation-delay: 1.1s; }
  .js #home .z-10 > :nth-child(5) { animation-delay: 1.4s; }
  a[href^="tel:"].rounded-full::after { animation: shine 5.5s ease-in-out 2.2s infinite; }

  /* Scroll reveal (hidden state only exists when JS is running) */
  .js [data-reveal] {
    opacity: 0; translate: 0 18px;
    transition:
      opacity var(--reveal) var(--soft) var(--d, 0ms),
      translate var(--reveal) var(--soft) var(--d, 0ms),
      scale var(--reveal) var(--soft) var(--d, 0ms),
      transform .35s var(--ease), box-shadow .35s var(--ease), background-color .35s var(--ease);
  }
  .js [data-reveal="fade"] { translate: none; }
  .js [data-reveal="scale"] { translate: none; scale: .96; }
  .js [data-reveal="left"] { translate: -22px 0; }
  .js [data-reveal="right"] { translate: 22px 0; }
  .js [data-reveal="orn"] { translate: none; scale: 0 1; opacity: .6; }
  .js [data-reveal].in { opacity: 1; translate: 0 0; scale: 1; }
  .js [data-reveal="orn"].in { opacity: .6; }

  /* Mobile menu + lightbox */
  #mobile-menu:not(.hidden) { animation: menuIn .32s var(--ease); }
  #lightbox-modal:not(.hidden) { animation: fadeIn .3s ease; }
  #lightbox-modal:not(.hidden) img { animation: pop .4s var(--ease); }

  @keyframes kenburns { from { scale: 1.1; } to { scale: 1.2; } }
  @keyframes rise { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
  @keyframes shine { 0%, 62% { left: -60%; } 100% { left: 130%; } }
  @keyframes menuIn { from { opacity: 0; translate: 0 -10px; } to { opacity: 1; translate: 0 0; } }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes pop { from { opacity: 0; scale: .94; } to { opacity: 1; scale: 1; } }
}

/* ---------- Back-to-top button ---------- */
#to-top {
  position: fixed; right: max(1.25rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 40; width: 3rem; height: 3rem; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: rgb(var(--wine-logo)); color: #f3e5ab; border: 1px solid #c99e32;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .45), 0 0 0 4px rgba(250, 247, 242, .12);
  transition: opacity .35s var(--ease), translate .35s var(--ease), background-color .25s, color .25s, box-shadow .25s;
}
#to-top:hover { background: #d4af37; color: #1a1a1a; box-shadow: 0 8px 28px -4px rgba(212, 175, 55, .5); }
#to-top:focus-visible { outline: 2px solid #d4af37; outline-offset: 3px; }
#to-top .material-symbols-outlined { font-size: 28px; transition: translate .25s var(--ease); }
#to-top:hover .material-symbols-outlined { translate: 0 -2px; }
.js #to-top { opacity: 0; translate: 0 16px; pointer-events: none; visibility: hidden; }
.js #to-top.show { opacity: 1; translate: 0 0; pointer-events: auto; visibility: visible; }

/* ---------- Logo (client's provisional logo.png, background removed) ---------- */
.site-logo { height: 6rem; width: auto; display: block; filter: drop-shadow(0 2px 10px rgba(212, 175, 55, .18)); transition: height .35s var(--ease), transform .35s var(--ease), filter .35s; }
.site-header.scrolled .site-logo { height: 4.5rem; }
a:hover > .site-logo { transform: scale(1.04); filter: drop-shadow(0 2px 14px rgba(212, 175, 55, .4)); }
@media (max-width: 767px) { .site-logo { height: 4.75rem; } .site-header.scrolled .site-logo { height: 3.75rem; } }
.footer-logo { height: 11rem; width: auto; display: block; }
@media (max-width: 767px) { .footer-logo { height: 9rem; } }

/* Hero photo: one flat wine tint (no gradient), a bit more transparent than the first version (.5 -> .38) */
.hero-tint { background-color: rgba(var(--wine-logo), .38); }

/* Layered shadows on the text and logo keep them readable over the bright photo (no overlay, no tint). Layered shadows on the text and logo keep them readable over the bright photo. */
#home h1 { text-shadow: 0 0 2px rgba(0, 0, 0, .55), 0 2px 18px rgba(0, 0, 0, .65), 0 4px 32px rgba(0, 0, 0, .45); }
#home .z-10 > p { text-shadow: 0 0 2px rgba(0, 0, 0, .7), 0 1px 14px rgba(0, 0, 0, .75), 0 2px 26px rgba(0, 0, 0, .5); font-weight: 500; }
header.site-header:not(.scrolled) nav a,
header.site-header:not(.scrolled) #mobile-nav-toggle { text-shadow: 0 0 3px rgba(0, 0, 0, .9), 0 1px 12px rgba(0, 0, 0, .8), 0 2px 22px rgba(0, 0, 0, .55); font-weight: 600; }
header.site-header:not(.scrolled) .site-logo { filter: drop-shadow(0 0 2px rgba(0, 0, 0, .9)) drop-shadow(0 2px 8px rgba(0, 0, 0, .8)) drop-shadow(0 4px 18px rgba(0, 0, 0, .55)); }
#home > a[aria-label="Scroll down"] { color: #fff; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .85)); }


/* ================= Brand wine everywhere (replaces the prototype's near-black surfaces) =================
   Base: --wine-logo (#33000f). --wine-card: a slightly lighter wine for cards sitting on it. Flat colors only. */
:root { --wine-card: 66, 10, 28; --wine-hover: 80, 18, 38; }

/* Page background (also what peeks out at the sides during the curtain transitions) */
html, body[class], main[class] { background-color: rgb(var(--wine-logo)); }

/* Services (dark section): wine cards with a gold hairline */
#services .bg-surface-container-low { background-color: rgb(var(--wine-card)); border: 1px solid rgba(201, 158, 50, .28); box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .4); }
#services .hover\:bg-surface-container:hover,
#services .bg-surface-container-low:hover { background-color: rgb(var(--wine-hover)); }
#services .bg-wine-cabernet\/40 { background-color: rgba(var(--wine-logo), .7); }

/* Hero badge and notice, previously charcoal */
#home .z-10 > .inline-flex { background-color: rgba(var(--wine-logo), .88); }
#home .z-10 > :nth-child(5) { background-color: rgba(var(--wine-logo), .8); border: 1px solid rgba(201, 158, 50, .3); }

/* "Included with Every Rental": flat wine instead of the wine gradient */
.theme-light .keep-dark { background-image: none !important; background-color: rgb(var(--wine-logo)); }
.theme-light .keep-dark .bg-surface-container-lowest\/60 { background-color: rgba(255, 255, 255, .06); border: 1px solid rgba(201, 158, 50, .3); }

/* Footer */
footer[class] { background-color: rgb(var(--wine-logo)); border-top-color: rgba(201, 158, 50, .4); }
footer .bg-surface-container-low { background-color: rgba(255, 255, 255, .06); }

/* Lightbox */
#lightbox-modal { background-color: rgba(var(--wine-logo), .96); }
#lightbox-modal button { background-color: rgb(var(--wine-card)); }

/* Gallery (The Grand Hall / The Intimate Salon): every tile is the same 3:4 size at every width.
   2 columns on phones and tablets, 4 from 1024px. Photos are cropped to fill (the lightbox shows them whole). */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.gallery-grid .gallery-tile { display: block; margin: 0; aspect-ratio: 3 / 4 !important; }
.gallery-grid .gallery-tile img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 640px) { .gallery-grid { gap: 1.25rem; } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }

/* Hero video: same flat wine tint (.hero-tint) sits on top; with reduced motion the poster image is shown instead */
.hero-video { display: block; opacity: 1; transition: opacity .45s ease; }
.hero-video.fade-out { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .hero-video { display: none; } }
