/* FG — Modernisation progressive, lot 1 : articles uniquement.
   Charger APRES style.css. Retirer ce lien pour annuler le lot. */
.fg-article-page #article .section-inner { padding-top: 16px; padding-bottom: 60px; }
.fg-article-page .section-heading {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  line-height: 1.18;
  letter-spacing: -.025em;
  font-weight: 600;
  padding-top: 20px;
  padding-bottom: 16px;
  overflow-wrap: anywhere;
}
.fg-article-page .fg-article-main { min-width: 0; }
.fg-article-page .fg-article-main > .lead,
.fg-article-page .fg-article-content { max-width: 72ch; }
.fg-article-page .fg-article-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}
.fg-article-page .fg-article-content p { margin-bottom: 1.2em; }
.fg-article-page .fg-article-content h2,
.fg-article-page .fg-article-content h3 {
  line-height: 1.3;
  letter-spacing: -.01em;
  margin-top: 1.65em;
  margin-bottom: .65em;
}
.fg-article-page .fg-article-content img,
.fg-article-page .fg-article-content video,
.fg-article-page .fg-article-content iframe {
  max-width: 100%;
}
.fg-article-page .fg-article-content img { height: auto; }
.fg-article-page .fg-article-content figure { max-width: 100%; margin: 1.5em 0; }
.fg-article-page .fg-article-content figcaption {
  font-size: .875rem; line-height: 1.5; opacity: .78; margin-top: .4em;
}
.fg-article-page .fg-article-content table { max-width: 100%; }
.fg-article-page .fg-article-aside { min-width: 0; }
@media (max-width: 767px) {
  .fg-article-page .section-heading { padding-top: 10px; padding-bottom: 8px; }
  .fg-article-page .fg-article-content { font-size: 1rem; line-height: 1.7; }
  .fg-article-page .fg-article-aside { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .fg-article-page .fg-article-content { scroll-behavior: auto; }
}


/* Lot 2 — Rubriques : styles limités à rubrique.html */
.fg-rubrique-page .section-heading {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.fg-rubrique-page .fg-rubrique-intro {
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}
.fg-rubrique-page .fg-rubrique-intro img { max-width: 100%; height: auto; }
.fg-rubrique-page .fg-rubrique-cards > [class*="col-"] { margin-bottom: 20px; }
.fg-rubrique-page .fg-rubrique-cards .icon-box-1 {
  height: 100%;
  min-height: 145px;
  padding: 22px;
  border: 1px solid #e5e9ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20,30,55,.045);
  transition: box-shadow .18s ease, transform .18s ease;
}
.fg-rubrique-page .fg-rubrique-cards .icon-box-1:hover {
  box-shadow: 0 7px 22px rgba(20,30,55,.10);
  transform: translateY(-2px);
}
.fg-rubrique-page .fg-rubrique-cards .icon-box-1 h4 {
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.fg-rubrique-page .fg-rubrique-cards .icon-box-1 a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .fg-rubrique-page .fg-rubrique-cards .icon-box-1 { transition: none; }
  .fg-rubrique-page .fg-rubrique-cards .icon-box-1:hover { transform: none; }
}

/* Lot 3 — Documents joints (modèle partagé article/rubrique).
   Ne modifie pas les documents intégrés directement dans le texte. */
.fg-documents .fg-documents-list {
  list-style: none;
  margin: 14px 0 24px;
  padding: 0;
}
.fg-documents .fg-document-item {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  border: 1px solid #e1e6ee;
  border-radius: 9px;
  background: #fff;
  overflow-wrap: anywhere;
}
.fg-documents .fg-document-link {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease;
}
.fg-documents .fg-document-link:hover,
.fg-documents .fg-document-link:focus-visible {
  background: #f5f7fb;
  text-decoration: none;
}
.fg-documents .fg-document-title {
  display: block;
  font-size: .96rem;
  line-height: 1.45;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.fg-documents .fg-document-meta {
  display: block;
  margin-top: 5px;
  font-size: .8rem;
  line-height: 1.4;
  opacity: .72;
}
.fg-documents .fg-document-item .descriptif,
.fg-documents .fg-document-item .credits {
  padding: 0 16px 12px;
  font-size: .875rem;
  line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
  .fg-documents .fg-document-link { transition: none; }
}


/* Lot 4 révisé — bandeau sous la navigation fixe */
#headerwrap {
  height: auto;
  min-height: 265px;
  overflow: visible;
}
#headerwrap .fg-header-inner { height: auto; position: relative; }
#headerwrap .fg-header-layout {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 132px; /* réserve la place aux deux lignes du menu fixe */
  padding-bottom: 20px;
  min-height: 265px;
}
#headerwrap .fg-header-logo {
  display: block;
  width: min(370px, 100%);
  max-width: 100%;
  max-height: 115px;
  height: auto;
  margin: 0;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 1;
}
#headerwrap #header-social:not(.is-stuck) {
  position: static;
  flex: 0 1 auto;
  max-width: 60%;
  margin: 0;
}
#headerwrap #header-social:not(.is-stuck) .social-list {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
#headerwrap #header-social:not(.is-stuck) .social-list a {
  font-size: 12px;
  padding: 6px 9px;
}
@media (max-width: 991px) {
  #headerwrap .fg-header-layout { padding-top: 125px; }
  #headerwrap .fg-header-logo { width: min(300px, 100%); }
}
@media (max-width: 767px) {
  #headerwrap .fg-header-layout {
    min-height: 0;
    padding-top: 105px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  #headerwrap .fg-header-logo { width: min(250px, 100%); max-height: 95px; }
  #headerwrap #header-social:not(.is-stuck) { max-width: 100%; }
  #headerwrap #header-social:not(.is-stuck) .social-list { justify-content: flex-start; }
}
/* Réduction des espaces sur les pages intérieures uniquement */
.fg-article-page > section:first-of-type .section-inner,
.fg-rubrique-page > section:first-of-type .section-inner { padding-top: 22px; padding-bottom: 12px; }
.fg-article-page > section:first-of-type .section-heading,
.fg-rubrique-page > section:first-of-type .section-heading { padding-top: 12px; padding-bottom: 8px; margin-bottom: 0; }
.fg-article-page #article .section-inner { padding-top: 14px; }
.fg-rubrique-page > section:nth-of-type(2) .section-inner { padding-top: 16px; }

