/* ==========================================================
   laizhou-hong.fr — pages intérieures : prose, sommaire,
   tableaux, santé, curseurs, annuaire, formulaires.
   ========================================================== */

/* ---------- Sous-navigation de rubrique ---------- */
.subnav {
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  ul {
    display: flex;
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
  }
  a {
    display: inline-block;
    padding: 0.8em 0;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    &:hover { color: var(--text); }
    &[aria-current] { color: var(--accent-text); border-bottom-color: var(--accent); }
  }
}

/* ---------- En-tête de page ---------- */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--space-6) var(--space-5);
  background:
    radial-gradient(50% 90% at 90% 20%, color-mix(in oklab, var(--c-fire) 22%, transparent), transparent 70%);
  h1 { font-size: var(--fs-2xl); max-width: 22ch; }
  .hero__han { font-size: clamp(6rem, 18vw, 14rem); bottom: -0.3em; }
}
.lead--wide { max-width: 62ch; }

/* ---------- Grille document + sommaire ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
  @media (max-width: 960px) { grid-template-columns: 1fr; gap: var(--space-4); }
  /* Page sans sommaire (aucun sous-titre) : le contenu prend toute la largeur */
  &:not(:has(> .toc)) { grid-template-columns: minmax(0, 1fr); }
}
.section--doc { padding-block: var(--space-5) var(--space-7); }

.toc {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
  font-size: var(--fs-sm);
  scrollbar-width: thin;
  @media (max-width: 960px) { position: static; max-height: none; }
}
.toc__box {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  summary {
    font: 700 var(--fs-base)/1.2 var(--font-display);
    cursor: pointer;
    list-style: none;
    &::-webkit-details-marker { display: none; }
    &::after { content: " ▾"; color: var(--accent-text); }
  }
  &[open] summary::after { content: " ▴"; }
  ol { margin: var(--space-3) 0 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; }
  a { color: var(--text-muted); text-decoration: none; &:hover, &[aria-current] { color: var(--accent-text); } }
  .toc__l3 { padding-left: 1rem; font-size: 0.92em; }
}

/* ---------- Prose ---------- */
.prose {
  max-width: 78ch;
  h2 {
    position: relative;
    margin-top: var(--space-6);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
    font-size: var(--fs-xl);
    &:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
  }
  h3 { margin-top: var(--space-5); }
  h4 { margin: var(--space-4) 0 var(--space-2); font-family: var(--font-display); font-size: var(--fs-base); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-text); }
  ul, ol { padding-left: 1.3em; margin: 0 0 var(--space-3); }
  li { margin-bottom: 0.35em; }
  li p { margin: 0; }
  strong { font-weight: 650; }
  blockquote { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--accent); background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; }
  hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-5) 0; }
  img { border-radius: var(--radius); }
  .anchor {
    margin-left: 0.4em;
    font-weight: 400;
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s;
  }
  h2:hover .anchor, h3:hover .anchor, h2:focus-within .anchor { opacity: 1; }
}

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; margin: var(--space-4) 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.prose table, .risk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  th, td { padding: 0.7em 0.9em; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
  th { font-family: var(--font-display); font-weight: 700; background: var(--bg-alt); position: sticky; top: 0; }
  tbody tr:last-child td { border-bottom: 0; }
  tbody tr:hover td { background: color-mix(in oklab, var(--accent) 6%, transparent); }
  td:first-child { font-weight: 600; }
}
@media (max-width: 720px) {
  .table-wrap { border: 0; background: transparent; }
  .prose table, .risk-table, .lineage-table {
    thead { display: none; }
    tr { display: block; margin-bottom: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--space-2) var(--space-3); }
    td { display: grid; grid-template-columns: 9rem 1fr; gap: var(--space-2); padding: 0.45em 0; border-bottom: 1px dashed var(--line); }
    td:last-child { border-bottom: 0; }
    td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); }
    td:first-child::before { color: var(--accent-text); }
    td > .badge { justify-self: start; }
  }
}

