/* Idées Déguisement — feuille de style unique.
   Un site sobre, au service des idées ; les personnages masqués apportent la fantaisie. */
@font-face { font-family: "DM Sans"; src: url(/assets/fonts/dm-sans.woff) format("woff"); font-weight: 400 700; font-display: swap; }

:root {
  --encre: #1d1b26;
  --doux: #5b5966;
  --trait: #e4e3ea;
  --surface: #f4f4f7;
  --papier: #fff;
  --accent: #d6336c;          /* rouge-framboise, proche de la cocarde de Napoléon */
  --accent-fonce: #b4235a;
  --accent-pale: #fdebf1;
  --texte: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --large: 1140px;
  --lecture: 44rem;
  --marge: clamp(1rem, 4vw, 2rem);
  --rayon: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; font: 400 1.0625rem/1.6 var(--texte); color: var(--encre); background: var(--papier); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-fonce); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-weight: 700; line-height: 1.12; letter-spacing: -.025em; margin: 0; }
h1 { font-size: clamp(1.45rem, 1.2rem + 1.3vw, 2.1rem); }
h2 { font-size: clamp(1.3rem, 1.15rem + .55vw, 1.55rem); }
h3 { font-size: 1.1rem; letter-spacing: -.01em; }
h4 { font-size: 1rem; font-weight: 700; line-height: 1.3; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--papier); padding: .5rem 1rem; }

