/* Front styles for APABA Articles Techniques */
@media (max-width: 768px) {
  .apaba-single-wrap {
    display: block !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  .apaba-single-wrap>main {
    margin-bottom: 1.25rem;
  }
}


/* Grid layout inspired by aurabio style */
.apaba-at-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  align-items: start
}

.apaba-at-sidebar {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  position: sticky;
  top: 1rem
}

.apaba-at-sidebar h4 {
  margin: .25rem 0 .5rem;
  font-size: 1rem
}

.apaba-at-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow: auto
}

.apaba-at-filter-list li {
  margin: .25rem 0
}

.apaba-at-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem
}

.apaba-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  background: #fff;
  display: flex;
  flex-direction: column
}

.apaba-card-thumb {
  display: block;
  background: #fafafa
}

.apaba-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #fff;
  display: block
}

.apaba-card-placeholder {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: #6b7280;
  background: #fff
}

.apaba-card-title {
  font-size: 1rem;
  line-height: 1.25;
  padding: .75rem .75rem 0;
  margin: 0
}

.apaba-card-title a {
  text-decoration: none
}

.apaba-card-meta {
  font-size: .8rem;
  color: #6b7280;
  padding: .5rem .75rem .75rem
}

@media (max-width: 768px) {
  .apaba-at-container {
    grid-template-columns: 1fr
  }

  .apaba-at-sidebar {
    position: relative;
    top: auto
  }
}


/* Make the Title input full width on create/edit form */
.apaba-at-form input[name="apaba_title"],
.apaba-at-form-wrap input[name="apaba_title"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


/* Filières button group */
.apaba-filieres-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .5rem 0 1rem;
}

.apaba-fil-btn {
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: .4rem .8rem;
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
}

.apaba-fil-btn.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.apaba-sidebar-sep {
  height: 1px;
  background: #e5e7eb;
  margin: 1rem 0;
}

/* Form wrapper spacing to match WP content width */
.apaba-at-form-wrap {
  max-width: 1100px;
  margin: 1rem auto;
  padding: 0 1rem;
}


/* --- Filières buttons: stacked, larger --- */
.apaba-filieres-btns {
  display: block;
  margin: .5rem 0 1rem;
}

.apaba-fil-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: .6rem .8rem;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: .5rem;
}

.apaba-fil-btn.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}


/* Stronger active style for filière buttons */
.apaba-filieres-btns .apaba-fil-btn.active {
  background: #111827 !important;
  color: #fff !important;
  border-color: #111827 !important;
}

/* === VISUAL PATCH v11.1: hover/focus + font sizes === */

/* Titles (sidebar) */
.apaba-at-sidebar h4 {
  font-size: 18px;
}

/* Filières buttons */
.apaba-fil-btn {
  font-size: 15px;
  background: #fff;
  transition: background .15s ease;
}

.apaba-fil-btn:hover {
  background: #f3f4f6;
}

/* Active has priority (and same while hovered) */
.apaba-filieres-btns .apaba-fil-btn.active,
.apaba-filieres-btns .apaba-fil-btn.active:hover {
  background: #111827 !important;
  color: #fff !important;
  border-color: #111827 !important;
}

/* Avoid sticky theme focus background after click */
.apaba-fil-btn:focus,
.apaba-fil-btn:focus-visible {
  outline: 2px solid #1A8781;
  outline-offset: 1px;
}

/* Categories labels */
.apaba-at-filter-list li label {
  font-size: 15px;
}

/* =========================================================
   === OVERRIDES DEMANDÉS (écrasent les valeurs ci-dessus) ===
   ========================================================= */

/* État actif des boutons filières (fond/bord #1A8781, texte blanc) */
.apaba-filieres-btns .apaba-fil-btn.active,
.apaba-filieres-btns .apaba-fil-btn.active:hover {
  background: #1A8781 !important;
  border-color: #1A8781 !important;
  color: #fff !important;
}

/* Focus cohérent avec la couleur active */
.apaba-fil-btn:focus,
.apaba-fil-btn:focus-visible {
  outline: 2px solid #1A8781;
  outline-offset: 1px;
}

/* Hover: texte noir */
.apaba-fil-btn:hover {
  color: #000;
}

/* Titres (colonne droite) */
.apaba-at-sidebar h4 {
  font-size: 24px;
  line-height: 1.25;
}

/* Taille du texte des boutons filières */
.apaba-fil-btn {
  font-size: 20px;
}

