/* ============================================================
   style.css — La Demeure du Val
   Global design system, shared components, layout
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
  --color-bg:      #FAF7F2;
  --color-surface: #F2EDE4;
  --color-text:    #1C1A17;
  --color-muted:   #7A7168;
  --color-accent:  #B5541A;
  --color-gold:    #C9A96E;
  --color-white:   #FFFFFF;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --nav-height:     72px;
  --container-max:  1200px;

  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 16px; }
img   { display: block; max-width: 100%; height: auto; }
a     { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

body {
  font-family: var(--font-body);
  background:  var(--color-bg);
  color:       var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

.section {
  padding: clamp(4rem, 10vw, 8rem) 0;
}

/* ---- Typography ---- */
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.section-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--color-muted);
  margin-top: 0.75rem;
  max-width: 52ch;
}

.section-header {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease-smooth);
  cursor: pointer;
}

.btn--primary {
  background: var(--color-white);
  color: var(--color-text);
}
.btn--primary:hover {
  background: var(--color-gold);
  color: var(--color-white);
}

.btn--ghost {
  background: transparent;
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-white);
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-white);
}
.btn--accent:hover {
  background: #9a4515;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}

/* Scrolled background via pseudo-element opacity — keeps transition GPU-composited */
.nav::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(250, 247, 242, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(28, 26, 23, 0.08);
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
  z-index: -1;
}

.nav.scrolled::before {
  opacity: 1;
}

.nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Logo */
.nav__logo {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.nav__logo:hover { opacity: 0.65; }

.nav__logo-top {
  font-family: var(--font-body);
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.4s;
}
.nav.scrolled .nav__logo-top { color: var(--color-muted); }

.nav__logo-name {
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-white);
  transition: color 0.4s;
}
.nav.scrolled .nav__logo-name { color: var(--color-text); }

/* Desktop nav links — hidden on mobile */
.nav__links {
  display: none;
  align-items: center;
  gap: 2rem;
  flex: 1;
  justify-content: center;
}

.nav__link {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
  position: relative;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--color-gold);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease-smooth);
}
.nav__link:hover,
.nav__link.is-active { color: var(--color-white); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }

.nav.scrolled .nav__link { color: var(--color-muted); }
.nav.scrolled .nav__link:hover,
.nav.scrolled .nav__link.is-active { color: var(--color-text); }

/* Right-side actions */
.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-shrink: 0;
}

/* Lang toggle */
.lang-btn {
  line-height: 1;
  color: var(--color-white);
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.25s;
}
.lang-btn svg {
  display: block;
  border-radius: 3px;
}
.nav.scrolled .lang-btn {
  color: var(--color-text);
  border-color: rgba(28, 26, 23, 0.2);
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.12); }
.nav.scrolled .lang-btn:hover { background: var(--color-surface); }

/* Contact CTA button — hidden on mobile */
.nav__cta {
  display: none;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--color-accent);
  color: var(--color-white);
  padding: 0.5rem 1.125rem;
  transition: background 0.25s;
  white-space: nowrap;
}
.nav__cta:hover { background: #9a4515; }

/* Hamburger — visible on mobile only */
.nav__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  color: var(--color-white);
  transition: color 0.4s;
}
.nav.scrolled .nav__burger { color: var(--color-text); }

.nav__burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.25s ease, width 0.25s ease;
}
.nav__burger.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__burger.is-active span:nth-child(2) { opacity: 0; width: 0; }
.nav__burger.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.nav__mobile {
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--color-bg);
  padding: 1.75rem clamp(1.25rem, 5vw, 3rem) 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-6px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 99;
}
.nav__mobile.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.nav__mobile-link {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-surface);
  transition: color 0.2s;
}
.nav__mobile-link:hover,
.nav__mobile-link.is-active { color: var(--color-text); }

.nav__mobile-cta {
  display: inline-flex;
  align-self: flex-start;
  background: var(--color-accent);
  color: var(--color-white) !important;
  border-bottom: none;
  padding: 0.875rem 1.75rem;
  margin-top: 1.5rem;
  transition: background 0.25s;
}
.nav__mobile-cta:hover { background: #9a4515; color: var(--color-white) !important; }

.nav__mobile-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-surface);
}

.lang-btn--dark {
  color: var(--color-text);
  border-color: rgba(28, 26, 23, 0.2);
}
.lang-btn--dark:hover { background: var(--color-surface); }

/* Lang label visibility */
html.lang-fr .lang-fr-label { display: block; }
html.lang-fr .lang-en-label { display: none;  }
html.lang-en .lang-fr-label { display: none;  }
html.lang-en .lang-en-label { display: block; }

/* Desktop breakpoint — show links, hide burger */
@media (min-width: 768px) {
  .nav__links  { display: flex; }
  .nav__cta    { display: inline-flex; }
  .nav__burger { display: none; }
  .nav__mobile { display: none; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
  /* placeholder bg while image loads */
  background: var(--color-surface);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 13, 10, 0.25) 0%,
    rgba(15, 13, 10, 0.52) 55%,
    rgba(15, 13, 10, 0.72) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--color-white);
  padding: 0 1.25rem;
  max-width: 820px;
}

