/* =========================================================
   Amicale des directeurs des douanes — refonte légère
   Palette & typographie fidèles au site d'origine (Divi)
   ========================================================= */

:root {
  --brand:        #363794;   /* indigo de marque */
  --brand-dark:   #2a2b73;
  --accent:       #2ea3f2;   /* bleu liens */
  --text:         #111111;
  --muted:        #555555;
  --line:         #e6e6e9;
  --white:        #ffffff;
  --bg-soft:      #f6f7fb;
  --maxw:         1100px;
  --font-body:    'Open Sans', Helvetica, Arial, Lucida, sans-serif;
  --font-head:    'Poppins', Helvetica, Arial, Lucida, sans-serif;
}

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; color: var(--brand); }
p { margin: 0 0 1rem; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.header-inner {
  width: 93%;
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 1rem;
  transition: padding .25s ease;
}
/* Logo : grand quand on est tout en haut, plus compact dès qu'on défile. */
.brand img {
  height: 88px;
  width: auto;
  transition: height .25s ease;
}
.site-header.scrolled .header-inner { padding: 7px 0; }
.site-header.scrolled .brand img { height: 52px; }

/* ---------- Navigation ---------- */
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; align-items: center; gap: .2rem; }
.main-nav li { position: relative; }
.main-nav a,
.main-nav .nav-toggle {
  display: block;
  font-family: var(--font-body);
  font-size: 15px;
  color: #1a1a1a;
  padding: .55rem .85rem;
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
/* premier niveau : pastille arrondie au survol */
.main-nav > ul > li > a,
.main-nav > ul > li > .nav-toggle {
  border-radius: 9px;
  transition: color .2s ease, background-color .2s ease;
}
.main-nav > ul > li > a:not(.btn-login):hover,
.main-nav > ul > li > .nav-toggle:hover,
.main-nav > ul > li.has-sub:focus-within > .nav-toggle { color: var(--brand); background: var(--bg-soft); }
.main-nav a:hover,
.main-nav .nav-toggle:hover { color: var(--brand); text-decoration: none; }
.main-nav .current > a,
.main-nav > ul > li.current > .nav-toggle { color: var(--brand); font-weight: 600; }

/* flèche du parent : pivote quand le sous-menu est ouvert */
.has-sub > .nav-toggle::after {
  content: "";
  display: inline-block;
  margin-left: .4em;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}

/* ----- Sous-menus modernisés (carte flottante) ----- */
.sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 248px;
  background: var(--white);
  border: 1px solid rgba(54,55,148,.10);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(20,20,60,.16), 0 2px 8px rgba(20,20,60,.06);
  padding: .5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.97);
  transform-origin: top center;
  transition: opacity .2s ease, transform .2s cubic-bezier(.2,.7,.3,1), visibility .2s;
}
/* petite flèche de liaison vers le parent */
.sub-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 26px;
  width: 12px;
  height: 12px;
  background: var(--white);
  border-left: 1px solid rgba(54,55,148,.10);
  border-top: 1px solid rgba(54,55,148,.10);
  transform: rotate(45deg);
  border-radius: 3px 0 0 0;
}
/* pont invisible : garde le survol entre le parent et la carte */
.sub-menu::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.has-sub:hover > .sub-menu,
.has-sub:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.sub-menu a {
  position: relative;
  font-size: 14.5px;
  margin: 1px 0;
  padding: .6rem .9rem .6rem 1.1rem;
  border-radius: 9px;
  color: #1a1a1a;
  transition: color .18s ease, background-color .18s ease, transform .18s ease;
}
/* barre d'accent qui se déploie au survol */
.sub-menu a::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 3px;
  height: 58%;
  background: var(--brand);
  border-radius: 3px;
  transform: translateY(-50%) scaleY(0);
  transition: transform .18s ease;
}
.sub-menu a:hover {
  background: var(--bg-soft);
  color: var(--brand);
  transform: translateX(3px);
}
.sub-menu a:hover::before { transform: translateY(-50%) scaleY(1); }

