/*
 * Design system 4 · Bordeaux & sauge
 * Source : design/Design system 4 · Bordeaux & sauge-html.zip
 * Polices : Cormorant Garamond (titres, prénoms, chiffres) · Jost (texte, navigation, boutons)
 */

:root {
  /* Fonds & lignes */
  --papier: #FFF8EE;      /* champs, texte sur bordeaux */
  --parchemin: #F4EDE2;   /* fond principal */
  --lin: #EDE2D1;         /* sections alternées */
  --sable: #E6D7C1;       /* cadres photo, blocs */
  --bordure: #D6C3A6;     /* filets, contours */
  --champ: #FFFCF7;       /* fond des champs de formulaire */

  /* Texte & accents */
  --espresso: #3B2A20;        /* texte principal, titres */
  --brun-doux: #5A4636;       /* texte secondaire */
  --bordeaux: #6E2A2F;        /* boutons, liens, bandeaux, titres */
  --bordeaux-fonce: #4E1C21;  /* survol, état actif */
  --bordeaux-filet: #8F4A4F;  /* séparateurs sur bordeaux */
  --rose-the: #E8CFC4;        /* texte secondaire sur bordeaux */
  --sauge-foncee: #5E6B4E;    /* surtitres, icônes */
  --sauge: #7C8B6A;           /* décor uniquement, jamais en texte */

  /* Typographie */
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', system-ui, sans-serif;

  /* Formes */
  --r-pilule: 999px;
  --r-champ: 10px;
  --r-carte: 14px;

  /* Mise en page */
  --gouttiere: 40px;
  --section: 96px;
  --contenu: 1200px;
}

@media (max-width: 720px) {
  :root { --gouttiere: 16px; --section: 64px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--parchemin);
  color: var(--espresso);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

/* Grain parchemin sur toute la page (14 %) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

h1, h2, h3, p { margin: 0; }

a { color: var(--bordeaux); }
a:hover { color: var(--bordeaux-fonce); }

:focus-visible {
  outline: 2px solid var(--bordeaux);
  outline-offset: 3px;
}

img { max-width: 100%; }

/* ---- Typographie ---- */

.surtitre {
  font-size: 13px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--sauge-foncee);
}

.label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.titre-section {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 48px;
  line-height: 1.1;
  color: var(--bordeaux);
}

@media (max-width: 720px) {
  .titre-section { font-size: 36px; }
}

.amp { font-style: italic; color: var(--bordeaux); }

/* ---- Logo ---- */

.logo {
  font-family: var(--serif);
  font-size: 30px;
  font-style: italic;
  color: var(--bordeaux);
  text-decoration: none;
}

/* ---- Boutons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--r-pilule);
  border: 1px solid var(--bordeaux);
  background: var(--bordeaux);
  color: var(--papier);
  font-family: var(--sans);
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}

.btn:hover {
  background: var(--bordeaux-fonce);
  border-color: var(--bordeaux-fonce);
  color: var(--papier);
}

.btn--secondaire {
  background: transparent;
  color: var(--bordeaux);
}

.btn--secondaire:hover {
  background: var(--bordeaux);
  border-color: var(--bordeaux);
  color: var(--papier);
}

/* ---- Accessibilité : masqué à l'écran, lu par les lecteurs d'écran ---- */

.visuellement-cache {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Champs de formulaire ---- */

.champ-texte,
input[type=text], input[type=password], input[type=date] {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--r-champ);
  border: 1px solid var(--bordure);
  background: var(--champ);
  font-family: var(--sans);
  font-size: 16px;
  color: var(--espresso);
}

input::placeholder { color: #7A6553; }

input:focus {
  outline: none;
  border-color: var(--bordeaux);
  box-shadow: 0 0 0 3px var(--rose-the);
}

/* ---- Bouton burger (affiché sur mobile par chaque page) ---- */

.burger {
  display: none;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--bordure);
  border-radius: var(--r-pilule);
  background: var(--papier);
  cursor: pointer;
  position: relative;
}

.burger span {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--bordeaux);
  transition: transform .2s, opacity .2s;
}

.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 26px; }

.burger[aria-expanded=true] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded=true] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded=true] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Menu déroulant mobile, commun au site et à l'admin (.menu-burger sur le <nav>) */
@media (max-width: 960px) {
  .js .burger { display: block; }
  .js .menu-burger { display: none; }

  .js .menu-burger.ouvert {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 4px 0;
  }

  .js .menu-burger.ouvert a,
  .js .menu-burger.ouvert button {
    display: block;
    width: 100%;
    padding: 14px 4px;
    border: 0;
    border-top: 1px solid var(--bordure);
    border-radius: 0;
    background: none;
    color: var(--espresso);
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .js .menu-burger.ouvert a:hover,
  .js .menu-burger.ouvert button:hover,
  .js .menu-burger.ouvert [aria-current=page] { color: var(--bordeaux); }
}

/* ---- Fenêtre de confirmation / information (popup.js), ouverte près de l'élément touché ---- */

.popup {
  position: absolute;
  z-index: 1000;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  padding: 16px 18px;
  border-radius: var(--r-carte);
  border: 1px solid var(--bordure);
  background: var(--papier);
  color: var(--espresso);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(59, 42, 32, .18), 0 2px 6px rgba(59, 42, 32, .08);
  animation: popup-entree .14s ease-out;
}

/* Flèche vers l'élément touché */
.popup::before {
  content: "";
  position: absolute;
  top: -7px;
  left: calc(var(--fleche, 50%) - 6px);
  width: 12px;
  height: 12px;
  background: var(--papier);
  border-left: 1px solid var(--bordure);
  border-top: 1px solid var(--bordure);
  transform: rotate(45deg);
}
.popup--dessus::before { top: auto; bottom: -7px; transform: rotate(225deg); }

.popup__message { margin: 0 0 14px; }
.popup__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.popup__btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--r-pilule);
  border: 1px solid var(--bordeaux);
  background: transparent;
  color: var(--bordeaux);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
}
.popup__btn:hover { background: var(--lin); }
.popup__btn--principal { background: var(--bordeaux); color: var(--papier); }
.popup__btn--principal:hover { background: var(--bordeaux-fonce); border-color: var(--bordeaux-fonce); }

@keyframes popup-entree {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.popup--dessus { animation-name: popup-entree-dessus; }
@keyframes popup-entree-dessus {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---- Brin de feuillage (au-dessus des titres de section) ---- */

.brin { display: block; color: var(--sauge); }
