/* =========================================================================
   Généalogie de la famille Lederer — feuille de style « patrimoine élégant »
   Polices système uniquement, aucune dépendance externe.
   ========================================================================= */

:root {
  --cream:      #f6f1e7;   /* fond principal */
  --ivory:      #fbf9f3;   /* fond clair (cartes, nav) */
  --paper:      #efe7d6;   /* fond alterné */
  --ink:        #2b2622;   /* texte principal */
  --sepia:      #6b5d4f;   /* texte secondaire / légendes */
  --sepia-soft: #8a7c6b;
  --accent:     #7a2e2e;   /* bordeaux */
  --gold:       #9a7b3f;   /* or sombre */
  --line:       #d8ccb6;   /* filets */
  --shadow:     0 6px 22px rgba(43, 38, 34, 0.14);

  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', 'Liberation Serif', serif;
  --maxw: 70ch;
}

/* ---- Reset léger ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--gold); }

/* ---- Conteneurs & sections ---- */
.container { width: min(var(--maxw), 92vw); margin-inline: auto; }
.container-wide { width: min(1100px, 94vw); margin-inline: auto; }

.section { padding: 4.5rem 0; border-top: 1px solid var(--line); }
.section:nth-of-type(even) { background: var(--paper); }

.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 0.6rem;
}
h1, h2, h3 { font-weight: 600; line-height: 1.2; color: var(--ink); }
h2 {
  font-size: clamp(1.6rem, 1rem + 2.4vw, 2.4rem);
  margin: 0 0 1.4rem;
}
h2 .num { color: var(--gold); font-weight: 400; margin-right: 0.5em; }
h3 { font-size: 1.25rem; margin: 2rem 0 0.6rem; }
p { margin: 0 0 1.1rem; }
.lead { font-size: 1.15rem; color: var(--sepia); }
blockquote {
  margin: 1.6rem 0; padding: 0.4rem 0 0.4rem 1.4rem;
  border-left: 3px solid var(--gold); color: var(--sepia); font-style: italic;
}
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }

/* ---- Navigation collante ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 249, 243, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; gap: 0.4rem;
  width: min(1100px, 96vw); margin-inline: auto;
  padding: 0.55rem 0; overflow-x: auto; scrollbar-width: thin;
}
.nav-brand { font-weight: 700; color: var(--ink); margin-right: auto; white-space: nowrap; font-size: 0.95rem; }
.nav a {
  text-decoration: none; color: var(--sepia); white-space: nowrap;
  font-size: 0.82rem; letter-spacing: 0.02em;
  padding: 0.3rem 0.6rem; border-radius: 4px;
}
.nav a:hover { color: var(--ink); background: var(--paper); }
.nav a.active { color: var(--accent); background: rgba(122, 46, 46, 0.08); }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(180deg, var(--ivory), var(--cream));
  padding: 4rem 0 3.5rem; text-align: center;
}
.hero h1 {
  font-size: clamp(2.1rem, 1.2rem + 4vw, 3.6rem);
  letter-spacing: 0.01em; margin: 0 0 0.6rem;
}
.hero .subtitle { font-size: 1.25rem; color: var(--sepia); font-style: italic; margin: 0 0 0.5rem; }
.hero .dates { font-size: 0.9rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.hero-figure { margin: 2.2rem auto 0; max-width: 460px; }

/* ---- Figures & légendes ---- */
.figure { margin: 1.8rem 0; }
.figure img {
  border: 1px solid var(--line); padding: 6px; background: var(--ivory);
  box-shadow: var(--shadow); border-radius: 2px;
}
.figure.portrait { max-width: 360px; }
.caption { font-size: 0.85rem; color: var(--sepia); font-style: italic; margin-top: 0.6rem; }
.figure.float-right { float: right; max-width: 300px; margin: 0.4rem 0 1.2rem 1.8rem; }
.figure.float-left  { float: left;  max-width: 300px; margin: 0.4rem 1.8rem 1.2rem 0; }
.clearfix::after { content: ""; display: block; clear: both; }

/* ---- Frise chronologique (lignée) ---- */
.timeline { list-style: none; margin: 1.5rem 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 2px; background: var(--line);
}
.timeline li { position: relative; padding: 0 0 1.3rem 2.2rem; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 0.55rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ivory); border: 3px solid var(--gold);
}
.timeline .yr { font-weight: 700; color: var(--accent); }
.timeline .who { font-weight: 600; }
.timeline .meta { color: var(--sepia); font-size: 0.92rem; }

