/* 7. La table des animations (page et fenêtre), et les pages qui ne montrent qu'une animation. */

/* Le bouton de l'en-tête */
.entete-table, .entete button.entete-table { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 2px solid var(--lampe); border-radius: 3px; background: none; color: var(--lampe); font-weight: 700; text-decoration: none; white-space: nowrap; order: 2; }
.entete-table:hover, .entete button.entete-table:hover { background: var(--lampe); color: var(--nuit-basse); }
.entete-table[aria-current] { border-color: transparent; text-decoration: underline; text-underline-offset: 6px; }

/* L'index */
.index { display: grid; gap: clamp(24px, 3vw, 40px); }
.index:focus { outline: none; }
.index [hidden] { display: none; }
.index-recherche { display: grid; grid-template-columns: minmax(0, 420px) auto; gap: 6px 20px; align-items: center; }
.index-recherche label { grid-column: 1 / -1; font-weight: 700; }
.index-recherche input { min-height: 48px; width: 100%; padding: 0 16px; border: 2px solid var(--nuit); border-radius: 3px; background: #fff; color: var(--nuit); font-size: 1.125rem; }
.index-recherche p { font-variant-numeric: tabular-nums; }
.index-famille h2, .index-famille h3 { font-size: clamp(1.5rem, 2vw, 2rem); padding-bottom: 8px; border-bottom: 2px solid var(--nuit); }
@media (min-width: 1100px) {
  .index-famille { display: grid; grid-template-columns: clamp(220px, 20vw, 340px) minmax(0, 1fr); gap: 0 40px; border-top: 2px solid var(--nuit); }
  .index-famille :is(h2, h3) { border: 0; padding-top: 14px; }
}
.index-famille small { font: 500 1rem/1 var(--texte); letter-spacing: 0; }
.index-famille ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 0 clamp(20px, 3vw, 48px); }
.index-famille a { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; height: 100%; padding: 12px 0; text-decoration: none; border-bottom: 1px solid rgb(20 27 60 / .25); }
.index-famille img { display: block; width: 120px; height: 80px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(20 27 60 / .3); }
.index-texte { display: grid; gap: 2px; line-height: 1.25; }
.index-texte b { font: 800 1.1875rem/1.1 var(--titre); }
.index-texte i { font: italic 500 .9375rem/1.2 var(--titre); }
.index-famille a:hover b, .index-famille a[aria-current] b { text-decoration: underline; text-decoration-color: var(--vermillon); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.index-famille a[aria-current] b::after { content: " (tu y es)"; font: 500 .9375rem/1 var(--texte); }
.index-rien { font-size: 1.1875rem; }
@media (max-width: 430px) {
  .index-recherche { grid-template-columns: minmax(0, 1fr); }
  .index-famille a { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .index-famille img { width: 96px; height: 64px; }
}

/* La page de la table */
.table-page { padding: clamp(32px, 5vw, 72px) var(--marge) clamp(56px, 6vw, 96px); background: var(--papier); color: var(--nuit); display: grid; gap: clamp(20px, 3vw, 40px); min-height: 70vh; align-content: start; }
.table-page h1 { font-size: clamp(2.6rem, 6vw, 5.4rem); font-weight: 900; letter-spacing: -.035em; line-height: .96; }

@media (min-width: 1100px) { .table-fenetre .index-famille { grid-template-columns: 220px minmax(0, 1fr); } }

/* La fenêtre de la table : elle descend de l'en-tête, vite fermée */
.table-fenetre { width: min(1180px, 100vw - 24px); max-width: none; max-height: calc(100dvh - 32px); margin: 16px auto auto; padding: 0 clamp(16px, 3vw, 44px) 32px; border: 0; border-radius: 6px; background: var(--papier); color: var(--nuit); overflow: auto; overscroll-behavior: contain; box-shadow: 0 30px 80px rgb(6 8 24 / .6); }
.table-fenetre::backdrop { background: rgb(6 8 24 / .72); }
.table-tete { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 calc(-1 * clamp(16px, 3vw, 44px)); padding: 14px clamp(16px, 3vw, 44px); background: var(--papier); }
.table-tete h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); }
.table-tete h2:focus { outline: none; }
html:has(.table-fenetre[open]) { overflow: hidden; scrollbar-gutter: stable; }
html[data-motion] .table-fenetre { opacity: 0; transition: opacity var(--courte), translate var(--courte) ease-in, display var(--courte) allow-discrete, overlay var(--courte) allow-discrete; }
html[data-motion="full"] .table-fenetre { translate: 0 -18px; }
html[data-motion] .table-fenetre[open] { opacity: 1; translate: none; transition-duration: var(--moyenne); transition-timing-function: cubic-bezier(.23, 1, .32, 1); }
@starting-style { html[data-motion] .table-fenetre[open] { opacity: 0; } html[data-motion="full"] .table-fenetre[open] { translate: 0 -18px; } }
html[data-motion] .table-fenetre::backdrop { opacity: 0; transition: opacity var(--courte), display var(--courte) allow-discrete, overlay var(--courte) allow-discrete; }
html[data-motion] .table-fenetre[open]::backdrop { opacity: 1; transition-duration: var(--moyenne); }
@starting-style { html[data-motion] .table-fenetre[open]::backdrop { opacity: 0; } }

/* Une animation par page */
.seule { background: var(--fond); color: var(--encre); min-height: 70vh; }
.fil { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 18px var(--marge) 0; line-height: 1.5; }
.fil > * + *::before { content: "/"; display: inline-block; margin-right: 12px; opacity: .6; }
.fil a { text-underline-offset: 4px; padding-block: 4px; }
.seule .fiche { padding-top: clamp(20px, 2.4vw, 36px); }
.seule .fiche-titre { font-size: clamp(2.3rem, 3.7vw, 4rem); font-weight: 900; letter-spacing: -.03em; line-height: .98; }
.voisines { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 24px var(--marge) clamp(40px, 5vw, 72px); border-top: 2px solid; margin: 0 var(--marge); padding-inline: 0; }
.voisine { display: grid; grid-template-columns: auto minmax(0, auto); gap: 14px; align-items: center; text-decoration: none; font: 800 1.1875rem/1.15 var(--titre); justify-self: start; }
.voisine img { display: block; width: 96px; height: 64px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / .3); }
.voisine small { display: block; font: 500 1rem/1.2 var(--texte); }
.voisine:hover span { text-decoration: underline; text-underline-offset: 4px; }
.voisine--next { grid-column: 3; justify-self: end; text-align: right; }
.voisine--next img { order: 2; }
.voisines-table { grid-column: 2; padding: 10px 4px; text-underline-offset: 5px; }
.fiche-seule { white-space: nowrap; font: 500 1.0625rem/1.3 var(--texte); padding: 6px 0; text-underline-offset: 4px; }
@media (max-width: 700px) {
  .voisines { grid-template-columns: minmax(0, 1fr); }
  .voisines > * { grid-column: 1; justify-self: start; }
  .voisine--next { text-align: left; } .voisine--next img { order: 0; }
  .voisines-table { order: 3; }
}
@media (max-width: 560px) {
  .entete .entete-table, .entete button.entete-table { white-space: normal; padding: 0 8px; }
  .fil [aria-current] { display: none; }
}
