/*
 * La galerie de nos formations (app/pages/nos_formations.php), faite pour le site de la MFR : couleurs de la charte écrites en dur,
 * fond clair comme la page du site qui l'accueille (elle reste la même en mode sombre, comme le reste de ce site).
 */
.nos-formations { margin: 0; background: #ffffff; color: #1d1d1b; font: 16px/1.5 Roboto, system-ui, sans-serif; }
.nos-formations * { box-sizing: border-box; }
.nf-tete { padding: 10px 16px; border-bottom: 3px solid #CEAB5D; }
.nf-corps { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }
.en-cadre .nf-corps { padding: 6px 8px 24px; }
/* Dans une page du site, son titre et son introduction suffisent */
.en-cadre .nf-h1, .en-cadre .nf-intro { display: none; }
.nf-h1 { font: 700 30px/1.2 "Roboto Slab", Georgia, serif; color: #472612; margin: 6px 0 8px; }
.nf-intro { margin: 0 0 16px; max-width: 760px; color: #4a3a30; }

/* Filtres : des pastilles à cocher, par groupe */
.nf-filtres { background: #F7F3EE; border-radius: 14px; padding: 12px 14px; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.nf-groupe { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nf-groupe legend { float: left; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #92542A; margin-right: 8px; padding: 0; }
.nf-filtre input { position: absolute; opacity: 0; pointer-events: none; }
.nf-filtre span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid #DFD7CD;
  background: #fff; cursor: pointer; font-size: 15px; user-select: none; }
.nf-filtre input:checked + span { background: #472612; border-color: #472612; color: #fff; }
.nf-filtre input:focus-visible + span { outline: 3px solid #CEAB5D; outline-offset: 2px; }
.nf-filtres-pied { flex-basis: 100%; display: flex; align-items: center; gap: 16px; margin: 4px 0 0; }
.nf-compte { font-weight: 700; color: #472612; }
.nf-tout { color: #92542A; }
.avec-js .nf-sans-js { display: none; }

/* Tuiles */
.nf-tuiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.nf-tuile[hidden], .nf-vide[hidden] { display: none; }
.nf-tuile a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; background: #fff; border-radius: 14px;
  overflow: hidden; box-shadow: 0 6px 20px rgba(71, 38, 18, .10); border-top: 4px solid #CEAB5D; }
.nf-tuile a:focus-visible { outline: 3px solid #CEAB5D; outline-offset: 3px; }
.nf-photo { position: relative; display: block; aspect-ratio: 16 / 9; background: #92542A 50% 20% / cover no-repeat; }
.nf-voie { position: absolute; left: 10px; bottom: 10px; background: rgba(71, 38, 18, .88); color: #fff; font-size: 13px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; }
.nf-tuile-corps { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.nf-titre { font: 700 20px/1.25 "Roboto Slab", Georgia, serif; color: #472612; }
.nf-resume { font-size: 15px; color: #4a3a30; }
.nf-pied { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: #45521F; font-weight: 700; margin-top: auto; }
.nf-plus { align-self: flex-start; color: #92542A; font-weight: 700; }
.nf-plus::after { content: " →"; }
.nf-vide { padding: 20px; background: #F7F3EE; border-radius: 14px; }

/* Détail : dans la fenêtre, ou en pleine page sans JavaScript */
.nf-fenetre { width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: auto; }
.nf-fenetre::backdrop { background: rgba(29, 20, 14, .55); }
.nf-fermer { position: sticky; top: 8px; float: right; margin: 8px 8px 0 0; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: #fff; color: #472612; font-size: 20px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
/* Les visages sont presque toujours dans le haut de la photo : cadrée au tiers supérieur plutôt qu'au centre */
.nf-detail-photo { aspect-ratio: 21 / 9; max-height: 400px; background: #92542A 50% 12% / cover no-repeat; }
.nf-detail-corps { padding: 18px 22px 22px; }
.nf-titre-detail { font: 700 26px/1.2 "Roboto Slab", Georgia, serif; color: #472612; margin: 0 0 8px; }
.nf-accroche { font-weight: 500; font-size: 17px; margin: 0 0 12px; }
.nf-etiquettes { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.nf-etiquettes li { background: #F1E8D7; color: #472612; border-radius: 999px; padding: 3px 12px; font-size: 14px; font-weight: 700; }
.nf-reperes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 16px; }
.nf-reperes div { background: #F7F3EE; border-radius: 10px; padding: 8px 12px; }
.nf-reperes dt { font-size: 13px; color: #92542A; font-weight: 700; }
.nf-reperes dd { margin: 2px 0 0; font-weight: 700; color: #1d1d1b; }
.nf-gestes { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.nf-btn { display: inline-flex; align-items: center; min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 2px solid #472612;
  background: #fff; color: #472612; font: 700 15px/1.2 Roboto, sans-serif; text-decoration: none; cursor: pointer; }
.nf-btn.plein { background: #472612; color: #fff; }
.nf-btn:focus-visible { outline: 3px solid #CEAB5D; outline-offset: 2px; }
.nf-demande, .nf-rubrique { border-top: 1px solid #DFD7CD; }
.nf-demande > summary, .nf-rubrique > summary { cursor: pointer; padding: 12px 0; font: 700 18px/1.3 "Roboto Slab", Georgia, serif; color: #472612; }
.nf-demande:not([open]) { display: none; }
.nf-rubrique h4 { margin: 10px 0 4px; font-size: 16px; color: #92542A; }
.nf-rubrique ul { padding-left: 20px; }
.nf-chiffres { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 10px; }
.nf-chiffres li { background: #F7F3EE; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 140px; }
.nf-chiffres b { font: 700 22px/1.2 "Roboto Slab", Georgia, serif; color: #45521F; }
.nf-etapes { padding-left: 22px; }
.nf-etapes li { margin: 0 0 6px; }
.nf-note { font-size: 14px; color: #646363; margin: 14px 0 0; }
.nf-note a, .nf-retour { color: #92542A; font-weight: 700; }

/* Formulaire de demande */
.nf-demande form { padding: 0 0 12px; }
.nf-sorte { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.nf-sorte legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.nf-sorte label, .nf-case { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.nf-sorte input, .nf-case input { width: 22px; height: 22px; accent-color: #472612; }
.nf-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 14px; }
.nf-champs label, .nf-large { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; }
.nf-large { margin-top: 10px; }
.nf-demande input:not([type=radio]):not([type=checkbox]), .nf-demande select, .nf-demande textarea {
  font: 16px Roboto, sans-serif; padding: 10px 12px; min-height: 44px; border: 1px solid #C8CDD0; border-radius: 10px; background: #fff; color: #1d1d1b; width: 100%; }
.nf-demande input:focus, .nf-demande select:focus, .nf-demande textarea:focus { outline: 3px solid #CEAB5D; outline-offset: 1px; }
.nf-rgpd { font-size: 14px; color: #4a3a30; }
.nf-envoi { display: flex; justify-content: flex-end; }
.nf-piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.nf-erreur { background: #F4E7E5; border-left: 4px solid #78151E; padding: 10px 14px; border-radius: 8px; }
.nf-merci { background: #E3E3C8; border-left: 4px solid #45521F; padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; }

@media (max-width: 600px) {
  .nf-h1 { font-size: 24px; }
  .nf-fenetre { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; margin: 0; }
  .nf-detail-photo { aspect-ratio: 16 / 9; }
  .nf-detail-corps { padding: 14px 16px 20px; }
  .nf-gestes .nf-btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: no-preference) {
  .nf-tuile a { transition: transform .15s ease, box-shadow .15s ease; }
  .nf-tuile a:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(71, 38, 18, .18); }
}