/* Lot 5 — Resserrement vertical des rubriques.
   Classes explicites dans rubrique.html : aucune incidence sur les articles. */
.fg-rubrique-page .fg-rubrique-heading-section .section-inner {
  padding-top: 24px;
  padding-bottom: 8px;
}
.fg-rubrique-page .fg-rubrique-heading .section-heading.ptb {
  margin: 0;
  padding: 22px 0 14px;
}
.fg-rubrique-page .fg-rubrique-content-section .section-inner {
  padding-top: 12px;
  padding-bottom: 30px;
}
.fg-rubrique-page .fg-rubrique-intro {
  margin-bottom: 14px;
}
.fg-rubrique-page .fg-rubrique-intro:empty { display: none; }
.fg-rubrique-page .fg-rubrique-intro > :first-child { margin-top: 0; }
.fg-rubrique-page .fg-rubrique-intro > :last-child { margin-bottom: 0; }
.fg-rubrique-page .fg-rubrique-cards { margin-top: 0; }
@media (max-width: 767px) {
  .fg-rubrique-page .fg-rubrique-heading-section .section-inner {
    padding-top: 18px;
    padding-bottom: 4px;
  }
  .fg-rubrique-page .fg-rubrique-heading .section-heading.ptb {
    padding: 16px 0 10px;
  }
  .fg-rubrique-page .fg-rubrique-content-section .section-inner {
    padding-top: 8px;
  }
}

/* Lot 6 — Médias dans les articles.
   Styles limités au texte des articles ; pas de changement du portfolio SPIP. */
