/* ========================================================================
   TOURAINE.NET — Styles
   Loire Valley Tourism — Editorial Luxury Aesthetic
   ======================================================================== */

/* --- Design Tokens --- */
:root {
  --c-cream: #F5F0E8;
  --c-sand: #E8E0D0;
  --c-gold: #B8964E;
  --c-gold-light: #D4B778;
  --c-forest: #2C4A3E;
  --c-forest-deep: #1A3028;
  --c-charcoal: #2B2B2B;
  --c-ink: #1A1A1A;
  --c-white: #FEFCF9;
  --c-muted: #7A7368;
  --c-wine: #722F37;
  --c-river: #4A7C8A;
  /* Font stacks with size-adjusted fallbacks */
  --ff-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --ff-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ff-accent: 'Cormorant', Georgia, serif;
  --max-w: 1280px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-body);
  background: var(--c-cream);
  color: var(--c-charcoal);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* --- Utility --- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.container { width: 92%; max-width: var(--max-w); margin: 0 auto; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: 1.15;
  /* Prevent font synthesis */
  font-synthesis: none;
}
h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); letter-spacing: -0.02em; color: var(--c-ink); }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
p { max-width: 68ch; }

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate { opacity: 0; }
.animate.in-view {
  animation: fadeUp .7s var(--ease) forwards;
}
.animate.in-view.delay-1 { animation-delay: .1s; }
.animate.in-view.delay-2 { animation-delay: .2s; }
.animate.in-view.delay-3 { animation-delay: .3s; }
.animate.in-view.delay-4 { animation-delay: .4s; }

/* ========================================================================
   HEADER / NAV
   ======================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 4%;
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.site-header.scrolled {
  background: rgba(245, 240, 232, .96);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; max-width: var(--max-w); margin: 0 auto;
}
.logo {
  font-family: var(--ff-display);
  font-size: 1.6rem; font-weight: 600;
  color: var(--c-forest-deep);
  letter-spacing: .02em;
}
.logo em {
  font-style: italic; font-weight: 400;
  color: var(--c-gold);
}
.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  /* Prevent layout shift */
  min-height: 40px;
}
.nav-links a {
  font-size: .85rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--c-charcoal);
  position: relative; padding-bottom: 2px;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1.5px; background: var(--c-gold);
  transition: width .35s var(--ease);
}
.nav-links a:hover::after, .nav-links a:focus::after { width: 100%; }

/* Mobile Menu */
.menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  width: 28px; padding: 4px 0;
}
.menu-toggle span {
  display: block; height: 2px; background: var(--c-charcoal);
  border-radius: 1px; transition: all .3s var(--ease);
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: 0;
    width: min(320px, 85vw); height: 100dvh;
    flex-direction: column; justify-content: center; gap: 2rem;
    background: var(--c-cream);
    transform: translateX(100%);
    transition: transform .45s var(--ease);
    box-shadow: -8px 0 32px rgba(0,0,0,.08);
    padding: 2rem;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.1rem; }
}

/* ========================================================================
   HERO
   ======================================================================== */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex; align-items: center;
  background: var(--c-forest-deep);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgba(26,48,40,.92) 0%, rgba(44,74,62,.7) 40%, rgba(184,150,78,.25) 100%);
  z-index: 1;
}
.hero-pattern {
  position: absolute; inset: 0; z-index: 0;
  opacity: .06;
  background-image:
    radial-gradient(circle at 20% 50%, var(--c-gold) 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, var(--c-gold) 1px, transparent 1px);
  background-size: 60px 60px, 45px 45px;
}
.hero-content {
  position: relative; z-index: 2;
  width: 92%; max-width: var(--max-w); margin: 0 auto;
  padding: 120px 0 80px;
  /* Aggressive CLS prevention */
  min-height: 600px;
  contain: layout style;
  /* Reserve exact space for content */
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-text-wrapper {
  /* Fixed container for hero text to prevent any shift */
  min-height: 350px;
  contain: layout;
  flex-shrink: 0;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .8rem; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--c-gold-light);
  margin-bottom: 1.5rem;
  min-height: 1.2rem; /* Prevent CLS */
  animation: fadeUp .7s var(--ease) .2s both;
}
.hero-eyebrow::before {
  content: ''; display: block;
  width: 32px; height: 1.5px;
  background: var(--c-gold);
}
.hero h1 {
  color: var(--c-white);
  max-width: 14ch;
  margin-bottom: 1.5rem;
  /* Fixed height to completely prevent CLS */
  height: calc(2 * 1.15 * 5.2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: fadeUp .7s var(--ease) .35s both;
}
@media (max-width: 768px) {
  .hero h1 { height: calc(2 * 1.15 * 2.8rem); }
}
.hero h1 span {
  display: block;
  font-style: italic; font-weight: 400;
  color: var(--c-gold-light);
}
.hero-desc {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: rgba(254,252,249,.75);
  max-width: 52ch; line-height: 1.7;
  margin-bottom: 2.5rem;
  min-height: 3.4em; /* Reserve space for 2 lines */
  animation: fadeUp .7s var(--ease) .5s both;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 1rem;
  animation: fadeUp .7s var(--ease) .65s both;
}
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .9rem 2rem;
  font-size: .85rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  border-radius: 2px;
  transition: all .3s var(--ease);
}
.btn-primary {
  background: var(--c-gold);
  color: var(--c-ink);
}
.btn-primary:hover { background: var(--c-gold-light); transform: translateY(-1px); }
.btn-outline {
  border: 1.5px solid rgba(254,252,249,.35);
  color: var(--c-white);
}
.btn-outline:hover { border-color: var(--c-gold-light); color: var(--c-gold-light); }

