/* ============================================================
   PAGE AMBASSADEURS
   Chargée uniquement sur le gabarit « Page — Ambassadeurs ».
   Utilise les jetons de design du thème (style.css) : le mode
   sombre et les thèmes alternatifs suivent automatiquement.
   ============================================================ */

.afc-amb-page {
  background: var(--afc-bg);
  padding-bottom: 80px;
}

/* Le JS masque via l'attribut `hidden` : il doit l'emporter sur
   les `display:flex|grid` des cartes, de la grille et du compteur. */
.afc-amb-page [hidden] { display: none !important; }

/* ── En-tête autonome ──────────────────────────────────────── */
.afc-ambheader {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 253, 250, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--afc-border);
}

.afc-ambheader__inner {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  min-height: 72px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.afc-ambheader__logo { flex: none; display: inline-flex; align-items: center; }
.afc-ambheader__logo img { max-height: 40px; width: auto; }
.afc-ambheader__logo .afc-logo--dark { display: none; }

.afc-ambheader__nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.afc-ambheader__nav::-webkit-scrollbar { display: none; }

.afc-ambheader__menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 26px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.afc-ambheader__menu li { flex: none; }

.afc-ambheader__menu a {
  display: block;
  padding: 6px 2px;
  color: var(--afc-text-2);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.afc-ambheader__menu a:hover { color: var(--afc-accent); }

.afc-ambheader__menu .current-menu-item > a,
.afc-ambheader__menu .current_page_item > a {
  color: var(--afc-accent);
  border-bottom-color: var(--afc-accent);
}

.afc-ambheader__action { flex: none; }

/* Bascule mobile — masquée en desktop */
.afc-ambheader__burger {
  display: none;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--afc-border-2);
  border-radius: 10px;
  background: var(--afc-surface);
  cursor: pointer;
  transition: border-color .15s;
}
.afc-ambheader__burger:hover { border-color: var(--afc-accent); }
.afc-ambheader__burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--afc-text);
  transition: transform .2s, opacity .15s;
}
.afc-ambheader__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.afc-ambheader__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.afc-ambheader__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* La barre de navigation mobile du site pilotait le tiroir, absent ici. */
.afc-amb-body .afc-bottom-nav { display: none; }

/* ── En-tête mobile : le menu devient un panneau déroulant ── */
@media (max-width: 860px) {
  .afc-ambheader__inner {
    min-height: 0;
    gap: 12px;
    position: relative;
  }
  .afc-ambheader__logo { margin-right: auto; }
  .afc-ambheader__logo img { max-height: 32px; }
  .afc-ambheader__burger { display: flex; }

  .afc-ambheader__nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    z-index: 30;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    background: var(--afc-surface);
    border: 1px solid var(--afc-border-card);
    border-radius: var(--afc-r-lg);
    box-shadow: var(--afc-shadow-lg);
    transition: max-height .25s ease, opacity .18s ease, visibility .18s;
  }
  .afc-ambheader__nav.is-open {
    max-height: 70vh;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
  }

  .afc-ambheader__menu {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 6px;
  }
  .afc-ambheader__menu li + li { border-top: 1px solid var(--afc-divider); }
  .afc-ambheader__menu a {
    padding: 14px 14px;
    font-size: 15px;
    border-bottom: 0;
    border-radius: var(--afc-r-sm);
  }
  .afc-ambheader__menu .current-menu-item > a,
  .afc-ambheader__menu .current_page_item > a { background: var(--afc-accent-soft); }
}

/* Écrans étroits : le bouton d'action passe sous la barre, pleine largeur */
@media (max-width: 480px) {
  .afc-ambheader__inner { flex-wrap: wrap; row-gap: 10px; }
  .afc-ambheader__action { order: 3; flex-basis: 100%; }
  .afc-ambheader__action .afc-btn-cta,
  .afc-ambheader__action .afc-btn-alert {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
  .afc-ambheader__nav { top: 100%; }
}

/* ── Bouton d'action de l'en-tête (remplace « Recevoir des alertes ») ── */
.afc-btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: #fff;
}
.afc-btn-cta svg { flex: none; }
.afc-btn-cta--drawer {
  width: 100%;
  justify-content: center;
  padding: 14px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 700;
}

