/* Genere par 05-Psychoeducation/construire_top.ps1 : ne pas modifier ici. */
/* Version autonome : reprend les bases de css/style.css du site et les styles du module TND. */
:root {
  --fond: #fffdf9; --fond-doux: #f1e6d8; --texte: #24211f; --texte-doux: #5a524c;
  --accent: #a3461b; --accent-fonce: #7d3412; --accent-doux: #f8dfd0;
  --vert: #3f5f3a; --vert-doux: #e2ebdd; --bord: #c9b8a6; --rayon: 14px;
}

/* Article (styles limités à #psy, classes « p- », communs avec le module TND) */
#psy { padding-top: 1.5rem; }
#psy h3 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 0.5rem; }
#psy [hidden] { display: none !important; }
#psy section { scroll-margin-top: 1rem; margin-bottom: 2.5rem; }
.p-texte { max-width: 46rem; }

.p-pastille {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 3rem; height: 3rem; border-radius: 46% 54% 52% 48% / 56% 44% 56% 44%;
  background: var(--accent-doux); color: var(--accent-fonce);
}
.p-pastille.p-vert { background: var(--vert-doux); color: var(--vert); border-radius: 55% 45% 48% 52% / 46% 56% 44% 54%; }
.p-pastille svg { width: 66%; height: 66%; }
.p-pastille.p-grand { width: 5rem; height: 5rem; margin: 0.2rem 0 0.9rem; }

.p-reglage { display: inline-flex; align-items: center; gap: 0.5rem; background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 0.5rem 1rem; margin-bottom: 1.5rem; font-size: 1rem; cursor: pointer; }
.p-reglage input { accent-color: var(--accent); width: 1.15rem; height: 1.15rem; }

.p-grille { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.85rem; }
.p-grille li { margin: 0; }
.p-porte {
  display: grid; grid-template-columns: 3rem 1fr; gap: 0.1rem 0.85rem; align-items: start; height: 100%;
  background: #fff; color: var(--texte); border: 2px solid var(--bord); border-radius: var(--rayon); padding: 0.95rem 1.1rem; text-decoration: none;
}
a.p-porte:hover { border-color: var(--accent); }
a.p-porte:hover .p-pastille { transform: rotate(-6deg); }
.p-porte .p-pastille { grid-row: span 2; transition: transform 0.2s; }
.p-porte .p-lib { font-weight: 700; font-size: 1.08rem; color: var(--texte); }
.p-porte .p-desc { font-size: 0.98rem; color: var(--texte-doux); line-height: 1.45; }
.p-grille.p-publics .p-porte { border-color: var(--vert); }

.p-bref { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.2rem 1.4rem 0.3rem; margin-bottom: 1rem; }
.p-bref h3 { color: var(--vert); }
.p-etiquette { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--vert); display: block; margin-bottom: 0.3rem; }
#psy details.p-loin { background: var(--fond-doux); border-radius: var(--rayon); padding: 0.2rem 1.4rem; margin: 0 0 1.8rem; }
#psy details.p-loin[open] { padding-bottom: 0.6rem; }
#psy details.p-loin > summary { cursor: pointer; font-weight: 700; color: var(--accent-fonce); padding: 0.7rem 0; }
#psy details.p-loin > summary:hover { text-decoration: underline; }
.p-sources { font-size: 0.92rem; color: var(--texte-doux); border-top: 1px solid var(--bord); padding-top: 0.6rem; }
.p-sources ul { padding-left: 1.2rem; margin-bottom: 0.4rem; }

.p-encadre { border-left: 5px solid var(--vert); background: var(--vert-doux); padding: 1rem 1.25rem; border-radius: 0 var(--rayon) var(--rayon) 0; margin: 0 0 1.5rem; max-width: 46rem; }
.p-encadre p:last-child { margin-bottom: 0; }
.p-question { border: 2px dashed var(--accent); background: #fff; border-radius: var(--rayon); padding: 0.9rem 1.2rem; margin: 0 0 1.2rem; max-width: 46rem; }
.p-question .p-etiquette { color: var(--accent-fonce); }
.p-question p:last-child { margin-bottom: 0; }

.p-pistes { list-style: none; padding: 0; margin: 0 0 1rem; }
.p-pistes li { display: grid; grid-template-columns: 3rem 1fr; gap: 0 0.85rem; align-items: start; margin: 0 0 0.9rem; }
.p-pistes li p { margin: 0; }
.p-pistes li strong { display: block; }

.p-cartes { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.85rem; }
.p-cartes li { margin: 0; }
/* Colonnes fixes : une carte seule sur la dernière ligne prend toute la largeur */
@media (min-width: 900px) {
  .p-grille, .p-cartes { grid-template-columns: repeat(3, 1fr); }
  .p-grille > li:last-child:nth-child(3n+1), .p-cartes > li:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .p-grille, .p-cartes { grid-template-columns: repeat(2, 1fr); }
  .p-grille > li:last-child:nth-child(odd), .p-cartes > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 599px) { .p-grille, .p-cartes { grid-template-columns: 1fr; } }
.p-carte { font: inherit; text-align: left; cursor: pointer; width: 100%; background: #fff; color: var(--texte); border: 2px solid var(--bord); border-radius: var(--rayon); padding: 1rem 1.1rem; }
.p-carte:hover { border-color: var(--accent); }
.p-carte .p-idee { font-weight: 700; display: block; }
.p-carte .p-indice { font-size: 0.92rem; color: var(--accent-fonce); font-weight: 600; display: block; margin-top: 0.4rem; }
.p-reponse { background: var(--vert-doux); border-radius: 0 0 var(--rayon) var(--rayon); padding: 0.8rem 1.1rem; margin-top: -0.6rem; border: 2px solid var(--bord); border-top: 0; font-size: 1rem; }
.p-reponse strong { color: var(--vert); }

.p-bouton { display: inline-block; font-weight: 600; text-decoration: none; background: var(--accent); color: #fff; border: 2px solid var(--accent); padding: 0.6rem 1.2rem; border-radius: 999px; line-height: 1.3; font-size: 1rem; }
.p-bouton:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); color: #fff; }
.p-bouton.p-second { background: transparent; color: var(--accent); }
.p-bouton.p-second:hover { background: var(--fond-doux); color: var(--accent-fonce); }
.p-haut { font-size: 0.95rem; }
.p-licence { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--bord); font-size: 0.92rem; color: var(--texte-doux); }
mark { background: #fff4c2; }

@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  .p-bref, #psy details.p-loin { padding-left: 1rem; padding-right: 1rem; }
  .p-bandeau .p-motif { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Lisibilité (01/11/2026) : zones et titres plus marqués, lignes plus courtes */
#psy h2 { font-size: 1.85rem; color: var(--accent-fonce); }
#psy h3 { font-size: 1.35rem; color: var(--vert); margin: 1.7rem 0 0.5rem; }
#psy h3:first-child, #psy summary + h3, #psy .p-porte h3 { margin-top: 0.4rem; }
.p-texte, .p-encadre, .p-question, .p-mots { max-width: 40rem; }
.p-bref:not(.p-rdv) { border-left: 6px solid var(--vert); }
.p-sources { color: var(--texte); }
#psy section { padding-top: 2rem; border-top: 2px solid var(--bord); }
.p-bandeau { border-bottom-width: 2px; }
.p-licence { border-top-width: 2px; }