/* ---------- en-tête ---------- */
.entete { border-bottom: 1px solid var(--trait); background: var(--papier); }
.entete__inner { max-width: var(--large); margin: 0 auto; padding: .55rem var(--marge); display: flex; align-items: center; gap: 1.25rem; }
.logo { display: flex; align-items: center; gap: .55rem; color: var(--encre); text-decoration: none; font-weight: 700; font-size: 1.05rem; line-height: 1; letter-spacing: -.02em; }
.logo__mascotte { width: 40px; height: auto; margin-top: -4px; transition: transform .2s ease; }
.logo:hover .logo__mascotte { transform: rotate(-8deg); }
.menu { margin-left: auto; }
.menu ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.menu a { display: block; white-space: nowrap; padding: .45rem .75rem; border-radius: 9px; color: var(--encre); text-decoration: none; font-weight: 600; }
.menu a:hover { background: var(--surface); }
.menu a[aria-current] { background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
.entete__recherche { display: flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border: 1px solid var(--trait); border-radius: 999px; color: var(--encre); text-decoration: none; font-weight: 600; }
.entete__recherche:hover { border-color: var(--encre); }
.entete__recherche svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (max-width: 860px) {
  .entete__inner { flex-wrap: wrap; gap: .5rem; }
  .entete__recherche { margin-left: auto; }
  .entete__recherche span { display: none; }
  .menu { order: 3; margin: 0 calc(var(--marge) * -1); width: calc(100% + 2 * var(--marge)); overflow-x: auto; scrollbar-width: none; }
  .menu ul { padding: 0 var(--marge) .15rem; }
  .menu a { white-space: nowrap; background: var(--surface); }
}

/* ---------- la bande des personnages ---------- */
.troupe { display: flex; align-items: flex-end; justify-content: center; gap: .25rem; margin: 0; padding: 0; list-style: none; border-bottom: 2px solid var(--encre); }
.troupe li { flex: none; }
.troupe img { height: var(--h, 130px); width: auto; transform-origin: 50% 100%; }
.troupe li:nth-child(odd) img { --r: -2deg; }
.troupe li:nth-child(even) img { --r: 2deg; }
.troupe li:hover img { animation: salut .5s ease; }
@keyframes salut { 40% { transform: translateY(-8px) rotate(var(--r)); } }

/* ---------- accueil ---------- */
.une { border-bottom: 1px solid var(--trait); overflow: hidden; }
.une__inner { max-width: var(--large); margin: 0 auto; padding: clamp(2.25rem, 6vw, 4rem) var(--marge) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem 3rem; align-items: end; }
@media (min-width: 940px) { .une__inner { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.une__texte { padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.une h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.5rem); line-height: 1.06; letter-spacing: -.03em; max-width: 24ch; text-wrap: balance; }
.une__intro { max-width: 34rem; font-size: 1.15rem; color: var(--doux); margin: 1rem 0 1.6rem; }
.une__exemples { display: flex; flex-wrap: wrap; gap: .4rem .5rem; list-style: none; margin: 1.1rem 0 0; padding: 0; font-size: .95rem; }
.une__exemples li:first-child { color: var(--doux); padding: .25rem 0; }
.une__exemples a { display: block; padding: .25rem .7rem; border-radius: 8px; background: var(--surface); color: var(--encre); text-decoration: none; font-weight: 600; }
.une__exemples a:hover { background: var(--accent-pale); color: var(--accent-fonce); }
.une .troupe { --h: clamp(110px, 15vw, 215px); gap: .2rem; border-bottom: 0; justify-content: flex-end; }
@media (max-width: 939px) { .une .troupe { justify-content: center; --h: min(150px, calc((100vw - 3rem) / 4.3)); } .une__texte { padding-bottom: 0; } }

.recherche { display: flex; gap: .5rem; max-width: 34rem; }
.recherche input { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; padding: .8rem 1rem; border: 1.5px solid #cfcdd8; border-radius: 12px; color: var(--encre); background: var(--papier); }
.recherche input:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px var(--accent-pale); }
.recherche button, .formulaire button { font: inherit; font-weight: 700; padding: .8rem 1.25rem; border: 0; border-radius: 12px; background: var(--encre); color: var(--papier); cursor: pointer; }
.recherche button:hover, .formulaire button:hover { background: var(--accent-fonce); }

.bloc { max-width: var(--large); margin: 0 auto; padding: clamp(2.25rem, 5vw, 3.5rem) var(--marge) 0; }
.bloc > h2, .bloc__tete { margin-bottom: 1.25rem; }
.bloc__tete { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.bloc__tete a { font-weight: 600; }
.bloc--texte { padding-bottom: 1rem; }

/* Rubriques principales */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: .6rem; list-style: none; margin: 0; padding: 0; }
.tuile a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; border-radius: var(--rayon); background: var(--surface); color: var(--encre); text-decoration: none; transition: background .15s ease; }
.tuile a:hover { background: var(--accent-pale); }
.tuile__label { font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.tuile__nb { font-size: .88rem; color: var(--doux); white-space: nowrap; }
.tuiles--compact { margin-top: 2rem; }

/* ---------- en-tête des pages ---------- */
.tete { border-bottom: 1px solid var(--trait); }
.tete__inner { position: relative; max-width: var(--large); margin: 0 auto; padding: 1.1rem var(--marge) 1.75rem; }
.tete h1 { max-width: 34ch; text-wrap: balance; }
.tete .chapo { max-width: 58rem; }
.tete__perso { position: absolute; right: var(--marge); bottom: -1px; height: 120px; width: auto; }
@media (min-width: 861px) { .tete__inner--perso { padding-right: 190px; min-height: 150px; } }
@media (max-width: 860px) { .tete__perso { display: none; } }

.page { max-width: var(--large); margin: 0 auto; padding: 2rem var(--marge) 3rem; }
.fil ol { display: flex; flex-wrap: wrap; gap: .15rem .5rem; list-style: none; margin: 0 0 1rem; padding: 0; font-size: .9rem; color: var(--doux); }
.fil li + li::before { content: "/"; margin-right: .5rem; color: #b9b7c3; }
.fil a { color: var(--doux); }
.chapo { font-size: 1.15rem; line-height: 1.55; color: var(--doux); margin: .9rem 0 0; }
.page > .chapo { max-width: var(--lecture); margin: 0 0 2rem; }
.article__date { color: var(--doux); margin: 0; font-size: .95rem; }
.article__une { margin: 1.5rem 0 2rem; max-width: var(--lecture); }
.article__une img { border-radius: var(--rayon); }

.contenu { max-width: var(--lecture); }
.contenu > * + * { margin-top: 1rem; }
.contenu h2 { margin-top: 2.5rem; }
.contenu h3 { margin-top: 1.75rem; }
.contenu h4 { margin-top: 1.25rem; }
.contenu h2 + *, .contenu h3 + *, .contenu h4 + * { margin-top: .6rem; }
.contenu p, .contenu ul, .contenu ol { margin-bottom: 0; }
.contenu ul:not(.idees), .contenu ol { padding-left: 1.25rem; }
.contenu li + li { margin-top: .3rem; }
.contenu .illustration { margin: 1.5rem 0; }
.contenu .illustration img { border-radius: var(--rayon); margin: 0 auto; }
.table-wrap { overflow-x: auto; }
.contenu table { border-collapse: collapse; width: 100%; }
.contenu th, .contenu td { border: 1px solid var(--trait); padding: .5rem .75rem; text-align: left; vertical-align: top; }

/* Listes d'idées : des étiquettes faciles à parcourir */
.contenu .idees { columns: 3 10.5rem; column-gap: 2.25rem; list-style: none; padding: 0; margin: .9rem 0 1.5rem; }
.idees li { position: relative; break-inside: avoid; margin: 0; padding: .3rem .4rem .3rem 1.05rem; border-radius: 6px; line-height: 1.4; }
.idees li::before { content: ""; position: absolute; left: .2rem; top: .9em; width: .38rem; height: .38rem; border-radius: 50%; background: var(--accent); }
.contenu:has(.idees), .contenu:has(.galerie) { max-width: 58rem; }

/* Sommaire */
.sommaire { max-width: 58rem; margin: 0 0 2.25rem; }
.sommaire summary { font-weight: 700; cursor: pointer; margin-bottom: .6rem; }
.sommaire details:not([open]) summary { margin-bottom: 0; }
.sommaire ul { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.sommaire a { display: block; padding: .25rem .7rem; border: 1px solid var(--trait); border-radius: 8px; color: var(--encre); text-decoration: none; font-weight: 600; }
.sommaire a:hover { border-color: var(--encre); }
.sommaire--lettre a { min-width: 2.3rem; text-align: center; }

/* Cartes de rubriques */
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 1.5rem 1rem; list-style: none; margin: 0 0 2.75rem; padding: 0; }
.cartes--grandes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.cartes--articles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.carte a { display: block; color: var(--encre); text-decoration: none; }
.carte__image { display: block; aspect-ratio: 4 / 3; border-radius: var(--rayon); overflow: hidden; background: var(--surface); }
.carte__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.carte a:hover img { transform: scale(1.04); }
.carte__titre { display: block; margin-top: .6rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.carte a:hover .carte__titre { color: var(--accent-fonce); }

/* Rubriques voisines */
.voisins { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--trait); }
.voisins h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.pastilles { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.pastilles a { display: block; padding: .32rem .8rem; border: 1px solid var(--trait); border-radius: 8px; color: var(--encre); text-decoration: none; font-weight: 600; }
.pastilles a:hover { border-color: var(--encre); }

/* Galeries photos */
.contenu .galerie { columns: 2 150px; column-gap: .6rem; margin-top: 1rem; }
@media (min-width: 760px) { .contenu .galerie { columns: 4; } }
.galerie figure { margin: 0 0 .6rem; break-inside: avoid; }
.galerie img { width: 100%; border-radius: 10px; background: var(--surface); }
.galerie a { position: relative; display: block; cursor: zoom-in; border-radius: 10px; overflow: hidden; }
.galerie__nom { position: absolute; inset: auto 0 0; padding: 1.6rem .6rem .5rem; background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #fff; font-size: .82rem; font-weight: 600; line-height: 1.3; opacity: 0; transform: translateY(.3rem); transition: opacity .15s ease, transform .15s ease; pointer-events: none; }
.galerie a:hover .galerie__nom, .galerie a:focus-visible .galerie__nom { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .galerie__nom { transition: none; transform: none; } }
.galerie--vide { display: none; }

.visionneuse { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.visionneuse::backdrop { background: rgba(16, 15, 22, .92); }
.visionneuse img { max-width: 96vw; max-height: 82vh; width: auto; border-radius: 10px; margin: 0 auto; }
.visionneuse__legende { color: #fff; text-align: center; margin: .6rem auto 0; max-width: 40rem; font-weight: 600; }
.visionneuse__barre { display: flex; justify-content: center; gap: .5rem; margin-top: .6rem; }
.visionneuse button { font: inherit; font-weight: 600; padding: .5rem 1rem; border: 0; border-radius: 10px; background: var(--papier); color: var(--encre); cursor: pointer; }

/* Vidéos (chargées au clic) */
.video { position: relative; aspect-ratio: 16 / 9; max-width: var(--lecture); border-radius: var(--rayon); overflow: hidden; background: var(--encre); }
.video__play { position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer; background: center / cover no-repeat; }
.video__play::after { content: ""; position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 32px no-repeat; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Recherche */
.page--recherche .recherche { margin-bottom: 2rem; }
.resultats { max-width: 58rem; }
.resultats h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
.resultats ul { list-style: none; margin: 0; padding: 0; }
.resultat a { display: block; padding: .75rem 0; border-bottom: 1px solid var(--trait); color: var(--encre); text-decoration: none; }
.resultat a:hover strong { color: var(--accent-fonce); }
.resultat small { display: block; color: var(--doux); font-size: .9rem; }
.resultat--idee { padding: .75rem 0; border-bottom: 1px solid var(--trait); }
.resultat__ou { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.resultat__ou a { padding: .12rem .55rem; border-radius: 7px; background: var(--surface); color: var(--encre); text-decoration: none; font-size: .9rem; font-weight: 600; }
.resultat__ou a:hover { background: var(--accent-pale); color: var(--accent-fonce); }
.resultat mark { background: var(--accent-pale); color: inherit; border-radius: 3px; }
.resultats__vide { display: flex; align-items: flex-end; gap: 1rem; color: var(--doux); }
.resultats__vide img { height: 120px; width: auto; flex: none; }

/* Contact */
.formulaire { max-width: 36rem; }
.formulaire__champ { margin: 0 0 1.1rem; }
.formulaire label { display: block; font-weight: 600; margin-bottom: .35rem; }
.formulaire input, .formulaire textarea { width: 100%; font: inherit; padding: .75rem .9rem; border: 1.5px solid #cfcdd8; border-radius: 12px; color: var(--encre); }
.formulaire input:focus, .formulaire textarea:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px var(--accent-pale); }
.formulaire__piege { position: absolute; left: -9999px; }
.message { max-width: 36rem; padding: 1rem 1.2rem; border-radius: 12px; background: #e6f6ee; font-weight: 600; }
.message--erreur { background: var(--accent-pale); }

/* ---------- pied de page ---------- */
.pied { margin-top: 4.5rem; background: var(--surface); }
.pied { position: relative; }
.pied__scene { position: relative; max-width: var(--large); height: 0; margin: 0 auto; }
.pied__scene .troupe { --h: clamp(56px, 7vw, 88px); position: absolute; right: var(--marge); bottom: 0; border: 0; }
.pied__inner { max-width: var(--large); margin: 0 auto; padding: 2.5rem var(--marge) 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.5rem; }
.pied__titre { font-weight: 700; margin: 0 0 .6rem; }
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li + li { margin-top: .3rem; }
.pied a { color: var(--doux); text-decoration: none; }
.pied a:hover { color: var(--encre); text-decoration: underline; }
.pied__mention { max-width: var(--large); margin: 0 auto; padding: 1rem var(--marge) 2rem; font-size: .88rem; color: var(--doux); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .carte a:hover img, .logo:hover .logo__mascotte { transform: none; }
}

/* ---------- explorateur ---------- */
.maj { margin: .6rem 0 0; font-size: .88rem; color: var(--doux); }
.explorer__outils input { width: 100%; max-width: 30rem; font: inherit; padding: .65rem .9rem; border: 1.5px solid #cfcdd8; border-radius: 10px; background: var(--papier); color: var(--encre); }
.explorer__outils input:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px var(--accent-pale); }
.explorer [hidden] { display: none; }

.puces { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: .9rem 0 0; padding: 0; }
.puces button { font: inherit; font-size: .92rem; font-weight: 600; padding: .3rem .75rem; border: 1px solid var(--trait); border-radius: 999px; background: var(--papier); color: var(--encre); cursor: pointer; }
.puces button:hover { border-color: var(--encre); }
.puces button[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--papier); }

.explorer__outils { position: sticky; top: 0; z-index: 2; background: var(--papier); padding: .75rem 0 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--trait); }
.explorer__groupe { margin-bottom: 2.25rem; }
.explorer__groupe h2 { font-size: 1.3rem; margin-bottom: .8rem; }
.explorer__groupe h2 span { font-size: .9rem; font-weight: 600; color: var(--doux); margin-left: .3rem; }
.explorer__liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: .4rem; list-style: none; margin: 0; padding: 0; }
.explorer__liste li { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .55rem .8rem; border-radius: 10px; background: var(--surface); }
.explorer__liste a { color: var(--encre); font-weight: 600; text-decoration: none; }
.explorer__liste a:hover { color: var(--accent-fonce); text-decoration: underline; }
.explorer__liste small { color: var(--doux); white-space: nowrap; }
.explorer__vide { color: var(--doux); }
.puces--recherche { margin: -1rem 0 1.25rem; }
.puces small { font-weight: 500; opacity: .7; }
.galerie figure[hidden] { display: none; }
.galerie__suite { max-width: 58rem; }
.galerie__suite button { font: inherit; font-weight: 700; padding: .65rem 1.1rem; border: 1.5px solid var(--encre); border-radius: 10px; background: var(--papier); color: var(--encre); cursor: pointer; }
.galerie__suite button:hover { background: var(--encre); color: var(--papier); }
.carte__accroche { display: block; margin-top: .2rem; font-size: .9rem; line-height: 1.4; color: var(--doux); }
.carte__nb { display: inline-block; margin-top: .4rem; padding: .08rem .5rem; border-radius: 6px; background: var(--surface); font-size: .82rem; font-weight: 600; color: var(--doux); }
.carte__image .carte__perso { width: auto; height: 78%; margin: 22% auto 0; object-fit: contain; }
.contenu .idees li + li { margin-top: 0; }

/* À voir aussi */
.voir-aussi { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--trait); }
.voir-aussi h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.cartes--compactes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); margin-bottom: 0; }
.cartes--compactes .carte__accroche { display: none; }

/* Mode d'emploi express */
.contenu .astuces { margin: 2.5rem 0; padding: 1.5rem 1.5rem .75rem; border-radius: var(--rayon); background: var(--surface); }
.contenu .astuces h2 { margin-top: 0; }
.contenu .astuces > p { margin-bottom: 1rem; color: var(--doux); }
.astuces dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 0 1.5rem; margin: 0; }
.astuces dl > div { padding: .75rem 0; border-top: 1px solid var(--trait); }
.astuces dt { font-weight: 700; }
.astuces dd { margin: .15rem 0 0; font-size: .95rem; line-height: 1.45; }

/* Barre collante des pages longues */
.barre { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--trait); box-shadow: 0 2px 12px rgba(29,27,38,.08); }
@supports (backdrop-filter: blur(6px)) { .barre { background: rgba(255,255,255,.85); backdrop-filter: blur(8px); } }
.barre[hidden] { display: none; }
.barre__inner { max-width: var(--large); margin: 0 auto; padding: .5rem var(--marge); display: flex; align-items: center; gap: .75rem; }
.barre__sommaire { position: relative; }
.barre__sommaire summary { list-style: none; cursor: pointer; padding: .45rem .9rem; border: 1px solid var(--trait); border-radius: 999px; font-weight: 700; white-space: nowrap; }
.barre__sommaire summary::-webkit-details-marker { display: none; }
.barre__sommaire summary::after { content: ""; display: inline-block; width: .45em; height: .45em; margin-left: .5em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.15em) rotate(45deg); }
.barre__sommaire[open] summary { border-color: var(--encre); }
.barre__sommaire ul { position: absolute; top: calc(100% + .4rem); left: 0; width: min(92vw, 34rem); max-height: 65vh; overflow: auto; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: .75rem; list-style: none; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: 0 10px 30px rgba(29,27,38,.15); }
.barre__sommaire a { display: block; padding: .25rem .7rem; border: 1px solid var(--trait); border-radius: 8px; color: var(--encre); text-decoration: none; font-weight: 600; font-size: .95rem; }
.barre__sommaire a:hover { border-color: var(--encre); }
:target { scroll-margin-top: 4.5rem; }
.contenu h2, .contenu h3 { scroll-margin-top: 4.5rem; }

/* Retour en haut */
.haut { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 19; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 50%; background: var(--encre); color: #fff; box-shadow: 0 4px 14px rgba(29,27,38,.25); }
.haut[hidden] { display: none; }
.haut svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.haut:hover { background: var(--accent-fonce); }

/* Photos dans le texte */
.contenu .illustration img { max-height: 75vh; width: auto; max-width: 100%; }
.contenu .illustration--grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .75rem; align-items: start; }
.contenu .illustration--grille img { width: 100%; height: auto; max-height: none; border-radius: var(--rayon); }

/* ---------- menu complet ---------- */
.entete { position: relative; z-index: 25; }
.mega summary { display: flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border: 1px solid var(--trait); border-radius: 999px; font-weight: 600; cursor: pointer; list-style: none; white-space: nowrap; }
.mega summary::-webkit-details-marker { display: none; }
.mega summary:hover, .mega[open] summary { border-color: var(--encre); }
.mega__icone { position: relative; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }
.mega__icone::before, .mega__icone::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }
.mega__icone::before { top: -5px; } .mega__icone::after { top: 5px; }
.mega[open] .mega__icone { background: transparent; }
.mega[open] .mega__icone::before { top: 0; transform: rotate(45deg); }
.mega[open] .mega__icone::after { top: 0; transform: rotate(-45deg); }
.mega__panneau { position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - 80px); overflow: auto; background: var(--papier); border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); box-shadow: 0 18px 40px rgba(29,27,38,.14); }
.mega__grille { max-width: var(--large); margin: 0 auto; padding: 1.5rem var(--marge) .5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 1.5rem 1.75rem; }
.mega__titre { display: flex; align-items: flex-end; gap: .5rem; margin-bottom: .45rem; color: var(--encre); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.mega__titre img { width: 34px; height: auto; }
.mega__titre:hover { color: var(--accent-fonce); }
.mega__bloc ul { list-style: none; margin: 0; padding: 0; }
.mega__bloc li a { display: block; padding: .18rem 0; color: var(--doux); text-decoration: none; font-size: .95rem; line-height: 1.35; }
.mega__bloc li a:hover { color: var(--encre); text-decoration: underline; }
.mega__bloc .mega__plus { color: var(--accent-fonce); font-weight: 600; }
.mega__pied { max-width: var(--large); margin: 0 auto; padding: .75rem var(--marge) 1.5rem; font-weight: 600; }
.mega__pied a { display: inline-block; padding: .35rem 0; color: var(--encre); }
@media (max-width: 1180px) { .mega__long { display: none; } .mega__texte::first-letter { text-transform: uppercase; } }
@media (max-width: 860px) {
  .mega { margin-left: auto; }
  .entete__recherche { margin-left: 0; }
  .mega__panneau { max-height: calc(100vh - 110px); }
}

/* ---------- tuiles illustrées de l'accueil ---------- */
.tuile a { justify-content: flex-start; padding: .75rem 1.1rem .75rem .9rem; min-height: 5.5rem; }
.tuile__perso { flex: none; width: 84px; height: 84px; object-fit: contain; object-position: 50% 100%; transition: transform .2s ease; }
.tuile a:hover .tuile__perso { transform: rotate(-6deg) scale(1.06); }
.tuile__texte { display: flex; flex-direction: column; gap: .1rem; }
.tuiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
@media (max-width: 600px) { .mega__grille { grid-template-columns: 1fr 1fr; gap: 1.25rem 1rem; } .mega__titre { font-size: 1rem; } }

/* Étiquettes qui mènent vers une autre page */
.contenu .idees li > a { color: var(--accent-fonce); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent-pale); text-underline-offset: 3px; }
.contenu .idees li > a:hover { text-decoration-color: currentColor; }

