/* ==================================================================
   Ce que je fais : le tiroir du fichier (24/10/2026)
   ==================================================================
   Chargée après pages.css, qu'elle ne modifie pas. Une feuille tapée
   posée seule : le répertoire des prestations. En haut à droite, le
   tiroir du meuble à fiches (img/tiroir.png, 24 x 24, agrandi au pixel
   près). La recherche est une ligne de formulaire tapée ; l'index des
   familles, une table tapée avec ses points de conduite. Chaque famille
   commence par son intercalaire : un onglet de carton manille qui porte
   son nom et son nombre de fiches, et le chant du carton sous l'onglet.
   Puis les fiches, réglées : le nom tapé, sa phrase en Caslon, un
   pointillé sous chaque ligne. Chaque fiche est un lien entier.
   ================================================================== */

/* ---------- la tête de la feuille ---------- */
.fichier .doc-objet { width: 72px; height: 72px; margin-top: 4px; }
.fichier .chapeau { text-wrap: balance; }
.fichier h1 { text-wrap: wrap; }

/* ---------- la recherche : une ligne de formulaire tapée ---------- */
.recherche { display: grid; gap: 8px; max-width: 30rem; margin-top: clamp(28px, 4vw, 40px); }
.recherche label { font-family: var(--f-titre); font-size: var(--t-etiquette); line-height: 1.35; }
.recherche input::-webkit-search-cancel-button { cursor: pointer; }
.document .recherche-resultat { min-height: 1.5em; margin: 0; padding-top: 2px; font-size: 16px; line-height: 1.5; font-style: italic; color: var(--encre-2); }

/* ---------- l'index des familles : une table tapée ---------- */
.fiches-sommaire-nav { margin-top: clamp(10px, 1.6vw, 16px); }
.fiches-sommaire {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px;
  border-top: 1px solid var(--encre);
  padding-top: 6px;
}
.fichier .fiches-sommaire li > a {
  position: relative;
  display: flex; align-items: baseline; gap: 10px;
  min-height: 44px; padding: 10px 2.4em 8px 0;
  font-family: var(--f-titre); font-size: var(--t-etiquette); line-height: 1.3;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.fiches-sommaire a::after {
  content: ""; flex: 1 1 14px; min-width: 14px;
  border-bottom: 2px dotted var(--pointille); transform: translateY(-4px);
}
.fiches-sommaire .fiches-n {
  position: absolute; right: 0; top: 10px;
  color: var(--encre-2); font-variant-numeric: tabular-nums;
}
.fichier .fiches-sommaire li > a:hover { text-decoration-thickness: 2px; }

/* ---------- une famille : son intercalaire, puis ses fiches ---------- */
.famille { margin-top: clamp(46px, 6vw, 62px); }
.fiches-sommaire-nav + .famille { margin-top: clamp(42px, 5.4vw, 56px); }
/* les onglets décalés, comme les intercalaires d'un vrai fichier : à
   gauche, au milieu, à droite. Enfants de la section : la recherche (1),
   l'index (2), puis les familles à partir de 3. */
.famille:nth-child(3n + 1) h2 { margin-inline: auto; }
.famille:nth-child(3n + 2) h2 { margin-left: auto; margin-right: clamp(0px, 1.6vw, 14px); }

.famille h2 {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  width: fit-content; max-width: 100%;
  margin: 0 0 -1px clamp(0px, 1.6vw, 14px); padding: 9px 14px 8px 16px;
  background: var(--chemise) url("img/grain-papier.png") 0 0 / 256px 256px;
  border: 1px solid var(--chemise-bord); border-bottom: 0;
  border-radius: 7px 7px 0 0;
  image-rendering: pixelated;
  color: var(--encre);
  font-size: var(--t-h2); line-height: 1.2;
  letter-spacing: calc(2em / 27); text-transform: uppercase;
}
.famille h2 .fiches-n {
  flex: none;
  padding: 3px 6px 2px;
  border: 1.5px solid currentColor;
  font-size: var(--t-etiquette); line-height: 1; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
/* la phrase de la famille, posée sur le chant de l'intercalaire */
.famille-phrase {
  position: relative;
  padding: 14px 0 6px;
  border-top: 8px solid var(--chemise);
  box-shadow: inset 0 1px 0 var(--chemise-bord);
  color: var(--encre-2); font-style: italic;
}
.famille-phrase::before {
  content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 1px; background: var(--chemise-bord);
}

/* une fiche par prestation : le nom tapé à gauche, sa phrase à droite ;
   toute la ligne est le lien */
.fiches { border-top: 1px solid var(--encre); }
.fiches > li { border-bottom: 1px dotted var(--pointille); }
.fiches a {
  display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr); column-gap: 24px;
  align-items: baseline;
  min-height: 44px; padding: 11px 26px 10px 0;
  position: relative;
  text-decoration: none;
}
.fiches b { font-family: var(--f-titre); font-weight: 400; font-size: var(--t-etiquette); line-height: 1.35; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.fiches span { line-height: 1.5; }
/* la petite flèche tapée au bout de la ligne : la fiche mène quelque part */
.fiches a::after {
  content: "›"; position: absolute; right: 4px; top: 9px;
  font-family: var(--f-titre); font-size: var(--t-h2); line-height: 1; color: var(--encre-2);
}
@media (hover: hover) {
  .fiches a:hover { background: rgba(255, 252, 242, 0.45); }
  .fiches a:hover b { text-decoration-thickness: 2px; }
  .fiches a:hover::after { color: var(--encre); }
}
.fiches a:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }

/* ==================================================================
   TÉLÉPHONE
   ================================================================== */
@media (max-width: 600px) {
  .fichier .doc-objet { width: 48px; height: 48px; grid-row: 1; }
  .fichier .chapeau { grid-column: 1 / -1; }
  .fiches-sommaire { column-gap: 20px; }
  .fichier .fiches-sommaire li > a { padding-right: 1.9em; }
  .fiches a { grid-template-columns: 1fr; row-gap: 2px; padding: 10px 26px 10px 0; }
  .fiches span { line-height: 1.45; }
}
@media (max-width: 359px) {
  .fiches-sommaire { grid-template-columns: 1fr; }
}
