@font-face { font-family: "Bricolage"; src: url("../polices/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../polices/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../polices/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

/* Les teintes des plantes viennent des fichiers JSON ; tout le reste est ici. */
:root {
    --blanc: #ffffff;
    --tilleul: #eef2dc;
    --filet: #cfd8bd;
    --sapin: #1b2e1a;
    --mousse: #4d6049;
    --feuille: #2f6a2b;
    --capucine: #ff8a4c;

    --titre: "Bricolage", "Trebuchet MS", sans-serif;
    --texte: "Atkinson", Verdana, sans-serif;

    --e1: 8px; --e2: 16px; --e3: 24px; --e4: 40px; --e5: 64px;
    --rayon: 6px;          /* champs, boutons, encadrés ; les aplats de plante restent à angle droit */
    --courbe: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--blanc); color: var(--sapin); font: 400 18px/1.6 var(--texte); }
h1, h2, h3 { font-family: var(--titre); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
h3 { font-size: 1.25rem; letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: var(--feuille); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--capucine); outline-offset: 3px; }

.cadre { width: min(1320px, 100% - 2 * clamp(16px, 4vw, 48px)); margin-inline: auto; }
.bloc { padding-block: var(--e5); }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.evitement { position: absolute; left: 16px; top: -80px; z-index: 5; padding: 12px 16px; background: var(--sapin); color: var(--blanc); }
.evitement:focus { top: 8px; }
.vide { margin-top: var(--e3); font-size: 1.15rem; color: var(--mousse); }
.statut { display: block; color: var(--mousse); font-size: .9rem; }

/* En-tête */
.bandeau { padding: 8px 16px; background: var(--sapin); color: var(--blanc); font-size: .9rem; text-align: center; }
.bandeau a { color: inherit; }
.entete { border-bottom: 1px solid var(--filet); }
.entete__haut { display: flex; align-items: center; gap: var(--e2) var(--e5); padding-block: var(--e2); }
.marque { font: 800 1.9rem/1 var(--titre); letter-spacing: -.04em; color: var(--sapin); text-decoration: none; }
.recherche { display: flex; flex: 1; max-width: 640px; margin-left: auto; }
.recherche input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1px solid var(--mousse); border-right: 0; border-radius: var(--rayon) 0 0 var(--rayon); background: var(--blanc); color: inherit; font: inherit; }
.recherche input::placeholder { color: var(--mousse); opacity: 1; }
.recherche button { height: 48px; padding: 0 20px; border: 0; border-radius: 0 var(--rayon) var(--rayon) 0; background: var(--sapin); color: var(--blanc); font: 600 1rem var(--texte); cursor: pointer; transition: background .2s; }
.recherche button:hover { background: var(--feuille); }
.recherche button:active { background: var(--mousse); }
.rubriques-nav { display: flex; gap: var(--e3) clamp(20px, 2.6vw, 40px); overflow-x: auto; scrollbar-width: none; }
.rubriques-nav a { flex: none; padding: 10px 0 11px; border-bottom: 3px solid transparent; color: var(--sapin); font-size: 1rem; text-decoration: none; transition: border-color .2s; }
.rubriques-nav a:hover { border-color: var(--filet); }
.rubriques-nav a[aria-current] { border-color: var(--capucine); }
.rubriques-nav a:focus-visible { outline-offset: -3px; }