/* Taille du texte des catégories */
.apaba-at-filter-list li label {
  font-size: 20px;
}

/* Taille des titres de cartes */
#apaba-at-grid .apaba-card-title,
#apaba-at-grid .apaba-card-title a {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
}

/* Date sous le titre */
#apaba-at-grid .apaba-card-meta .date {
  font-size: 15px;
  line-height: 1.4;
  color: #6b7280;
}

/* Place la zone meta (date) en bas de la carte */
#apaba-at-grid .apaba-card-meta {
  margin-top: auto;
}

/* Placeholder "Sans image" */
#apaba-at-grid .apaba-card-placeholder {
  font-size: 16px;
  font-weight: 600;
}

/* ===============================
   ACTUALITÉS — grille éditoriale des articles natifs WP
   Réf. visuelle : Les Jardins de la Valette (même direction que le
   skin .apaba-article). Scope strict .apaba-actu-* ; tout en px ;
   tokens locaux pour rester autonome. cf. docs/handoff-theme-agrikole.md
   =============================== */

.apaba-actu-wrap {
  --aa: #1A8781;
  --aa-dark: #12655f;
  --aa-soft: #eaf5f4;
  --aa-ink: #1f3b34;
  --aa-body: #555d63;
  --aa-muted: #8a929a;
  --aa-line: #e8e6df;

  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 56px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.apaba-actu-head {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--aa-ink);
  margin: 0 0 26px;
  padding: 0;
}

/* Grille : surcharge .apaba-at-grid héritée (même spécificité, après) */
.apaba-actu-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.apaba-actu-grid .apaba-card {
  position: relative;
  border: 1px solid var(--aa-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(20, 40, 30, .06);
  padding: 14px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.apaba-actu-grid .apaba-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(20, 40, 30, .12);
}

.apaba-actu-grid .apaba-card-thumb {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--aa-soft);
}

.apaba-actu-grid .apaba-card-img,
.apaba-actu-grid .apaba-card-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}

.apaba-actu-grid .apaba-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--aa-muted);
  font-size: 14px;
  font-weight: 600;
}

.apaba-actu-grid .apaba-card-meta {
  margin: 16px 0 0;
  padding: 0 4px;
  font-size: 13px;
  color: var(--aa-muted);
  letter-spacing: .02em;
}

.apaba-actu-grid .apaba-card-sep {
  margin: 0 7px;
}

.apaba-actu-grid .apaba-card-title {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 700;
  margin: 8px 0 0;
  padding: 0 4px;
}

.apaba-actu-grid .apaba-card-title a {
  color: var(--aa-dark);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Carte entièrement cliquable : lien étiré sur le titre */
.apaba-actu-grid .apaba-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.apaba-actu-grid .apaba-card:hover .apaba-card-title a {
  color: var(--aa);
}

.apaba-actu-grid .apaba-card-excerpt {
  font-size: 14px;
  line-height: 1.55;
  color: var(--aa-body);
  margin: 10px 0 0;
  padding: 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.apaba-actu-grid .apaba-card-tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
  margin-top: auto; /* aligne les pastilles en bas de carte */
  padding: 0 4px;
}

.apaba-actu-grid .apaba-card-tag {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--aa);
  background: var(--aa-soft);
  padding: 6px 13px;
  border-radius: 999px;
  text-decoration: none;
  line-height: 1;
  transition: background-color .15s ease, color .15s ease;
}

.apaba-actu-grid .apaba-card-tag:hover {
  background: var(--aa);
  color: #fff;
}

.apaba-actu-empty {
  grid-column: 1 / -1;
  color: var(--aa-muted);
  font-size: 15px;
}

/* Pagination — classe distincte de .apaba-at-pagination pour ne PAS
   être captée par le JS RT (sinon AJAX vers les ressources techniques). */
#apaba-actu-pagination-container {
  max-width: 1180px;
  margin: 0 auto;
}

.apaba-actu-pagination {
  margin: 36px 0 0;
}

/* paginate_links(type=list) ⇒ <ul class="page-numbers"><li><a|span
   class="page-numbers">. On cible le <ul> ET les liens internes
   SÉPARÉMENT : sinon la règle `.page-numbers` styliserait aussi le
   <ul> conteneur (spécificité > `… ul`) → flex cassé, items empilés
   en colonne dans une boîte. */
.apaba-actu-pagination ul,
.apaba-actu-pagination ul.page-numbers {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
}

