/* Blocs de contenu des actualités et des pages (1.18.0, socle § 18).
   Toutes les classes commencent par « fs- » : ce sont les seules que le serveur
   conserve à l'enregistrement (App\Services\RichText). Cette feuille est
   chargée par le thème public ET par l'éditeur (visuel et aperçu), pour que
   l'auteur voie ce que verront les lecteurs. Les couleurs viennent des
   variables du thème ; les valeurs de repli servent à l'éditeur. */

:root { --fs-primary: var(--primary, #1d4ed8); --fs-accent: var(--accent, #c81e2d); }

/* Alignements du texte et des figures */
.fs-text-left { text-align: left; }
.fs-text-center { text-align: center; }
.fs-text-right { text-align: right; }

.fs-figure { margin: 1.5em 0; }
.fs-figure img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.fs-figure figcaption, .fs-gallery figcaption, .fs-embed figcaption { font-size: .88rem; color: #64748b; margin-top: .5rem; }
.fs-align-left { float: left; margin: .3em 1.5em 1em 0; max-width: 50%; }
.fs-align-right { float: right; margin: .3em 0 1em 1.5em; max-width: 50%; }
.fs-align-center { margin-left: auto; margin-right: auto; text-align: center; }
.fs-align-center img { margin-left: auto; margin-right: auto; }
.fs-align-wide { clear: both; width: 100%; max-width: 100%; }
.fs-align-wide img { width: 100%; }
.fs-size-small { width: 240px; max-width: 100%; }
.fs-size-medium { width: 420px; max-width: 100%; }
.fs-size-large { width: 640px; max-width: 100%; }
.fs-align-wide.fs-size-small, .fs-align-wide.fs-size-medium, .fs-align-wide.fs-size-large { width: 100%; }

/* Section : bandeau pleine largeur de contenu */
.fs-section { clear: both; margin: 2em 0; padding: 1.5rem 1.25rem; border-radius: 16px; }
.fs-section > :first-child { margin-top: 0; }
.fs-section > :last-child { margin-bottom: 0; }
.fs-section--light { background: #f1f5f9; }
.fs-section--brand { background: var(--fs-primary); color: #fff; }
.fs-section--brand h2, .fs-section--brand h3, .fs-section--brand h4, .fs-section--dark h2, .fs-section--dark h3, .fs-section--dark h4 { color: inherit; }
.fs-section--brand a, .fs-section--dark a { color: inherit; text-decoration: underline; }
.fs-section--dark { background: #0f172a; color: #e2e8f0; }

/* Colonnes : une seule sous 768 px */
.fs-columns { display: grid; gap: 1.5rem; margin: 1.5em 0; clear: both; }
.fs-columns--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fs-columns--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fs-column > :first-child { margin-top: 0; }
.fs-column > :last-child { margin-bottom: 0; }
@media (max-width: 767px) {
    .fs-columns--2, .fs-columns--3 { grid-template-columns: minmax(0, 1fr); }
    .fs-align-left, .fs-align-right { float: none; max-width: 100%; margin: 1.5em 0; }
}

/* Image et texte */
.fs-media-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.5rem; align-items: center; margin: 1.5em 0; clear: both; }
.fs-media-text--right { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.fs-media-text--right > .fs-figure { order: 2; }
.fs-media-text > .fs-figure { margin: 0; width: auto; float: none; max-width: 100%; }
.fs-media-text__body > :first-child { margin-top: 0; }
.fs-media-text__body > :last-child { margin-bottom: 0; }
@media (max-width: 767px) {
    .fs-media-text, .fs-media-text--right { grid-template-columns: minmax(0, 1fr); }
    .fs-media-text--right > .fs-figure { order: 0; }
}

/* Galerie */
.fs-gallery { display: grid; gap: .75rem; margin: 1.5em 0; clear: both; }
.fs-gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fs-gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fs-gallery--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fs-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; margin: 0; }
.fs-gallery figcaption { grid-column: 1 / -1; }
@media (max-width: 767px) {
    .fs-gallery--3, .fs-gallery--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
    .fs-gallery--2, .fs-gallery--3, .fs-gallery--4 { grid-template-columns: minmax(0, 1fr); }
}

/* Vidéo, audio, intégrations */
.fs-embed { margin: 1.5em 0; clear: both; }
.fs-embed--video iframe, .fs-embed--video video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; background: #0f172a; }
.fs-embed--audio audio { display: block; width: 100%; }

/* Encadrés */
.fs-callout { margin: 1.5em 0; padding: 1rem 1.25rem; border-left: 5px solid #2563eb; border-radius: 0 12px 12px 0; background: #eff6ff; color: #1e3a8a; clear: both; }
.fs-callout > :first-child { margin-top: 0; }
.fs-callout > :last-child { margin-bottom: 0; }
.fs-callout--tip { border-color: #15803d; background: #f0fdf4; color: #14532d; }
.fs-callout--warning { border-color: #b45309; background: #fffbeb; color: #78350f; }

/* Boutons et fichiers */
.fs-button { display: inline-block; padding: .65em 1.3em; border-radius: 999px; font-weight: 600; line-height: 1.3; text-decoration: none; border: 2px solid var(--fs-primary); }
.fs-button:hover { text-decoration: none; filter: brightness(.95); }
.fs-button--primary { background: var(--fs-primary); color: #fff; }
.fs-button--secondary { background: #fff; color: var(--fs-primary); }
.fs-file, .fs-map { margin: 1.2em 0; }

/* Accordéon */
.fs-accordion { margin: .75em 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.fs-accordion > summary { cursor: pointer; padding: .85rem 1.1rem; font-weight: 600; color: #0f172a; list-style: none; border-radius: 12px; }
.fs-accordion > summary::-webkit-details-marker { display: none; }
.fs-accordion > summary::after { content: "+"; float: right; font-weight: 700; }
.fs-accordion[open] > summary::after { content: "\2212"; }
.fs-accordion > summary:focus-visible { outline: 3px solid var(--fs-accent); outline-offset: 2px; }
.fs-accordion > :not(summary) { margin-left: 1.1rem; margin-right: 1.1rem; }
.fs-accordion > :last-child { margin-bottom: 1rem; }

/* Sommaire */
.fs-toc { margin: 1.5em 0; padding: 1rem 1.25rem; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; clear: both; }
.fs-toc__title { margin: 0 0 .4rem; font-weight: 700; color: #0f172a; }
.fs-toc ol { margin: 0; padding-left: 1.3em; }
.fs-toc ol ol { margin-top: .2em; }
.fs-toc a { text-decoration: underline; }

/* Espace */
.fs-spacer { border: 0; height: 2.5rem; margin: 0; background: none; clear: both; }
