﻿/* =========================
   RESET
   ========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Serif 4", serif;
  font-size: 18px;
  line-height: 1.75;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* =========================
   VARIABLES
   ========================= */

:root {
  --bg: #faf7f0;
  --paper: #fffdf8;
  --paper-2: #f6efe4;
  --ink: #2b241d;
  --muted: #6e6254;
  --line: #ddd3c4;
  --gold: #a47a3c;
  --gold-soft: #c29a59;
  --accent: #8f2f23;
  --accent-dark: #6d2118;
  --shadow: 0 10px 28px rgba(50, 35, 20, 0.08);
  --radius: 18px;
  --max-width: 1180px;

  /* Overlays hero */
  --hero-overlay: rgba(31, 24, 18, 0.45);
  --hero-overlay-sea: rgba(18, 46, 68, 0.50);
  --hero-overlay-dark: rgba(18, 46, 68, 0.60);
}

/* =========================
   HEADER + MENU
   Système réel utilisé dans le HTML :
   .site-header > .site-header-inner > .site-logo + .menu-toggle + .main-nav
   .main-nav fermé par défaut, ouvert via la classe .is-open (JS)
   .nav-grid en 4 colonnes, .nav-column avec h2 + ul
   ========================= */

.site-header {
  position: relative;
  z-index: 1000;
  background: rgba(255, 253, 248, 0.98);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
}

/* Logo — lien ou texte brut selon les pages */
.site-logo,
a.site-logo {
  font-family: "Playfair Display", serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.1;
  flex-shrink: 0;
}

a.site-logo:hover {
  text-decoration: none;
  color: var(--accent-dark);
}

/* Bouton hamburger */
.menu-toggle {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}

.menu-toggle:hover {
  background: #f8f2e8;
}

/* Navigation principale — fermée par défaut */
.main-nav {
  display: none;
  width: 100%;
  border-top: 1px solid var(--line);
  padding: 18px 0 22px;
}

.main-nav.is-open {
  display: block;
}

/* Grille 4 colonnes */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 26px;
}

.nav-column h2,
.nav-column h3 {
  margin: 0 0 10px;
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.nav-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-column li {
  margin: 5px 0;
}

.nav-column a {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.3;
  text-decoration: none;
}

.nav-column a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Tablettes */
@media (max-width: 900px) {
  .nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobiles */
@media (max-width: 600px) {
  .site-header-inner {
    padding: 12px 14px;
  }

  .site-logo,
  a.site-logo {
    font-size: 1.35rem;
  }

  .menu-toggle {
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }

  .nav-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nav-column {
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  .nav-column a {
    padding: 4px 0;
  }
}

/* =========================
   HERO — BASE
   ========================= */

.hero {
  position: relative;
  color: #fff;
}

.hero-overlay {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 88px 20px 78px;
  display: block;
}

.hero-kicker {
  margin: 0 0 14px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.9);
}

.hero h1 {
  margin: 0 0 18px;
  font-family: "Playfair Display", serif;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.08;
  font-weight: 600;
}

.hero-highlight {
  color: #ffd28d;
}

.hero-desc {
  max-width: 760px;
  margin: 0 0 26px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.95);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-hero {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 500;
  text-align: center;
}

.btn-hero:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  text-decoration: none;
}

.btn-hero.primary {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-hero.primary:hover {
  background: var(--accent-dark);
}

/* =========================
   HERO — IMAGES DE FOND
   Technique : on définit --hero-bg-url en style inline dans le HTML,
   et on utilise un sélecteur universel pour appliquer l'image.
   Cela évite de créer un bloc CSS par page.

   Usage dans le HTML :
     <div class="hero hero-page" style="--hero-bg-url: url('images/blois-chateau1.jpg')">

   Variantes d'overlay disponibles (à ajouter à la classe .hero) :
     .overlay-warm  → rgba(31, 24, 18, 0.45)  — pages patrimoniales
     .overlay-dark  → rgba(31, 24, 18, 0.48)  — pages médiévales/religieuses
     .overlay-sea   → rgba(18, 46, 68, 0.50)  — pages côtières/urbaines
     .overlay-night → rgba(18, 46, 68, 0.60)  — pages historiques/dynastiques
   ========================= */

.hero-page {
  background:
    linear-gradient(var(--hero-overlay), var(--hero-overlay)),
    var(--hero-bg-url, none) center/cover no-repeat;
}

/* Overlay chaud — pages patrimoniales */
.hero-page.overlay-warm {
  --hero-overlay: rgba(31, 24, 18, 0.45);
}

/* Overlay sombre — pages médiévales/religieuses */
.hero-page.overlay-dark {
  --hero-overlay: rgba(31, 24, 18, 0.48);
}

/* Overlay bleu nuit moyen — pages côtières/urbaines/destinations */
.hero-page.overlay-sea {
  --hero-overlay: rgba(18, 46, 68, 0.50);
}

/* Overlay bleu nuit profond — pages historiques/dynastiques */
.hero-page.overlay-night {
  --hero-overlay: rgba(18, 46, 68, 0.60);
}

/* -------------------------------------------------------
   PAGES EXISTANTES sans refactoring HTML
   (compatibilité ascendante — à supprimer au fur et à
   mesure que les pages HTML sont mises à jour)
   ------------------------------------------------------- */

/* Pages patrimoniales (overlay warm) */
.hero-home,
.hero-loire        { background: linear-gradient(rgba(31,24,18,.45), rgba(31,24,18,.45)), url("https://www.francebalade.com/loire/amboisepano1.jpg")               center/cover no-repeat; }
.hero-espagne      { background: linear-gradient(rgba(31,24,18,.45), rgba(31,24,18,.45)), url("https://www.francebalade.com/espagne/toledepano4b.jpg")             center/cover no-repeat; }
.hero-paris        { background: linear-gradient(rgba(31,24,18,.45), rgba(31,24,18,.45)), url("https://www.francebalade.com/paris/treiffel20.jpg")                 center/cover no-repeat; }
.hero-italie       { background: linear-gradient(rgba(31,24,18,.45), rgba(31,24,18,.45)), url("https://www.francebalade.com/italie/venisegdcanalsansilvestro.jpg") center/cover no-repeat; }
.hero-villes-centre{ background: linear-gradient(rgba(31,24,18,.45), rgba(31,24,18,.45)), url("https://www.francebalade.com/loire/amboisepano1.jpg")               center/cover no-repeat; }
.hero-chfort-loire2{ background: linear-gradient(rgba(31,24,18,.45), rgba(31,24,18,.45)), url("https://www.francebalade.com/valvienne/chinonchateaupano2.jpg")     center/cover no-repeat; }

/* Pages médiévales/religieuses (overlay dark) */
.hero-medieval,
.hero-arcreg       { background: linear-gradient(rgba(31,24,18,.48), rgba(31,24,18,.48)), url("https://www.francebalade.com/poitou/poitiersndgrandefac2.jpg")      center/cover no-repeat; }
.hero-chfort       { background: linear-gradient(rgba(31,24,18,.48), rgba(31,24,18,.48)), url("https://www.francebalade.com/touraine/chinonchateau2.jpg")          center/cover no-repeat; }
.hero-cathedrals   { background: linear-gradient(rgba(31,24,18,.48), rgba(31,24,18,.48)), url("https://www.francebalade.com/angoumois/angoulemecathedrale1.jpg")   center/cover no-repeat; }

/* Pages à URL absolue — anciennes pages non encore migrées vers hero-page */

/* =========================
   CONTENU PRINCIPAL
   ========================= */

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 34px 20px 70px;
}

.content-section {
  margin: 0 0 72px;
}

/* =========================
   FIL D'ARIANE + LIENS RAPIDES
   ========================= */

.breadcrumb {
  max-width: 100%;
  margin: 0 0 28px;
  font-size: 0.95rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--accent);
}