.apaba-actu-pagination li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.apaba-actu-pagination li::before,
.apaba-actu-pagination li::marker {
  content: none;
}

.apaba-actu-pagination li .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--aa-line, #e8e6df);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--aa-ink, #1f3b34);
  text-decoration: none;
  line-height: 1;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.apaba-actu-pagination li .page-numbers.current {
  background: var(--aa, #1A8781);
  border-color: var(--aa, #1A8781);
  color: #fff;
}

.apaba-actu-pagination li a.page-numbers:hover {
  border-color: var(--aa, #1A8781);
  color: var(--aa, #1A8781);
}

@media (max-width: 600px) {
  .apaba-actu-grid {
    grid-template-columns: 1fr;
  }

  .apaba-actu-head {
    font-size: 25px;
  }
}

/* ===============================
   PAGE CREATE / EDIT — FORMULAIRE
   Scope strict : .apaba-at-form
   =============================== */

/* Bloc d’actions principal (Envoyer / Annuler) */
.apaba-at-form .actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1rem;
}

/* Style de base partagé (légèrement plus gros) */
.apaba-at-form .actions button {
  font-size: 18px;
  /* + grand */
  padding: .55rem 1.1rem;
  /* + volume */
  line-height: 1.2;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

/* Envoyer (primaire) */
.apaba-at-form .actions button[name="apaba_save"] {
  background: #1A8781;
  border-color: #1A8781;
  color: #fff;
}

.apaba-at-form .actions button[name="apaba_save"]:hover {
  background: #156e69;
  border-color: #156e69;
}

.apaba-at-form .actions button[name="apaba_save"]:focus {
  outline: 2px solid rgba(26, 135, 129, .35);
  outline-offset: 1px;
}

/* Annuler (neutre) */
.apaba-at-form .actions button[type="button"] {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #111827;
}

.apaba-at-form .actions button[type="button"]:hover {
  background: #e5e7eb;
}

/* ===============================
   CONTRÔLES THÉMATIQUES (type=button)
   - Retirer (✕)
   - + Ajouter une thématique
   - Ajouter (id=apaba-them-new-btn)
   =============================== */

/* Bouton Retirer (✕) — un peu plus gros */
.apaba-at-form .apaba-them-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  /* ↑ */
  padding: 0;
  border-radius: 9999px;
  background: #ef4444;
  border: 1px solid #ef4444;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  /* ↑ */
}

.apaba-at-form .apaba-them-remove:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.apaba-at-form .apaba-them-remove:focus {
  outline: 2px solid rgba(239, 68, 68, .35);
  outline-offset: 1px;
}

/* Bouton “+ Ajouter une thématique” — vert (primaire), un peu plus gros */
.apaba-at-form .apaba-them-add {
  background: #1A8781;
  border: 1px solid #1A8781;
  color: #fff;
  border-radius: 10px;
  padding: .5rem 1rem;
  /* ↑ */
  font-size: 17px;
  /* ↑ */
}

.apaba-at-form .apaba-them-add:hover {
  background: #156e69;
  border-color: #156e69;
}

.apaba-at-form .apaba-them-add:focus {
  outline: 2px solid rgba(26, 135, 129, .35);
  outline-offset: 1px;
}

/* Bouton “Ajouter” — gris neutre, un peu plus gros */
.apaba-at-form #apaba-them-new-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #111827;
  border-radius: 10px;
  padding: .5rem 1rem;
  /* ↑ */
  font-size: 17px;
  /* ↑ */
}

.apaba-at-form #apaba-them-new-btn:hover {
  background: #e5e7eb;
}

.apaba-at-form #apaba-them-new-btn:focus {
  outline: 2px solid rgba(26, 135, 129, .25);
  outline-offset: 1px;
}

/* ===============================
   GESTION DES ARTICLES — bouton "Filtrer"
   Scope: .apaba-at-search
   =============================== */
.apaba-at-search button[type="submit"] {
  font-size: 16px;
  padding: .45rem .9rem;
  line-height: 1.2;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #1A8781;
  color: #fff;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.apaba-at-search button[type="submit"]:hover {
  background: #156e69;
  border-color: #156e69;
}

.apaba-at-search button[type="submit"]:focus {
  outline: 2px solid rgba(26, 135, 129, .35);
  outline-offset: 1px;
}


/* =========================================================
   === FILTRES DÉROULANTS (MOBILE < 768px) ===
   ========================================================= */