/* ---------- Santé ---------- */
.badge {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--eleve { background: color-mix(in oklab, var(--c-lacquer) 80%, transparent); color: #fff; }
.badge--modere { background: color-mix(in oklab, var(--c-amber) 30%, transparent); color: var(--text); }
.badge--faible { background: color-mix(in oklab, var(--text-muted) 22%, transparent); color: var(--text); }
.badge--extrapole { border: 1px solid var(--line); color: var(--text-muted); }
.badge--doc { margin-left: 0.4em; font-size: 0.68rem; border: 1px solid var(--accent); color: var(--accent-text); vertical-align: middle; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--fs-sm);
  label { display: inline-flex; align-items: center; gap: 0.4em; cursor: pointer; }
  input { accent-color: var(--c-fire); }
}
.risk-table tr[hidden] { display: none; }

.prose--health h3 { scroll-margin-top: 6rem; }
.callout {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  list-style: none;
}
.callout--warn { border-color: var(--c-amber); background: color-mix(in oklab, var(--c-amber) 12%, transparent); }
.callout--ok { border-color: #4caf50; background: color-mix(in oklab, #4caf50 12%, transparent); }

/* ---------- Curseurs de caractère ---------- */
.trait-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--space-4); }
.trait-group { padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); h3 { margin-bottom: var(--space-3); } }
.traits { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.traits--compact { margin-top: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--space-2) var(--space-4); .trait__why { display: none; } }
.trait { display: grid; grid-template-columns: 1fr auto; gap: 0.2em var(--space-3); align-items: center; }
.trait__label { font-weight: 600; }
.trait__bar {
  display: inline-flex;
  gap: 4px;
  i { width: 1.2rem; height: 0.55rem; border-radius: 3px; background: var(--line); }
  i.is-on { background: linear-gradient(90deg, var(--c-fire-hi), var(--c-fire)); }
}
.trait__why { grid-column: 1 / -1; color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- Annuaire ---------- */
.country-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.country-nav a {
  display: inline-block;
  padding: 0.45em 0.9em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-sm);
  small { color: var(--text-muted); }
  &:hover { border-color: var(--accent); }
}
.country { margin-bottom: var(--space-6); scroll-margin-top: 6rem; h2 { font-size: var(--fs-xl); } }
.breeder h3 { font-size: var(--fs-lg); margin-bottom: var(--space-2); a { color: var(--text); text-decoration: none; &:hover { color: var(--accent-text); } } }
.breeder--warn { border-color: var(--c-amber); }
.breeder__warning { color: var(--c-amber); font-size: var(--fs-sm); }
.tags .tag--a { background: color-mix(in oklab, #4caf50 22%, transparent); color: var(--text); }
.tags .tag--b { background: color-mix(in oklab, var(--c-amber) 28%, transparent); color: var(--text); }
.tags .tag--c { background: color-mix(in oklab, var(--text-muted) 22%, transparent); color: var(--text); }
.tag { display: inline-block; padding: 0.3em 0.8em; border-radius: 999px; font-size: var(--fs-sm); }
.tag--a { background: color-mix(in oklab, #4caf50 22%, transparent); }
.tag--b { background: color-mix(in oklab, var(--c-amber) 28%, transparent); }
.tag--c { background: color-mix(in oklab, var(--text-muted) 22%, transparent); }

.breeder-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: var(--space-6);
  align-items: start;
  @media (max-width: 860px) { grid-template-columns: 1fr; }
}
.sheet-aside {
  position: sticky;
  top: 5rem;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  dl { margin: 0 0 var(--space-4); display: grid; gap: var(--space-2); }
  dt { font-size: var(--fs-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
  dd { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
}

/* ---------- FAQ / glossaire ---------- */
.faq__cat { margin-top: var(--space-5); font-size: var(--fs-xl); }
.glossary { dt { margin-top: var(--space-4); font: 700 var(--fs-lg)/1.2 var(--font-display); color: var(--accent-text); } dd { margin: var(--space-1) 0 0; } }

/* ---------- Formulaire ---------- */
.form { display: grid; gap: var(--space-3); max-width: 40rem; }
.form__row { display: grid; gap: var(--space-1); label { font-weight: 600; } }
.form input, .form select, .form textarea {
  width: 100%;
  padding: 0.7em 0.9em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  &:user-invalid { border-color: var(--c-lacquer); }
}
.form textarea { field-sizing: content; min-height: 8rem; resize: vertical; }
.form__hp { position: absolute; left: -9999px; }

/* ---------- Cartes en liste (accueil santé) ---------- */
.cards--list { grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
.timeline__item strong { display: block; margin-bottom: var(--space-1); }

/* ---------- Photo détourée de l'accueil ---------- */
.hero__visual--photo {
  position: relative;
  width: min(100%, 440px);
  filter: drop-shadow(0 24px 40px #000c);
  img { width: 100%; height: auto; }
  /* ombre portée au sol */
  &::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 8%;
    bottom: 1.2rem;
    height: 1.4rem;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, #000b, transparent);
  }
}
.hero__credit {
  margin-top: var(--space-2);
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  a { color: inherit; }
}
@media (max-width: 860px) {
  .hero__visual--photo { width: min(78%, 320px); }
}

/* ---------- Récit historique ---------- */
.recit { padding-block: var(--space-5) var(--space-6); }
.recit__body {
  max-width: 68ch;
  font-size: calc(var(--fs-base) * 1.06);
  line-height: 1.75;
  h2 { font-size: var(--fs-lg); margin-top: var(--space-5); padding-top: var(--space-3); }
  h2 .anchor { display: none; }
  > h2:first-child + p::first-letter {
    float: left;
    margin: 0.08em 0.12em 0 0;
    font: 800 3.4em/0.8 var(--font-display);
    color: var(--accent-text);
  }
  > p:last-child {
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-left: 3px solid var(--accent);
    background: var(--bg-alt);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    line-height: 1.4;
  }
}

/* ---------- Leïka : galerie personnelle ---------- */
.leika-hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-6);
  align-items: center;
  @media (max-width: 860px) { grid-template-columns: 1fr; gap: var(--space-4); }
}
.leika-hero h1 { font-size: var(--fs-hero); line-height: 0.95; }
.leika-hero__cover {
  margin: 0;
  justify-self: center;
  width: min(100%, 460px);
  img { width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: 0 30px 60px -20px #000c; rotate: 2deg; }
  @media (max-width: 860px) { order: -1; width: min(80%, 340px); }
}
.id-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
  div { padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
  dd { margin: 0; font-weight: 650; small { font-weight: 400; color: var(--text-muted); } }
}

.gallery-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.gallery-filters .chip::before { content: none; }
.gallery-filters .chip small { color: var(--text-muted); margin-left: 0.3em; }
.gallery-filters .chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); small { color: inherit; opacity: 0.85; } }

.period { margin-bottom: var(--space-6); scroll-margin-top: 6rem; }
.period[hidden] { display: none; }
.period__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-3); border-bottom: 1px solid var(--line); padding-bottom: var(--space-2); }
.period__head :is(h2, h3) { margin: 0; font-size: var(--fs-xl); }
.period__head p { margin: 0; }

.leika-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.leika-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: zoom-in;
  img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.5s var(--ease); }
  &:hover img, &:focus-visible img { scale: 1.05; }
}
.leika-item__age {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: #0d0a09cc;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.viewer {
  width: min(96vw, 1200px);
  max-height: 96vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  &::backdrop { background: #000e; backdrop-filter: blur(6px); }
  &[open] { animation: pop 0.3s var(--ease); }
}
.viewer__img { display: block; max-width: 100%; max-height: 84vh; margin: 0 auto; object-fit: contain; }
.viewer__caption { margin: 0; padding: var(--space-3) var(--space-4); }
.viewer__close { position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--surface); }
.viewer__nav { position: absolute; top: 45%; z-index: 2; background: var(--surface); font-size: 1.6rem; }
.viewer__prev { left: 8px; }
.viewer__next { right: 8px; }