/* Accueil : le nuancier */
.ouverture h1 { padding-block: clamp(28px, 4vw, 52px); }
.nuancier { display: flex; height: clamp(320px, calc(100vh - 432px), 560px); overflow: hidden; }
.nuancier a { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; background: var(--teinte); color: var(--encre); text-decoration: none; transition: flex-grow .55s var(--courbe); }
.nuancier img { position: absolute; top: 0; left: 50%; width: max(100%, 42vw); max-width: none; height: 100%; object-fit: cover; transform: translateX(-50%); }
.nuancier a:has(img) { color: var(--blanc); text-shadow: 0 0 14px rgb(27 46 26 / .9), 0 1px 3px rgb(27 46 26 / .8); }
.nuancier a:has(img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgb(27 46 26 / .08), rgb(27 46 26 / .45) 45%, rgb(27 46 26 / .75)); }
.nuancier__nom { position: absolute; z-index: 1; left: 50%; bottom: 24px; writing-mode: vertical-rl; transform: translateX(-50%) rotate(180deg); font: 700 clamp(1.2rem, 1.9vw, 1.75rem)/1.1 var(--titre); letter-spacing: -.02em; white-space: nowrap; }
.nuancier__titre { position: absolute; z-index: 1; left: 28px; bottom: 24px; width: min(400px, 30vw); opacity: 0; font: 700 clamp(1.3rem, 2.3vw, 2.1rem)/1.12 var(--titre); letter-spacing: -.02em; text-wrap: balance; }
@media (min-width: 801px) {
    .nuancier:not(:hover, :focus-within) a:first-child, .nuancier a:hover, .nuancier:not(:hover) a:focus-visible { flex-grow: 4.6; }
    .nuancier:not(:hover, :focus-within) a:first-child .nuancier__nom, .nuancier a:hover .nuancier__nom, .nuancier:not(:hover) a:focus-visible .nuancier__nom { opacity: 0; }
    .nuancier:not(:hover, :focus-within) a:first-child .nuancier__titre, .nuancier a:hover .nuancier__titre, .nuancier:not(:hover) a:focus-visible .nuancier__titre { opacity: 1; transition: opacity .3s .18s; }
    .nuancier:not(:hover, :focus-within) a:first-child::after, .nuancier a:hover::after, .nuancier:not(:hover) a:focus-visible::after { background: linear-gradient(transparent 45%, rgb(27 46 26 / .8) 85%); }
    .nuancier a:focus-visible { outline-offset: -6px; outline-color: var(--encre); }
}

/* Accueil : familles */
.familles { margin-top: var(--e4); border-top: 1px solid var(--filet); }
.familles li { border-bottom: 1px solid var(--filet); }
.familles a { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) 90px; align-items: center; gap: var(--e3); padding-block: 18px; color: inherit; text-decoration: none; }
.familles__nom { font: 700 clamp(1.4rem, 2.6vw, 2.2rem)/1.1 var(--titre); letter-spacing: -.025em; }
.familles__teintes { display: flex; height: 44px; }
.familles__teintes i { flex: 0 1 11.111%; transition: transform .35s var(--courbe); transform-origin: bottom; }
.familles a:hover .familles__teintes i { transform: scaleY(1.35); }
.familles a:hover .familles__nom { color: var(--feuille); }
.familles__nombre { text-align: right; color: var(--mousse); white-space: nowrap; }

/* Accueil : questions */
.questions { padding-block: var(--e5); background: var(--sapin); color: var(--blanc); }
.questions ul { columns: 2; column-gap: var(--e5); margin-top: var(--e4); }
.questions li { break-inside: avoid; }
.questions a { display: block; padding-block: 12px; color: inherit; font-size: 1.2rem; line-height: 1.35; text-decoration-color: transparent; transition: text-decoration-color .2s, color .2s; }
.questions a:hover { color: var(--capucine); text-decoration-color: currentColor; }

/* Accueil : mois */
.mois { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--e4) var(--e3); margin-top: var(--e4); }
.mois h3::first-letter { text-transform: uppercase; }
.mois ul { margin-top: var(--e2); }
.mois a { display: flex; align-items: center; gap: 12px; padding-block: 6px; color: inherit; text-decoration: none; }
.mois a:hover { text-decoration: underline; }
.mois i { flex: none; width: 22px; height: 22px; }

