@font-face { font-family: Anton; src: url(fonts/anton-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Montserrat; font-weight: 400; src: url(fonts/montserrat-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Montserrat; font-weight: 600; src: url(fonts/montserrat-latin-600-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Montserrat; font-weight: 700; src: url(fonts/montserrat-latin-700-normal.woff2) format("woff2"); font-display: swap; }

:root {
  --ardoise: #2b2b2c;
  --ardoise-claire: #424244;
  --craie: #f2f1ee;
  --papier: #fff;
  --encre: #1d1d1b;
  --gris: #666869;       /* le gris des conditionnements du catalogue, foncé pour rester lisible */
  --filet: #e4e3e0;
  --rouge: #ae1636;      /* le rouge du logo */
  --surligneur: #ffe14d;
  --large-feuille: 348px;
  --base: min(calc(100vw - var(--large-feuille) - 72px), 880px);
  --zoom: 1;
  --tete: 0px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--ardoise);
  color: var(--encre);
  font: 400 15px/1.4 Montserrat, "Segoe UI", system-ui, sans-serif;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: var(--ardoise) url(img/ardoise.webp) center / cover no-repeat;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
a { color: inherit; }
ol { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--surligneur); outline-offset: 2px; border-radius: 2px; }
.visuel-masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* Ordinateur : la feuille du sommaire imprimé, posée sur l'ardoise */
.app { display: flex; align-items: flex-start; width: max-content; min-width: 100%; }
.feuille {
  position: sticky; top: 0; left: 0; z-index: 5;
  width: var(--large-feuille); height: 100vh; height: 100dvh; flex: none;
  display: flex; flex-direction: column;
}
.tete { padding: 14px 18px 16px 22px; background: var(--ardoise); }
.marque { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--craie); margin-bottom: 12px; }
.marque img { width: 86px; height: auto; mix-blend-mode: lighten; display: block; }
.marque-txt { font: 400 25px/1.05 Anton, Impact, sans-serif; letter-spacing: .01em; text-transform: uppercase; }

.recherche { position: relative; }
.recherche input {
  width: 100%; height: 46px; padding: 0 40px 0 14px;
  background: var(--papier); color: var(--encre);
  border: 0; border-radius: 8px; font-weight: 600; font-size: 15px;
  appearance: none;
}
.recherche input::placeholder { color: var(--gris); font-weight: 400; opacity: 1; }
.recherche input::-webkit-search-cancel-button { display: none; }
.q-effacer { position: absolute; right: 6px; top: 7px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--gris); }
.q-effacer[hidden] { display: none; }
.puces { display: none; }

.panneau {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--papier); border-radius: 0 28px 0 0;
  display: flex; flex-direction: column;
}
.panneau-fermer { display: none; }
#sommaire, #resultats { padding: 18px 12px 12px 0; flex: 1 0 auto; }
#sommaire[hidden], #resultats[hidden] { display: none; }

