/* =========================================================
   GénéaCotentin — style-v2
   Direction : papier / encre / sceau (doux, cohérent, lisible)
   Objectif : "premium discret" + accessibilité + uniformité
========================================================= */

/* =========================
   THEME TOKENS
========================= */
:root{
  /* Surfaces */
  --bg: #F7F4EF;          /* ivoire papier */
  --bg-2: #EFE9DF;        /* parchemin */
  --card: #FFFFFF;
  --card-2: #FBFAF7;      /* carte légèrement teintée */
  --border: #DED6C9;

  /* Texte */
  --text: #32414D;
  --text-strong: #1F2A33;
  --text-muted: #5C6A75;

  /* Accents */
  --primary: #2F5D62;       /* vert sapin grisé */
  --primary-hover: #264C50;
  --secondary: #7A5C3E;     /* cuir/archives */
  --seal: #7B2D3A;          /* sceau bordeaux */

  /* États */
  --success: #2E6B4E;
  --warning: #B7791F;
  --danger: #B23A3A;

  --success-bg: #F0FDF4;
  --warning-bg: #FFFBEB;
  --danger-bg: #FEF2F2;

  /* UI */
  --radius: 16px;
  --radius-sm: 12px;

  --shadow-xs: 0 2px 8px rgba(31, 42, 51, .05);
  --shadow-sm: 0 8px 18px rgba(31, 42, 51, .07);
  --shadow: 0 14px 35px rgba(31, 42, 51, .10);

  /* Focus */
  --focus: rgba(47, 93, 98, .35);

  /* Layout */
  --container: 1100px;
}

/* =========================
   RESET / BASE
========================= */
*{ box-sizing: border-box; margin: 0; padding: 0; }

html{ scroll-behavior: smooth; }

body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img{ max-width: 100%; height: auto; display: block; }

.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem;
}

.section{ padding: 2.75rem 0; }

/* Signature "registre" très légère entre sections (discrète) */
.section + .section{
  border-top: 1px dashed color-mix(in srgb, var(--border) 75%, var(--text-muted));
}

/* Liens */
a{
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover{ color: var(--primary-hover); text-decoration: none; }

/* Focus accessible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 10px;
}

/* =========================
   TYPOGRAPHIE (contenu long)
========================= */
main h1{
  font-size: clamp(1.75rem, 2.6vw, 2.3rem);
  line-height: 1.18;
  margin-bottom: 1rem;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

main h2{
  font-size: 1.25rem;
  margin-top: 1.85rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
  color: var(--text-strong);
}

main h3{
  font-size: 1.05rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

main p{
  margin: 0.75rem 0;
  max-width: 78ch;
}

main ul, main ol{
  margin: 0.75rem 0 0.75rem 1.25rem;
  max-width: 78ch;
}

main li{ margin: 0.4rem 0; }

main strong{ font-weight: 650; color: var(--text-strong); }

hr{
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* =========================
   HEADER / NAV (premium + lisible)
========================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
}

.logo{ display:flex; align-items:center; }
.logo-link{ display:inline-flex; align-items:center; text-decoration:none; }

.logo img{
  max-height: 48px;
  width: auto;
}
@media (min-width: 768px){
  .logo img{ max-height: 60px; }
}

.menu-toggle{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-strong);
  box-shadow: var(--shadow-xs);
}
.menu-toggle:hover{ background: var(--card-2); }

/* Nav mobile */
.main-nav{
  display: none;
  width: 100%;
  padding-bottom: 0.85rem;
}
.main-nav.open{ display:block; }

.main-nav ul{
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0.85rem 0 0 0;
  padding: 0;
}

.main-nav a{
  text-decoration: none;
  display: inline-block;
  padding: 0.35rem 0.25rem;
  color: var(--text-strong);
}

.main-nav a:hover{ color: var(--primary); }

.main-nav a.active{
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--primary);
}

/* CTA nav */
.main-nav .cta a{
  font-weight: 750;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--border));
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-2) 55%, #fff);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.main-nav .cta a:hover{
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Desktop */
@media (min-width: 768px){
  .menu-toggle{ display:none; }
  .main-nav{
    display:block;
    width:auto;
    padding-bottom:0;
  }
  .main-nav ul{
    flex-direction: row;
    gap: 1.25rem;
    margin: 0;
    align-items: center;
  }
  .main-nav a{ padding: 0.25rem 0; }
}