.fg-article-page .fg-article-content :is(img, video, iframe) {
  max-width: 100%;
}
.fg-article-page .fg-article-content :is(.spip_documents, figure) {
  max-width: 100%;
}
.fg-article-page .fg-article-content :is(.spip_documents, figure) img {
  max-width: 100%;
  height: auto;
}
.fg-article-page .fg-article-content :is(iframe[src*="youtube.com/embed/"],
  iframe[src*="youtube-nocookie.com/embed/"], iframe[src*="player.vimeo.com/video/"]) {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 8px;
}
.fg-article-page .fg-article-content :is(.spip_doc_legende, figcaption) {
  font-size: .875rem;
  line-height: 1.5;
  color: #596477;
  margin-top: .45rem;
}
/* Galerie facultative : à appliquer explicitement à un bloc HTML de l'article.
   Ne transforme pas automatiquement tous les paragraphes et documents en grille. */
.fg-article-page .fg-article-content .fg-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.fg-article-page .fg-article-content .fg-media-grid > * {
  min-width: 0;
  margin: 0;
}
.fg-article-page .fg-article-content .fg-media-grid :is(iframe, video) {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}
@media (max-width: 640px) {
  .fg-article-page .fg-article-content .fg-media-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}


/* ==================================================
   Lot 7 — Témoignages des anciens élèves
   ================================================== */
.fg-alumni-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin: 30px 0 45px;
}
.fg-alumni-card {
    background: #fff;
    border: 1px solid #e2e7ef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .05);
    transition: transform .2s ease, box-shadow .2s ease;
    min-width: 0;
}
.fg-alumni-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
}
.fg-alumni-info { padding: 18px 20px 14px; }
.fg-alumni-info h3 {
    margin: 0 0 5px;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}
.fg-alumni-info p { margin: 0; color: #657084; font-size: .9rem; }
.fg-alumni-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
}
.fg-alumni-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
@media (max-width: 991px) {
    .fg-alumni-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 600px) {
    .fg-alumni-grid { grid-template-columns: 1fr; gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .fg-alumni-card { transition: none; }
    .fg-alumni-card:hover { transform: none; }
}

/* Lot 7 — Correctif ciblé : bandeau des pages intérieures.
   Neutralise le mode flottant des réseaux sur articles/rubriques :
   le JS peut conserver is-stuck, mais ces pages gardent une disposition stable. */
.fg-article-page #headerwrap,
.fg-rubrique-page #headerwrap { min-height: 0; height: auto; overflow: visible; }
.fg-article-page #headerwrap .fg-header-layout,
.fg-rubrique-page #headerwrap .fg-header-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: 285px;
  padding-top: 130px;
  padding-bottom: 20px;
  gap: 14px 22px;
}
.fg-article-page #headerwrap .fg-header-logo,
.fg-rubrique-page #headerwrap .fg-header-logo {
  position: static;
  display: block;
  width: min(360px, 100%);
  max-width: 100%;
  height: auto;
  max-height: 115px;
  margin: 0 !important;
  object-fit: contain;
  object-position: left center;
}
.fg-article-page #headerwrap #header-social,
.fg-rubrique-page #headerwrap #header-social {
  position: static !important;
  inset: auto !important;
  flex: 0 1 auto;
  max-width: 100%;
  margin: 0;
  z-index: auto;
}
.fg-article-page #headerwrap #header-social .social-list,
.fg-rubrique-page #headerwrap #header-social .social-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
@media (max-width: 991px) {
  .fg-article-page #headerwrap .fg-header-layout,
  .fg-rubrique-page #headerwrap .fg-header-layout { padding-top: 135px; }
}
@media (max-width: 767px) {
  .fg-article-page #headerwrap .fg-header-layout,
  .fg-rubrique-page #headerwrap .fg-header-layout {
    padding-top: 95px;
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
  }
  .fg-article-page #headerwrap #header-social .social-list,
  .fg-rubrique-page #headerwrap #header-social .social-list { justify-content: flex-start; }
}
/* Largeur étendue UNIQUEMENT pour les articles contenant une galerie alumni.
   Ne change pas les autres articles, ni le fonctionnement SPIP. */