/* Grille d'articles */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: var(--e4) var(--e3); margin-top: var(--e4); }
.tuile { display: block; color: inherit; text-decoration: none; }
.tuile__visuel { position: relative; display: flex; align-items: flex-end; aspect-ratio: 4 / 3; margin-bottom: 14px; padding: 18px; overflow: hidden; background: var(--teinte); color: var(--encre); }
.tuile__visuel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--courbe); }
.tuile:hover img { transform: scale(1.04); }
.tuile__nom { font: 800 clamp(1.7rem, 2.4vw, 2.2rem)/1 var(--titre); letter-spacing: -.035em; overflow-wrap: anywhere; transition: transform .4s var(--courbe); }
.tuile:hover .tuile__nom { transform: translateY(-8px); }
.tuile__titre { display: block; font-size: 1.08rem; font-weight: 600; line-height: 1.35; text-wrap: pretty; }
.tuile:hover .tuile__titre { text-decoration: underline; }
.tuile .statut { margin-top: 4px; }

/* Article */
.titre-article { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--e5); align-items: end; padding-block: var(--e4) var(--e5); }
.titre-article h1 { font-size: clamp(2.1rem, 4.2vw, 3.6rem); }
.fil { margin-bottom: var(--e3); font-size: .95rem; color: var(--mousse); }
.chapo { margin-top: var(--e3); font-size: 1.3rem; line-height: 1.5; }
.date, .titre-article .statut { margin-top: var(--e2); color: var(--mousse); }
.titre-article__visuel div { position: relative; aspect-ratio: 4 / 3; background: var(--teinte); color: var(--encre); }
.titre-article__visuel img { width: 100%; height: 100%; object-fit: cover; }
.titre-article__visuel span { position: absolute; left: 20px; bottom: 16px; right: 20px; }
.credits { margin-top: var(--e4); border-top: 1px solid var(--filet); }
.credits li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: var(--e3); padding-block: 12px; border-bottom: 1px solid var(--filet); overflow-wrap: anywhere; }
.page-fixe { max-width: 720px; margin-top: var(--e4); font-size: 1.1rem; line-height: 1.7; overflow-wrap: anywhere; }
.page-fixe > * + * { margin-top: var(--e3); }
.page-fixe > h2 { margin-top: var(--e5); }
.page-fixe ul li { position: relative; padding-left: 26px; }
.page-fixe ul li + li { margin-top: 8px; }
.page-fixe ul li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; background: var(--capucine); }
.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--e3); padding: var(--e3); background: var(--tilleul); border-radius: var(--rayon); }
.fiche dt { color: var(--mousse); font-size: .95rem; }
.fiche dd { margin: 0; font-weight: 600; }
.corps { display: grid; grid-template-columns: 270px minmax(0, 720px); gap: var(--e5) clamp(40px, 8vw, 120px); padding-block: var(--e5); }
.sommaire { align-self: start; position: sticky; top: var(--e3); max-height: calc(100vh - 48px); overflow-y: auto; }
.sommaire h2 { font-size: 1.25rem; }
.sommaire ol { margin-top: 12px; }
.sommaire a { display: block; padding-block: 6px; color: inherit; line-height: 1.35; text-decoration: none; }
.sommaire a:hover { color: var(--feuille); text-decoration: underline; }
.prose { font-size: 1.1rem; line-height: 1.7; }
.prose section { scroll-margin-top: var(--e3); }
.prose section + section { margin-top: var(--e5); }
.prose section > * + * { margin-top: var(--e3); }
.prose section > ul li { position: relative; padding-left: 26px; }
.prose section > ul li + li { margin-top: 8px; }
.prose section > ul li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; background: var(--capucine); }
.etapes { counter-reset: etape; }
.etapes li { counter-increment: etape; display: grid; grid-template-columns: 56px 1fr; padding-block: 16px; border-top: 1px solid var(--filet); }
.etapes li::before { content: counter(etape); grid-row: span 2; font: 800 2.2rem/1 var(--titre); color: var(--feuille); }
.encadre { padding: 20px 24px; border-radius: var(--rayon); background: var(--tilleul); }
.encadre--attention { background: var(--capucine); }
.encadre strong { font-family: var(--titre); font-size: 1.15rem; }
.encadre a { color: inherit; }
.tableau { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--filet); text-align: left; }
thead th { border-bottom: 2px solid var(--sapin); }
figure { margin: 0; }
.photo-attendue { display: grid; place-items: center; aspect-ratio: 3 / 2; padding: var(--e3); border: 1px dashed var(--mousse); color: var(--mousse); text-align: center; }
figcaption { overflow-wrap: anywhere; margin-top: 8px; font-size: .9rem; color: var(--mousse); }
.produits__mention { font-size: .95rem; color: var(--mousse); }
.produits ul { margin-top: 12px; border-top: 1px solid var(--filet); }
.produits li { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); padding-block: 16px; border-bottom: 1px solid var(--filet); }
.bouton { flex: none; padding: 10px 18px; border-radius: var(--rayon); background: var(--sapin); color: var(--blanc); font-size: 1rem; font-weight: 600; text-decoration: none; transition: background .2s; }
a.bouton:hover { background: var(--feuille); }
.bouton[aria-disabled] { background: var(--tilleul); color: var(--mousse); }
details { border-bottom: 1px solid var(--filet); }
summary { padding-block: 16px; font-weight: 600; cursor: pointer; }
details p { padding-bottom: 20px; }
.a-rediger { color: var(--mousse); }