.hero__eyebrow {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 1.25rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 1;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.hero__location {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 1.5rem;
}

.hero__tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.125rem, 2.5vw, 1.625rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 3rem;
}

.hero__ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero__scroll-line {
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.55));
  transform-origin: top;
  animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50%       { opacity: 1;   transform: scaleY(1); }
}

/* ---- Gallery ---- */
.gallery {
  background: var(--color-bg);
  overflow: visible;
}
.gallery .section-title { color: var(--color-text); }
.gallery .section-sub   { color: var(--color-muted); }

/* ---- Photo grid — mobile-first, same layout on all screens ---- */

/* Shared button styles */
.photo-grid__main,
.photo-grid__cell {
  cursor: pointer;
  overflow: hidden;
  border: none;
  padding: 0;
  background: var(--color-surface);
  display: block;
  position: relative;
}
.photo-grid__main img,
.photo-grid__cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.photo-grid__main:hover img { transform: scale(1.04); }
.photo-grid__cell:hover img  { transform: scale(1.06); }

/* "Show all photos" badge */
.photo-grid__show-all {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-white);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  pointer-events: none;
  white-space: nowrap;
}
.photo-grid__show-all svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Mobile: stacked — large image on top, 2×2 grid below */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  border-radius: 12px;
  overflow: hidden;
}
.photo-grid__main {
  aspect-ratio: 4 / 3;
  width: 100%;
}
.photo-grid__side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.photo-grid__cell {
  aspect-ratio: 4 / 3;
  width: 100%;
}

/* Desktop: side-by-side — large left, 2×2 right */
@media (min-width: 768px) {
  .photo-grid {
    grid-template-columns: 58% 42%;
    grid-template-rows: clamp(380px, 50vh, 540px);
    gap: 8px;
    border-radius: 14px;
  }
  .photo-grid__main { aspect-ratio: unset; }
  .photo-grid__cell  { aspect-ratio: unset; }
  .photo-grid__side  { gap: 8px; }
}

/* ---- Lightbox ---- */
[hidden] { display: none !important; }

.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh; /* iOS Safari dynamic viewport */
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.95);
  cursor: pointer;
}

.lightbox__stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  /* Mobile: minimal padding so image fills the screen */
  padding: 3.5rem 0.5rem 2.5rem;
}

@media (min-width: 768px) {
  .lightbox__stage { padding: 4rem 5rem; }
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: background 0.2s;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox__close svg   { width: 20px; height: 20px; }

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: background 0.2s;
}
.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }
.lightbox__prev:hover,
.lightbox__next:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox__prev svg,
.lightbox__next svg { width: 22px; height: 22px; }

.lightbox__counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
}




/* ---- Key Figures ---- */
.figures {
  background: var(--color-surface);
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.figures__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(28, 26, 23, 0.1);
}

.figure-item {
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 4vw, 3rem) 1rem;
  text-align: center;
  gap: 0.625rem;
}

.figure-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 300;
  line-height: 1;
  color: var(--color-accent);
}

.figure-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ---- Description ---- */
.description__header { margin-bottom: 2.5rem; }

.description__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.description__col p {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.85;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}
.description__col p:last-of-type { margin-bottom: 2rem; }

/* ---- Features ---- */
.features { background: var(--color-surface); }

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: rgba(28, 26, 23, 0.08);
}

.feature-item {
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.875rem;
  padding: 2rem 1.25rem;
  transition: background 0.2s, transform 0.2s var(--ease-smooth);
}
.feature-item:hover {
  background: var(--color-white);
  transform: translateY(-2px);
}

.feature-icon {
  width: 32px;
  height: 32px;
  color: var(--color-gold);
}
.feature-icon svg { width: 100%; height: 100%; }

.feature-item span:last-child {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  text-transform: uppercase;
}

/* ---- Location ---- */
.location__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.location__text .section-title { margin-bottom: 1.5rem; }

.location__text p {
  font-size: 1.0625rem;
  line-height: 1.82;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
}

.location__highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.location__highlights li {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.location__highlights li::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--color-gold);
  flex-shrink: 0;
}

.location__map {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.location__map iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Map facade — click to load iframe */
.map-facade {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--color-surface);
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.08);
}
.map-facade__bg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--color-muted);
}
.map-facade__pin {
  width: 48px;
  height: 48px;
  color: var(--color-accent);
}
.map-facade__label {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--color-text);
  margin: 0;
}
.map-facade__cta {
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.5rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.2s;
}
.map-facade__cta:hover { opacity: 0.85; }

/* ---- Footer ---- */
.footer {
  background: var(--color-text);
  color: var(--color-white);
  padding: 3.5rem 0 2rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 1.5rem;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__name {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 400;
}

.footer__address {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.03em;
}

.footer__links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.footer__links a {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--color-gold); }

.footer__copy {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.28);
}

.footer__version {
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.15);
  margin-top: 0.25rem;
  font-family: monospace;
}

/* ---- Scroll Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity   0.85s var(--ease-out),
    transform 0.85s var(--ease-out);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .location__inner   { grid-template-columns: 1fr; }
  .description__body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .figures__grid { grid-template-columns: repeat(2, 1fr); }
  .hero__ctas    { flex-direction: column; align-items: center; }
}