/* =========================
   HERO (papier + halo doux)
========================= */
.hero{
  background:
    radial-gradient(1200px 520px at 18% 0%,
      color-mix(in srgb, var(--bg-2) 85%, #fff) 0%,
      var(--bg) 60%),
    linear-gradient(180deg,
      rgba(255,255,255,.55) 0%,
      rgba(255,255,255,0) 35%);
  padding: 3.25rem 0 2.75rem 0;
  border-bottom: 1px solid var(--border);
}

/* Micro-signature Accueil : point "sceau" */
/* Micro-signature Accueil : filet registre sous le H1 */
.hero h1{
  position: relative;
  display: inline-block;
  padding-bottom: .55rem;
}

.hero h1::after{
  content: "";
  position: absolute;
  left: 0;
  right: -10%;
  bottom: 0;
  height: 2px;
  background:
    linear-gradient(to right,
      color-mix(in srgb, var(--primary) 65%, var(--border)),
      transparent 85%);
  border-radius: 2px;
  opacity: .9;
}

.hero h1::before{
  content: "";
  position: absolute;
  left: 0;
  right: 20%;
  bottom: -7px;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    color-mix(in srgb, var(--border) 70%, var(--text-muted)),
    color-mix(in srgb, var(--border) 70%, var(--text-muted)) 8px,
    transparent 8px,
    transparent 16px
  );
  opacity: .75;
}

.hero p{
  margin-top: 0;
  margin-bottom: 1.35rem;
  max-width: 72ch;
  color: var(--text);
}