/* troupe de l'accueil : les personnages se partagent la largeur disponible */
.une .troupe { min-width: 0; }
.une .troupe li { flex: 0 1 auto; min-width: 0; }
.une .troupe img { max-width: 100%; height: auto; max-height: var(--h); width: auto; object-fit: contain; }
@media (min-width: 861px) and (max-width: 1120px) {
  .entete__inner { gap: .75rem; }
  .menu a { padding: .45rem .5rem; }
  .entete__recherche span { display: none; }
}
.contenu .idees--courte { columns: 1; }
.idees li:hover { background: var(--surface); }

/* ---------- résultats de recherche ---------- */
.resultat a { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; }
.resultat img { flex: none; width: 96px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--surface); }
.resultat__vide { flex: none; display: flex; align-items: center; justify-content: center; width: 96px; height: 72px; padding: .3rem; border-radius: 10px; background: var(--accent-pale); color: var(--accent-fonce); font-weight: 700; font-size: .72rem; line-height: 1.2; text-align: center; overflow: hidden; }
.resultat__texte { min-width: 0; }
.resultat strong { font-size: 1.05rem; }
.resultat__extrait { display: block; margin-top: .2rem; font-size: .92rem; color: var(--doux); line-height: 1.4; }
.resultat__extrait mark, .astuce-trouvee mark { background: var(--accent-pale); color: var(--encre); border-radius: 3px; }
.resultats__photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); gap: .75rem; }
.resultats__photos a { display: block; color: var(--doux); text-decoration: none; font-size: .85rem; }
.resultats__photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface); }
.resultats__photos a:hover img { outline: 3px solid var(--accent-pale); }
.resultats__photos span { display: block; margin-top: .25rem; line-height: 1.3; }
.astuce-trouvee { margin-top: 1.5rem; padding: 1.1rem 1.25rem; border-radius: var(--rayon); background: var(--surface); }
.astuce-trouvee h2 { margin: 0 0 .35rem !important; font-size: 1.1rem; }
.astuce-trouvee p { margin: 0; }
.contenu .illustration img { max-height: min(440px, 70vh); }