@media (max-width: 768px) {
  .apaba-filters-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1A8781;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: .6rem 1rem;
    cursor: pointer;
    width: 100%;
    margin-bottom: .75rem;
  }

  /* Masquer la sidebar par défaut sur mobile */
  .apaba-at-sidebar {
    display: none;
    margin-bottom: 1rem;
  }

  /* Afficher quand active */
  .apaba-at-sidebar.active {
    display: block;
    animation: apabaFadeIn .2s ease-in-out;
  }

  @keyframes apabaFadeIn {
    from {
      opacity: 0;
      transform: translateY(-5px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}


/* Hide mobile filters toggle by default (desktop) */
.apaba-filters-toggle {
  display: none;
}


@media (max-width: 768px) {
  .apaba-filters-toggle {
    display: flex;
    z-index: 10;
    position: relative;
  }
}


/* =========================================================
   === BARRE DE RECHERCHE ARTICLES TECHNIQUES (AJOUT) ===
   ========================================================= */
.apaba-at-searchbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}

/* Champ de recherche : croix native, dans le champ, visible si texte */
.apaba-at-search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 420px;
  min-width: 220px;
  max-width: 100%;
}

.apaba-at-searchbar .apaba-at-input {
  width: 100%;
  flex: 1 1 auto;
  /* le thème agrikole impose margin-bottom:20px aux inputs → wrapper trop
     haut, croix décalée. On neutralise. */
  margin: 0 !important;
  padding: .35rem 2.1rem .35rem .7rem;
  /* place pour la croix à droite */
  font-size: 15px;
  height: 36px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

/* Supprime la croix native du navigateur (évite le doublon) */
.apaba-at-input::-webkit-search-cancel-button,
.apaba-at-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.apaba-at-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .07);
  color: #3c4043;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}

.apaba-at-clear svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.apaba-at-clear:hover,
.apaba-at-clear:focus-visible {
  background: #1A8781;
  color: #fff;
  outline: none;
}

.apaba-at-clear:active {
  transform: translateY(-50%) scale(.92);
}

/* Masquée tant qu'il n'y a rien à effacer (placeholder visible = champ vide) */
.apaba-at-search-field .apaba-at-input:placeholder-shown ~ .apaba-at-clear {
  display: none;
}


/* === Gestion articles: toolbar === */
.apaba-at-search {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem
}

.apaba-at-search .apaba-manage-top {
  display: flex;
  gap: .5rem;
  align-items: center
}

.apaba-at-search .apaba-manage-top input[type="text"] {
  flex: 1;
  min-width: 0
}

.apaba-at-search .apaba-create-btn {
  margin-left: auto;
  background: #1A8781;
  color: #fff;
  border: 1px solid #1A8781;
  border-radius: 8px;
  padding: .45rem .9rem;
  line-height: 1.2;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center
}

.apaba-at-search .apaba-create-btn:hover {
  background: #156e69;
  border-color: #156e69
}

.apaba-at-search .apaba-manage-selects {
  display: flex;
  gap: .5rem
}

.apaba-at-search .apaba-manage-selects select {
  width: 50%
}

@media (max-width:768px) {
  .apaba-at-search .apaba-manage-top {
    flex-wrap: wrap
  }

  .apaba-at-search .apaba-create-btn {
    width: auto
  }

  .apaba-at-search .apaba-manage-selects {
    flex-direction: row
  }

  .apaba-at-search .apaba-manage-selects select {
    width: 50%
  }
}



/* Limite la largeur de la colonne gauche à 50 % */
.apaba-at-form #apaba-them-wrap.apaba-them-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 50%) auto;
  /* gauche = max 50%, droite = auto */
  gap: 1rem;
  align-items: start;
}

/* Colonne droite : toujours alignée à droite */
.apaba-them-right {
  justify-self: end;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}


/* Pagination des vignettes d'articles techniques */
.apaba-at-results {
  display: flex;
  flex-direction: column;
}

#apaba-at-grid {
  flex-grow: 1;
}

#apaba-at-pagination-container {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.apaba-at-pagination {
  text-align: center;
}

.apaba-at-pagination ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

/* WP sort un <ul class="page-numbers"> : la règle .page-numbers (boutons)
   l'atteint aussi → cadre/ombre/fond parasites autour du groupe. On les
   retire sur le conteneur uniquement (sélecteur plus spécifique). */