.breadcrumb span {
  margin: 0 6px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
}

.quick-links-home {
  margin: 0 0 32px;
}

.quick-links a {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  background: #f4ebdf;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.95rem;
}

.quick-links a:hover {
  background: #efe1cf;
  text-decoration: none;
}

/* =========================
   TITRES DE SECTION
   ========================= */

.section-heading,
.section-heading-single {
  display: block;
  width: 100%;
  max-width: 980px;
  margin-bottom: 30px;
  columns: 1;
}

.section-heading .section-kicker,
.section-heading h2,
.section-heading p,
.section-heading-single .section-kicker,
.section-heading-single h2,
.section-heading-single p {
  display: block;
  width: 100%;
  max-width: 980px;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.84rem;
  font-weight: 600;
}

.section-heading h2,
.section-heading-single h2 {
  margin: 0 0 16px;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15;
  color: var(--ink);
}

.section-heading p,
.section-heading-single p {
  margin: 0 0 14px;
}

/* =========================
   CARTES
   ========================= */

.featured-card,
.card,
.links-block,
.scenic-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.featured-card {
  overflow: hidden;
  margin-bottom: 28px;
}

.featured-card img {
  width: 100%;
  height: auto;
}

.featured-card-body {
  padding: 26px 28px 28px;
}

.featured-card-body h3 {
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
  font-size: 1.9rem;
  line-height: 1.2;
}

.featured-card-body p  { margin: 0 0 14px; }
.featured-card-body ul { margin: 0 0 14px 0; padding-left: 22px; }
.featured-card-body li { margin-bottom: 8px; }

.card-link {
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
  color: var(--accent);
}

.card-link:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.8rem;
  font-weight: 700;
}

.card-meta {
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.96rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 8px;
}

/* =========================
   GRILLES
   ========================= */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 26px 0 30px;
}

