/* ============================================================
   CASALIONEL — Thème clair & lumineux
   Palette ivoire / blanc / anthracite · accent doré
   Typographies : Playfair Display (titres) + Inter (corps)
   ============================================================ */

:root {
  /* === Couleurs === */
  --bg:            #f6f3ee;          /* ivoire chaud */
  --bg-soft:       #efe9e0;          /* sections alternées */
  --card:          #ffffff;
  --text:          #2a2622;          /* anthracite chaud */
  --muted:         #6f6a63;          /* texte secondaire */
  --gold:          #a8843f;          /* doré profond (bon contraste sur clair) */
  --gold-soft:     #c9a86a;          /* doré doux */
  --gold-tint:     #f3e9d4;          /* fond doré très clair */
  --border:        rgba(42,38,34,0.10);
  --border-strong: rgba(42,38,34,0.18);
  --shadow:        0 10px 30px rgba(42,38,34,0.08);
  --shadow-lg:     0 18px 44px rgba(42,38,34,0.14);

  /* === Formes === */
  --radius:        16px;
  --radius-lg:     22px;
  --photo-ratio:   16 / 9;

  /* === Typo === */
  --font-title: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

/* Léger motif décoratif d'arrière-plan sur l'accueil */
.home-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 85% 0%, rgba(168,132,63,0.07), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(168,132,63,0.05), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

img { display: block; max-width: 100%; }

/* ============================================================
   HEADER — flexbox robuste ( enfants directs : brand, actions,
   language-switch, navbar ). Le bouton hamburger est injecté
   en premier enfant par app.js sur mobile.
   ============================================================ */
header {
  position: relative;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 18px rgba(42,38,34,0.05);
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 28px 0 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  order: 1;
}

.brand-name {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.1;
}

.brand-tagline {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.5px;
  font-style: italic;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  order: 3;
  margin-left: auto;
}

.action-link {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.action-link:hover {
  background: var(--gold-tint);
  transform: translateY(-2px);
}

.action-link svg {
  width: 22px;
  height: 22px;
  fill: var(--gold);
}

.action-link:focus-visible,
.language-switch button:focus-visible,
.slideshow-controls button:focus-visible,
.slideshow-toggle:focus-visible,
.slideshow:focus-visible,
.navbar a:focus-visible,
.grid-card:focus-visible,
.hero-cta:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Sélecteur de langue */
.language-switch {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 14px;
}

.language-switch button {
  width: 29px;
  height: 21px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language-switch button:hover { transform: translateY(-2px); }

.language-switch button.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.language-switch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Navigation */
.navbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  width: 100%;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding: 0 0 0 0;
  order: 4;
}

.navbar a {
  padding: 14px 18px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 500;
  position: relative;
  transition: color 0.2s ease;
}

.navbar a::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 8px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.navbar a:hover { color: var(--text); }
.navbar a:hover::after { transform: scaleX(1); }

.navbar a.active { color: var(--gold); }
.navbar a.active::after { transform: scaleX(1); }

/* ============================================================
   MAIN
   ============================================================ */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 28px;
}

.section-title {
  font-family: var(--font-title);
  text-align: center;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  margin: 0 0 32px 0;
  color: var(--text);
  letter-spacing: 0.5px;
}

.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  background: var(--gold);
  margin: 14px auto 0 auto;
}

/* ============================================================
   ACCUEIL — intro + grille
   ============================================================ */
.home-intro {
  text-align: center;
  max-width: 1100px;
  margin: 0 auto 40px auto;
}

.home-intro h1 {
  font-family: var(--font-title);
  font-size: clamp(21px, 3.5vw, 32px);
  font-weight: 600;
  margin: 0 0 14px 0;
  color: var(--text);
  letter-spacing: 0.5px;
  line-height: 1.15;
}

.home-intro p {
  color: var(--muted);
  font-size: clamp(15px, 2.2vw, 18px);
  margin: 0;
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: break-word;
}

.grid-2x3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.grid-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.grid-card img {
  width: 100%;
  aspect-ratio: var(--photo-ratio);
  object-fit: cover;
  transition: transform 0.4s ease;
}

.grid-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.grid-card:hover img { transform: scale(1.04); }

.place-label {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(42,38,34,0.12);
}

