/* Site famille-d-horrer.com — same look as the canvas pages (colours, fonts, layout). */
:root {
  --bg: #F7F7F4; --paper: #FFFFFF; --ink: #22262B; --ink-2: #33383E; --muted: #5A5F66; --muted-2: #4A4F55;
  --blue: #1F3A5F; --blue-dark: #0F2440; --gold: #C9A24A; --line: #DCDAD2; --cream: #F3EFE3;
  --serif: 'Source Serif 4', Georgia, serif; --display: 'Cormorant Garamond', Georgia, serif; --sans: 'IBM Plex Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); }
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
kbd { font-family: var(--sans); font-size: .9em; padding: 0 4px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--paper); padding: 8px 12px; }

/* header + menu */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 10; }
.bar { padding-top: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--blue); }
.brand img { width: 40px; height: auto; display: block; }
.brand span { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: .01em; }
.langs { display: flex; gap: 4px; font-family: var(--sans); font-size: 14px; }
.langs a { text-decoration: none; padding: 12px 6px; color: var(--muted); }
.langs a[aria-current] { font-weight: 500; color: var(--blue-dark); }
.menu { padding-top: 4px; }
.menu > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 4px; font-family: var(--sans); font-size: 15px; }
.menu > ul > li { position: relative; }
.menu summary, .menu > ul > li > a { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; cursor: pointer;
  color: var(--blue); text-decoration: none; border-bottom: 3px solid transparent; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.menu details[open] > summary, .menu details.cur > summary { border-bottom-color: var(--gold); color: var(--blue-dark); font-weight: 500; }
.menu details ul { list-style: none; margin: 0; padding: 8px 0; position: absolute; z-index: 20; left: 0; top: 100%; min-width: 300px; max-width: calc(100vw - 32px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 8px 24px rgba(15, 36, 64, .12); }
.menu details a { display: flex; align-items: center; min-height: 40px; padding: 4px 18px; text-decoration: none; font-size: 15px; color: var(--ink); }
.menu details a.sub { padding-left: 34px; font-style: italic; color: var(--muted-2); }
.menu details a:hover { background: var(--bg); }
.menu details a[aria-current] { font-weight: 600; background: var(--cream); color: var(--blue-dark); }

/* crumbs + page marks */
.crumbs { border-bottom: 1px solid var(--line); background: var(--paper); }
.crumbs .row { padding-top: 14px; padding-bottom: 14px; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.marks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.marks a { display: block; width: 28px; height: 6px; border-radius: 3px; background: var(--line); }
.marks a[aria-current] { background: var(--blue); }
.marks a.paren { width: 14px; background: transparent; border: 1px dashed #8D8A80; }
.marks a.paren[aria-current] { background: #8D8A80; }

/* hero */
.hero { background: var(--bg) center bottom / cover no-repeat; }
.hero .wrap { padding-top: 72px; padding-bottom: 56px; }
.kicker { margin: 0; font-family: var(--sans); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }
.hero h1 { margin: 10px 0 0; font-family: var(--display); font-weight: 600; font-size: clamp(34px, 5vw, 56px); line-height: 1.08; color: var(--blue); max-width: 880px; }
.hero.paren h1 { font-style: italic; color: var(--muted-2); }

/* text pages */
.content { display: flow-root; padding-bottom: 48px; }   /* flow-root: the page grows to hold the last margin items */
/* one text column per section; margin items (<aside>) sit in the flow before their paragraph and float into the margin column:
   they start at their paragraph, stack below each other (clear: right, also from one section to the next: a tall item runs on beside
   the next section, in the margin column, never over the text), never push the text; the page (main.content) grows to hold the last ones */
.block { margin-top: 48px; }
.block > * { max-width: 680px; }
.block .mp { display: flex; flex-direction: column; }   /* narrow screen: the margin item under its paragraph */
.block .mp > aside { order: 2; }
.block .mp > p, .block .mp > .list { max-width: 680px; }
.block aside { max-width: 300px; margin: 0 0 8px; }
@media (min-width: 941px) {
  .block { max-width: 1044px; padding-right: 364px; }
  .content > .notes { max-width: min(680px, calc(100% - 364px)); }   /* the notes stay clear of a margin item that runs on */
  .block .mp { display: contents; }
  .block aside { float: right; clear: right; width: 300px; margin-right: -364px; }
}
.block h2 { margin: 0 0 16px; font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.15; color: var(--blue); }
.block h3 { margin: 30px 0 12px; font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1.2; color: var(--blue); }
.block h2 + h3 { margin-top: 4px; }
.block p, .block .list { margin: 0 0 18px; font-size: 19px; line-height: 1.75; overflow-wrap: anywhere; }
.block .list ul, .block .list ol { margin: 0; padding-left: 1.3em; }
.block p img { vertical-align: middle; }
figure { margin: 0 0 22px; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #E9E7E0; }
figure.wide { margin: 8px 0 26px; }
figcaption a.doc-cap { color: inherit; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
figcaption { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--muted-2); }
figcaption .credit { display: block; margin-top: 2px; font-size: 13px; }
figcaption .credit a { color: inherit; }
a.doc { font-family: var(--sans); font-size: 14px; font-weight: 500; text-decoration: none; padding: 1px 7px; border: 1px solid var(--gold); border-radius: 3px; white-space: nowrap; }
a.doc.long { white-space: normal; }
sup.fn a, sup a[href^="#s"] { font-family: var(--sans); font-size: 13px; text-decoration: none; padding: 0 2px; }
sup.fr-only { font-family: var(--sans); font-size: 11px; letter-spacing: 0.05em; color: var(--muted, #5A5F66); margin-left: 2px; }
sup a[href^="#s"] { font-style: italic; }
.notes { margin-top: 56px; max-width: 680px; padding-top: 24px; border-top: 1px solid var(--line); }
.notes + .notes { margin-top: 24px; }
.notes h2 { margin: 0 0 14px; font-family: var(--sans); font-weight: 500; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.notes ol, .notes ul { margin: 0; padding-left: 26px; font-size: 16px; line-height: 1.6; color: var(--ink-2); display: flex; flex-direction: column; gap: 10px; overflow-wrap: anywhere; }
.notes ul.centuries { padding: 0; gap: 6px; list-style: none; }
/* the number of a note leads back to its marker in the text (#rN); the sticky header must not hide the target */
.notes ol { list-style: none; padding-left: 44px; }
.notes li { scroll-margin-top: 110px; }
.notes ol > li > .fn-back { margin-left: -44px; }
sup.fn, sup[id^="rs"] { scroll-margin-top: 110px; }
figure[id^="img-"] { scroll-margin-top: 110px; }
figure[id^="img-"]:target img { outline: 3px solid #C9A24A; outline-offset: 3px; }
.fn-back { display: inline-block; min-width: 44px; font-family: var(--sans); font-size: 13px; text-decoration: none; color: var(--muted); }
a.fn-back { color: var(--blue); }
.fn-arrow { margin-left: 4px; font-size: 14px; }
a.fn-back:hover, a.fn-back:focus-visible { color: var(--blue-dark); }
.centuries .fn-back { font-style: italic; min-width: 0; margin-right: 8px; }
.notes li:target, sup.fn:target, sup[id^="rs"]:target { background: #F3E7C4; border-radius: 3px; transition: background 1.5s ease; }
.paren-note { margin-top: 32px; max-width: 680px; padding: 16px 20px; background: #F7F5EE; border: 1px dashed #A8A496; border-radius: 4px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.sync-note { margin: 0 0 28px; max-width: 680px; padding: 12px 16px; background: #F7F5EE; border-left: 3px solid #A8A496; border-radius: 2px;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.sync-note a { font-family: var(--sans); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.paren-note a { font-family: var(--sans); font-size: 14px; font-weight: 500; text-decoration: none; }
.minitree { margin: 0 0 24px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; font-family: var(--sans); font-size: 13px; line-height: 1.4; }
.minitree summary { cursor: pointer; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.minitree > div { margin-top: 10px; }
.minitree > a { display: inline-block; margin-top: 10px; }
.arbre-branche { margin: 8px 0 24px; }
.arbre-branche summary::marker { color: #A8A496; }
.arbre-branche [id]:target { scroll-margin-top: 96px; background: rgba(201,162,74,.25); }
.arbre-tout { margin: 16px 0 0; font-family: var(--sans); font-size: 14px; }

/* prev / next */
.prevnext { border-top: 1px solid var(--line); background: var(--paper); }
.prevnext .row { padding-top: 28px; padding-bottom: 40px; align-items: flex-start; gap: 16px; }
.pn { display: flex; flex-direction: column; gap: 4px; min-height: 48px; text-decoration: none; max-width: 46%; }
.pn.right { align-items: flex-end; text-align: right; margin-left: auto; }
.pn span { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.pn strong { font-size: 19px; font-weight: 600; }
.skipparen { align-self: center; font-family: var(--sans); font-size: 14px; color: var(--muted-2); }

/* lists of pages */
.seq, .toc { list-style: none; margin: 40px 0 0; padding: 0; max-width: 760px; }
.seq li a { display: flex; gap: 16px; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--line); text-decoration: none; font-size: 21px; }
.seq li:last-child a { border-bottom: 1px solid var(--line); }
.seq li a span { font-family: var(--sans); font-size: 14px; color: var(--muted); min-width: 24px; }
.seq li a { flex-wrap: wrap; }
.seq li a b { font-weight: inherit; flex: 1 1 0; min-width: 0; }
.seq li a em { flex: 0 0 100%; padding-left: 40px; margin-top: -6px; font-style: normal; font-size: 16px; line-height: 1.55; color: var(--muted); }
.toc { margin-top: 12px; }
.toc li a { display: block; padding: 8px 0; font-size: 19px; text-decoration: none; }
.toc-sec { margin-top: 44px; }
.toc-sec h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 32px; color: var(--blue); }
.toc-sec h3 { margin: 24px 0 0; font-family: var(--sans); font-weight: 500; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* footer */
.foot { border-top: 1px solid var(--line); background: #F1EFE8; font-family: var(--sans); font-size: 14px; color: var(--muted-2); }
.foot .row { padding-top: 24px; padding-bottom: 8px; }
.foot .links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot p { margin: 0 auto; padding-top: 8px; padding-bottom: 28px; line-height: 1.6; }

/* pages made for the canvas keep their inline styles; make them fit narrow screens */
.extra { overflow-wrap: anywhere; overflow-x: auto; }
.extra svg { max-width: 100%; height: auto; }
.extra table { display: block; max-width: 100%; overflow-x: auto; }
.home img { max-width: 100%; height: auto; }
.home { overflow-wrap: anywhere; }
.home [style*="flex: 0 0 auto"] { flex-shrink: 1 !important; max-width: 100%; }

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hero .wrap { padding-top: 40px; padding-bottom: 32px; }
  .block { margin-top: 32px; }
  .block p, .block .list { font-size: 18px; line-height: 1.7; }
  .block aside { max-width: none; }
  .menu summary, .menu > ul > li > a { padding: 0 10px; }
  .menu > ul > li { position: static; }
  .menu details ul { left: 16px; right: 16px; min-width: 0; }
  .pn { max-width: 100%; }
  .marks { display: none; }
  a.doc { white-space: normal; }
  .menu { position: relative; }
}
@media print {
  .top, .crumbs, .prevnext, .foot { display: none; }
  .hero { background: none !important; }
}

/* home: Yves's welcome text */
.welcome { border-top: 1px solid var(--line); background: var(--bg); }
.welcome .wrap { padding-top: 56px; padding-bottom: 56px; }
.welcome h2 { margin: 0 0 20px; font-family: var(--display); font-weight: 600; font-size: 34px; color: var(--blue); }
.welcome-text { max-width: 720px; font-size: 19px; line-height: 1.75; color: var(--ink-2); }
.welcome-text p { margin: 0 0 16px; }

/* contact page */
.lead { margin: 40px 0 8px; max-width: 720px; font-size: 19px; line-height: 1.7; color: var(--ink-2); }
form.contact { margin-top: 24px; max-width: 640px; display: flex; flex-direction: column; gap: 18px; font-family: var(--sans); }
form.contact label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted-2); }
form.contact input, form.contact textarea { font: 17px/1.5 var(--serif); color: var(--ink); padding: 10px 12px; border: 1px solid #C9C5B8; border-radius: 4px; background: var(--paper); }
form.contact input:focus, form.contact textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
form.contact .hp { position: absolute; left: -9999px; }
form.contact button { align-self: flex-start; min-height: 48px; padding: 0 26px; border: 0; border-radius: 4px; background: var(--blue); color: #fff; font: 500 15px var(--sans); cursor: pointer; }
form.contact button:disabled { opacity: .6; cursor: wait; }
form.contact .status { margin: 0; font-size: 15px; }
form.contact .req { margin: 0; font-size: 14px; color: var(--muted-2); }
form.contact .privacy { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted-2); }
form.contact .privacy a { color: inherit; }
form.contact .status.ok { color: #2F6B3A; }
form.contact .status.err { color: #8B3A3A; }
.direct { margin-top: 28px; font-family: var(--sans); font-size: 15px; color: var(--muted-2); }

/* a document waiting for the family's agreement: no link yet */
.attente { font-style: italic; color: var(--muted-2); }

/* menu: new sections (« new: true » in menu.yaml) */
.menu .new { margin-left: 10px; padding: 2px 8px; border-radius: 10px; background: #F3E9CF; color: #6B4E0E; font-size: 12px; font-weight: 500; white-space: nowrap; }

/* cookie consent banner (assets/consent.js) */
.consent{position:fixed;left:16px;right:16px;bottom:16px;z-index:50;max-width:620px;margin:0 auto;padding:16px 18px;
  background:#fff;border:1px solid #DCDAD2;border-radius:6px;box-shadow:0 6px 24px rgba(15,36,64,.18);
  font:15px/1.5 "IBM Plex Sans",system-ui,sans-serif;color:#22262B}
.consent p{margin:0 0 12px}
.consent-row{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.consent button{min-height:44px;padding:0 18px;border-radius:22px;font:inherit;cursor:pointer;border:1px solid #1F3A5F}
.consent .go{background:#1F3A5F;color:#fff}
.consent .no{background:#fff;color:#1F3A5F}

/* header on phones: short language codes and a « Menu » button that opens the menu as a panel */
.menu-toggle, .langs .short, .arbre .gen { display: none; }
@media (max-width: 760px) {
  .bar { flex-wrap: nowrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .brand { flex: 1 1 auto; min-width: 0; gap: 10px; }
  .brand img { width: 32px; }
  .brand span { font-size: 20px; line-height: 1.15; }
  .langs { gap: 0; font-size: 13px; flex: 0 0 auto; }
  .langs a { padding: 10px 5px; }
  .langs .full { display: none; }
  .langs .short { display: inline; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 40px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--blue-dark);
    font: 500 14px var(--sans); cursor: pointer; }
  .menu-toggle::before { content: ''; width: 16px; height: 2px; background: currentColor; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; }
  .top.open .menu-toggle::before { content: '✕'; width: 16px; height: auto; background: none; box-shadow: none; font-size: 15px; line-height: 1; text-align: center; }
  .top.open .menu-toggle { background: var(--cream); }
  .js .menu { display: none; }
  .js .top.open .menu { display: block; max-height: calc(100vh - 64px); overflow-y: auto; padding: 0 0 16px; }
  .menu > ul { flex-direction: column; gap: 0; font-size: 17px; }
  .menu > ul > li { position: static; border-bottom: 1px solid var(--line); }
  .menu summary, .menu > ul > li > a { justify-content: space-between; min-height: 52px; padding: 0 4px; border-bottom: 0; }
  .menu details[open] > summary { color: var(--blue-dark); font-weight: 600; }
  .menu details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
  .menu details ul { position: static; min-width: 0; max-width: none; margin: 0 0 10px; padding: 0; border: 0; box-shadow: none; background: transparent; }
  .menu details a { min-height: 44px; padding: 4px 8px 4px 16px; font-size: 16px; border-radius: 4px; }
  .menu details a.sub { padding-left: 32px; }
}
@media (max-width: 380px) {
  .brand span { font-size: 17px; }
  .menu-toggle { padding: 0 10px; }
}

/* family tree on phones: small steps, and no more indentation after the 6th level (a « gén. N » label instead) */
@media (max-width: 640px) {
  .arbre ul { margin-left: 0 !important; padding-left: 9px !important; }
  .arbre ul ul ul ul ul ul ul { padding-left: 0 !important; border-left: 0 !important; }
  .arbre li { overflow-wrap: break-word; }
  .arbre [style*="font-size: 17px"] { font-size: 16px !important; }
  .arbre .gen { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 9px; background: var(--cream);
    font: 500 11px/18px var(--sans); color: var(--muted); vertical-align: 2px; }
}

/* the header stays at the top of the screen (phones and computers); anchors are not hidden under it */
/* when it shrinks, the height it loses is kept as a margin (--top-shrink, from menu.js): the page keeps its length, so no jump and no flicker */
.top { position: sticky; top: 0; z-index: 30; transition: box-shadow .3s ease, margin-bottom .3s ease; }
.top.scrolled { box-shadow: 0 2px 12px rgba(15, 36, 64, .10); margin-bottom: var(--top-shrink, 0px); }
html { scroll-padding-top: var(--header-h, 140px); }
@media (min-width: 761px) {
  .bar { transition: padding-top .3s ease; }
  .brand img { transition: width .3s ease; }
  .brand span { transition: font-size .3s ease; }
  .top.scrolled .bar { padding-top: 8px; }
  .top.scrolled .brand img { width: 30px; }
  .top.scrolled .brand span { font-size: 20px; }
}
.top.measuring, .top.measuring * { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .top, .top * { transition: none !important; } }

/* site search (tools/site/recherche.js, Pagefind) */
.search-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px;
  font-family: var(--sans); font-size: 14px; color: var(--blue); background: var(--paper); border: 1px solid var(--line); border-radius: 20px; cursor: pointer; }
.search-toggle:hover { border-color: var(--blue); }
.search-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.search-toggle + .langs { margin-left: 0; }
dialog.recherche { width: min(720px, calc(100vw - 32px)); max-height: min(78vh, 760px); margin: 8vh auto auto; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: var(--paper); color: var(--ink); box-shadow: 0 18px 48px rgba(15, 36, 64, .22); display: none; flex-direction: column; }
dialog.recherche[open] { display: flex; }
dialog.recherche::backdrop { background: rgba(15, 36, 64, .35); }
.r-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.r-head input { flex: 1; min-width: 0; font: 19px var(--serif); color: var(--ink); border: 0; outline: 0; padding: 10px 0; background: transparent; }
.r-head input::-webkit-search-cancel-button { cursor: pointer; }
.r-close { font: 14px var(--sans); color: var(--blue); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; cursor: pointer; }
.r-body { overflow-y: auto; padding: 4px 0 8px; }
#r-list { list-style: none; margin: 0; padding: 0; }
.r-group { padding: 12px 18px 4px; font: 500 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
#r-list [role=option] { cursor: pointer; }
.r-sugg { display: flex; align-items: baseline; gap: 10px; padding: 8px 18px; }
.r-kind { flex: none; min-width: 72px; font: 12px var(--sans); color: var(--muted); }
.r-label { font-size: 17px; }
.r-sugg .r-sec { margin-left: auto; font: 12px var(--sans); color: var(--muted); }
.r-page a { display: block; padding: 10px 18px; text-decoration: none; color: var(--ink); }
.r-title { font-size: 17px; font-weight: 600; color: var(--blue-dark); }
.r-page .r-sec { margin-left: 10px; font: 12px var(--sans); color: var(--muted); }
.r-ex { display: block; margin-top: 3px; font-size: 15px; line-height: 1.5; color: var(--muted-2); }
.r-ex mark { background: #F4E7C2; color: inherit; padding: 0 1px; }
#r-list [aria-selected=true], #r-list [role=option]:hover { background: var(--cream); }
.r-status { margin: 10px 18px 4px; font: 14px var(--sans); color: var(--muted); }
.r-status:empty { display: none; }
.r-more { margin: 6px 18px 10px; font: 14px var(--sans); color: var(--blue); background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 8px 14px; cursor: pointer; }
.r-hint { margin: 0; padding: 10px 18px; border-top: 1px solid var(--line); font: 13px var(--sans); color: var(--muted); background: var(--bg); }
@media (max-width: 640px) {
  .search-toggle span { display: none; }
  .search-toggle { padding: 4px 10px; }
  dialog.recherche { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .r-kind { min-width: 60px; }
  .r-hint { display: none; }
}

/* newsletter (tools/lettre.py): subscription form (footer, /<lang>/nouvelles/), archive */
form.lettre { display: grid; gap: 6px; max-width: 560px; font-family: var(--sans); }
form.lettre label:first-of-type { font-weight: 500; color: var(--ink); }
.lettre-row { display: flex; gap: 8px; }
.lettre-row input { flex: 1; min-width: 0; font: 15px var(--sans); padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); }
.lettre-row button { font: 500 15px var(--sans); padding: 9px 16px; color: #FFFFFF; background: var(--blue); border: 0; border-radius: 4px; cursor: pointer; }
.lettre-row button:hover { background: var(--blue-dark); }
.lettre-row button:disabled { opacity: .6; }
.lettre-priv { font-size: 13px; color: var(--muted); line-height: 1.5; }
form.lettre .status:empty { display: none; }
form.lettre .status.ok { color: #2E6B3A; } form.lettre .status.err { color: #8A2B2B; }
form.lettre .hp { position: absolute; left: -9999px; }
.foot form.lettre-pied { padding: 12px 0 4px; font-size: 14px; }
.nouvelles form.lettre-page, .lettre-numero form.lettre-page { margin: 28px 0 36px; padding: 20px 22px; background: var(--cream); border: 1px solid var(--line); border-radius: 4px; }
.lettres li a span { min-width: 9em; }
.nouvelles .rss a { font-family: var(--sans); font-size: 14px; }

/* home page « fil de l'histoire » (tools/fil.py, assets/fil.js): an ink thread through the chapter numbers, a small
   vignette for each chapter (wash + ink lines, two layers), the thread splits into the three branches.
   Without JavaScript: numbers in circles and vignettes as they are; .fil-on: thread drawn by the scroll, vignettes appear. */
.home { position: relative; --fil-ink: #3E4C44; }
.fil > li.etape:not(.paren) { position: relative; padding-left: 76px !important; }
.fil > li.etape:not(.paren) > span:first-child { position: absolute; left: 0; top: 20px; z-index: 2; width: 52px; height: 52px; display: flex;
  align-items: center; justify-content: center; border-radius: 50%; background: #FFFFFF; box-shadow: 0 0 0 1px var(--line);
  font-size: 26px !important; line-height: 1 !important;
  font-variant-numeric: lining-nums; font-feature-settings: 'lnum' 1;      /* figures of one height: old-style 3, 4, 7, 9 hang below the line and sit off centre */
  transition: box-shadow .5s ease, color .5s ease, transform .5s cubic-bezier(.2, 1.6, .4, 1); }
.vign { position: relative; flex: 0 0 176px; height: 132px; margin: 0; perspective: 700px; align-self: flex-start; }
.vign .lay { position: absolute; inset: -4px; background: center / cover no-repeat; }
.home #branches a.branche { position: relative; padding-left: 76px !important; }
.fil-on #branches > h2, .fil-on #branches > p { padding-left: 76px; }     /* the thread comes down in the margin, not through the title */
.fil-svg { position: absolute; left: 0; top: 0; z-index: 1; overflow: visible; pointer-events: none; }
.fil-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fil-svg .route { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 2 6; }
.fil-svg .trait { stroke: var(--fil-ink); stroke-width: 2.4; }
.fil-svg .trait.paren { stroke-width: 1.6; stroke-dasharray: 5 5; }
.fil-svg .bout { fill: var(--fil-ink); transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .5s cubic-bezier(.2, 1.6, .4, 1); }
.fil-svg .bout.eteinte { fill: #FFFFFF; stroke: var(--fil-ink); stroke-width: 1.6; }
.fil-svg .bout.on { transform: scale(1); }

.fil-on .fil > li.etape:not(.paren) > span:first-child { color: #B9B4A6 !important; }
.fil-on .fil > li.etape.lit:not(.paren) > span:first-child { color: #A8822F !important; box-shadow: 0 0 0 2px var(--fil-ink); transform: scale(1.06); }
.fil-on .vign .lay { will-change: transform; }
.fil-on .vign .tilt { position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(calc(var(--p, 0) * 9deg)) rotateY(calc(var(--p, 0) * -4deg)); }
.fil-on .vign .wash { transform: translate3d(0, calc(var(--p, 0) * 7px), 0) scale(1.04); opacity: 0; filter: blur(6px);
  -webkit-mask: radial-gradient(circle at var(--ox, 50%) var(--oy, 50%), #000 0, #000 var(--r, 0%), transparent calc(var(--r, 0%) + 14%));
          mask: radial-gradient(circle at var(--ox, 50%) var(--oy, 50%), #000 0, #000 var(--r, 0%), transparent calc(var(--r, 0%) + 14%)); }
.fil-on .vign .ink { transform: translate3d(0, calc(var(--p, 0) * -9px), 24px); clip-path: inset(0 100% 0 0); }
.vign .sketch { display: none; }
.fil-on .vign .sketch { display: block; opacity: .2; transform: translate3d(0, calc(var(--p, 0) * -9px), 24px); }   /* the underdrawing, before the thread arrives */
@property --r { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
.fil-on .seen .vign .wash { animation: fil-wash 1.6s cubic-bezier(.3, .6, .2, 1) forwards; }
.fil-on .seen .vign .ink { animation: fil-ink 1.4s .5s cubic-bezier(.5, 0, .3, 1) forwards; }
@keyframes fil-wash { from { opacity: 0; filter: blur(6px); --r: 0%; } 35% { opacity: 1; } to { opacity: 1; filter: blur(0); --r: 110%; } }
@keyframes fil-ink { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (max-width: 640px) {
  .vign { flex-basis: 160px; height: 120px; }
  .fil > li.etape:not(.paren) { padding-left: 64px !important; }
  .fil > li.etape:not(.paren) > span:first-child { width: 44px; height: 44px; font-size: 22px !important; }
  .home #branches a.branche { padding-left: 64px !important; }
  .fil-on #branches > h2, .fil-on #branches > p { padding-left: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .fil-on .vign .wash, .fil-on .vign .ink { animation: none !important; opacity: 1; filter: none; clip-path: none; -webkit-mask: none; mask: none; transform: none; }
  .fil-on .vign .tilt { transform: none; }
}
@media print { .fil-svg { display: none; } }

/* first mention of a person or a place: a quiet link to the tree / the map (tools/crosslinks.py) */
main a.xl { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
main a.xl:hover, main a.xl:focus-visible { color: var(--blue); border-bottom-style: solid; }
