@charset "utf-8";
@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,300;6..72,400;6..72,500;6..72,600;6..72,700&family=Manrope:wght@300;400;500;600&display=swap");

/* ==========================================================================
   Pages personnelles de Sylvain Nivard
   Feuille unique partagée par l'accueil, Ma famille, Mes voyages
   et les ~70 récits de voyage (qui utilisent déjà ces mêmes sélecteurs).
   Palette et typographie reprises du site Filiader (genealogieV2-new).
   ========================================================================== */

:root {
  --ivory:  #f5efe6;
  --ivory2: #ede4d3;
  --ink:    #3a2e1f;
  --ink2:   #5a4a35;
  --gold:   #8a6320;
  --gold2:  #c89d54;
  --sage:   #5f6e4e;
  --ash:    #6f665a;

  --ink-10: rgba(58, 46, 31, 0.10);
  --ink-20: rgba(58, 46, 31, 0.20);
  --ink-70: rgba(58, 46, 31, 0.70);
  --ink-75: rgba(58, 46, 31, 0.75);

  --shadow-paper: 0 1px 0 rgba(58,46,31,.08), 0 6px 24px -8px rgba(58,46,31,.18);
  --shadow-leaf:  0 2px 8px -2px rgba(58,46,31,.25);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 68ch;
  --page:    72rem;
  --gutter:  1.5rem;
}

/* --- Base ---------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--ivory);
  background-image:
    radial-gradient(at 0% 0%, rgba(168,127,60,.06), transparent 50%),
    radial-gradient(at 100% 100%, rgba(126,140,110,.06), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain léger, purement décoratif */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.23 0 0 0 0 0.18 0 0 0 0 0.12 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

::selection { background: var(--gold); color: var(--ivory); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Charpente (sélecteurs hérités du site de 2007) ---------------------- */

#site {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: var(--page);
  margin: 0 auto;
  background: none;
}

#conteneur {
  position: relative;
  width: auto;
  margin: 0;
}

#centre {
  margin: 0;
  padding: 0 var(--gutter) 4rem;
}

/* Cales graphiques vides du gabarit d'origine */
#gche, #drte, .haut_news, .pied_news { display: none; }

/* --- Bandeau de navigation ---------------------------------------------- */

#header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: auto;
  margin: 0;
  background: rgba(245,239,230,.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-10);
  background-image: none;
}

.menuhaut {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 2rem;
  width: auto;
  max-width: var(--page);
  margin: 0 auto;
  padding: .9rem var(--gutter);
  list-style: none;
  font-family: var(--sans);
  font-size: .9rem;
}

.menuhaut li, .menuhaut ul {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menuhaut li::before { content: none; }

.menuhaut a {
  display: inline-block;
  height: auto;
  padding: .25rem 0;
  color: var(--ink-75);
  font-size: inherit;
  font-weight: 500;
  letter-spacing: .04em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.menuhaut a:hover,
.menuhaut a:focus-visible { color: var(--gold); border-bottom-color: var(--gold); }

.menuhaut a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }

/* Nom du site, à gauche du menu */
.menuhaut .marque {
  margin-right: auto;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: -.01em;
}

.menuhaut .marque a { color: var(--ink); font-weight: 400; }
.menuhaut .marque a:hover { border-bottom-color: transparent; color: var(--gold); }

/* --- Titres -------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  letter-spacing: -.01em;
  font-weight: 500;
  text-align: left;
  background: none;
  height: auto;
}

h1 {
  margin: 3.5rem 0 2rem;
  padding: 0;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.1;
  color: var(--ink);
}

h2 {
  margin: 3rem 0 1rem;
  padding: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.25;
  color: var(--gold);
  font-weight: 500;
}

h3 {
  margin: 2rem 0 .5rem;
  padding: 0;
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 600;
}

h1 a, h2 a, h3 a { font: inherit; color: inherit; padding: 0; margin: 0; }

/* Les récits exportés de Word sont truffés de titres et de paragraphes vides
   qui creusaient des trous dans la page. */
#centre h2:empty, #centre h3:empty, #centre h4:empty, #centre p:empty { display: none; }

/* Surtitre en petites capitales espacées */
.surtitre {
  display: block;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ink2);
}

/* --- Cartes « papier » --------------------------------------------------- */

