/* Toiture Pro — adaptations du design au rendu serveur.
   La maquette React pilotait ses états en JavaScript (menu ouvert, FAQ dépliée,
   panneau de réglages). Ici ces états sont obtenus en HTML/CSS natif, sans script.
   Ce fichier ne redéfinit aucun style visuel : il ne fait que rebrancher les
   mêmes règles sur les nouveaux sélecteurs. Chargé en dernier. */

/* ---- Liens rendus réellement cliquables (ex-onClick de la maquette) ---- */
.plain-link,
.doc-table__link,
.footer-grid li > a,
.sidebar-list a {
  color: inherit;
  text-decoration: none;
}
.plain-link:hover { color: var(--orange); }

.footer-grid li > a { display: block; }
.doc-table__link { display: inline-block; }

.logo { text-decoration: none; color: inherit; }

/* Ligne entièrement cliquable sans casser la mise en page en flex :
   le lien est superposé, les libellés restent les enfants flex. */
.linkbox li.has-cover,
.comparatif-bloc li.has-cover { position: relative; }
.linkbox li.has-cover .cover-link,
.comparatif-bloc li.has-cover .cover-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Listes latérales « Autres familles » / « Autres guides ». */
.sidebar-list { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.sidebar-list li { padding: .6rem 0; border-bottom: 1px dashed var(--rule); }
.sidebar-list li:last-child { border-bottom: 0; }
.sidebar-list a:hover { color: var(--orange); }

.toc a { text-decoration: none; }

/* ---- FAQ : <details>/<summary> remplace l'accordéon JavaScript ---- */
.faq-item > summary.faq-q { list-style: none; }
.faq-item > summary.faq-q::-webkit-details-marker { display: none; }
.faq-item[open] > .faq-q .faq-q__icon {
  transform: rotate(45deg);
  background: var(--orange);
  color: #fff;
}
.faq-item[open] .faq-a {
  max-height: 500px;
  padding-bottom: 1.4rem;
}

/* ---- Menu mobile : case à cocher masquée au lieu d'un état React ---- */
.nav-toggle::before { content: "☰"; }
@media (max-width: 1024px) {
  .nav-toggle-cb:checked ~ .nav { display: flex; }
  .nav-toggle-cb:checked ~ .header__cta .nav-toggle::before { content: "✕"; }
}

/* ================================================================
   En-tête boutique (design « shop ») rendu côté serveur
   ================================================================ */

/* Le mega-panneau est un ENRICHISSEMENT : sans JavaScript, chaque entrée de la
   barre reste un vrai lien vers la page du rayon, qui liste déjà les mêmes
   familles. Le panneau n'apparaît donc que si le script a pu s'installer. */
.mm-panel { display: none; }
html.has-js .catbar__item[aria-expanded="true"] + .mm-panel { display: block; }

/* Les entrées de rayon sont des liens (et non des boutons) pour rester
   navigables sans script ; on leur redonne l'aspect des boutons du design. */
.catbar__row > a.catbar__item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.catbar__item i { font-style: normal; }
html:not(.has-js) .catbar__item i { display: none; }

/* Menu mobile de la barre de rayons : même patron de case à cocher. */
.shophead-cb { display: none; }
@media (max-width: 900px) {
  .catbar { display: none; }
  .shophead-cb:checked ~ .catbar { display: block; }
  .shophead-cb:checked ~ .shophead__top .shophead__burger::before { content: "✕"; }
  .catbar__row { flex-direction: column; align-items: stretch; }
}
.shophead__burger::before { content: "☰"; }

/* Champ de recherche : formulaire réel vers /recherche. Le panneau de
   suggestions est rempli par le script ; il reste vide et masqué sans lui. */
.srch__panel:empty { display: none; }
.srch__submit {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 .2rem;
}
.srch__submit:hover { color: var(--orange); }

/* ---- Galerie de fiche : lightbox par ancre :target, sans script ---- */
.lightbox { display: none; }
.lightbox:target { display: grid; }
.lightbox__close { text-decoration: none; }
.gallery__cell { text-decoration: none; }

/* Les vignettes sont des liens : on leur rend l'aspect des cellules du design. */
a.gallery__cell { display: block; cursor: zoom-in; }
.gallery__cell img { width: 100%; height: 100%; object-fit: contain; padding: .4rem; }

/* Précédent / suivant de la visionneuse — de simples ancres, donc utilisables
   sans script et au clavier. */
.lightbox__nav {
  position: absolute;
  bottom: 4vmin;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(8, 40, 68, .85);
  border-radius: 999px;
  padding: .35rem 1rem;
  color: #fff;
  font-family: var(--display);
  font-size: .9rem;
  letter-spacing: .04em;
}
.lightbox__nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0 .3rem;
}
.lightbox__nav a:hover { color: var(--orange); }