@supports selector(:has(*)) {
  .fg-article-page #article .row:has(.fg-alumni-grid) > .fg-article-main {
    float: none;
    width: 100%;
  }
  .fg-article-page #article .fg-article-main:has(.fg-alumni-grid) > .fg-article-content {
    max-width: none;
  }
  .fg-article-page #article .fg-article-main:has(.fg-alumni-grid) > .lead {
    max-width: 85ch;
  }
  .fg-article-page #article .row:has(.fg-alumni-grid) > .fg-article-aside {
    float: none;
    width: 100%;
    clear: both;
    margin-top: 24px;
  }
}

/* Lot 8 — Portfolio SPIP (uniquement le modèle portfolio.html).
   Le carrousel existant et ses classes JS sont conservés. */
.fg-portfolio-section .fg-portfolio-container {
  padding-left: 15px;
  padding-right: 15px;
}
.fg-portfolio-section .fg-portfolio-slider-row {
  margin-bottom: 30px;
}
.fg-portfolio-section .fg-portfolio-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  border-radius: 8px;
}
.fg-portfolio-section .fg-portfolio-captions {
  margin-top: 18px;
}
.fg-portfolio-section .fg-portfolio-caption {
  padding: 14px 18px;
  margin-bottom: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.fg-portfolio-section .fg-portfolio-caption p {
  margin: 0 0 6px;
}
@media (max-width: 767px) {
  .fg-portfolio-section .fg-portfolio-slider-row { margin-bottom: 18px; }
  .fg-portfolio-section .fg-portfolio-caption { padding: 10px 15px; }
}

/* Lot 9 — Finitions des documents insérés dans les articles SPIP.
   Complète les règles médias déjà présentes (lot 6), sans changer les squelettes. */
.fg-article-page .fg-article-content .spip_documents {
  box-sizing: border-box;
  max-width: 100%;
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
}
.fg-article-page .fg-article-content .spip_documents_center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.fg-article-page .fg-article-content .spip_documents_left {
  margin-right: 1.3rem;
}
.fg-article-page .fg-article-content .spip_documents_right {
  margin-left: 1.3rem;
}
.fg-article-page .fg-article-content .spip_doc_titre {
  font-weight: 600;
  line-height: 1.4;
  margin-top: .6rem;
}
.fg-article-page .fg-article-content .spip_doc_descriptif,
.fg-article-page .fg-article-content .spip_doc_credits {
  font-size: .875rem;
  line-height: 1.55;
  color: #596477;
  margin-top: .35rem;
}
.fg-article-page .fg-article-content .spip_documents :is(img, svg) {
  max-width: 100%;
  height: auto;
}
/* Empêche les tableaux éditoriaux de faire déborder les petits écrans.
   Le défilement horizontal est limité au tableau concerné. */
.fg-article-page .fg-article-content .table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 640px) {
  .fg-article-page .fg-article-content .spip_documents_left,
  .fg-article-page .fg-article-content .spip_documents_right {
    float: none !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
    clear: both;
    text-align: center;
  }
  .fg-article-page .fg-article-content .spip_documents {
    max-width: 100%;
  }
}