.apaba-at-pagination ul.page-numbers {
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.apaba-at-pagination li {
  margin: 0;
  padding: 0;
}

.apaba-at-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  background: #fff;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.apaba-at-pagination .page-numbers:hover {
  border-color: #1A8781;
  color: #1A8781;
  background: #f0f9f9;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.apaba-at-pagination .page-numbers.current {
  background: #1A8781;
  border-color: #1A8781;
  color: #fff;
  cursor: default;
  box-shadow: 0 10px 15px -3px rgba(26, 135, 129, 0.3);
}

.apaba-at-pagination .page-numbers.current:hover {
  transform: none;
}

.apaba-at-pagination .page-numbers.dots {
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: default;
}

.apaba-at-pagination .page-numbers.prev,
.apaba-at-pagination .page-numbers.next {
  font-size: 18px;
  font-weight: bold;
}

@media (max-width: 640px) {
  #apaba-at-pagination-container {
    margin-top: 2rem;
  }

  .apaba-at-pagination ul {
    gap: 0.35rem;
  }

  .apaba-at-pagination .page-numbers {
    min-width: 36px;
    height: 36px;
    font-size: 14px;
    border-radius: 6px;
  }
}


/* File Manager (Edit Form) */
.apaba-file-manager-grid {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  align-items: flex-start;
}

.apaba-file-upload-section {
  flex: 1;
  /* 1/3 roughly */
  background: #fdfdfd;
  padding: 1.25rem;
  border: 1px solid #eee;
  border-radius: 8px;
}

.apaba-file-list-section {
  flex: 2;
  /* 2/3 roughly */
  background: #fff;
  padding: 1.25rem;
  border: 1px solid #eee;
  border-radius: 8px;
}

.apaba-file-manager-grid label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ap_accent);
}

.apaba-upload-input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

#apaba-current-input-wrapper {
  width: 100%;
}

.apaba-upload-input-group input[type="file"] {
  width: 100%;
}

#apaba-instant-stage-btn {
  width: auto;
  padding: 0.4rem 1rem;
  font-weight: 500;
}

.apaba-file-icon {
  font-size: 1.5rem;
}

.apaba-sidebar-title {
  font-size: 2.1rem;
  /* Réglage de la taille ici (Original: h3) */
  font-weight: 700;
  color: #333;
}

/* Mobile responsive for file manager */
@media (max-width: 768px) {
  .apaba-file-manager-grid {
    flex-direction: column;
  }

  .apaba-file-upload-section,
  .apaba-file-list-section {
    flex: none;
    width: 100%;
  }
}

/* Header Meta Layout */
.apaba-article-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.5rem 0 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.apaba-meta-info {
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}

.apaba-back-nav {
  margin-bottom: 0;
}

.apaba-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  background: #fdfdfd;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.apaba-btn-back:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
  transform: translateX(-3px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.apaba-btn-back svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.apaba-btn-back:hover svg {
  transform: translateX(-2px);
}

/* =========================================================================
   === SKIN ARTICLE BLOG — single /articletechnique/  (refonte 2026-05-18)
   === Thème agrikole : racine = 10px → TOUT en px (jamais rem).
   === Contenu TinyMCE incohérent (h2..h6) → tous les niveaux stylés.
   === Tout sélecteur préfixé .apaba-article (feuille chargée sur tout le
   === front). Exceptions : #apaba-lightbox + @media print.
   ========================================================================= */

.apaba-article {
  --aa: #1A8781;
  --aa-dark: #12655f;
  --aa-soft: #eaf5f4;
  --aa-soft2: #f5faf9;
  --aa-ink: #23282d;
  --aa-body: #353b41;
  --aa-muted: #7a828a;
  --aa-line: #e6e9ec;

  max-width: 1120px;
  margin: 0 auto 4rem;
  padding: 0 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.apaba-article *,
.apaba-article *::before,
.apaba-article *::after {
  box-sizing: border-box;
}

/* ---- En-tête article ------------------------------------------------- */
.apaba-article .aa-hero {
  max-width: 760px;
  margin: 22px auto 18px;
}

.apaba-article .aa-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--aa);
  background: var(--aa-soft);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.apaba-article .aa-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.apaba-article .aa-badge {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--aa);
  color: #fff;
}

.apaba-article .aa-badge--sec {
  background: #fff;
  color: var(--aa-body);
  border: 1px solid var(--aa-line);
}

.apaba-article .aa-metarow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--aa-line);
}

