:root {
  --pepite-focus: #1d5fa7;
}

body {
  overflow-x: hidden;
}

.skip-links {
  position: absolute;
  left: -9999px;
}

.skip-links:focus-within {
  left: 1rem;
  top: 1rem;
  z-index: 9999;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

.custom-logo-link img,
.logo img {
  max-width: 100%;
  height: auto;
}

.header-right {
  flex: 1;
  min-width: 0;
}

.main-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.header-link .link,
.btn-recherche,
.search-button,
.to-page-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icon,
.ui-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  line-height: 0;
}

.social-icon svg,
.ui-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.btn-recherche .ui-icon,
.search-button .ui-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.navigation {
  margin: 0;
  padding: 0;
  list-style: none;
}

.navigation > li > a {
  text-decoration: none;
}

.menu-toggle {
  display: none;
}

.search-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
}

.search-panel {
  display: none;
}

.search-panel.is-open {
  display: block;
}

.search-panel .close {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  margin-top: 0.75rem;
}

.header-form {
  align-items: center;
  gap: 0.5rem;
}

.header-form .input {
  min-width: 240px;
}

.home-intro {
  max-width: 48rem;
  margin: 0 0 1.5rem;
}

.legacy-content img,
.legacy-content iframe,
.legacy-content video,
.pepite-editorial img,
.prose img {
  max-width: 100%;
  height: auto;
}

.legacy-content .container,
.legacy-content .row,
.legacy-content .col-12,
.legacy-content .col-lg-8,
.legacy-content .offset-lg-2 {
  max-width: 100%;
}

.legacy-content .page-body {
  padding-bottom: 3rem;
}

.pepite-editorial > * + *,
.prose > * + * {
  margin-top: 1.25rem;
}

.pepite-editorial h2,
.pepite-editorial h3,
.pepite-editorial h4,
.prose h2,
.prose h3,
.prose h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.pepite-editorial ul,
.pepite-editorial ol,
.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.pepite-editorial blockquote,
.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid #38b0cc;
  background: rgba(56, 176, 204, 0.08);
}

.pepite-editorial table,
.prose table {
  width: 100%;
  border-collapse: collapse;
}

.pepite-editorial th,
.pepite-editorial td,
.prose th,
.prose td {
  padding: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  vertical-align: top;
}

.pepite-editorial .wp-block-table,
.prose .wp-block-table {
  overflow-x: auto;
}

.pepite-editorial .wp-block-button__link,
.prose .wp-block-button__link {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
}

.pepite-editorial .wp-block-file,
.prose .wp-block-file {
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0.75rem;
}

.pepite-editorial .wp-block-columns,
.prose .wp-block-columns {
  gap: 1.5rem;
}

.pepite-editorial .alignwide,
.prose .alignwide {
  max-width: min(100vw - 2rem, 72rem);
  width: min(100vw - 2rem, 72rem);
  margin-left: calc(50% - min(50vw - 1rem, 36rem));
}

.pepite-editorial [id],
.prose [id] {
  scroll-margin-top: 7rem;
}

.archive-header {
  margin-bottom: 1.5rem;
}

.archive-description {
  max-width: 50rem;
}

.page-header--simple,
.page-header--post {
  padding: 2rem 0 1rem;
}

.page-header-body {
  max-width: 52rem;
}

.page-title {
  margin: 0;
}

.page-body {
  padding-bottom: 3rem;
}

.page-header > .container,
.page-body.container,
.container.rte-content.page-body {
  width: min(100% - 2rem, 1280px);
  max-width: 1280px;
}

.prose {
  padding: 2rem 0;
}

.editor-styles-wrapper .pepite-editorial,
.editor-styles-wrapper .prose {
  max-width: 52rem;
  margin: 0 auto;
}

.footer-links p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
}

.footer-nav {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.footer-nav li {
  margin: 0;
}

.footer-nav a,
.link-page {
  text-decoration: none;
}

.footer-copyright {
  margin: 0 0 0.75rem;
}

.logos-partenaires img,
.logos-soutiens img {
  max-height: 80px;
  width: auto;
}

.section-partenaires,
.section-soutiens {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
}

.article-partenaires,
.article-soutiens {
  display: inline-flex;
  align-items: center;
}

.card-group-element.home-news-list {
  gap: 1.5rem;
}

.card-group-element.home-news-list .card {
  height: 100%;
}

.card-group-element.home-news-list img {
  display: block;
  width: 100%;
  height: auto;
}

.to-page-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
}