/* formulaire : envoi de photos */
.formulaire__photos { margin: 0 0 1.4rem; padding: 1rem 1.1rem .4rem; border: 1.5px dashed #cfcdd8; border-radius: var(--rayon); }
.formulaire__photos legend { padding: 0 .4rem; font-weight: 700; }
.formulaire__aide { margin: 0 0 .9rem; font-size: .95rem; color: var(--doux); }
.formulaire input[type="file"] { padding: .55rem; background: var(--surface); }
.formulaire__case { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 .9rem; }
.formulaire__case input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; accent-color: var(--accent-fonce); }
.formulaire__case label { font-weight: 400; font-size: .95rem; margin: 0; }

/* appel à photos */
.envoi-photo { display: flex; align-items: center; gap: 1.25rem; max-width: 58rem; margin: 3rem 0 0; padding: 1.25rem 1.5rem; border-radius: var(--rayon); background: var(--accent-pale); }
.envoi-photo img { flex: none; width: 72px; height: auto; }
.envoi-photo h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.envoi-photo p { margin: 0; }
.envoi-photo a { display: inline-block; padding: .3rem 0; color: var(--accent-fonce); font-weight: 700; }
@media (max-width: 560px) { .envoi-photo img { width: 52px; } }
.contenu a.lien-partenaire::after { content: " (lien partenaire)"; font-size: .8em; color: var(--doux); font-weight: 400; }