/* ---- Tuiles de catégorie et cartes façade : liens réels ---- */
.ctile,
.mm-tile,
.sugg,
.fcard__cta { text-decoration: none; color: inherit; }
.ctile,
.mm-tile,
.sugg { cursor: pointer; }
.catgroup__head a { text-decoration: none; }

/* Repli si le navigateur ne connaît pas color-mix() (badge de note d'un critère). */
@supports not (color: color-mix(in oklch, red 10%, transparent)) {
  .critsec__note { background: rgba(232, 119, 34, .12); }
}

/* ---- Panneau de réglages : même principe ---- */
.tweaks-cb:checked ~ .tweaks-panel { display: block; }
.tweaks-fab { text-decoration: none; }

/* ---- Comparateur avant / après ----
   La position du curseur est portée par --ba-pos. Sans JavaScript, le
   comparateur reste affiché à 50 % et le curseur natif est masqué. */
.ba__layer--after { clip-path: inset(0 0 0 var(--ba-pos, 50%)); }
.ba__divider { left: var(--ba-pos, 50%); }
.ba__range {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
html:not(.has-js) .ba__range { display: none; }
html:not(.has-js) .ba { cursor: default; }
.ba__range:focus-visible { opacity: 1; }

/* ---- Calculateur : le formulaire remplace l'état React ---- */
.calc__seg button { text-align: center; }
/* Bouton de recalcul : indispensable sans JavaScript, superflu avec
   (le formulaire se renvoie alors tout seul à chaque changement). */
.calc__submit { margin-top: auto; }
html.has-js .calc__submit { display: none; }

/* ---- Calculateur : champs longueur × largeur, rendement et prix ---- */
.calc__dims {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.calc__dims input[type="number"] {
  width: 100%;
  padding: .7rem .8rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink);
}
.calc__dims input[type="number"]:focus { border-color: var(--orange); outline: none; }
.calc__dims-x { color: var(--ink-muted); font-weight: 700; }
.calc__dims--pair { align-items: flex-start; }
.calc__dims--pair > div { flex: 1; }
.calc__hint {
  display: block;
  margin-top: .3rem;
  font-size: .72rem;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.calc__advice a { color: var(--orange); font-weight: 600; text-decoration: none; }
.calc__advice a:hover { text-decoration: underline; }

/* ---- Note interne (barème /10) ---- */
.note-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: .1rem .45rem;
  border-radius: 4px;
  background: var(--orange);
  color: #fff;
  font-family: var(--display);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
}
.note-chip small { font-size: .68em; font-weight: 600; opacity: .85; }
.product-card__cat .note-chip { float: right; }
.comp-table .note-chip { white-space: nowrap; }

.note-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-sm);
}
.note-chip--lg { font-size: 1.5rem; padding: .3rem .7rem; }
.note-banner strong { display: block; font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; }
.note-banner small { color: var(--ink-soft); font-size: .85rem; }
.note-banner small a { color: var(--orange); font-weight: 600; text-decoration: none; }
.note-banner small a:hover { text-decoration: underline; }

/* ---- Recherche interne ---- */
.search-form {
  display: flex;
  gap: .6rem;
  margin-bottom: 2rem;
}
.search-form input[type="search"] {
  flex: 1;
  padding: .85rem 1rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
}
.search-form input[type="search"]:focus { border-color: var(--orange); outline: none; }
.search-count { color: var(--ink-soft); margin: 0 0 1.5rem; }
.search-h2 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: 1.3rem;
  margin: 2rem 0 .75rem;
}