.hero-stats {
  display: flex; gap: 3rem; margin-top: 4rem;
  padding-top: 2.5rem; border-top: 1px solid rgba(255,255,255,.1);
  animation: fadeUp .7s var(--ease) .8s both;
}
.hero-stat strong {
  display: block;
  font-family: var(--ff-display);
  font-size: 2.4rem; font-weight: 500;
  color: var(--c-gold-light);
}
.hero-stat span {
  font-size: .78rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(254,252,249,.5);
}

/* ========================================================================
   PILLARS (3-Column Feature)
   ======================================================================== */
.pillars { padding: 7rem 0; }
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-eyebrow {
  font-size: .78rem; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: .8rem;
}
.section-header h2 { margin-bottom: 1rem; }
.section-header p {
  margin: 0 auto;
  color: var(--c-muted);
  font-size: 1.05rem;
}
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.pillar-card {
  position: relative;
  background: var(--c-white);
  border-radius: 4px;
  overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,.08);
}
.pillar-img {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--c-sand);
  overflow: hidden;
}
.pillar-img-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .5rem;
  font-family: var(--ff-display);
  font-size: 1rem; font-style: italic;
  color: var(--c-muted);
  background: linear-gradient(135deg, var(--c-sand) 0%, #DDD5C5 100%);
}
.pillar-img-placeholder svg { opacity: .4; }
.pillar-tag {
  position: absolute; top: 1rem; left: 1rem;
  padding: .35rem .85rem;
  font-size: .7rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--c-forest-deep);
  color: var(--c-gold-light);
  border-radius: 2px;
}
.pillar-body { padding: 1.8rem; }
.pillar-body h3 { margin-bottom: .7rem; }
.pillar-body h3 a { transition: color .25s; }
.pillar-body h3 a:hover { color: var(--c-gold); }
.pillar-body p {
  color: var(--c-muted);
  font-size: .95rem; line-height: 1.7;
  margin-bottom: 1.2rem;
}
.pillar-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--c-gold);
  transition: gap .3s var(--ease);
}
.pillar-link:hover { gap: .7rem; }
.pillar-link svg { width: 14px; height: 14px; }

@media (max-width: 900px) { .pillars-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; } }

/* ========================================================================
   INTERACTIVE MAP
   ======================================================================== */