/* Photos : jamais déformées. Les images contraintes en hauteur gardent leurs proportions,
   même sur les navigateurs qui gèrent mal max-height (Safari iOS notamment). */
img { object-fit: contain; }
.carte__image img, .resultat img, .resultats__photos img { object-fit: cover; }
.contenu .illustration img, .visionneuse img { width: auto; height: auto; object-fit: contain; }
.galerie img { height: auto; }

.puces small { font-size: .82rem; }
.article__date a { display: inline-block; padding: .3rem 0; }
@media (max-width: 600px) { .chapo { font-size: 1.05rem; line-height: 1.5; } .tete__inner { padding-bottom: 1.4rem; } .contenu h2 { margin-top: 2.1rem; } }
@media (max-width: 600px) { .puces--recherche { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--marge)); padding: 0 var(--marge) .2rem 0; } .puces--recherche::-webkit-scrollbar { display: none; } .puces--recherche li { flex: none; } }

/* ---------- tutos pas à pas ---------- */
.contenu .tuto { margin: 1.25rem 0 0; padding: 1.15rem 1.3rem 1.25rem; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--papier); }
.contenu .tuto h3 { margin: 0; font-size: 1.1rem; }
.contenu .tuto .tuto__infos { display: flex; flex-wrap: wrap; gap: .35rem; margin: .55rem 0 .7rem; padding: 0; list-style: none; }
.contenu .tuto .tuto__infos li { margin: 0; padding: .12rem .6rem; border-radius: 999px; background: var(--surface); font-size: .88rem; font-weight: 600; color: var(--doux); }
.contenu .tuto p { margin: .5rem 0 0; }
.contenu .tuto ol { margin: .6rem 0 0; padding-left: 1.3rem; }
.contenu .tuto ol li + li { margin-top: .35rem; }
.contenu .tuto ol li::marker { font-weight: 700; color: var(--accent-fonce); }
.contenu .tuto + .tuto { margin-top: 1rem; }
.cartes--saison { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.cartes [hidden], .une__exemples [hidden] { display: none; }
.bloc__intro { margin: -.4rem 0 1rem; color: var(--doux); }
.une__exemples li { order: 100; } .une__exemples li:first-child { order: -1; }

/* ---------- liens partenaires ---------- */
.idees .achat { display: inline-block; margin-left: .35rem; padding: .02rem .5rem; border: 1px solid var(--accent); border-radius: 999px; font-size: .78rem; font-weight: 700; line-height: 1.5; color: var(--accent-fonce); text-decoration: none; vertical-align: .05em; }
.idees .achat:hover, .idees .achat:focus-visible { background: var(--accent); color: #fff; }
.partenaire { max-width: 58rem; margin: 2.5rem 0 0; padding: 1.2rem 1.35rem; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface); }
.partenaire p { margin: 0; }
.partenaire__titre { font-weight: 700; font-size: 1.1rem; }
.partenaire > p + p { margin-top: .3rem; }
.partenaire__bouton { display: inline-block; margin-top: .85rem; padding: .6rem 1.1rem; border-radius: 10px; background: var(--encre); color: #fff; font-weight: 700; text-decoration: none; }
.partenaire__bouton:hover { background: var(--accent-fonce); }
.partenaire__note, .contenu .partenaire__note { margin-top: .6rem; font-size: .85rem; color: var(--doux); }
@media (max-width: 600px) {
  .tuiles { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .tuile a { flex-direction: column; align-items: flex-start; gap: .35rem; padding: .7rem .8rem; min-height: 0; }
  .tuile__perso { width: 64px; height: 64px; }
  .tuile__label { font-size: 1rem; }
  .cartes--saison, .cartes--grandes, .cartes { grid-template-columns: 1fr 1fr; gap: 1.1rem .75rem; }
  .carte__titre { font-size: .98rem; }
  .carte__accroche { display: none; }
}
.astuces__fiche { display: inline-block; margin-top: .1rem; padding: .25rem 0; font-weight: 600; color: var(--accent-fonce); }
.tuile--large { grid-column: 1 / -1; }
.tuile--large .tuile__nb { white-space: normal; }
.carte__vide { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 1rem; background: var(--accent-pale); color: var(--accent-fonce); font-weight: 700; font-size: 1.15rem; line-height: 1.25; text-align: center; }