/* Sommaire : un onglet de couleur par rubrique, comme le bandeau des pages */
.rub-t {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: stretch;
  width: 100%; padding-right: 8px; border-radius: 0 6px 6px 0;
}
.rub-t .onglet { background: var(--c); border-radius: 0 3px 3px 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: width .15s; }
.rub-t .nom { font: 400 18px/1.25 Anton, Impact, sans-serif; letter-spacing: .015em; text-transform: uppercase; padding: 5px 0; }
.rub-t .pg, .sub-t .pg { font-weight: 700; font-size: 13px; color: var(--gris); align-self: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rub-t:hover .nom, .sub-t:hover, .ttr button:hover { color: var(--rouge); }
.rub { margin-bottom: 2px; }
.subs { display: none; padding: 2px 0 10px 24px; }
.rub.ouverte > .subs { display: block; }
.sub-t { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 4px 8px 4px 0; font-weight: 600; font-size: 14px; line-height: 1.3; }
.sub.ici > .sub-t { color: var(--rouge); }
.ttr { display: none; padding: 0 8px 6px 12px; border-left: 2px solid var(--filet); margin-left: 1px; }
.sub.ici > .ttr, .subs > .ttr { display: block; }
.subs > .ttr { padding-left: 12px; }
.ttr button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 3px 0; font-size: 13px; line-height: 1.3; color: #3c3c3a; }
.ttr .pg { color: var(--gris); font-size: 12px; font-variant-numeric: tabular-nums; }
.ttr .sur-page { font-weight: 700; color: var(--encre); }

/* Résultats */
#resultats { padding: 14px 10px 12px 14px; }
.res-entete { margin: 0 4px 10px; font-size: 13px; color: var(--gris); }
.res-entete strong { color: var(--encre); }
.res-rubs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 4px 12px; }
.res-rub { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 8px; border: 1px solid var(--filet); border-radius: 999px; font-size: 13px; font-weight: 600; }
.res-rub:hover { border-color: var(--encre); }
.res-rub i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.res { display: grid; grid-template-columns: 68px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 6px 4px; border-radius: 8px; }
.res:hover { background: #f5f4f1; }
.res.vise { background: #fff6c2; }
.res-vign { position: relative; width: 68px; height: 68px; overflow: hidden; border-radius: 6px; background: var(--filet); }
.res-vign img { position: absolute; width: 300px; max-width: none; height: auto; }
.res-txt { min-width: 0; }
.res-t { display: block; font-weight: 600; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.res-s { display: block; font-size: 12.5px; line-height: 1.3; color: var(--gris); margin-top: 1px; overflow-wrap: anywhere; }
.res-t mark, .res-s mark { background: var(--surligneur); color: inherit; border-radius: 2px; padding: 0 1px; }
.res-pg { font: 400 19px/1 Anton, Impact, sans-serif; color: var(--encre); padding-right: 6px; font-variant-numeric: tabular-nums; }
.vide { margin: 8px 6px; font-size: 14px; }
.vide a { font-weight: 700; color: var(--rouge); white-space: nowrap; }
.chargement { margin: 8px 6px; color: var(--gris); }

.pied { padding: 12px 16px 16px 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; border-top: 1px solid var(--filet); position: sticky; bottom: 0; background: var(--papier); }
.btn-boutique { flex: 1 0 100%; display: block; padding: 11px 12px; background: var(--rouge); color: #fff; border-radius: 8px; font-weight: 700; font-size: 14px; text-align: center; text-decoration: none; }
.btn-boutique:hover { background: #8f102b; }
.pied-lien { font-size: 13px; font-weight: 600; text-underline-offset: 2px; }

/* Les pages */
.pages { flex: 1; padding: 28px 36px 96px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.page {
  position: relative; margin: 0; flex: none;
  width: calc(var(--base) * var(--zoom));
  aspect-ratio: 595.2756 / 841.8898;
  background: var(--ardoise-claire);
  box-shadow: 0 10px 34px rgba(0,0,0,.5);
  scroll-margin-top: 12px;
}
.page img { display: block; width: 100%; height: 100%; }
.calque { position: absolute; inset: 0; pointer-events: none; }
.zone { position: absolute; pointer-events: auto; border-radius: 3px; }
.zone:hover, .zone:focus-visible { background: rgba(255, 225, 77, .4); }
.trait { position: absolute; display: block; background: var(--surligneur); mix-blend-mode: multiply; border-radius: 3px; }
.trait.vise { outline: 2px solid var(--rouge); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .trait.vise { animation: passer .45s ease-out; }
}
@keyframes passer { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.sans-js { color: var(--craie); }
.sans-js a { color: var(--surligneur); }

/* Commandes */
.barre {
  position: fixed; bottom: 16px; z-index: 6;
  left: calc(var(--large-feuille) + (100vw - var(--large-feuille)) / 2); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  background: var(--encre); color: var(--craie); border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.barre-page, .barre-res, .barre-zoom { display: flex; align-items: center; gap: 2px; }
.barre-res[hidden] { display: none; }
.barre-page[hidden] { display: none; }
.barre-zoom { padding-left: 8px; margin-left: 4px; border-left: 1px solid #55554f; }
.barre-sommaire { display: none; }
.rond { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.rond:hover { background: #47473f; }
.saut { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.saut input { width: 44px; height: 30px; text-align: center; background: #47473f; border: 0; border-radius: 6px; color: #fff; font-weight: 700; }
.res-compte { padding: 0 8px; font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Téléphone : recherche et rubriques toujours sous le pouce, panneau plein écran */
@media (max-width: 899px) {
  :root { --large-feuille: 0px; --base: 100vw; }
  html { scroll-padding-top: calc(var(--tete) + 8px); }
  .app { display: block; width: auto; }
  .feuille { position: sticky; top: 0; width: 100%; height: auto; display: block; }
  .tete { padding: 8px 10px 0; display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
  .marque { margin: 0; }
  .marque img { width: 52px; }
  .marque-txt { display: none; }
  .recherche input { height: 42px; font-size: 16px; }
  .q-effacer { top: 5px; }
  .puces {
    grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 10px;
    scrollbar-width: none; margin: 0 -10px; padding-left: 10px; padding-right: 10px;
  }
  .puces::-webkit-scrollbar { display: none; }
  .puce {
    flex: none; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 9px;
    background: #3d3d3e; color: var(--craie); border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  }
  .puce i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
  .puce.ici { background: var(--papier); color: var(--encre); }
  .panneau {
    display: none; position: fixed; left: 0; right: 0; top: var(--tete); bottom: 0; z-index: 7; border-radius: 0;
  }
  body.panneau-ouvert .panneau { display: flex; }
  body.panneau-ouvert .puces { display: none; }
  body.panneau-ouvert .tete { padding-bottom: 8px; }
  body.panneau-ouvert .barre { display: none; }
  .panneau-fermer {
    display: block; flex: none; width: 100%; padding: 12px 16px; font-weight: 700; font-size: 14px;
    border-bottom: 1px solid var(--filet); position: sticky; top: 0; background: var(--papier); z-index: 1;
  }
  #sommaire { padding-top: 12px; }
  .rub-t .nom { font-size: 19px; padding: 7px 0; }
  .sub-t { padding: 8px 8px 8px 0; font-size: 15px; }
  .ttr button { padding: 7px 0; font-size: 14px; }
  .res { padding: 8px 4px; }
  .pages { padding: 6px 0 84px; gap: 6px; }
  .page { box-shadow: none; }
  .barre {
    left: 0; right: 0; bottom: 0; transform: none; border-radius: 0; justify-content: space-between;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  }
  .barre-sommaire { display: block; padding: 0 14px; height: 38px; background: var(--papier); color: var(--encre); border-radius: 8px; font-weight: 700; font-size: 14px; }
  .barre-zoom { display: none; }
  .barre-res { margin-left: auto; }
  .rond { width: 40px; height: 40px; }
}

@media print {
  .feuille, .barre { display: none; }
  .pages { padding: 0; gap: 0; }
  .page { width: 100%; box-shadow: none; break-after: page; }
}