/* Rubriques réservées aux membres : cadenas + grisé */
.lock-ic {
  width: 13px;
  height: 13px;
  margin-right: 6px;
  vertical-align: -2px;
  fill: currentColor;
  opacity: .9;
  flex: none;
}
.main-nav .locked > a { color: #9aa0ad; }
.main-nav .locked > a:hover { color: var(--brand); }
.main-nav .locked > a:hover .lock-ic { opacity: 1; }
.main-nav .locked > a:hover::before { background: #b9bcc7; }   /* barre d'accent discrète pour ces entrées */

/* États dynamiques (injectés par auth.js quand on est connecté) */
.main-nav a.is-unlocked { color: inherit; }            /* consultable : plus grisé, cadenas ouvert */
.main-nav a.is-unlocked .open-ic { fill: #0f6e45; opacity: .85; }
.main-nav a.is-editable { color: inherit; }            /* modifiable : crayon couleur marque */
.main-nav a.is-editable .edit-ic { fill: var(--brand); opacity: 1; }
.main-nav a.is-editable:hover .edit-ic { opacity: 1; }

/* sous-sous-menu : déroulé sur le côté */
.sub-menu .has-sub > .sub-menu { top: -.5rem; left: calc(100% + 8px); }
.sub-menu .has-sub > .sub-menu::before { top: 18px; left: -6px; border-radius: 0 0 0 3px; }
.sub-menu .has-sub > .sub-menu::after { top: 0; left: -12px; right: auto; width: 12px; height: 100%; }
.sub-menu .has-sub > .nav-toggle::after { transform: translateY(1px) rotate(-90deg); }
.sub-menu .has-sub:hover > .nav-toggle::after { transform: translateY(1px) rotate(-90deg); }

.btn-login {
  margin-left: .4rem;
  border: 1px solid var(--brand) !important;
  border-radius: 100px;
  color: var(--brand) !important;
  font-weight: 600;
  padding: .45rem 1.1rem !important;
}
.btn-login:hover { background: var(--brand) !important; color: #fff !important; }

/* burger */
.nav-burger {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .4rem;
}
.nav-burger span {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px 0;
  background: var(--brand);
  border-radius: 3px;
  transition: transform .25s, opacity .25s;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 100px;
  padding: .7rem 1.6rem;
  background: transparent;
  cursor: pointer;
  transition: all .3s ease;
}
.btn:hover { background: var(--brand); color: #fff; text-decoration: none; }
.btn-solid { background: var(--brand); color: #fff; }
.btn-solid:hover { background: var(--brand-dark); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  text-align: center;
  padding: 235px 0;
  background-image:
    linear-gradient(180deg, rgba(0,0,0,.63) 0%, rgba(0,0,0,.18) 100%),
    url("../img/hero.webp");
  background-size: cover;
  background-position: center;
}
.hero-inner { width: 90%; max-width: 900px; margin: 0 auto; }
.hero h1 {
  font-size: 52px;
  color: #fff;
  margin: 0 0 1rem;
}
.hero p { font-size: 20px; margin: 0; }

/* bandeau de page intérieure */
.page-hero {
  background: var(--brand);
  color: #fff;
  text-align: center;
  padding: 64px 0 56px;
}
.page-hero h1 { color: #fff; font-size: 38px; margin: 0; }
.page-hero p { margin: .8rem 0 0; opacity: .9; }

/* ---------- Sections / contenu ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-soft); }
.container { width: 90%; max-width: var(--maxw); margin: 0 auto; }
.container-narrow { width: 90%; max-width: 820px; margin: 0 auto; }

.section h2 { font-size: 30px; text-align: center; margin: 0 0 .4rem; }
.divider {
  width: 34%;
  max-width: 220px;
  height: 0;
  border-top: 3px solid var(--brand);
  margin: 1rem auto 2.2rem;
}

.prose { font-size: 16px; line-height: 1.7; color: var(--text); }
.prose h2 { text-align: left; font-size: 26px; margin: 2.2rem 0 .6rem; }
.prose h3 { font-size: 19px; color: var(--brand); margin: 1.8rem 0 .5rem; }
.prose p { margin: 0 0 1.1rem; }
.prose ul { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.prose li { margin: .3rem 0; }
.prose .article-title {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--brand);
  font-size: 20px;
  margin: 2rem 0 .4rem;
}
.lead { font-size: 18px; color: var(--muted); }

/* listes de personnes (CA, bureau, délégués) */
.people {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .5rem 1.5rem;
}
.people li {
  padding: .55rem .2rem;
  border-bottom: 1px solid var(--line);
}
.people li strong { color: var(--brand); }
.people li span { color: var(--muted); }

/* encart info */
.callout {
  background: var(--bg-soft);
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  margin: 1.6rem 0;
}
.callout :last-child { margin-bottom: 0; }

/* bloc adresse */
.address {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.3rem 1.5rem;
  margin: 1.4rem 0;
}

/* ---------- Cartes (accueil) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
  margin-top: 2rem;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(54,55,148,.10); }
.card h3 { margin: 0 0 .5rem; font-size: 18px; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- Formulaires ---------- */
.form { max-width: 640px; margin: 1.5rem auto 0; }
.form-row { margin-bottom: 1.1rem; }
.form label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: 15px; }
.form .req { color: #c0392b; }
.form input,
.form select,
.form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: .7rem .85rem;
  border: 1px solid #cfd2dc;
  border-radius: 6px;
  background: #fff;
}
.form input:focus,
.form select:focus,
.form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(54,55,148,.12); }
.form textarea { min-height: 150px; resize: vertical; }
.form .choice { display: flex; align-items: flex-start; gap: .6rem; font-weight: 400; }
.form .choice input { width: auto; margin-top: .25rem; }
.form .hint { font-size: 13.5px; color: var(--muted); margin-top: .25rem; }
.form-actions { margin-top: 1.5rem; text-align: center; }

/* champ honeypot anti-spam : invisible, hors flux, non focalisable visuellement */
.hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* liens connexion/inscription reconstruits par JS (anti-bots) */
a.obf { cursor: pointer; }

/* ---------- Messages de formulaire (connexion, compte) ---------- */
.form-message {
  font-size: 14.5px;
  padding: .7rem .9rem;
  border-radius: 8px;
  margin: 0 0 .2rem;
}
.form-message.is-error { background: #fcebec; color: #a32d2d; border: 1px solid #f0c2c5; }
.form-message.is-ok    { background: #e7f6ee; color: #0f6e45; border: 1px solid #bfe6d0; }

/* ---------- Visionneuse de documents (PDF/images) ---------- */
body.dv-open { overflow: hidden; }
.doc-viewer { position: fixed; inset: 0; z-index: 1300; display: flex; }
.doc-viewer[hidden] { display: none; }
.dv-overlay { position: fixed; inset: 0; background: rgba(15,16,40,.7); }
.dv-dialog {
  position: relative; z-index: 1; margin: auto; width: min(960px, 96vw); height: min(90vh, 100%);
  display: flex; flex-direction: column; background: #1f2230; border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,.5);
}
.dv-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; background: #20223a; }
.dv-title { color: #fff; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-actions { display: flex; align-items: center; gap: .6rem; flex: none; }
.dv-dl { padding: .45rem 1rem; font-size: 14px; white-space: nowrap; }
.dv-close { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: .1rem .4rem; border-radius: 8px; }
.dv-close:hover { background: rgba(255,255,255,.15); }
.dv-body { flex: 1; background: #525659; }
.dv-frame { width: 100%; height: 100%; border: 0; display: block; }
.dv-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: #20223a; font-size: 26px; line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.dv-nav:hover { background: #fff; }
.dv-prev { left: 14px; }
.dv-next { right: 14px; }
.dv-count { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 2;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12.5px; padding: .25rem .7rem; border-radius: 20px; }
@media (max-width: 600px) { .dv-dl { padding: .45rem .7rem; } .dv-dl span { display: none; } }

/* ---------- Barre d'aperçu de rôle (admin) ---------- */
.view-as-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 1200;
  display: flex; align-items: center; gap: .25rem;
  background: #1f2230; color: #fff; padding: .4rem .5rem; border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0,0,0,.32); font-size: 14px; max-width: calc(100% - 1.5rem);
}
.view-as-bar .va-label { opacity: .85; padding: 0 .4rem; white-space: nowrap; }
.va-btn {
  border: 0; cursor: pointer; padding: .42rem .9rem; border-radius: 999px;
  background: transparent; color: #fff; font-weight: 600; font-family: inherit; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.va-btn:hover { background: rgba(255,255,255,.16); }
.va-btn.is-active { background: #fff; color: #1f2230; }
.va-btn:disabled { opacity: .55; cursor: default; }

/* ---------- Modale « Mon compte » (pop-up) ---------- */
.btn-login.is-logged { cursor: pointer; }
body.acct-open { overflow: hidden; }

.acct-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 1rem;
}
.acct-modal[hidden] { display: none; }
.acct-overlay { position: fixed; inset: 0; background: rgba(15,16,40,.55); }
.acct-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 460px;
  background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.28);
  padding: 1.8rem 1.7rem 1.6rem; max-height: 90vh; overflow-y: auto;
}
.acct-close {
  position: absolute; top: .6rem; right: .8rem;
  background: none; border: 0; font-size: 28px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: .1rem .4rem; border-radius: 8px;
}
.acct-close:hover { color: var(--brand); background: var(--bg-soft); }
.acct-dialog h2 { font-size: 22px; margin: 0 0 .2rem; text-align: left; }
.acct-email { color: var(--muted); font-size: 14.5px; margin: 0 0 1rem; word-break: break-all; }
.acct-role { margin: 0 0 1rem; }
.acct-role-line { margin: 0 0 .3rem; }
.acct-role-cap { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.acct-role-dates {
  margin: .55rem 0 0; padding: .5rem .7rem; font-size: 13.5px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
}
.acct-h3 { font-size: 16px; margin: 0 0 .8rem; }
.acct-warn {
  background: #fff6e6; border: 1px solid #f3d79b; color: #8a5a00;
  border-radius: 8px; padding: .7rem .9rem; font-size: 14px; margin-bottom: 1rem;
}
.acct-dialog .form { max-width: none; margin: 0; }
.acct-dialog .form-actions { text-align: left; margin-top: 1.1rem; }
.acct-foot {
  display: flex; gap: .6rem; flex-wrap: wrap;
  margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
}
.acct-foot .btn { flex: 1; text-align: center; min-width: 140px; }

/* ---------- Tableau de bord « Mon compte » ---------- */
.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.account-email { font-size: 18px; font-weight: 600; color: var(--brand); margin: 0; }
.account-role  { font-size: 14.5px; color: var(--muted); margin: .2rem 0 0; }

/* ---------- Accès membres (gate) ---------- */
.member-gate {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3rem 2rem;
}
.member-gate .lock { font-size: 42px; line-height: 1; margin-bottom: .8rem; }
.member-gate h2 { text-align: center; }
.member-gate .actions { margin-top: 1.6rem; display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Édition en ligne (membres autorisés) ---------- */
.member-flash {
  padding: .8rem 1rem; border-radius: 8px; margin: 0 0 1.4rem; font-size: 15px;
}
.member-flash.is-ok    { background: #e7f6ee; color: #0f6e45; border: 1px solid #bfe6d0; }
.member-flash.is-error { background: #fcebec; color: #a32d2d; border: 1px solid #f0c2c5; }

.member-edit-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem 1.1rem; margin-bottom: 1.4rem;
}
.member-edit-note { margin: 0; font-weight: 600; color: var(--brand); }

/* ---- Grille de cartes des publications ---- */
.pub-area { max-width: 1160px; }
.pub-intro { text-align: center; color: var(--muted); margin: 0 auto 2.2rem; max-width: 640px; font-size: 15.5px; }
.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
  align-items: start;   /* chaque carte épouse son contenu (pas d'étirement) */
}
.pub {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 1.5rem 1.4rem;
  box-shadow: 0 6px 18px rgba(20,22,60,.05);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.pub:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(54,55,148,.14); border-color: #d8daee; }
.pub::before {
  content: ""; display: block; width: 40px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), #2ea3f2); margin: 0 0 1rem;
}
.pub.is-hidden { opacity: .62; }
/* contenu de la carte : espacement vertical régulier titre / date / texte / bouton */
.pub-view { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; }
.pub .pub-title { align-self: stretch; font-size: 18px; text-align: left; line-height: 1.3; margin: 0; color: #20223a; }
.pub-date {
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--brand); background: #eef0fb; border-radius: 20px; padding: .2rem .75rem;
  margin: 0; text-transform: capitalize;
}
.pub-body { align-self: stretch; color: #4a4d5e; font-size: 14.5px; line-height: 1.6; margin: 0; }
.pub-flag {
  display: inline-block; vertical-align: middle; margin-left: .5rem;
  font-size: 12px; font-weight: 600; color: #a32d2d;
  background: #fcebec; border: 1px solid #f0c2c5; border-radius: 20px; padding: .1rem .55rem;
}

/* En édition, la carte garde sa taille (édition discrète, en place). */
.pub.is-editing::before { display: none; }

.pub-tools { display: flex; gap: .45rem; flex-wrap: wrap; align-self: stretch; margin-top: .2rem; padding-top: .85rem; border-top: 1px dashed var(--line); }
.pub-inline { display: inline; margin: 0; }
.pub-tool {
  display: inline-flex; align-items: center; padding: .38rem .8rem; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--brand); border-radius: 8px; background: #fff; color: var(--brand);
  font-family: inherit; transition: background .15s, color .15s;
}
.pub-tool:hover { background: var(--brand); color: #fff; }
.pub-tool.danger { border-color: #c0392b; color: #c0392b; }
.pub-tool.danger:hover { background: #c0392b; color: #fff; }

.pub-edit-form {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 1.2rem 1.3rem; margin: 1rem 0 1.6rem;
}
.pub-edit-form h3 { margin: 0 0 .6rem; font-size: 17px; }
.pub-edit-form label { display: block; font-size: 14px; font-weight: 600; margin: .8rem 0 .3rem; }
.pub-edit-form input, .pub-edit-form textarea {
  width: 100%; font-family: inherit; font-size: 15px; font-weight: 400;
  padding: .55rem .7rem; border: 1px solid #cfd2dc; border-radius: 7px; background: #fff;
}
.pub-edit-form .pub-check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.pub-edit-form .pub-check input { width: auto; }
.pub-edit-actions { margin-top: 1.1rem; display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---- Édition « en place » discrète (comme en direct sur le front) ---- */
.pub-edit { display: none; }
.pub.is-editing .pub-view { display: none; }
.pub.is-editing .pub-edit { display: flex; flex-direction: column; gap: .5rem; }
.pub.is-editing { box-shadow: 0 0 0 2px rgba(54,55,148,.35), 0 16px 38px rgba(54,55,148,.14); }
.pub-edit input, .pub-edit textarea, .pub-edit select { font-family: inherit; box-sizing: border-box; max-width: 100%; }

/* Champs « texte » : ressemblent au contenu, juste une légère trame pointillée. */
.pub-edit .edit-title, .pub-edit .edit-body {
  width: 100%; color: inherit; background: #f5f6fd;
  border: 1px dashed #c4c8e6; border-radius: 8px; padding: .3rem .5rem;
}
.pub-edit .edit-title { font-size: 17.5px; font-weight: 600; color: #20223a; line-height: 1.35; }
.pub-edit .edit-body { font-size: 14.5px; line-height: 1.55; min-height: 60px; resize: vertical; }
.pub-edit .edit-title:focus, .pub-edit .edit-body:focus, .pub-edit .edit-date:focus,
.pub-edit .edit-docselect:focus, .pub-edit .edit-link:focus {
  outline: none; background: #fff; border-style: solid; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(54,55,148,.12);
}
/* le texte du bouton garde son fond indigo (texte blanc lisible) même au focus */
.pub-edit .edit-doclabel:focus {
  outline: none; border-style: solid; border-color: #fff;
  box-shadow: 0 0 0 3px rgba(54,55,148,.30);
}

/* Date : petite pastille éditable, comme à l'affichage. */
.pub-edit .edit-date {
  align-self: flex-start; width: auto; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--brand); background: #eef0fb; border: 1px dashed #c4c8e6; border-radius: 20px; padding: .2rem .7rem;
}

/* Bouton document : on édite directement son texte (input qui ressemble au bouton). */
.pub-edit .edit-doclabel {
  align-self: flex-start; width: auto; min-width: 190px; font-weight: 600; font-size: 14px;
  color: #fff; background: var(--brand); border: 1px dashed rgba(255,255,255,.55);
  border-radius: 999px; padding: .5rem 1rem;
}
.pub-edit .edit-doclabel::placeholder { color: rgba(255,255,255,.85); }

/* Contrôles secondaires : discrets, sur une ligne sous le contenu. */
.pub-edit .edit-extra {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 12.5px; color: var(--muted);
  border-top: 1px dashed var(--line); margin-top: .15rem; padding-top: .5rem;
}
.pub-edit .edit-docselect { width: auto; max-width: 175px; font-size: 12.5px; padding: .3rem .5rem; border: 1px solid #cfd2dc; border-radius: 7px; background: #fff; }
.pub-edit .edit-link { flex: 1 1 150px; font-size: 12.5px; padding: .35rem .5rem; border: 1px solid #cfd2dc; border-radius: 7px; background: #fff; color: inherit; }
.pub-edit .edit-file {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--brand);
  background: #fff; border: 1px solid var(--brand); border-radius: 999px; padding: .35rem .85rem;
  transition: background .15s, color .15s;
}
.pub-edit .edit-file:hover { background: var(--brand); color: #fff; }
.pub-edit .edit-file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.pub-edit .edit-file-name { font-weight: 400; font-style: italic; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-edit .pub-check { display: inline-flex; align-items: center; gap: .3rem; }
.pub-edit .pub-check input { width: auto; }
.pub-edit-actions { margin-top: .35rem; display: flex; gap: .5rem; }
.pub-edit-actions .btn { padding: .4rem 1.05rem; }

/* le calendrier s'ouvre au clic partout dans le champ date */
input[type="date"] { cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }
.pub-edit-form .pub-hint { font-size: 13px; color: var(--muted); margin: .3rem 0 0; }
.pub-docs { display: flex; flex-direction: column; gap: .5rem; margin: 0; align-self: stretch; }
.pub-docs .btn { width: 100%; text-align: center; }
.pub-docs .btn-solid svg, .pub-docs .btn svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: .4rem; fill: currentColor; }

/* ---- Barre d'édition : réglage de la mise en page (colonnes) ---- */
.member-edit-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page-layout-form { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.page-layout-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.page-layout-opt {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
  border: 1px solid var(--brand); border-radius: 8px; background: #fff; color: var(--brand);
  transition: background .15s, color .15s;
}
.page-layout-opt:hover { background: #eef0fb; }
.page-layout-opt.is-active { background: var(--brand); color: #fff; }
.pub-opt { font-weight: 400; color: var(--muted); font-size: 12.5px; }

/* ---- Nombre de colonnes de la grille de publications ---- */
.pub-grid--cols-1 { grid-template-columns: minmax(0, 640px); justify-content: center; }
.pub-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pub-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .pub-grid--cols-2, .pub-grid--cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (max-width: 600px) {
  .pub-grid--cols-1, .pub-grid--cols-2, .pub-grid--cols-3 { grid-template-columns: 1fr; }
}
.pub--no-title .pub-view { gap: .7rem; }

/* ---- Rendu du contenu enrichi des publications ---- */
.pub-body p { margin: 0 0 .6rem; }
.pub-body p:last-child { margin-bottom: 0; }
.pub-body ul, .pub-body ol { margin: .4rem 0 .4rem 1.2rem; padding: 0; }
.pub-body li { margin: .2rem 0; }
.pub-body a { color: var(--brand); text-decoration: underline; }

/* ---- Éditeur enrichi (barre d'outils + zone éditable) ---- */
.rich { display: flex; flex-direction: column; gap: .35rem; }
.rich-bar { display: flex; flex-wrap: wrap; gap: .25rem; }
.rich-btn {
  min-width: 30px; height: 30px; padding: 0 .45rem; cursor: pointer; font-family: inherit;
  font-size: 14px; line-height: 1; color: var(--brand); background: #fff;
  border: 1px solid #cfd2dc; border-radius: 7px;
  transition: background .15s, color .15s, border-color .15s;
}
.rich-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.rich-btn.is-b { font-weight: 800; }
.rich-btn.is-i { font-style: italic; }
.rich-btn.is-u { text-decoration: underline; }
.rich-editor {
  min-height: 90px; font-family: inherit; font-size: 14.5px; line-height: 1.6; color: #33364a;
  background: #fff; border: 1px solid #cfd2dc; border-radius: 8px; padding: .55rem .7rem;
}
.rich-editor:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(54,55,148,.12); }
.rich-editor ul, .rich-editor ol { margin: .3rem 0 .3rem 1.2rem; }
.rich-editor a { color: var(--brand); }
.rich-editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
/* Édition « en place » : éditeur compact et discret (trame pointillée). */
.pub-edit .rich-editor { min-height: 60px; background: #f5f6fd; border: 1px dashed #c4c8e6; }
.pub-edit .rich-editor:focus { background: #fff; border-style: solid; border-color: var(--brand); }

/* ---------- Connexion ---------- */
.login-wrap { max-width: 420px; margin: 0 auto; }
.login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.07);
  padding: 2.4rem 2rem;
}
.login-card .brand-mark { text-align: center; margin-bottom: 1.2rem; }
.login-card .brand-mark img { height: 56px; width: auto; margin: 0 auto; }

/* ---------- Pied de page ---------- */
.site-footer {
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  line-height: 1.6;
}
.footer-inner {
  width: 90%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
}
.site-footer a { color: #fff; }
.site-footer h4 { color: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .35rem 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.18);
  text-align: center;
  font-size: 14px;
  padding: 14px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { padding: 120px 0; }
  .hero h1 { font-size: 40px; }
  .brand img { height: 60px; }
  .site-header.scrolled .brand img { height: 46px; }

  .nav-burger { display: block; }
  .main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 86vw);
    background: #fff;
    box-shadow: -8px 0 40px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .28s ease;
    padding: 78px 1rem 2rem;
    overflow-y: auto;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav li { border-bottom: 1px solid var(--line); }
  .main-nav a, .main-nav .nav-toggle { padding: .85rem .4rem; width: 100%; text-align: left; }
  .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--brand);
    border-radius: 0;
    min-width: 0;
    margin: 0 0 .4rem .6rem;
    padding: .1rem 0;
    display: none;
  }
  .sub-menu::before, .sub-menu::after { display: none; }       /* pas de flèche/pont en accordéon */
  .sub-menu a { margin: 0; border-radius: 0; }
  .sub-menu a:hover { transform: none; }
  .has-sub.open > .sub-menu { display: block; }
  .has-sub > .nav-toggle::after { float: right; margin-top: .5em; }
  .btn-login { display: inline-block; margin: .8rem 0 0; }
  body.nav-open { overflow: hidden; }
  .nav-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    opacity: 0; visibility: hidden; transition: opacity .28s; z-index: 90;
  }
  .nav-overlay.show { opacity: 1; visibility: visible; }

  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .hero { padding: 70px 0; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 17px; }
  .page-hero h1 { font-size: 30px; }
  .section { padding: 42px 0; }
  .section h2 { font-size: 25px; }
}