/* ── En-tête ───────────────────────────────────────────────── */
.afc-amb-hero {
  text-align: center;
  padding: clamp(40px, 7vw, 80px) 0 clamp(28px, 4vw, 44px);
}

.afc-amb-hero__badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: var(--afc-pill);
  background: var(--afc-accent-soft);
  color: var(--afc-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.afc-amb-hero__title {
  margin: 18px 0 0;
  font-family: var(--afc-font-head);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--afc-text);
}
.afc-amb-hero__title span { color: var(--afc-accent); }

.afc-amb-hero__intro {
  max-width: 620px;
  margin: 16px auto 0;
  color: var(--afc-text-muted);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.6;
}

/* ── Barre de filtres ──────────────────────────────────────── */
.afc-amb-filters {
  background: var(--afc-surface);
  border: 1px solid var(--afc-border-card);
  border-radius: var(--afc-r-xl);
  box-shadow: var(--afc-shadow-md);
  padding: 18px;
}

.afc-amb-filters__row {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: 14px;
}

.afc-amb-search,
.afc-amb-select {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--afc-input-bg);
  border: 1px solid var(--afc-border-input);
  border-radius: var(--afc-r-md);
  color: var(--afc-text-faint);
  transition: border-color .15s, box-shadow .15s;
}
.afc-amb-search:focus-within,
.afc-amb-select:focus-within {
  border-color: var(--afc-accent);
  box-shadow: 0 0 0 3px var(--afc-accent-soft);
}

.afc-amb-search input,
.afc-amb-select select {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--afc-text);
  appearance: none;
  -webkit-appearance: none;
}
.afc-amb-search input:focus,
.afc-amb-select select:focus { outline: none; }
.afc-amb-search input::placeholder { color: var(--afc-text-faint); }
.afc-amb-search input::-webkit-search-cancel-button { cursor: pointer; }

.afc-amb-select select { cursor: pointer; padding-right: 20px; }
.afc-amb-select__chev { position: absolute; right: 14px; pointer-events: none; }

/* ── Puces de domaines ─────────────────────────────────────── */
.afc-amb-chips-wrap { margin: 26px 0 6px; }

.afc-amb-chips__label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--afc-text-label);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.afc-amb-chips { display: flex; flex-wrap: wrap; gap: 9px; }

.afc-amb-chip {
  padding: 9px 17px;
  border: 1px solid var(--afc-border-2);
  border-radius: var(--afc-pill);
  background: var(--afc-surface);
  color: var(--afc-text-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.afc-amb-chip:hover { border-color: var(--afc-accent); color: var(--afc-accent); }
.afc-amb-chip.is-active {
  background: var(--afc-accent);
  border-color: var(--afc-accent);
  color: #fff;
}

.afc-amb-count {
  margin: 22px 0 16px;
  color: var(--afc-text-soft);
  font-size: 13.5px;
  font-weight: 600;
}

/* ── Grille ────────────────────────────────────────────────── */
.afc-amb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.afc-amb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 22px 18px;
  background: var(--afc-surface);
  border: 1px solid var(--afc-border-card);
  border-radius: var(--afc-r-lg);
  box-shadow: var(--afc-shadow-sm);
  text-align: center;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  animation: afcFadeIn .3s ease both;
}
.afc-amb-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--afc-shadow-lg);
  border-color: var(--afc-border-2);
}
.afc-amb-card--vedette { border-color: var(--afc-accent); }

.afc-amb-card__star {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--afc-accent);
  font-size: 15px;
  line-height: 1;
}

.afc-amb-card__photo {
  width: 96px;
  height: 96px;
  margin: 0 auto 15px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--afc-accent-soft);
  border: 3px solid var(--afc-surface);
  box-shadow: 0 0 0 1px var(--afc-border-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.afc-amb-card__photo img { width: 100%; height: 100%; object-fit: cover; }

.afc-amb-card__initiales {
  font-family: var(--afc-font-head);
  font-weight: 800;
  font-size: 30px;
  color: var(--afc-accent);
}

.afc-amb-card__nom {
  margin: 0;
  font-family: var(--afc-font-head);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  color: var(--afc-text);
}

.afc-amb-card__fonction {
  margin: 5px 0 0;
  color: var(--afc-accent);
  font-size: 13.5px;
  font-weight: 600;
}
.afc-amb-card__orga { color: var(--afc-text-soft); font-weight: 500; }

.afc-amb-card__lieu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--afc-text-muted);
  font-size: 13px;
}
.afc-amb-card__flag { font-size: 15px; line-height: 1; }