/* ---------- Leïka : lien vers son histoire ---------- */
.story-link {
  display: grid;
  gap: 0.2rem;
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.3s, translate 0.3s var(--ease);
  strong { font: 700 var(--fs-lg)/1.2 var(--font-display); }
  span:last-child { color: var(--text-muted); font-size: var(--fs-sm); }
  &:hover { border-color: var(--accent); translate: 0 -2px; }
}
.story-link__eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-text); }
.page-hero .eyebrow a { color: inherit; }

/* ---------- Graphiques de suivi (série unique) ---------- */
:root { --chart-line: light-dark(#A8360F, #C8481A); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--space-3); margin: var(--space-4) 0 var(--space-5); }
.chart { margin: 0; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.chart__title { font: 650 var(--fs-base)/1.3 var(--font-display); margin-bottom: var(--space-2); }
.chart__unit { font: 400 var(--fs-sm) var(--font-body); color: var(--text-muted); }
.chart__plot { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__tick, .chart__reflabel { fill: var(--text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chart__cross[hidden] { display: none; }
.chart__ref { fill: color-mix(in oklab, var(--text-muted) 16%, transparent); }
.chart__line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__dot { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2; }
.chart__dot--open { fill: var(--surface); stroke: var(--chart-line); }
.chart__dot.is-active { r: 6; }
.chart__dot--ghost.is-active { r: 5; }
.chart__endlabel { fill: var(--text); font-size: 13px; font-weight: 650; }
.chart__cross { stroke: var(--text-muted); stroke-width: 1; }
.chart__hit { fill: transparent; cursor: crosshair; outline: none; }
.chart__hit:focus-visible { stroke: var(--c-fire-hi); stroke-width: 2; }
.chart__tip {
  position: absolute;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 0.1rem;
  min-width: 9rem;
  max-width: 15rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  pointer-events: none;
  strong { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
  span { color: var(--text-muted); }
  em { font-style: normal; color: var(--text-muted); }
  em:empty { display: none; }
}
.chart__tip[hidden] { display: none; }
.chart__table { margin-top: var(--space-2); font-size: var(--fs-sm); summary { cursor: pointer; color: var(--accent-text); } table { margin-top: var(--space-2); } }
.mici .callout { font-size: var(--fs-sm); }

/* ---------- Chronologie MICI : photos détourées, le texte épouse la silhouette ---------- */
.cutout {
  width: var(--w, 230px);
  height: var(--h, auto);
  margin: 0;
  img { display: block; width: 100%; height: auto; }
  figcaption {
    height: 34px;
    padding-top: 4px;
    font-size: 0.72rem;
    line-height: 1.25;
    color: var(--text-muted);
    text-align: center;
  }
}
/* Pas de marge : l'écart au texte est donné par shape-margin, pour que le masque couvre exactement la figure */
.cutout.is-right { float: right; shape-margin: 18px; shape-image-threshold: 0.35; }
.cutout.is-left { float: left; shape-margin: 18px; shape-image-threshold: 0.35; }
.mici h2, .mici h3 { clear: both; }
.mici ul { list-style-position: inside; padding-left: 0; }
@media (max-width: 700px) {
  .cutout.is-right, .cutout.is-left { float: none; width: min(60vw, 220px); height: auto; margin: var(--space-2) auto var(--space-3); shape-outside: none !important; }
}

/* ---------- Chronologie MICI : photos encadrées (hospitalisation) ---------- */
.shot {
  margin: 0.3rem 0 var(--space-3);
  img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
  figcaption {
    margin-top: var(--space-1);
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-muted);
    span { display: block; opacity: 0.8; }
  }
}
.shot--portrait { width: 230px; }
.shot--landscape { width: 330px; }
.shot.is-right { float: right; margin-left: var(--space-4); }
.shot.is-left { float: left; margin-right: var(--space-4); }
@media (max-width: 700px) {
  .shot.is-right, .shot.is-left { float: none; width: 100%; max-width: 420px; margin: var(--space-2) auto var(--space-3); }
}

/* ---------- Formulaire : photos jointes ---------- */
.form input[type="file"] {
  padding: 0.55em;
  cursor: pointer;
  &::file-selector-button {
    margin-right: var(--space-3);
    padding: 0.45em 1em;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }
}
.form__hint { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.form__check {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: 0.92rem;
  input { width: auto; margin-top: 0.25em; accent-color: var(--accent); }
  &[hidden] { display: none; }
}

/* ---------- Galerie de la race ---------- */
.leika-grid--compact { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.gallery-call { margin-top: var(--space-6); }
.gallery-credits {
  margin-top: var(--space-4);
  font-size: 0.85rem;
  color: var(--text-muted);
  summary { cursor: pointer; font-weight: 600; color: var(--text); }
  ul { margin: var(--space-2) 0 0; padding-left: 1.2em; }
  li { margin-bottom: 0.3em; }
}
/* Photos d'élevage et d'exposition : cadrage carré, tête du chien en haut de l'image */
.leika-grid--breed .leika-item { aspect-ratio: 1; img { object-position: 50% 25%; } }
.prose .leika-grid { padding: 0; li { margin: 0; } }

/* ---------- Lignées : graphe généalogique ---------- */
/* Couleur = pays où vit le chien (palette validée clair/sombre, doublée par le texte des cases et la légende) */
.ln-GB { --ln: light-dark(#2563C9, #4F86E0); }
.ln-FR { --ln: light-dark(#B8400F, #D9622F); }
.ln-US { --ln: light-dark(#1E8A5E, #2FA273); }
.ln-RS { --ln: light-dark(#7A4FC4, #9270D8); }
.ln-AU { --ln: light-dark(#B07A00, #B08418); }
.ln-PL { --ln: light-dark(#C23B77, #D65A93); }
.ln-XX { --ln: var(--text-muted); } /* autres pays */
/* Lignées par élevage : reproducteurs puis portées (date | père × mère | chiots) */
.kennels { display: grid; gap: var(--space-4); margin: var(--space-3) 0; }
.kennel-block { min-width: 0; padding: var(--space-3); border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 60%, transparent); scroll-margin-top: 5rem; }
.kennel-block__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); h2 { margin: 0; font-size: 1.35rem; } }
.kennel-block__label { margin: var(--space-3) 0 var(--space-1); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.litter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.litter {
  display: grid; grid-template-columns: 7.5rem minmax(0, 16rem) minmax(0, 1fr); gap: var(--space-2); align-items: center;
  padding: var(--space-2) 0; border-top: 1px solid var(--line);
  p { margin: 0; }
}
.litter.is-declared .litter__pups { border-left: 2px dashed var(--text-muted); padding-left: var(--space-2); }
.litter:not(.is-declared) .litter__pups { border-left: 2px solid var(--text-muted); padding-left: var(--space-2); }
.litter__date { font-size: 0.85rem; color: var(--text-muted); }
.litter__parents { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3em; }
.litter__pups { display: flex; flex-wrap: wrap; gap: 0.35rem; }
@media (max-width: 760px) {
  .litter { grid-template-columns: 1fr; gap: var(--space-1); }
}
/* Arbre des portées : reproducteur, puis ses portées, puis les chiots (liens en pointillé = à confirmer) */
.ltree { display: grid; gap: var(--space-4); margin: var(--space-3) 0; }
.ltree ul { list-style: none; margin: 0; padding: 0; }
.ltree-litters, .ltree-next { padding-left: var(--space-4) !important; margin-left: 13px !important; border-left: 2px solid var(--line); }
.ltree-litter { padding: var(--space-2) 0 var(--space-2) var(--space-2); position: relative; }
.ltree-litter::before { content: ""; position: absolute; left: calc(-1 * var(--space-4) - 2px); top: 1.35rem; width: calc(var(--space-4) + var(--space-2)); border-top: 2px solid var(--line); }
.ltree-litter.is-declared::before { border-top-style: dashed; }
.ltree-litter.is-declared > .ltree-pups { border-left-style: dashed; }
.ltree-couple { margin: 0 0 var(--space-1); display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em; font-size: 0.9rem; }
.ltree-pups { display: flex; flex-wrap: wrap; gap: 0.4rem; padding-left: var(--space-2); border-left: 2px solid var(--line); }
.ltree-next > li { margin-top: var(--space-2); }
.ltree-chip {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.2em 0.6em; border: 2px solid var(--ln, var(--line));
  border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 0.85rem; line-height: 1.25;
  img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; margin-left: -0.35em; }
  small { display: block; color: var(--text-muted); font-size: 0.72rem; }
  &:hover, &:focus-visible { border-width: 3px; padding: calc(0.2em - 1px) calc(0.6em - 1px); }
}
.ltree-chip--main { font-size: 1rem; padding: 0.35em 0.9em; }
.ltree-chip--line strong::after { content: " ▾"; color: var(--text-muted); font-weight: 400; }
.ltree-chip--unknown { border-style: dotted; color: var(--text-muted); }
.ltree-root { padding: var(--space-3); border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.ltree-root { min-width: 0; overflow-x: auto; }
@media (max-width: 600px) {
  /* Mobile : retraits réduits, élevage abrégé, pour que les lignées profondes tiennent dans l'écran */
  .ltree-root { padding: var(--space-2); }
  .ltree-litters, .ltree-next { padding-left: 0.5rem !important; margin-left: 6px !important; }
  .ltree-litter { padding-left: 0.3rem; }
  .ltree-litter::before { display: none; }
  .ltree-pups { padding-left: 0.4rem; }
  .ltree-chip { max-width: 100%; min-width: 0; }
  .ltree-chip small { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.lineage-scroll { overflow-x: auto; margin: var(--space-3) 0 var(--space-2); padding-bottom: var(--space-2); }
.lineage { display: block; width: 100%; min-width: 720px; height: auto; margin-inline: auto; font-family: inherit; } /* tient dans la page sur ordinateur, défile sur mobile */
.lineage__edge { fill: none; stroke: var(--text-muted); stroke-width: 2; }
.lineage__edge--dash { stroke-dasharray: 6 5; }
.lineage__union { fill: var(--text-muted); }
.lineage__ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.lineage__node {
  rect { fill: var(--surface); stroke: var(--ln, var(--line)); stroke-width: 2; }
  .lineage__name { fill: var(--text); font-size: 15px; font-weight: 700; }
  .lineage__sex { fill: var(--ln, var(--text-muted)); font-weight: 400; }
  .lineage__meta { fill: var(--text-muted); font-size: 12px; }
}
.lineage__node--private rect { stroke-dasharray: 5 4; }
a:hover .lineage__node rect, a:focus-visible .lineage__node rect { stroke-width: 3.5; }
.lineage-legend {
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; padding: 0; list-style: none;
  font-size: 0.85rem; color: var(--text-muted);
  li { display: flex; align-items: center; gap: 0.5em; }
}
.lineage-swatch { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ln); background: var(--surface); }
.lineage-line { width: 28px; border-top: 2px solid var(--text-muted); }
.lineage-line--dash { border-top-style: dashed; }
.lineage-note { font-size: 0.85rem; }
.lineage-table tr:target { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Tableau des lignées : vignette ronde cliquable (ouvre la visionneuse) */
.lineage-dog { display: flex; align-items: center; gap: var(--space-2); }
.lineage-thumb {
  flex: none; width: 56px; height: 56px; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid var(--line); overflow: hidden;
  img { width: 100%; height: 100%; object-fit: cover; }
}
.lineage-thumb--empty { display: grid; place-items: center; background: var(--surface); color: var(--text-muted); font-size: 1.2rem; }


/* ---------- Bilingue ---------- */
.lang-switch { text-decoration: none; display: inline-grid; place-items: center; }
.lang-switch svg { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.18); }
.i18n-banner { margin: 0; padding: var(--space-2) 0; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--text-muted); }
.i18n-banner .container { display: block; }
.lang-suggest { margin: 0; padding: var(--space-2) 0; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.lang-suggest[hidden] { display: none; }
.lang-suggest .container { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.lang-suggest a { font-weight: 600; }
.lang-suggest__close { margin-left: auto; background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 1rem; }

/* ---------- Illustrations libres dans les pages (cartes, races voisines), crédit sous chaque image ---------- */
.doc-figure {
  margin: var(--space-3) 0;
  max-width: 720px;
  > a { display: block; }
  img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
  figcaption { margin-top: var(--space-1); font-size: 0.8rem; line-height: 1.4; color: var(--text-muted); }
  figcaption span { display: block; font-size: 0.72rem; opacity: 0.85; }
  figcaption span a { color: inherit; }
}
.doc-figures {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-3); margin: var(--space-3) 0;
  .doc-figure { margin: 0; max-width: none; }
  .doc-figure img { aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 30%; }
}

/* ---------- Fil d'Ariane ---------- */
.breadcrumbs { font-size: .82rem; color: var(--text-muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; margin: 0; padding: var(--space-3) 0 0; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: .5rem; margin: 0; }
.breadcrumbs li + li::before { content: "›"; opacity: .6; }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-text); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--text); }
.breadcrumbs + .page-hero, .breadcrumbs + section { padding-top: var(--space-4); }

/* ---------- Statistiques de visite (/stats, page privée) ---------- */
.stats h2 { margin-top: var(--space-6); }
.stats__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); }
.stats__bar nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.stats__period { padding: .45em .9em; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; font-size: var(--fs-sm); }
.stats__period[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stats__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-3); margin-top: var(--space-5); }
.stats__tile { display: grid; gap: .2rem; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text-muted); }
.stats__num { font: 800 clamp(1.8rem, 1.4rem + 1.5vw, 2.6rem)/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.stats__chart { margin: var(--space-3) 0 0; }
.stats__chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.stats__grid { stroke: var(--line); stroke-width: 1; }
.stats__base { stroke: var(--text-muted); stroke-width: 1; opacity: .6; }
.stats__axis { fill: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.stats__hit { fill: transparent; }
.stats__barmark { fill: var(--accent); }
.stats__slot:hover .stats__hit { fill: color-mix(in oklab, var(--accent) 10%, transparent); }
.stats__slot:hover .stats__barmark { fill: var(--accent-text); }
.stats__details { margin-top: var(--space-3); }
.stats__details summary { cursor: pointer; color: var(--accent-text); }
.stats__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 0 var(--space-5); }
.stats__cols td a { word-break: break-all; }
.stats__note { margin-top: var(--space-5); font-size: var(--fs-sm); }

/* Schéma annoté (silhouette numérotée) : plus large que les photos */
.doc-figure--schema { max-width: 860px; }
.doc-figure--schema img { box-shadow: none; }

/* ---------- Illustrations des pages (bin/build-illustrations-pages.py) ---------- */
.illus { margin: var(--space-4) 0; }
.illus figcaption { margin-top: var(--space-2); font-size: 0.8rem; line-height: 1.45; color: var(--text-muted); }
.illus figcaption span { display: block; font-size: 0.72rem; opacity: .85; }
.illus ul, .illus ol { list-style: none; margin: 0; padding: 0; }
.illus li { margin: 0; }
.illus-icon { width: 1.6rem; height: 1.6rem; flex: none; color: var(--accent-text); }
.walk-chart__title, .edu-timeline__title, .recog-grid__title { font: 700 var(--fs-base)/1.3 var(--font-display); margin: 0 0 var(--space-3); }

/* Caractère : six traits autour de la silhouette */
.traits-figure { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.traits-figure__dog { width: min(100%, 420px); height: auto; margin-inline: auto; padding: var(--space-3) var(--space-4); background: var(--c-bone); border-radius: var(--radius-lg); }
.traits-figure__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
@media (max-width: 760px) { .traits-figure__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .traits-figure__list { grid-template-columns: minmax(0, 1fr); } }
.traits-figure__item { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--space-2); align-items: start; padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.traits-figure__item .illus-icon { grid-row: span 2; margin-top: .15rem; }
.traits-figure__item span { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.4; }

/* Soins : besoins au quotidien */
.care-tiles ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: var(--space-2); }
.care-tiles__tile { display: grid; gap: .15rem; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.care-tiles__tile .illus-icon { margin-bottom: var(--space-1); }
.care-tiles__name { font-size: var(--fs-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.care-tiles__tile strong { font: 700 var(--fs-lg)/1.15 var(--font-display); }
.care-tiles__tile > span:last-child { font-size: var(--fs-sm); color: var(--text-muted); }

/* Soins : durée de promenade */
.walk-chart { padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-width: 620px; }
.walk-chart__svg { display: block; width: 100%; height: auto; overflow: visible; }
.walk-chart__grid { stroke: var(--line); stroke-width: 1; }
.walk-chart__axis { fill: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.walk-chart__value { fill: var(--text); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.walk-chart__bar { fill: var(--accent); }
.walk-chart g:hover .walk-chart__bar { fill: var(--accent-text); }

/* Éducation : frise des périodes clés */
.edu-timeline { padding: var(--space-3) var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.edu-timeline ol { display: grid; gap: var(--space-3); }
.edu-timeline li { display: grid; gap: .3rem; }
.edu-timeline li > span { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.45; }
.edu-timeline__track { position: relative; height: 14px; border-radius: 999px; background: color-mix(in oklab, var(--line) 70%, transparent); }
.edu-timeline__seg { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.edu-timeline__seg--strong { background: var(--accent); }
.edu-timeline__seg--soft { background: color-mix(in oklab, var(--accent) 35%, transparent); }
.edu-timeline__seg--mark { background: var(--text); min-width: 6px; top: -4px; bottom: -4px; }
.edu-timeline__axis { position: relative; height: 1.2rem; margin-top: var(--space-2); border-top: 1px solid var(--line); font-size: .72rem; color: var(--text-muted); }
.edu-timeline__axis span { position: absolute; top: .25rem; transform: translateX(-50%); white-space: nowrap; }
.edu-timeline__axis span:first-child { transform: none; }
.edu-timeline__axis span:last-child { transform: translateX(-100%); }
@media (max-width: 560px) { .edu-timeline__axis span:nth-child(2), .edu-timeline__axis span:nth-child(5) { display: none; } }

/* Reconnaissance : qui reconnaît la race (icône + libellé, jamais la couleur seule) */
.recog-grid ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: var(--space-2); }
.recog-grid__card { --st: var(--text-muted); display: grid; gap: .15rem; padding: var(--space-3); border: 1px solid var(--line); border-top: 4px solid var(--st); border-radius: var(--radius); background: var(--surface); }
.recog-grid__card--oui { --st: light-dark(#2F6B3F, #7FC48E); }
.recog-grid__card--non { --st: var(--accent-text); }
.recog-grid__card--partiel { --st: light-dark(#8A5A12, var(--c-amber)); }
.recog-grid__status { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-sm); font-weight: 700; color: var(--st); }
.recog-grid__status .illus-icon { width: 1.15rem; height: 1.15rem; color: var(--st); stroke-width: 2.4; }
.recog-grid__card strong { font: 700 var(--fs-lg)/1.15 var(--font-display); }
.recog-grid__where { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.recog-grid__card > span:last-child { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.4; }