/* Pied */
.pied { padding-block: var(--e5); background: var(--tilleul); }
.pied__grille { display: flex; justify-content: space-between; gap: var(--e4); flex-wrap: wrap; }
.pied__nom { font: 800 1.9rem/1 var(--titre); letter-spacing: -.04em; }
.pied__nom small { display: block; margin-top: 8px; font: 400 .95rem var(--texte); letter-spacing: 0; color: var(--mousse); }
.pied ul { columns: 2; column-gap: var(--e5); }
.pied li a { display: block; padding-block: 5px; color: inherit; }

@media (max-width: 800px) {
    body { font-size: 17px; }
    .bloc, .questions { padding-block: 48px; }
    .entete__haut { flex-wrap: wrap; padding-bottom: 8px; }
    .recherche { flex-basis: 100%; max-width: none; margin: 0; }
    .rubriques-nav a { padding-block: 12px; }
    .nuancier { flex-direction: column; height: auto; }
    .nuancier a { display: flex; flex: none; min-height: 60px; align-items: center; padding-inline: clamp(16px, 4vw, 48px); }
    .nuancier a:first-child { min-height: 190px; align-items: flex-end; padding-bottom: 18px; }
    .nuancier a:has(img) { min-height: 110px; }
    .nuancier a:has(img):first-child { min-height: 230px; }
    .nuancier a:has(img)::after { background: linear-gradient(90deg, rgb(27 46 26 / .72), rgb(27 46 26 / .5) 45%, transparent 85%); }
    .nuancier a:has(img):first-child::after { background: linear-gradient(transparent 40%, rgb(27 46 26 / .8)); }
    .nuancier__nom { position: relative; left: auto; bottom: auto; writing-mode: horizontal-tb; transform: none; font-size: 1.35rem; white-space: normal; }
    .nuancier a:first-child .nuancier__nom { font-size: 2.4rem; }
    .nuancier__titre { display: none; }
    .familles a { grid-template-columns: 1fr auto; gap: 10px 16px; }
    .familles__teintes { grid-row: 2; grid-column: 1 / -1; height: 28px; }
    .questions ul, .pied ul { columns: 1; }
    .titre-article, .corps { grid-template-columns: minmax(0, 1fr); gap: var(--e4); }
    .titre-article { padding-bottom: var(--e4); }
    .corps { padding-block: var(--e4); }
    .sommaire { position: static; max-height: none; padding: 20px; background: var(--tilleul); border-radius: var(--rayon); }
    .sommaire a { padding-block: 10px; }
    .produits li { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
}