.apaba-article .aa-date {
  font-size: 15px;
  color: var(--aa-muted);
  font-weight: 500;
}

/* Bandeau-titre du thème (#featured-title, photo générique) désactivé,
   scopé à nos pages uniquement via :has() (feuille chargée site-wide). */
body:has(.apaba-article) #featured-title {
  display: none !important;
}

/* Sans bandeau, il reste le padding-top résiduel de #main-content : on le
   neutralise UNIQUEMENT sur nos pages (pas de bidouille globale, pas de
   marge négative, réversible). L'espace sous le menu = espacement normal
   du header du thème (global, hors périmètre). */
body:has(.apaba-article) #main-content {
  padding-top: 0;
}

.apaba-article .aa-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 46px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--aa-ink);
  margin: 14px 0 20px;
}

/* ---- Colonne de lecture --------------------------------------------- */
.apaba-article .entry-content {
  max-width: 760px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.8;
  color: var(--aa-body);
  text-align: left;
}

.apaba-article .entry-content::after {
  content: "";
  display: table;
  clear: both;
}

.apaba-article .entry-content p {
  margin: 0 0 22px;
}

/* Chapô + lettrine (touche éditoriale) */
.apaba-article .entry-content > p:first-of-type {
  font-size: 21px;
  line-height: 1.7;
  color: #4a5158;
}

.apaba-article .entry-content > p:first-of-type::first-letter {
  float: left;
  font-size: 68px;
  line-height: 0.82;
  font-weight: 800;
  color: var(--aa);
  margin: 8px 14px 0 0;
}

/* Titres : TOUS les niveaux (l'éditeur produit du h5/h6) ------------- */
.apaba-article .entry-content h1,
.apaba-article .entry-content h2,
.apaba-article .entry-content h3,
.apaba-article .entry-content h4,
.apaba-article .entry-content h5,
.apaba-article .entry-content h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 800;
  color: var(--aa-ink);
  line-height: 1.25;
  margin: 52px 0 18px;
  padding: 0;
  letter-spacing: -0.01em;
}

.apaba-article .entry-content h1 { font-size: 34px; }
.apaba-article .entry-content h2 { font-size: 30px; }
.apaba-article .entry-content h3 { font-size: 26px; }
.apaba-article .entry-content h4 { font-size: 23px; }
.apaba-article .entry-content h5 { font-size: 22px; }
.apaba-article .entry-content h6 { font-size: 21px; }

/* Accent décoratif au-dessus de chaque titre de section */
.apaba-article .entry-content h2::before,
.apaba-article .entry-content h3::before,
.apaba-article .entry-content h4::before,
.apaba-article .entry-content h5::before,
.apaba-article .entry-content h6::before {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  border-radius: 4px;
  background: var(--aa);
  margin-bottom: 16px;
}

.apaba-article .entry-content > h1:first-child,
.apaba-article .entry-content > h2:first-child,
.apaba-article .entry-content > h3:first-child,
.apaba-article .entry-content > h4:first-child,
.apaba-article .entry-content > h5:first-child,
.apaba-article .entry-content > h6:first-child {
  margin-top: 8px;
}

/* Le 1er h5/h6 sert souvent de sous-titre d'article : style "deck" */
.apaba-article .entry-content > h5:first-child,
.apaba-article .entry-content > h6:first-child {
  font-size: 24px;
  color: var(--aa-dark);
}