/* Lot 10 — pied de page : règles limitées à .fg-site-footer */
.fg-site-footer .fg-footer-main { padding: 52px 0 38px; }
.fg-site-footer .fg-footer-main .row { display: flex; flex-wrap: wrap; row-gap: 30px; }
.fg-site-footer .fg-footer-main .row > [class*="col-"] { float: none; }
.fg-site-footer .widget-title { margin: 0 0 19px; font-size: 1.15rem; font-weight: 700; line-height: 1.35; }
.fg-site-footer .about-us-widget ul { list-style: none; margin: 0; padding: 0; }
.fg-site-footer .about-us-widget li { margin-bottom: 11px; }
.fg-site-footer .about-us-widget a { display: inline-flex; align-items: baseline; gap: 10px; line-height: 1.5; text-decoration: none; }
.fg-site-footer .about-us-widget a:hover, .fg-site-footer .about-us-widget a:focus-visible { text-decoration: underline; }
.fg-site-footer .about-us-widget a .fa { flex: 0 0 18px; width: 18px; text-align: center; }
.fg-site-footer .media { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.fg-site-footer .media .pull-left { float: none !important; flex: 0 0 72px; margin: 0; }
.fg-site-footer .media .widget-img { width: 72px; height: 56px; object-fit: cover; border-radius: 5px; }
.fg-site-footer .media-body { min-width: 0; width: auto; flex: 1; }
.fg-site-footer .media-heading a { display: inline-block; line-height: 1.4; }
.fg-site-footer .media-body small { display: block; margin-top: 4px; }
.fg-site-footer .tagcloud { display: flex; flex-wrap: wrap; gap: 7px; }
.fg-site-footer .tagcloud .tag-link { margin: 0; white-space: normal; }
.fg-site-footer .fg-footer-bottom { padding: 23px 0 19px; }
.fg-site-footer .fg-footer-bottom .thin-hr { margin: 14px auto; }
.fg-site-footer .fg-footer-bottom .copyright { font-size: .88rem; }
@media (max-width: 767px) {
  .fg-site-footer .fg-footer-main { padding: 35px 0 25px; }
  .fg-site-footer .fg-footer-main .row { row-gap: 23px; }
  .fg-site-footer .fg-footer-main .row > [class*="col-"] { width: 100%; }
}

/* Lot 11 — Accueil : finition progressive sans toucher aux boucles SPIP. */
.fg-home-page .fg-home-news { padding-bottom: 32px; }
.fg-home-page .fg-home-news-inner { padding-top: 35px; }
.fg-home-page .fg-home-news h2 { margin-top: 8px; margin-bottom: 12px; font-weight: 700; line-height: 1.2; }
.fg-home-page .fg-home-news h2 .fa { margin-left: 8px; opacity: .65; font-size: .75em; }
.fg-home-page .fg-home-news-grid { margin-top: 14px; margin-bottom: 34px; }
.fg-home-page .fg-home-news-grid .news-card,
.fg-home-page .fg-home-voyages .news-card { overflow: hidden; border-radius: 9px; }
.fg-home-page .fg-home-news-grid .news-card__link,
.fg-home-page .fg-home-voyages .news-card__link { display: block; height: 100%; text-decoration: none; }
.fg-home-page .fg-home-news-grid .news-card__media,
.fg-home-page .fg-home-voyages .news-card__media { overflow: hidden; }
.fg-home-page .fg-home-news-grid .news-card__img,
.fg-home-page .fg-home-voyages .news-card__img { max-width: 100%; height: auto; transition: transform .25s ease; }
@media (hover:hover) and (prefers-reduced-motion: no-preference) {
  .fg-home-page .fg-home-news-grid .news-card:hover .news-card__img,
  .fg-home-page .fg-home-voyages .news-card:hover .news-card__img { transform: scale(1.025); }
}
.fg-home-page .fg-home-news-grid .news-card__title,
.fg-home-page .fg-home-voyages .news-card__title { overflow-wrap: anywhere; line-height: 1.3; }
.fg-home-page .fg-home-news-grid .news-card__excerpt,
.fg-home-page .fg-home-voyages .news-card__excerpt { line-height: 1.55; }
.fg-home-page .fg-home-news a:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.fg-home-page .bandeau-secretariat img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
@media (max-width: 767px) {
  .fg-home-page .fg-home-news-inner { padding-top: 20px; }
  .fg-home-page .fg-home-news-grid { margin-bottom: 20px; }
}


/* Lot 12 — Mise en valeur discrète, sans toucher à la grille de style.css.
   Grille d'origine : 12 colonnes, chaque carte occupe 3 colonnes sur desktop. */
.fg-home-page .fg-home-news-grid > .news-card:nth-child(-n+2) {
  box-shadow: 0 9px 25px rgba(12, 29, 86, .13);
  border-top: 3px solid #101c87;
}
.fg-home-page .fg-home-news-grid > .news-card:nth-child(-n+2) .news-card__title {
  font-weight: 700;
}