/* ---- Comparateur avant / après : photos réelles ---- */
.ba__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ba__tag {
  position: absolute;
  top: .9rem;
  z-index: 3;
  padding: .25rem .65rem;
  border-radius: 4px;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .8rem;
  color: #fff;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.ba__tag--before { left: .9rem; background: #7a2418; }
.ba__tag--after  { right: .9rem; background: #1a4d2e; }

/* ---- Lexique ---- */
.lexique-item { border-bottom: 1px dashed var(--rule); padding-bottom: 1.25rem; margin-bottom: 1.5rem; }
.lexique-item:last-of-type { border-bottom: 0; }
.lexique-item h2 { margin-top: 0; }
.lexique-lien { margin: 0; font-size: .9rem; }

/* Accessibilité : cible de saut visible au clavier. */
:target { scroll-margin-top: 90px; }

/* ---- Bandeau de consentement (mesure d'audience) ----
   Il informe sans bloquer la lecture : aucun voile, aucun mur de cookies.
   « Refuser » et « Accepter » partagent la même classe, donc exactement le
   même poids visuel — c'est ce que la CNIL exige. */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 130;
  background: var(--card);
  border-top: 3px solid var(--orange);
  box-shadow: 0 -8px 28px rgba(8, 40, 68, .18);
}
.consent__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.consent__txt strong {
  display: block;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 1rem;
}
.consent__txt p {
  margin: .25rem 0 0;
  font-size: .86rem;
  color: var(--ink-soft);
  max-width: 78ch;
  line-height: 1.5;
}
.consent__txt a { color: var(--orange); }
.consent__actions {
  display: flex;
  gap: .6rem;
  flex-shrink: 0;
}
.consent__actions .btn { min-width: 120px; text-align: center; }

@media (max-width: 720px) {
  .consent__inner { flex-direction: column; align-items: stretch; gap: .9rem; }
  .consent__actions .btn { flex: 1; min-width: 0; }
}

.consent-reglage p:last-child { margin-bottom: 0; display: flex; gap: .6rem; flex-wrap: wrap; }

/* Le bandeau est fixé en bas de l'écran : on réserve sa hauteur tant qu'il est
   affiché, pour qu'il ne recouvre jamais la fin du pied de page. L'espace
   disparaît dès que le visiteur a répondu, puisque le bandeau n'existe plus. */
body:has(.consent) { padding-bottom: 150px; }
@media (max-width: 720px) {
  body:has(.consent) { padding-bottom: 250px; }
}

/* ============================================================================
   PANNEAU D'ADMINISTRATION (/admin)
   Le gros du travail est déjà fait par .form-field, .form-row, .form-legal
   (styles.css), .doc-table, .errlist, .callout et .btn : il ne reste ici que
   la barre d'actions, l'état d'un article et le découpage de l'éditeur.
   ============================================================================ */

.adm-bar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule);
}
.adm-bar__actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.adm-bar__actions form { margin: 0; }

/* Agent éditorial */
.adm-agent {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  margin-top: 1.75rem; padding: 1.1rem 1.4rem;
  background: var(--bg-soft); border: 1px dashed var(--rule); border-radius: var(--radius);
}
.adm-agent p { margin: .3rem 0 0; font-size: .88rem; color: var(--ink-muted); max-width: 62ch; }
.adm-agent code {
  font-size: .85em; padding: .1em .35em;
  background: var(--bg-mid); border-radius: 3px;
}

/* Liste des articles */
.adm-slug {
  display: block; margin-top: .2rem;
  font-size: .78rem; color: var(--ink-muted); font-family: ui-monospace, monospace;
}
.adm-etat {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.adm-etat--on  { background: #e8f3e7; color: #2f6b2c; }
.adm-etat--off { background: var(--bg-mid); color: var(--ink-muted); }
:root[data-theme="dark"] .adm-etat--on { background: #17301a; color: #7fc47a; }

.adm-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.adm-actions form { margin: 0; }
.adm-danger:hover { border-color: #c1392b; color: #c1392b; }

/* Éditeur */
.adm-h2 {
  margin: 2.5rem 0 1.25rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--orange);
  font-family: var(--display); font-size: 1.1rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.adm-bloc {
  margin: 0 0 1.25rem; padding: 1.25rem 1.4rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--card);
}
.adm-bloc legend {
  padding: 0 .5rem; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted);
}
.adm-bloc textarea { line-height: 1.55; }

.adm-submit {
  display: flex; gap: .6rem; flex-wrap: wrap;
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}

/* Journal */
.adm-journal { list-style: none; padding: 0; margin: 0; }
.adm-journal li {
  padding: .55rem .75rem; border-bottom: 1px solid var(--rule);
  font-family: ui-monospace, monospace; font-size: .82rem;
  color: var(--ink-soft); word-break: break-word;
}
.adm-journal li:nth-child(odd) { background: var(--bg-soft); }

@media (max-width: 640px) {
  .adm-bar, .adm-agent { flex-direction: column; align-items: stretch; }
  .adm-submit .btn { flex: 1; }
}