/* Liens ---------------------------------------------------------------- */
.apaba-article .entry-content a {
  color: var(--aa-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s ease, background .15s ease;
}

.apaba-article .entry-content a:hover {
  color: var(--aa-dark);
  background: var(--aa-soft);
  text-decoration-thickness: 2px;
  border-radius: 3px;
  box-shadow: 0 0 0 3px var(--aa-soft);
}

/* Gras (pas de coloration sémantique) */
.apaba-article .entry-content strong,
.apaba-article .entry-content b {
  font-weight: 700;
  color: var(--aa-ink);
}

/* Listes --------------------------------------------------------------- */
.apaba-article .entry-content ul,
.apaba-article .entry-content ol {
  margin: 0 0 22px;
  padding-left: 26px;
}

.apaba-article .entry-content li {
  margin: 9px 0;
  padding-left: 4px;
}

.apaba-article .entry-content ul li::marker {
  color: var(--aa);
  font-size: 1.1em;
}

.apaba-article .entry-content ol li::marker {
  color: var(--aa);
  font-weight: 700;
}

.apaba-article .entry-content li > ul,
.apaba-article .entry-content li > ol {
  margin: 9px 0 4px;
}

/* Citation : pull-quote éditoriale ------------------------------------ */
.apaba-article .entry-content blockquote {
  position: relative;
  margin: 32px 0;
  padding: 22px 26px 22px 58px;
  background: var(--aa-soft2);
  border-left: 4px solid var(--aa);
  border-radius: 0 12px 12px 0;
  font-size: 20px;
  font-style: italic;
  color: #3a4046;
}

.apaba-article .entry-content blockquote::before {
  content: "\201C";
  position: absolute;
  left: 16px;
  top: 6px;
  font-size: 56px;
  line-height: 1;
  color: var(--aa);
  opacity: .35;
  font-family: Georgia, "Times New Roman", serif;
}

.apaba-article .entry-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Images / figures ----------------------------------------------------- */
.apaba-article .entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

/* Images du corps cliquables (aperçu lightbox) : affordance + on
   neutralise le style de lien (halo vert) quand le lien enveloppe une image. */
.apaba-article .entry-content img {
  cursor: zoom-in;
  transition: filter .15s ease, transform .15s ease;
}

.apaba-article .entry-content img:hover {
  filter: brightness(1.04);
  transform: scale(1.01);
}

.apaba-article .entry-content a:has(img) {
  display: inline-block;
  line-height: 0;
  background: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  border-radius: 14px;
}

.apaba-article .entry-content a:has(img):hover {
  background: none !important;
  box-shadow: none !important;
}

.apaba-article .entry-content figure {
  margin: 30px 0;
  text-align: center;
}

.apaba-article .entry-content p > img,
.apaba-article .entry-content figure img {
  box-shadow: 0 14px 34px rgba(20, 40, 38, .14);
}

.apaba-article .entry-content .aligncenter {
  display: block;
  margin: 30px auto;
}

.apaba-article .entry-content figcaption,
.apaba-article .entry-content .wp-caption-text {
  margin-top: 12px;
  font-size: 14px;
  font-style: italic;
  color: var(--aa-muted);
  text-align: center;
}

@media (min-width: 880px) {
  .apaba-article .entry-content .alignright {
    float: right;
    max-width: 44%;
    margin: 8px 0 22px 32px;
  }

  .apaba-article .entry-content .alignleft {
    float: left;
    max-width: 44%;
    margin: 8px 32px 22px 0;
  }
}

@media (max-width: 879px) {

  .apaba-article .entry-content .alignright,
  .apaba-article .entry-content .alignleft {
    float: none;
    display: block;
    max-width: 100%;
    margin: 30px auto;
  }
}

/* Séparateur décoratif ------------------------------------------------- */
.apaba-article .entry-content hr {
  border: 0;
  margin: 44px 0;
  text-align: center;
}

.apaba-article .entry-content hr::before {
  content: "\25C6 \25C6 \25C6";
  letter-spacing: 10px;
  color: var(--aa);
  opacity: .5;
  font-size: 12px;
}

/* Tables --------------------------------------------------------------- */
.apaba-article .entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 26px;
  font-size: 16px;
  border: 1px solid var(--aa-line);
  border-radius: 12px;
  overflow: hidden;
}

.apaba-article .entry-content th,
.apaba-article .entry-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--aa-line);
  text-align: left;
}

.apaba-article .entry-content th {
  background: var(--aa-soft);
  color: var(--aa-ink);
  font-weight: 700;
}

.apaba-article .entry-content tbody tr:nth-child(even) {
  background: var(--aa-soft2);
}

.apaba-article .entry-content tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 760px) {
  .apaba-article .entry-content table {
    display: block;
    overflow-x: auto;
  }
}

/* Code ----------------------------------------------------------------- */
.apaba-article .entry-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  background: var(--aa-soft);
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--aa-dark);
}

.apaba-article .entry-content pre {
  background: #1f2933;
  color: #f3f4f6;
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 0 0 26px;
  font-size: 15px;
}

.apaba-article .entry-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Cartes pied d'article : Galerie + Fichiers -------------------------- */
.apaba-article .aa-foot {
  max-width: 760px;
  margin: 48px auto 0;
  display: grid;
  gap: 22px;
}

.apaba-article .aa-card {
  border: 1px solid var(--aa-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 40, 38, .07);
  overflow: hidden;
}

.apaba-article .aa-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  background: var(--aa-soft);
  border-bottom: 1px solid var(--aa-line);
}