.bloc, .news {
  margin: 0 0 1.5rem;
  padding: 1.75rem clamp(1.25rem, 3vw, 2.25rem);
  background: rgba(237,228,211,.6);
  border: 1px solid var(--ink-10);
  border-radius: .5rem;
  box-shadow: var(--shadow-paper);
  font-size: 1rem;
  text-align: left;
}

.bloc > :first-child, .news > :first-child { margin-top: 0; }
.bloc > :last-child,  .news > :last-child  { margin-bottom: 0; }

.bloc h2, .news h2 { margin-top: 1.75rem; }
.bloc h2:first-child, .news h2:first-child { margin-top: 0; }

/* --- Texte --------------------------------------------------------------- */

p {
  margin: 0 0 1.1rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1.75;
  text-indent: 0;
  text-align: justify;
  max-width: var(--measure);
  hyphens: auto;
}

p:last-child { margin-bottom: 0; }

b, strong { font-weight: 600; color: var(--ink); }

hr {
  height: 0;
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--ink-10);
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(138,99,32,.6);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color .15s ease, color .15s ease;
}

a:hover, a:focus-visible { color: var(--gold); text-decoration-color: var(--gold); }

p a { font-size: inherit; font-weight: 500; padding: 0; margin: 0; text-align: inherit; }

/* --- Listes -------------------------------------------------------------- */

#centre ul, #centre ol {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  max-width: var(--measure);
}

#conteneur li {
  margin: 0 0 .4rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1.65;
  text-align: left;
  list-style: none;
  position: relative;
}

#centre li::before {
  content: "\00b7";
  position: absolute;
  left: -1rem;
  color: var(--gold2);
}

#conteneur li a { font-size: inherit; font-weight: 500; margin: 0; }

/* Entrée de voyage sans page associée */
.indispo { color: var(--ash); }
.indispo::after {
  content: " — non disponible";
  font-size: .8em;
  letter-spacing: .04em;
  color: var(--ash);
  opacity: .8;
}

/* --- Images -------------------------------------------------------------- */

img {
  max-width: 100%;
  height: auto;
  margin: 0;
  background: none;
  border: 0;
  border-radius: .25rem;
}

figure {
  margin: 1.5rem 0;
  max-width: var(--measure);
}

figure img {
  display: block;
  border: 1px solid var(--ink-10);
  box-shadow: var(--shadow-leaf);
}

figcaption {
  margin-top: .6rem;
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--ink-75);
}

/* --- Bandeau photo de l'accueil ------------------------------------------ */

/* header.jpg est l'image d'origine du site (750 × 228, titre incrusté).
   On la plafonne à sa taille native pour qu'elle reste nette, et on la laisse
   se réduire proportionnellement sur les petits écrans. */
.bandeau {
  max-width: 750px;
  margin: 2.5rem auto 0;
  padding: 0;
  text-align: center;
}

.bandeau img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .5rem;
  box-shadow: var(--shadow-paper);
}

/* --- Pied de page -------------------------------------------------------- */

#pied {
  display: block;
  width: auto;
  height: 0;
  margin: 0;
  background: none;
}

.pied_c {
  position: relative;
  z-index: 1;
  max-width: var(--page);
  margin: 4rem auto 0;
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--ink-10);
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .06em;
  text-align: center;
  text-indent: 0;
  color: var(--ink-75);
}

.pied_c a { color: inherit; }

/* --- Retour en haut de page (récits longs) ------------------------------- */

.retour {
  margin: 2.5rem 0 0;
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .06em;
}

/* --- Petits écrans ------------------------------------------------------- */

@media (max-width: 768px) {
  :root { --gutter: 1.1rem; }

  body { font-size: .97rem; }

  .menuhaut {
    gap: .35rem 1.25rem;
    padding: .75rem var(--gutter);
    font-size: .85rem;
  }

  .menuhaut .marque { flex-basis: 100%; margin-right: 0; }

  h1 { margin: 2.25rem 0 1.5rem; }

  p { text-align: left; hyphens: none; }

  .bloc, .news { padding: 1.25rem 1.1rem; }
}

/* --- Impression ---------------------------------------------------------- */

@media print {
  body { background: #fff; color: #000; }
  body::after, #header, .pied_c, .retour { display: none !important; }
  #site, #centre { max-width: none; padding: 0; }
  .bloc, .news { border: 0; box-shadow: none; background: none; padding: 0; margin: 0 0 1rem; }
  p { max-width: none; }
  a { text-decoration: none; color: inherit; }
}

/* --- Préférence d'animation réduite -------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