/* ---- Cartes (enfants d'Ignaz) ---- */
.cards { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 1.5rem 0; }
.card {
  background: var(--ivory); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: top center; background: var(--paper); }
.card.no-img { border-top: 4px solid var(--gold); }
.card .card-body { padding: 1.1rem 1.2rem 1.3rem; }
.card h3 { margin: 0 0 0.2rem; }
.card .card-dates { color: var(--gold); font-size: 0.85rem; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; margin: 0; color: var(--ink); }

/* ---- Mise en valeur (section Klimt) ---- */
.section.feature { background: var(--ink); color: var(--cream); }
.feature h2, .feature h3 { color: var(--ivory); }
.feature .eyebrow { color: #d7b56a; }
.feature a { color: #e7c98a; }
.feature .caption { color: #c9bda9; }
.feature .figure img { border-color: #4a423a; background: #211d19; }
.feature-grid { display: grid; gap: 2rem; grid-template-columns: 1.3fr 1fr; align-items: start; }
@media (max-width: 760px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---- Galerie ---- */
.gallery { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 1.4rem 0; }
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; height: 220px; object-fit: cover; object-position: top center;
  border: 1px solid var(--line); background: var(--ivory); cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease; border-radius: 2px;
}
.gallery img:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.gallery figcaption { font-size: 0.78rem; color: var(--sepia); font-style: italic; margin-top: 0.35rem; }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 17, 14, 0.92); padding: 4vmin; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 88vh; box-shadow: 0 10px 50px rgba(0,0,0,0.5); cursor: default; }
.lightbox .lb-cap { position: absolute; bottom: 2.5vmin; left: 0; right: 0; text-align: center; color: #e7ddca; font-style: italic; font-size: 0.9rem; padding: 0 1rem; }
.lb-close { position: absolute; top: 2.5vmin; right: 3vmin; background: none; border: none; color: #fff; font-size: 2.6rem; line-height: 1; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: none; color: #fff; font-size: 3rem; cursor: pointer; padding: 0 1.2rem; opacity: 0.8; }
.lb-nav:hover { opacity: 1; }
.lb-prev { left: 1vmin; } .lb-next { right: 1vmin; }

/* ---- Généalogie détaillée (registre repliable) ---- */
.tree details {
  border: 1px solid var(--line); border-radius: 4px; background: var(--ivory);
  margin: 0.7rem 0; overflow: hidden;
}
.tree summary {
  cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 600; color: var(--ink);
  list-style: none; display: flex; align-items: center; gap: 0.6rem;
  background: var(--ivory);
}
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: "▸"; color: var(--gold); transition: transform 0.2s; }
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree summary .branch-code { color: var(--gold); font-size: 0.8rem; letter-spacing: 0.08em; margin-left: auto; }
.tree .branch-body { padding: 0.4rem 1.2rem 1.2rem; border-top: 1px solid var(--line); }

.lineage { list-style: none; margin: 0.4rem 0; padding: 0; }
.lineage ul { list-style: none; margin: 0.2rem 0 0.2rem 0; padding-left: 1.4rem; border-left: 1px solid var(--line); }
.lineage li { padding: 0.35rem 0; }
.lineage .person { font-weight: 600; }
.lineage .spouse { color: var(--sepia); }
.lineage .vitals { color: var(--sepia-soft); font-size: 0.88rem; }
.lineage .note { display: block; color: var(--sepia); font-size: 0.9rem; font-style: italic; }

/* ---- Pied de page ---- */
.footer { background: var(--ink); color: var(--cream); padding: 3rem 0; text-align: center; }
.footer a { color: #e7c98a; }
.footer .small { color: #b7ab97; font-size: 0.85rem; margin-top: 1rem; }

/* ---- Notes d'avertissement ---- */
.privacy-note { font-size: 0.85rem; color: var(--sepia); font-style: italic; border-left: 3px solid var(--line); padding-left: 1rem; margin: 1.5rem 0; }

/* ---- Responsive ---- */
@media (max-width: 700px) {
  body { font-size: 17px; }
  .section { padding: 3rem 0; }
  .figure.float-right, .figure.float-left { float: none; max-width: 100%; margin: 1.5rem 0; }
  .gallery img { height: 170px; }
}