.apaba-article .aa-card__head svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--aa);
}

.apaba-article .aa-card__title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--aa-ink);
}

.apaba-article .aa-card__body {
  padding: 20px 22px;
}

.apaba-article .aa-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.apaba-article .aa-photo {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--aa-soft2);
  border: 1px solid var(--aa-line);
}

.apaba-article .aa-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.apaba-article .aa-photo:hover img {
  transform: scale(1.06);
}

.apaba-article .aa-files {
  list-style: none;
  margin: 0;
  padding: 0;
}

.apaba-article .aa-file + .aa-file {
  margin-top: 8px;
}

.apaba-article .aa-file a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid var(--aa-line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--aa-ink);
  background: var(--aa-soft2);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.apaba-article .aa-file a:hover {
  border-color: var(--aa);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 40, 38, .1);
}

.apaba-article .aa-file__ic {
  font-size: 26px;
  line-height: 1;
  flex: 0 0 auto;
}

.apaba-article .aa-file__name {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 16px;
  word-break: break-word;
}

.apaba-article .aa-file__meta {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--aa);
  background: var(--aa-soft);
  padding: 5px 10px;
  border-radius: 999px;
}

/* Bouton retour (déjà stylé plus haut, ajustement marge) */
.apaba-article .apaba-back-nav {
  margin: 0;
}

/* Lightbox (ID unique, hors .apaba-article) --------------------------- */
#apaba-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 26, .92);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Bouton fermer : override fort (le thème impose padding/min-width sur
   <button> → sinon ellipse 100x60 avec un "×" décalé). */
#apaba-lightbox button {
  position: absolute !important;
  top: 22px !important;
  right: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(18, 28, 26, .78) !important;
  color: #fff !important;
  border: 1.5px solid rgba(255, 255, 255, .85) !important;
  border-radius: 50% !important;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .45) !important;
  text-shadow: none !important;
  cursor: pointer;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: background .15s ease, color .15s ease, transform .2s ease, border-color .15s ease;
}

#apaba-lightbox button:hover,
#apaba-lightbox button:focus-visible {
  background: #fff !important;
  color: #12655f !important;
  border-color: #fff !important;
  transform: rotate(90deg) scale(1.06);
  outline: none;
}

#apaba-lightbox button svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

#apaba-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}

/* Responsive ----------------------------------------------------------- */
@media (max-width: 600px) {
  .apaba-article .entry-content {
    font-size: 17px;
  }

  .apaba-article .entry-content h1 { font-size: 27px; }
  .apaba-article .entry-content h2 { font-size: 25px; }
  .apaba-article .entry-content h3 { font-size: 23px; }
  .apaba-article .entry-content h4,
  .apaba-article .entry-content h5,
  .apaba-article .entry-content h6 { font-size: 21px; }

  .apaba-article .entry-content > p:first-of-type { font-size: 19px; }

  .apaba-article .entry-content > p:first-of-type::first-letter {
    font-size: 56px;
  }

  .apaba-article .aa-title {
    font-size: 31px;
  }
}

/* Impression ----------------------------------------------------------- */
@media print {

  header,
  footer,
  nav,
  #apaba-lightbox,
  .apaba-btn-back,
  .apaba-back-nav {
    display: none !important;
  }

  .apaba-article {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .apaba-article .aa-title {
    font-size: 24pt;
    color: #000;
    margin: 0 0 6pt;
  }

  .apaba-article .entry-content,
  .apaba-article .entry-content p,
  .apaba-article .entry-content li {
    color: #000 !important;
    font-size: 12pt;
    max-width: none;
  }

  .apaba-article .entry-content a {
    color: #000 !important;
    background: none !important;
    box-shadow: none !important;
  }

  .apaba-article .entry-content a[href^="http"]:not([href*="apabawp"])::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    word-break: break-all;
  }

  .apaba-article .entry-content h2,
  .apaba-article .entry-content h3,
  .apaba-article .entry-content h4,
  .apaba-article .entry-content h5,
  .apaba-article .entry-content h6 {
    break-after: avoid;
  }

  .apaba-article .entry-content figure,
  .apaba-article .aa-card,
  .apaba-article .entry-content li {
    break-inside: avoid;
  }

  .apaba-article .entry-content .alignright,
  .apaba-article .entry-content .alignleft {
    float: none;
    display: block;
    max-width: 60%;
    margin: 16px auto;
  }
}