.single-thumb {
  margin: 0 0 1.5rem;
}

.single-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.75rem;
}

.pepite-child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.pepite-child-card .card,
.pepite-child-card .item,
.pepite-child-card .home-news-link {
  height: 100%;
}

.pepite-child-card .card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
}

.pepite-child-card .card-body {
  padding: 1rem 1.1rem 1.2rem;
}

.pepite-child-card .date {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: #4b5563;
}

.pepite-child-card .card-txt {
  margin: 0.75rem 0 0;
}

.pepite-child-grid--portraits {
  align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pepite-child-grid--portraits .pepite-child-card,
.pepite-child-grid--portraits .pepite-child-card .item,
.pepite-child-grid--portraits .pepite-child-card .home-news-link,
.pepite-child-grid--portraits .pepite-child-card .card {
  height: auto;
}

.pepite-child-grid--portraits .card-img-top {
  aspect-ratio: 516 / 335;
  overflow: hidden;
  background: #f6f8fb;
}

.pepite-child-grid--portraits .home-news-figure,
.pepite-child-grid--portraits .picture {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

.pepite-child-grid--portraits .object-fit {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pepite-child-grid--portraits .card-body {
  padding: 1rem 1rem 1.1rem;
}

.pepite-child-grid--portraits .home-news-title {
  margin: 0;
  line-height: 1.2;
}

.pepite-child-grid--portraits .card-txt {
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.pepite-child-grid--directory,
.pepite-child-grid--cards {
  align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pepite-child-grid--directory .pepite-child-card,
.pepite-child-grid--directory .pepite-child-card .item,
.pepite-child-grid--directory .pepite-child-card .home-news-link,
.pepite-child-grid--directory .pepite-child-card .card,
.pepite-child-grid--cards .pepite-child-card,
.pepite-child-grid--cards .pepite-child-card .item,
.pepite-child-grid--cards .pepite-child-card .home-news-link,
.pepite-child-grid--cards .pepite-child-card .card {
  height: auto;
}

.pepite-child-grid--directory .card-img-top,
.pepite-child-grid--cards .card-img-top {
  aspect-ratio: 516 / 335;
  overflow: hidden;
  background: #f6f8fb;
}

.pepite-child-grid--directory .home-news-figure,
.pepite-child-grid--directory .picture,
.pepite-child-grid--cards .home-news-figure,
.pepite-child-grid--cards .picture {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

.pepite-child-grid--directory .object-fit,
.pepite-child-grid--cards .object-fit {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pepite-child-grid--directory .card-body,
.pepite-child-grid--cards .card-body {
  padding: 1rem 1rem 1.1rem;
}

.pepite-child-grid--directory .home-news-title,
.pepite-child-grid--cards .home-news-title {
  margin: 0;
  line-height: 1.2;
}

.pepite-child-grid--directory .card-txt,
.pepite-child-grid--cards .card-txt {
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.card-group-element.home-news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card-group-element.home-news-list .card-img-top:empty {
  display: none;
}

.card-group-element.home-news-list .card-img-top {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f6f8fb;
}

.card-group-element.home-news-list .card-img-top .home-news-figure,
.card-group-element.home-news-list .card-img-top .picture {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

.card-group-element.home-news-list .card-img-top .object-fit {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (max-width: 767px) {
  .pepite-child-grid--directory,
  .pepite-child-grid--cards {
    grid-template-columns: 1fr;
  }
}

.pepite-child-list {
  padding-left: 1.25rem;
}

.pepite-form {
  margin-top: 2rem;
}

.pepite-form .form-group + .form-group {
  margin-top: 1rem;
}

.pepite-form .control-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.pepite-form .form-control {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  background: #fff;
}

.pepite-form textarea.form-control {
  min-height: 10rem;
}

.pepite-form .btn {
  min-width: 180px;
  border-radius: 999px;
}

.pepite-form-notice {
  margin: 1rem 0 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
}

.pepite-form-notice--success {
  background: rgba(16, 185, 129, 0.12);
  color: #065f46;
}

.pepite-form-notice--error {
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
}

.pepite-form__trap {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 991px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    display: none;
    width: 100%;
  }

  .main-nav.is-open {
    display: block;
  }

  .main-navigation {
    flex-wrap: wrap;
  }
}

@media (min-width: 992px) {
  .page-header-body {
    max-width: none;
    width: 100%;
  }

  .page-header .col-10 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .page-body .row.rte-content > .col-lg-8.offset-lg-2 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .page-body .single-content,
  .page-body .pepite-editorial,
  .page-body .prose {
    max-width: none;
  }

  .page-body .single-content .col-lg-8,
  .page-body .single-content article.col-lg-8 {
    width: 100%;
    max-width: none;
    flex: 0 0 100%;
  }

  .page-body .single-content .offset-lg-2 {
    margin-left: 0;
  }

  .page-body .single-content .textmedia-item.textmedia-text,
  .page-body .single-content .textmedia,
  .page-body .single-content .frame-container,
  .page-body .single-content .frame-inner {
    width: 100%;
    max-width: none;
  }

  .page2colonnes .page-body > .row > article.col-lg-8,
  .page-body > .row > article.col-lg-8 {
    flex: 0 0 78%;
    max-width: 78%;
  }

  .page2colonnes .page-body > .row > aside.col-lg-4,
  .page-body > .row > aside.col-lg-4 {
    flex: 0 0 22%;
    max-width: 22%;
  }
}

@media (max-width: 767px) {
  .header-form .input {
    min-width: 0;
    width: 100%;
  }

  .header-form {
    flex-wrap: wrap;
  }

  .section-partenaires,
  .section-soutiens {
    justify-content: flex-start;
  }

  .pepite-editorial .alignwide,
  .prose .alignwide {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .pepite-child-grid {
    grid-template-columns: 1fr;
  }

  .pepite-child-grid--portraits {
    grid-template-columns: 1fr;
  }
}

/* header-alignment-fix */
@media (min-width: 992px) {
  .site-header .navigation.list-group {
    display: flex;
    align-items: flex-end;
    margin: 0;
    padding: 0;
  }

  .site-header .navigation > .list-parent {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    list-style: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .site-header .navigation > .list-parent > .menu-parent-desktop {
    position: relative;
    display: flex;
    flex-direction: column;
  }

  .site-header .navigation > .list-parent > .menu-parent-desktop > .link.d-none.d-lg-flex {
    position: relative;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    margin: 0;
    padding: 0.35rem 0 1rem;
    line-height: 1.1;
    text-decoration: none;
  }

  .site-header .navigation > .list-parent.active > .menu-parent-desktop > .link.d-none.d-lg-flex::after,
  .site-header .navigation > .list-parent.is-open > .menu-parent-desktop > .link.d-none.d-lg-flex::after,
  .site-header .navigation > .list-parent:hover > .menu-parent-desktop > .link.d-none.d-lg-flex::after,
  .site-header .navigation > .list-parent:focus-within > .menu-parent-desktop > .link.d-none.d-lg-flex::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: #79c9e8;
  }

  .site-header .navigation > .list-parent > .menu-parent-desktop > .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    margin-top: 0;
    min-width: 240px;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 0;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 14px 30px rgba(18, 38, 63, 0.12);
    z-index: 40;
  }

  .site-header .navigation > .list-parent.is-open > .menu-parent-desktop > .dropdown-menu,
  .site-header .navigation > .list-parent:hover > .menu-parent-desktop > .dropdown-menu,
  .site-header .navigation > .list-parent:focus-within > .menu-parent-desktop > .dropdown-menu {
    display: block;
  }

  .site-header .menu-level2 {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .site-header .menu-level2 .list {
    margin: 0;
  }

  .site-header .menu-level2 .link {
    display: block;
    line-height: 1.35;
    text-decoration: none;
    white-space: normal;
  }

  .site-header > .container {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .site-header .white-circle {
    flex: 0 0 190px;
    width: 190px;
    max-width: 190px;
    position: relative;
    z-index: 2;
  }

  .site-header .header-right {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .site-header .second-navigation {
    justify-content: flex-end;
  }

  .site-header .main-navigation {
    align-items: flex-end;
    gap: 0.75rem;
  }

  .site-header .header-menu {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0.25rem;
  }

  .site-header .main-nav {
    width: 100%;
  }

  .site-header .navigation.list-group {
    justify-content: flex-start;
    gap: 1.35rem;
  }
}



/* ====== v4 : compléments (accordeons natifs, icone telechargement) ====== */
.pepite-accordion {
  margin: 20px 0;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  background: #fff;
}
.pepite-accordion summary {
  cursor: pointer;
  padding: 18px 24px;
  font-weight: 600;
  font-size: 1.1em;
  list-style: none;
  position: relative;
  padding-right: 48px;
}
.pepite-accordion summary::-webkit-details-marker { display: none; }
.pepite-accordion summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}
.pepite-accordion[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.pepite-accordion .pepite-accordion-body { padding: 0 24px 18px; }

/* icone telechargement (remplace Font Awesome Pro, non distribuable) */
.media-left .fa-arrow-down-to-line { display: inline-block; width: 24px; height: 24px; }
.media-left .fa-arrow-down-to-line::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-color: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 3h2v10.17l3.59-3.58L18 11l-6 6-6-6 1.41-1.41L11 13.17V3zM5 19h14v2H5v-2z"/></svg>') no-repeat center / contain;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 3h2v10.17l3.59-3.58L18 11l-6 6-6-6 1.41-1.41L11 13.17V3zM5 19h14v2H5v-2z"/></svg>') no-repeat center / contain;
}

/* labels du menu principal : retour a la ligne naturel sur desktop */
.site-header .navigation > .list-parent > .menu-parent-desktop > .link.d-none.d-lg-flex {
  text-wrap: balance;
}

/* Le CSS d'origine force top:18px !important sur .header-menu .dropdown-menu
   (calibre pour l'ancienne structure) : le panneau recouvrait son libelle et
   debordait sur les titres. On le replace sous le libelle du menu. */
.site-header .header-menu .navigation > .list-parent > .menu-parent-desktop > .dropdown-menu {
  top: 100% !important;
}

/* Listings de sous-pages (equipe, referents, portraits, annuaire...) :
   grille uniforme. Neutralise la mosaique "actus de l'accueil" du CSS
   d'origine (grid-area sur :first-child / :nth-child) que ces listings
   heritaient via la classe home-news-list. */
.pepite-child-grid.home-news-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.pepite-child-grid.home-news-list .card-group-element-item:nth-child(n) {
  grid-area: auto;
  width: auto;
  margin: 0;
}

.pepite-child-grid .pepite-child-card,
.pepite-child-grid .pepite-child-card .item,
.pepite-child-grid .pepite-child-card .home-news-link,
.pepite-child-grid .pepite-child-card .card {
  height: 100%;
}

@media (max-width: 991px) {
  .pepite-child-grid.home-news-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .pepite-child-grid.home-news-list {
    grid-template-columns: 1fr;
  }
}

/* Cartes OpenStreetMap des fiches (annuaire, referents, equipe) */
.pepite-map {
  margin: 1.5rem 0 0;
}
.pepite-map iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
}
.pepite-map-link {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}

/* Interieur des cartes de listing : champs structures + resume borne */
.pepite-card-fields {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.pepite-card-fields .field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 0.1rem;
}
.pepite-card-fields .field-value {
  display: block;
  color: #1f2937;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.pepite-child-card .card-txt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.pepite-child-card .home-news-title {
  margin-bottom: 0.25rem;
}

/* Portraits sans photo (vignettes jamais archivees) : pastille a initiale */
.pepite-child-grid--portraits .card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 516 / 335;
  background: linear-gradient(135deg, #eaf6fb 0%, #cfeaf6 55%, #b5def0 100%);
}
.pepite-child-grid--portraits .card-img-placeholder span {
  font-size: 4rem;
  font-weight: 700;
  color: #123c63;
  opacity: 0.55;
}

/* Logos dans les cartes de listing : affiches entiers, jamais recadres */
.pepite-child-card .card-img-top {
  aspect-ratio: 516 / 335;
  overflow: hidden;
  background: #f6f8fb;
}
.pepite-child-card .card-img-top .home-news-figure,
.pepite-child-card .card-img-top .picture {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}
.pepite-child-card .card-img-top img.object-fit {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pepite-child-card .card-img-logo {
  background: #fff;
  padding: 1.4rem;
  border-bottom: 1px solid #eef1f5;
}
.pepite-child-grid .pepite-child-card .card-img-logo img.object-fit {
  object-fit: contain !important;
}