.afc-amb-card__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 13px;
}

.afc-amb-tag {
  padding: 4px 11px;
  border-radius: var(--afc-pill);
  background: var(--afc-bg-alt);
  color: var(--afc-text-2);
  font-size: 11.5px;
  font-weight: 600;
}
.afc-amb-tag--plus { background: var(--afc-accent-soft); color: var(--afc-accent); }

.afc-amb-card__bio {
  margin: 14px 0 0;
  color: var(--afc-text-muted);
  font-size: 13.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.afc-amb-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}
.afc-amb-card__footer:not(:only-child) { margin-top: 16px; }

.afc-amb-card__socials { display: flex; gap: 6px; }

.afc-amb-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--afc-bg-alt);
  color: var(--afc-text-muted);
  transition: background .15s, color .15s;
}
.afc-amb-social:hover { background: var(--afc-accent); color: #fff; }

.afc-amb-card__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--afc-r-sm);
  background: none;
  color: var(--afc-accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.afc-amb-card__more:hover { background: var(--afc-accent-soft); }

/* ── État vide ─────────────────────────────────────────────── */
.afc-amb-empty {
  padding: clamp(48px, 8vw, 90px) 24px;
  border: 2px dashed var(--afc-border-2);
  border-radius: var(--afc-r-xl);
  text-align: center;
}

.afc-amb-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--afc-bg-alt);
  color: var(--afc-text-soft);
  font-size: 30px;
}

.afc-amb-empty h2 {
  margin: 0 0 8px;
  font-family: var(--afc-font-head);
  font-weight: 700;
  font-size: clamp(19px, 2.5vw, 24px);
  color: var(--afc-text);
}

.afc-amb-empty p {
  max-width: 380px;
  margin: 0 auto;
  color: var(--afc-text-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.afc-amb-reset {
  display: inline-block;
  margin-top: 20px;
  padding: 11px 22px;
  border: 0;
  border-radius: var(--afc-r-md);
  background: var(--afc-accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.afc-amb-reset:hover { opacity: .88; }

/* ── Modale profil ─────────────────────────────────────────── */
.afc-amb-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.afc-amb-modal[hidden] { display: none; }

.afc-amb-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.afc-amb-modal__box {
  position: relative;
  width: min(640px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  padding: 34px clamp(22px, 4vw, 38px);
  background: var(--afc-surface);
  border-radius: var(--afc-r-xl);
  box-shadow: var(--afc-shadow-pop);
  animation: afcFadeIn .2s ease both;
}

.afc-amb-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--afc-bg-alt);
  color: var(--afc-text-2);
  cursor: pointer;
  transition: background .15s;
}
.afc-amb-modal__close:hover { background: var(--afc-accent); color: #fff; }

.afc-amb-modal__title {
  margin: 0 0 16px;
  padding-right: 40px;
  font-family: var(--afc-font-head);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--afc-text);
}

.afc-amb-modal__body {
  color: var(--afc-text-2);
  font-size: 15px;
  line-height: 1.7;
}
.afc-amb-modal__body p  { margin: 0 0 14px; }
.afc-amb-modal__body a  { color: var(--afc-accent); text-decoration: underline; }
.afc-amb-modal__body ul,
.afc-amb-modal__body ol { margin: 0 0 14px 20px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .afc-amb-filters__row { grid-template-columns: 1fr; }
  .afc-amb-grid { grid-template-columns: 1fr; }
  .afc-amb-chips { gap: 7px; }
  .afc-amb-chip { font-size: 12.5px; padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .afc-amb-card,
  .afc-amb-modal__box { animation: none; transition: none; }
  .afc-amb-card:hover { transform: none; }
}