.card {
  overflow: hidden;
  height: 100%;
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card-body {
  padding: 20px 22px 22px;
}

.card-body h3 {
  margin: 0 0 10px;
  font-family: "Playfair Display", serif;
  font-size: 1.45rem;
  line-height: 1.2;
}

.card-body p { margin: 0 0 12px; }

/* Fond dégradé chaud (grilles patrimoniales nommées) */
.cards-grid-home .card,
.cards-grid-castles .card,
.cards-grid-cathedrals .card,
.cards-grid-history .card,
.timeline-grid .card {
  background: linear-gradient(to bottom, #fffdf8, #fbf6ee);
}

.cards-grid-castles .card img {
  aspect-ratio: 16 / 11;
}

/* Toutes les autres grilles .cards-grid-{slug} :
   fond, survol et état actif communs.
   Pour ajouter une page, aucune ligne CSS supplémentaire n'est nécessaire. */
[class*="cards-grid-"] .card {
  background: linear-gradient(to bottom, #fffdf8, #f7fbfd);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

[class*="cards-grid-"] .card:hover {
  transform: translateY(-6px);
}

[class*="cards-grid-"] .card.active-map-target {
  box-shadow: 0 0 0 3px rgba(42, 127, 170, 0.35), var(--shadow);
}

/* =========================
   GRILLE STATISTIQUES
   ========================= */

.cards-grid-stats {
  grid-template-columns: repeat(4, 1fr);
}

/* =========================
   BLOCS DE LIENS
   ========================= */

.links-block {
  padding: 24px 26px;
  margin: 24px 0 28px;
  background: linear-gradient(to bottom, #fffdf8, #fbf6ee);
}

.links-block h3 {
  margin: 0 0 14px;
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
}

.links-list {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 40px;
}

.links-list li {
  margin: 0 0 8px;
  break-inside: avoid;
}

/* =========================
   IMAGES PLEINE LARGEUR
   ========================= */

.scenic-card {
  overflow: hidden;
  margin: 28px 0 10px;
}

.scenic-card img { width: 100%; }

.scenic-card figcaption {
  padding: 14px 20px 18px;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  font-size: 0.97rem;
}

/* =========================
   ORNEMENT
   ========================= */

.ornament {
  margin: 8px 0 48px;
  text-align: center;
  color: var(--gold-soft);
  font-size: 1.2rem;
  letter-spacing: 0.18em;
}

/* =========================
   CARTE LEAFLET
   ========================= */

.map-shell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

#carte {
  width: 100%;
  height: 520px;
}

.labaule-marker span {
  display: block;
  width: 18px;
  height: 18px;
  background: #1a4a6b;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.labaule-marker.active span {
  width: 24px;
  height: 24px;
  background: #2a7faa;
  box-shadow: 0 2px 14px rgba(42, 127, 170, 0.6);
}

.leaflet-popup-content-wrapper { border-radius: 12px; }

.leaflet-popup-content strong {
  font-family: "Playfair Display", serif;
  color: var(--accent);
}

/* =========================
   FOOTER
   ========================= */

.site-footer {
  background: #f3ede2;
  border-top: 1px solid var(--line);
  padding: 24px 20px 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.98rem;
}

.site-footer p { margin: 0; }
.site-footer a  { color: var(--accent); }

.footer-sep {
  margin: 0 10px;
  color: #b39b7b;
}

/* =========================
   TABLETTES  (≤ 960px)
   ========================= */

@media (max-width: 960px) {
  .cards-grid         { grid-template-columns: 1fr; }
  .cards-grid-stats   { grid-template-columns: repeat(2, 1fr); }
  .links-list         { columns: 1; }

  .featured-card-body,
  .card-body,
  .links-block        { padding-left: 20px; padding-right: 20px; }
}

/* =========================
   MOBILES  (≤ 760px)
   ========================= */

@media (max-width: 760px) {
  body { font-size: 17px; }

  .hero-overlay  { padding: 64px 16px 56px; }
  .hero-desc     { font-size: 1.03rem; }

  .hero-links,
  .quick-links,
  .button-row    { flex-direction: column; align-items: stretch; }

  .btn-hero,
  .quick-links a { width: 100%; text-align: center; }

  .main-content    { padding: 24px 16px 56px; }
  .content-section { margin-bottom: 58px; }

  .section-heading h2,
  .section-heading-single h2 { font-size: 2.1rem; }

  .featured-card-body    { padding: 22px 18px; }
  .featured-card-body h3 { font-size: 1.55rem; }
  .card-body             { padding: 18px 18px 20px; }
  .card-body h3          { font-size: 1.3rem; }
  .links-block           { padding: 20px 18px; }

  .cards-grid-stats { grid-template-columns: 1fr; }

  #carte         { height: 420px; }

  .site-footer   { padding: 22px 16px 26px; line-height: 1.8; }
  .footer-sep    { display: inline-block; margin: 0 6px; }
}

/* =========================
   PETITS MOBILES  (≤ 480px)
   ========================= */

@media (max-width: 480px) {
  .site-logo,
  a.site-logo    { font-size: 1.2rem; }

  .menu-toggle   { padding: 8px 12px; font-size: 0.92rem; }

  .hero h1       { font-size: 2.1rem; }
  .hero-kicker   { font-size: 0.8rem; letter-spacing: 0.1em; }

  .section-heading h2,
  .section-heading-single h2 { font-size: 1.85rem; }

  .featured-card-body h3,
  .card-body h3  { font-size: 1.25rem; }
}