.map-section {
  padding: 7rem 0;
  background: var(--c-forest-deep);
  color: var(--c-white);
}
.map-section .section-eyebrow { color: var(--c-gold-light); }
.map-section .section-header p { color: rgba(254,252,249,.6); }
.map-controls {
  display: flex; flex-wrap: wrap; gap: .6rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.map-filter {
  padding: .6rem 1.4rem;
  font-size: .8rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 2px;
  color: rgba(255,255,255,.6);
  transition: all .25s var(--ease);
}
.map-filter:hover { border-color: var(--c-gold); color: var(--c-gold-light); }
.map-filter.active {
  background: var(--c-gold);
  border-color: var(--c-gold);
  color: var(--c-ink);
}
.map-wrap {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #1a2e28;
}
.map-skeleton {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: #1a2e28;
  transition: opacity .5s;
}
.map-skeleton.loaded { opacity: 0; pointer-events: none; }
.map-skeleton-text {
  font-family: var(--ff-display);
  font-style: italic; font-size: 1.1rem;
  color: rgba(255,255,255,.25);
}
#map { width: 100%; height: 100%; min-height: 400px; }
.map-locate {
  margin-top: 1rem;
  display: flex; justify-content: center;
}
.map-locate .btn { font-size: .78rem; }

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  border-radius: 4px !important;
  font-family: var(--ff-body) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.15) !important;
}
.leaflet-popup-content { margin: 14px 16px !important; font-size: .9rem !important; }
.leaflet-popup-content strong { font-family: var(--ff-display); font-size: 1.1rem; display: block; margin-bottom: 4px; }
.leaflet-popup-content a { color: var(--c-gold); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.leaflet-popup-tip { box-shadow: none !important; }

@media (max-width: 768px) {
  .map-wrap { aspect-ratio: 4/3; }
}

/* ========================================================================
   HIGHLIGHTS / ITINERARIES
   ======================================================================== */
.highlights { padding: 7rem 0; }
.highlights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.highlight-card {
  display: flex; gap: 1.5rem;
  padding: 2rem;
  background: var(--c-white);
  border-radius: 4px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.highlight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.06);
}
.highlight-icon {
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-forest-deep);
  border-radius: 4px;
  color: var(--c-gold-light);
}
.highlight-text h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.highlight-text h3 a { transition: color .25s; }
.highlight-text h3 a:hover { color: var(--c-gold); }
.highlight-text p { color: var(--c-muted); font-size: .9rem; }
.highlight-meta {
  display: flex; gap: 1rem; margin-top: .6rem;
  font-size: .75rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--c-gold);
}

@media (max-width: 768px) {
  .highlights-grid { grid-template-columns: 1fr; }
  .highlight-card { flex-direction: column; }
}

/* ========================================================================
   FAQ
   ======================================================================== */
.faq {
  padding: 7rem 0;
  background: var(--c-white);
}
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 960px; margin: 0 auto;
  border-top: 1px solid var(--c-sand);
}
.faq-item {
  padding: 1.8rem 1.5rem;
  border-bottom: 1px solid var(--c-sand);
  cursor: pointer;
  transition: background .25s;
}
.faq-item:nth-child(odd) { border-right: 1px solid var(--c-sand); }
.faq-item:hover { background: var(--c-cream); }
.faq-q {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  font-family: var(--ff-display);
  font-size: 1.1rem; font-weight: 500;
  color: var(--c-ink);
}
.faq-q svg {
  flex-shrink: 0;
  width: 18px; height: 18px;
  color: var(--c-gold);
  transition: transform .3s var(--ease);
}
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .4s var(--ease), margin .4s var(--ease);
}
.faq-item.open .faq-a { max-height: 200px; margin-top: 1rem; }
.faq-a p { font-size: .9rem; color: var(--c-muted); line-height: 1.7; }

@media (max-width: 768px) {
  .faq-grid { grid-template-columns: 1fr; }
  .faq-item:nth-child(odd) { border-right: none; }
}

/* ========================================================================
   FOOTER
   ======================================================================== */
.site-footer {
  padding: 4rem 0 2rem;
  background: var(--c-ink);
  color: rgba(255,255,255,.5);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand .logo { margin-bottom: 1rem; }
.footer-brand .logo em { color: var(--c-gold); }
.footer-brand p { font-size: .9rem; line-height: 1.7; max-width: 32ch; }
.footer-col h4 {
  font-family: var(--ff-body);
  font-size: .75rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--c-gold); margin-bottom: 1.2rem;
}
.footer-col a {
  display: block; padding: .3rem 0;
  font-size: .88rem;
  transition: color .25s;
}
.footer-col a:hover { color: var(--c-white); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 2rem;
  font-size: .78rem;
}
.footer-bottom a { transition: color .25s; }
.footer-bottom a:hover { color: var(--c-gold-light); }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }
}

/* ========================================================================
   PRINT STYLES
   ======================================================================== */
@media print {
  .site-header, .map-section, .menu-toggle, .hero-actions { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  h1, h2, h3 { color: #000; }
  .hero { min-height: auto; background: none; padding: 2rem 0; }
  .hero h1, .hero-eyebrow, .hero-desc { color: #000; }
  .pillar-card, .highlight-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
}