.caption {
  padding: 18px 20px 22px 20px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.grid-card .caption-title {
  display: block;
  font-family: var(--font-title);
  font-size: 19px;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 600;
}

/* Carte contact (6e case) */
.grid-card.contact-highlight {
  background: linear-gradient(160deg, var(--gold-tint), var(--card));
  border-color: var(--gold-soft);
}

.grid-card.contact-highlight img {
  aspect-ratio: var(--photo-ratio);
  object-fit: cover;
  object-position: center center;
}

.grid-card.contact-highlight:hover img { transform: scale(1.02); }

.contact-content {
  padding: 18px 20px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-title {
  font-family: var(--font-title);
  font-size: 19px;
  color: var(--gold);
  letter-spacing: 0.5px;
  font-weight: 600;
}

.contact-line {
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}

/* ============================================================
   PAGES LOGEMENT — diaporama + descriptif
   ============================================================ */
.property-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

/* === Diaporama === */
.slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: var(--photo-ratio);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg-soft);
}

.slideshow .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 1s ease, transform 1s ease;
}

.slideshow .slide.active {
  opacity: 1;
  transform: scale(1);
}

.slideshow-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  pointer-events: none;
}

.slideshow-controls button {
  pointer-events: auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(42,38,34,0.18);
  transition: transform 0.2s ease, background 0.2s ease;
}

.slideshow-controls button:hover {
  transform: translateY(-2px);
  background: var(--card);
}

.slideshow-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(42,38,34,0.18);
}

.slideshow.is-paused .slideshow-toggle {
  background: rgba(168,132,63,0.9);
  color: #fff;
}

.slideshow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 6px 16px rgba(42,38,34,0.15);
}

.slideshow.is-paused::after {
  content: "Pause";
  opacity: 1;
}

/* === Bloc texte descriptif === */
.text-block {
  background: var(--card);
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  line-height: 1.75;
  color: var(--text);
  font-size: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
}

/* ============================================================
   PAGE LOCALISATION
   ============================================================ */
.location-page main { padding-top: 30px; }

.location-card {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.location-card img {
  width: 100%;
  display: block;
  object-fit: contain;
  background: var(--bg-soft);
}

/* ============================================================
   PIED DE PAGE
   ============================================================ */
.footer-spacer { height: 60px; }

/* ============================================================
   RESPONSIVE — Tablette (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .property-layout {
    grid-template-columns: 1fr;
    max-width: 760px;
  }
  /* Accueil : 2 colonnes sur tablette */
  .grid-2x3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  body { overflow-x: hidden; }

  /* === Header === */
  header {
    padding: 14px 16px 0 16px;
    gap: 10px;
  }

  /* Bouton hamburger (injecté en premier enfant par app.js) */
  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 24px;
    cursor: pointer;
    background: var(--bg-soft);
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--gold);
    order: 0;
    flex-shrink: 0;
  }

  .header-actions { gap: 8px; }
  .action-link { width: 40px; height: 40px; }
  .action-link svg { width: 20px; height: 20px; }

  /* Marque centrée entre hamburger et actions */
  .brand {
    flex: 1;
    align-items: center;
    text-align: center;
    order: 1;
  }
  .brand-name { font-size: 21px; letter-spacing: 1.5px; }
  .brand-tagline { font-size: 11px; }

  /* Navigation — masquée jusqu'à l'ouverture du menu */
  .navbar {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    padding: 0;
    border-top: 1px solid var(--border);
    order: 4;
  }
  body.mobile-nav-open .navbar { display: flex; }

  .navbar a {
    padding: 15px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
  }
  .navbar a::after { display: none; }
  .navbar a:last-child { border-bottom: none; }

  /* === Contenu principal === */
  main { padding: 26px 16px 32px 16px; }

  .home-intro { margin-bottom: 28px; }

  /* Grille d'accueil (1 colonne) */
  .grid-2x3 {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .grid-card:hover { transform: none; }
  .grid-card:hover img { transform: none; }

  /* Diaporama */
  .slideshow { aspect-ratio: 4 / 3; }
  .slideshow-controls { padding: 0 10px; }
  .slideshow-controls button { width: 42px; height: 42px; font-size: 20px; }

  /* Bloc texte */
  .text-block { padding: 22px 20px; font-size: 15.5px; }

  .location-card { border-radius: var(--radius); }

  .footer-spacer { height: 40px; }
}

/* ============================================================
   RESPONSIVE — Très petits écrans (≤ 400px)
   ============================================================ */
@media (max-width: 400px) {
  header { padding: 12px 12px 0 12px; }
  .brand-name { font-size: 19px; }
  .action-link { width: 38px; height: 38px; }
  main { padding: 22px 12px 28px 12px; }
  .text-block { padding: 18px 16px; }
  .slideshow { aspect-ratio: 1 / 1; }
  .caption, .contact-content { padding: 16px; }
}