/* =========================
   BOUTONS (cohérents partout)
========================= */
.btn,
.btn-primary,
.btn-outline{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 0.72rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.btn-primary{
  background: var(--primary);
  color: #fff;
  border-color: color-mix(in srgb, var(--primary) 70%, #000);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover{ background: var(--primary-hover); }
.btn-primary:active{ transform: translateY(1px); }

.btn-outline{
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover{
  background: var(--bg-2);
  border-color: color-mix(in srgb, var(--border) 75%, var(--text-muted));
}

/* Variante "sceau" pour 1 action forte (si vous voulez) */
.btn-seal{
  background: var(--seal);
  color: #fff;
  border-color: color-mix(in srgb, var(--seal) 75%, #000);
  box-shadow: var(--shadow-sm);
}
.btn-seal:hover{ background: color-mix(in srgb, var(--seal) 88%, #000); }

/* =========================
   GRILLES / CARTES
========================= */
.grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
@media (min-width: 768px){
  .grid{ grid-template-columns: repeat(3, 1fr); }
}

.card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  box-shadow: var(--shadow-sm);
}
.card h3{ margin-top: 0; color: var(--text-strong); }
.card p{ color: var(--text); }

/* Effet hover discret "papier" */
.card:hover{
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--border) 70%, var(--primary));
}

/* =========================
   BADGES (Source / Acte / Commune)
========================= */
.badge{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.25rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-strong);
  font-size: .9rem;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}
.badge--seal{
  background: color-mix(in srgb, var(--seal) 10%, #fff);
  border-color: color-mix(in srgb, var(--seal) 35%, var(--border));
  color: var(--seal);
}

/* =========================
   FORMULAIRE CONTACT
========================= */
.form{ margin-top: 1.5rem; max-width: 760px; }

.form-row{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px){
  .form-row{ grid-template-columns: 1fr 1fr; }
}

.form-field{ margin: 0.9rem 0; }

label{
  display: block;
  font-weight: 750;
  margin-bottom: 0.4rem;
  color: var(--text-strong);
}

input, select, textarea{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.9rem;
  font: inherit;
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(31,42,51,.03);
}
textarea{ resize: vertical; min-height: 140px; }

input::placeholder,
textarea::placeholder{
  color: color-mix(in srgb, var(--text-muted) 82%, #fff);
}

/* Note */
.form-note{
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Alerts */
.alert{
  border-radius: var(--radius);
  padding: 1rem 1rem;
  margin: 1rem 0 1.25rem 0;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.alert.success{
  background: var(--success-bg);
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}
.alert.error{
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}
.alert.warning{
  background: var(--warning-bg);
  border-color: color-mix(in srgb, var(--warning) 35%, var(--border));
}
.alert ul{ margin: 0.5rem 0 0 1.1rem; }

/* Honeypot invisible */
.hp{ position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* =========================
   FOOTER — V2 finalisé
   Objectif : rupture nette avec le header + ambiance "archives"
========================= */
.site-footer{
  /* Couleur volontairement plus chaude (brun ardoise) -> distinct du header clair */
  background:
    /* léger halo en haut pour donner du relief */
    radial-gradient(1200px 320px at 50% 0%,
      rgba(255,255,255,0.06),
      rgba(255,255,255,0) 60%),
    /* micro-grain façon papier (sans image) */
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.018) 0px,
      rgba(255,255,255,0.018) 2px,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0) 10px),
    /* base */
    #1E1B16;

  color: rgba(255,255,255,0.92);
  margin-top: 3rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Ligne "registre" très discrète en haut du footer */
.site-footer::before{
  content: "";
  display: block;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    rgba(255,255,255,.22),
    rgba(255,255,255,.22) 7px,
    transparent 7px,
    transparent 14px
  );
}

.footer-inner{
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.35rem 1rem;
}

/* Texte du footer */
.site-footer p,
.site-footer small{
  color: rgba(255,255,255,0.82);
}

/* Liens */
.footer-nav a{
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  margin-right: 1rem;
  opacity: 0.92;
}

.footer-nav a:hover{
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Accessibilité focus dans le footer */
.site-footer a:focus-visible{
  outline: 3px solid rgba(255,255,255,0.28);
  outline-offset: 3px;
  border-radius: 10px;
}

@media (min-width: 768px){
  .footer-inner{
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}


/* =========================
   UTILITAIRES (si besoin)
========================= */
.box, .section-box{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 1.25rem;
}
.muted{ color: var(--text-muted); }

/* =========================
   TABLEAUX – Aération & lisibilité
========================= */

/* Table globale */
table{
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 1.5rem 0;
}

/* En-têtes */
th{
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-strong);
  background: var(--bg-2);
  border-bottom: 2px solid var(--border);
  vertical-align: bottom;
}

/* Cellules */
td{
  padding: 1rem 1.25rem;
  vertical-align: top;
  line-height: 1.6;
}

/* Séparation douce des lignes */
tbody tr + tr td{
  border-top: 1px solid var(--border);
}

/* Dernière colonne (tarifs) : plus lisible */
td:last-child,
th:last-child{
  white-space: nowrap;
  text-align: right;
  font-weight: 650;
}

/* Première colonne : un peu plus large visuellement */
td:first-child,
th:first-child{
  width: 32%;
}

/* Colonne centrale (description) */
td:nth-child(2),
th:nth-child(2){
  width: 48%;
}

/* Hover discret (desktop) */
@media (hover: hover){
  tbody tr:hover{
    background: color-mix(in srgb, var(--bg-2) 55%, #fff);
  }
}

/* =========================
   TABLEAUX – Mobile
========================= */
@media (max-width: 640px){
  table{
    font-size: 0.95rem;
  }

  th,
  td{
    padding: 0.75rem 0.8rem;
  }

  td:last-child,
  th:last-child{
    text-align: left;
    white-space: normal;
  }
}

/* =========================
   TERRITOIRES — aligné avec style-v2
========================= */

.territoires-intro{
  margin-top: .25rem;
  color: var(--text);
}

/* Carte */
.territoires-map{
  margin: 1.25rem 0 1rem 0;
}

.territoires-map figure{
  margin: 0;
}

.territoires-map img{
  width: 100%;
  max-width: 860px;         /* évite l’effet “trop large” sur grand écran */
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

/* Liste des départements : retour à un rendu "contenu" standard */
.territoires-list{
  margin: 0.75rem 0;
}

/* Note / précision */
.territoires-note{
  margin-top: 1rem;
  color: var(--text-muted);
}
.carte-territoire {
    width: 100%;
    max-width: 900px;
    height: auto;
}

@media (max-width: 768px) {
    .carte-territoire {
        max-width: 100%;
    }
}

/* =========================
   CSS pour image accueil
========================= */

.hero-genealogie {
  position: relative;
  background-image: url("/assets/img/hero-genealogie.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
}

.hero-genealogie .container {
  position: relative;
  z-index: 2;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45); /* assombrit sans étouffer l’image */
  z-index: 1;
}

.hero-genealogie h1 {
  color: #fff;
  text-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.65),
    0 0 20px rgba(0, 0, 0, 0.4);
}

.hero-genealogie p {
  color: #f2f2f2;
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.6);
}

