/* == Waran — design system fidèle aux maquettes أطلال (voir maquettes/) == */
@import url("../fonts/fonts.cf207265907e.css");

:root {
  --bg: #FAF6EE; --surface: #FFF; --surface-2: #F5EDDF; --border: #EDE4D3;
  --ink: #2C2620; --muted: #8A8177;
  --primary: #E4A33D; --primary-grad: linear-gradient(180deg, #EFB44E, #D9942C);
  --primary-ink: #3A2B14; --accent-text: #B77F2E; --marker: #E8912B;
  --badge-dark: rgba(30, 25, 18, .78); --logo-green: #316B54;
  --radius-card: 16px; --radius-pill: 999px;
  --shadow: 0 2px 10px rgba(60, 45, 20, .07);
  --shadow-lg: 0 16px 40px rgba(50, 38, 18, .16);
  --font-display: "Baloo Bhaijaan 2", "Tajawal", sans-serif;
  --font-body: "Tajawal", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  /* ---- Polish : durées, focus, hauteur d'en-tête ---- */
  --fast: 150ms; --normal: 200ms;
  --ease: cubic-bezier(.3, 0, .2, 1);
  --focus-ring: 0 0 0 3px rgba(228, 163, 61, .5);
  --header-h: 84px;
  --tap: 44px;
  /* ---- [T23] Extensions guide design expert (base أطلال ci-dessus inchangée) :
     deuxième accent « lieu/géographie » (olive) à côté de l'accent « action »
     (ambre existant), typographie de lecture des vers, aération douce. Voir
     .superpowers/sdd/task-23-report.md pour le détail des décisions et les
     ratios de contraste vérifiés. ---- */
  --olive: #3B6D11; --olive-bg: #E8EFDC; --amber-hover: #D9942C;
  --surface-alt: #FCFAF6; --text-mute: #6E6455; --amber-text: #854F0B;
  --font-verse: "Amiri", "Tajawal", serif;
  --font-poem-title: "Reem Kufi", var(--font-display);
  --verse-size: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.7;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 800; margin: 0; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1240px; margin-inline: auto; padding-inline: 20px; }

/* ---- Accessibilité : focus clavier ambre, mouvement réduit ---- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
  box-shadow: var(--focus-ring); border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ---- Images en fondu (loading="lazy") ---- */
img[loading="lazy"] { opacity: 0; transition: opacity .4s var(--ease); }
img[loading="lazy"].is-loaded { opacity: 1; }

.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 246, 238, .86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  position: relative;
  max-width: 1400px; margin-inline: auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-badge {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--logo-green); color: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.brand-badge .icon { width: 22px; height: 22px; }
/* [Rebranding] pastille logo : la خيمة sur fond crème (le noir du logo ne
   passerait pas sur le vert), léger liseré. */
.brand-badge--logo {
  background: transparent; border: 0; box-shadow: none;
  width: auto; height: auto;
}
.brand-tente { width: 72px; height: 72px; object-fit: contain; display: block; }
.header-login {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 8px 14px; min-height: 38px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  font-weight: 700; font-size: 13.5px; color: var(--accent-text);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.header-login:hover { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.header-login--in { color: var(--olive); }
@media (max-width: 1150px) {
  /* mobile : à côté du hamburger, icône seule (le libellé passe en title) */
  .header-login span { display: none; }
  .header-login { padding: 8px; width: var(--tap); justify-content: center; }
}
.footer-sep { margin-inline: 6px; color: var(--text-mute, #8a7f6a); }
.footer-login { color: var(--olive, #6f7a3a); text-decoration: none; font-weight: 700; }
.footer-login:hover { text-decoration: underline; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong,
.brand-text small {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.brand-text strong { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.brand-text small { color: var(--muted); font-size: 12.5px; }
.main-nav {
  display: flex; align-items: center; gap: 4px;
  margin-inline-start: auto; flex-wrap: wrap;
}
.main-nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-pill);
  font-weight: 500; font-size: 15px; color: var(--ink);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}
.main-nav a:hover { background: var(--surface-2); }
.main-nav a:active { transform: scale(.97); }
.main-nav a.active {
  background: var(--primary); color: var(--primary-ink);
  font-weight: 700; box-shadow: var(--shadow);
}

/* ---- Navigation mobile (hamburger) ---- */
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); flex: none;
  margin-inline-start: auto;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-pill); color: var(--ink); cursor: pointer;
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle:active { transform: scale(.94); }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: flex; }

@media (max-width: 1150px) {
  /* Seuil calé sur la largeur réelle des 8 items de nav (pas de zone morte où
     le nav desktop passerait sur deux lignes sans que le hamburger prenne le relais). */
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; inset-inline: 12px; top: calc(100% + 8px);
    margin-inline-start: 0; flex-wrap: nowrap; flex-direction: column;
    align-items: stretch; gap: 4px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); box-shadow: var(--shadow-lg);
    padding: 10px; z-index: 99;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity var(--normal) var(--ease), transform var(--normal) var(--ease),
      visibility var(--normal);
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .main-nav a { min-height: var(--tap); }
}

/* ---- Boutons / chips / badges ---- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: var(--tap); padding: 10px 18px; border: 0; cursor: pointer;
  background: var(--primary-grad); color: var(--primary-ink);
  border-radius: var(--radius-pill); font-family: var(--font-body);
  font-weight: 700; font-size: 15px; box-shadow: var(--shadow);
  transition: filter var(--fast) var(--ease), transform var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: var(--shadow-lg); }
.btn-primary:active { transform: scale(.97); filter: brightness(.98); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 500;
  transition: background var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}
.chip--solid { background: var(--surface-2); border-color: transparent; }
a.chip { min-height: var(--tap); padding-block: 10px; }
a.chip:hover { background: var(--surface-2); box-shadow: var(--shadow); }
a.chip:active { transform: scale(.97); }
.badge-views, .badge-audio {
  position: absolute; top: 10px; display: inline-flex; align-items: center;
  gap: 5px; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 700;
}
/* Positions calées sur la maquette : vues toujours en haut-gauche physique,
   audio toujours en haut-droite physique (la maquette ne mirore pas ces badges en RTL). */
.badge-views { inset-inline-end: 10px; background: var(--badge-dark); color: #fff; }
.badge-audio { inset-inline-start: 10px; background: var(--primary); color: var(--primary-ink); }

/* ---- Grilles catalogues ---- */
.page-header { display: flex; align-items: baseline; gap: 12px; padding-block: 26px 6px; }
.page-header h1 { font-size: 30px; }
.page-header .count { color: var(--muted); font-size: 14px; }
.grid-cards {
  display: grid; gap: 20px; padding-block: 18px 40px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  /* chaque carte garde sa hauteur naturelle : évite le grand vide blanc avant le
     bouton quand une fiche a peu de métadonnées (pas d'étirement de ligne de grille) */
  align-items: start;
}
.pagination {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; padding-block: 6px 44px;
}
.pagination .chip {
  min-height: 40px; padding: 0 16px;
  display: inline-grid; place-items: center; line-height: 1;
}
/* [Design 21/07 — retour porteur] chiffres PARFAITEMENT centrés : cercle figé
   40×40 (aspect-ratio), padding zéro, chiffres tabulaires, correction du
   décalage optique des chiffres Tajawal (leur boîte penche vers le bas). */
.pagination .page-num {
  width: 40px; height: 40px; min-width: 40px; padding: 0;
  aspect-ratio: 1; border-radius: 50%;
  font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600;
  /* [22/07 — retour porteur] centrage VERTICAL réel du chiffre : grid +
     line-height 1 (le translateY approximatif le remontait trop). */
  display: inline-grid; place-items: center; line-height: 1;
}
.pagination .chip.is-active {
  background: var(--primary-grad); color: var(--primary-ink);
  font-weight: 700; border-color: transparent;
}

/* ---- Carte (composant) lieu ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease);
}
.card:hover, .card:focus-within { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-media { position: relative; aspect-ratio: 16 / 9.5; background: var(--primary-grad); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(20, 14, 6, .72));
}
.card-media .media-overlay {
  position: absolute; z-index: 1;
  inset-inline: 14px; bottom: 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.card-media .titre {
  color: #fff; font-family: var(--font-display); font-weight: 800;
  font-size: 21px; line-height: 1.3;
}
.card-media .region {
  color: rgba(255, 255, 255, .85); font-size: 12.5px;
  display: flex; align-items: center; gap: 4px;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body .poete { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.card-body .poete b { color: var(--accent-text); font-weight: 700; }
.avatar-s {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
  background: var(--primary); color: #fff; font-size: 12px;
  display: inline-grid; place-items: center; font-weight: 700;
}
.quote {
  background: var(--surface-2); border-inline-start: 3px solid var(--primary);
  border-radius: 10px; padding: 10px 14px; font-size: 14.5px; line-height: 1.9;
}
.audio-line { font-size: 13.5px; color: var(--accent-text); display: flex; align-items: center; gap: 6px; }
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; }
.card-body .btn-primary { margin-top: auto; }

/* ---- Carte (composant) poète ---- */
.poet-head { display: flex; align-items: center; gap: 12px; }
.avatar-l {
  width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 26px; font-weight: 800;
}
.poet-head .nom { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.poet-head .epithete { color: var(--muted); font-size: 13.5px; }
.meta-row { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.meta-row .icon { color: var(--primary); }
.meta-row .label { color: var(--muted); }
.meta-row .valeur { font-weight: 700; }
.bio-extrait {
  color: var(--muted); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- Fiches détail ---- */
.breadcrumb { color: var(--muted); font-size: 14px; padding-block: 18px 10px;
  display: flex; align-items: center; gap: 6px; }
/* [T23] repère géographique du fil d'Ariane (icône 📍 en tête) : olive */
.breadcrumb .icon { color: var(--olive); }
.detail-layout { display: grid; grid-template-columns: 1fr 330px; gap: 22px; padding-bottom: 50px; }
/* [P4] .hero -> .hero-gallery : même habillage visuel (fond dégradé,
   coins arrondis, ombre) qu'avant, désormais autour d'un carrousel scroll-
   snap d'une à sept diapositives (.hero-track > .hero-slide) au lieu d'une
   image unique. Un lieu sans photo garde .hero-gallery vide (même dégradé de
   secours qu'avant, aucune régression). */
.hero-gallery {
  position: relative; border-radius: var(--radius-card); overflow: hidden;
  aspect-ratio: 16 / 7; background: var(--primary-grad); box-shadow: var(--shadow-lg);
}
.hero-track {
  display: flex; width: 100%; height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide {
  flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always;
  position: relative;
}
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-gallery::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(228, 163, 61, .18), transparent 45%);
}
/* [P4] Points de navigation — un seul lieu à la fois « actif » (JS,
   static/js/gallery.js) ; absents du DOM quand une seule photo (pas de
   carrousel à piloter, cf. templates/atlas/place_detail.html). */
.hero-dots {
  position: absolute; z-index: 2; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px; padding: 6px 10px; border-radius: var(--radius-pill);
  background: rgba(20, 14, 4, .35); backdrop-filter: blur(2px);
}
.hero-dot {
  width: 8px; height: 8px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .55); cursor: pointer;
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.hero-dot.active { background: #fff; transform: scale(1.3); }
.hero-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.section-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
  padding: 20px 22px; margin-top: 20px;
  transition: box-shadow var(--normal) var(--ease);
}
.section-title {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-size: 21px; font-weight: 800; margin-bottom: 10px;
}
.section-title .icon { color: var(--primary); width: 1.05em; height: 1.05em; }
/* [T23] section « ذُكر في » (mentions dans le texte d'autres fiches) :
   icône olive — seule exception géographique parmi les titres de section,
   les autres (الوصف الجغرافي, الأبيات الشعرية, التسجيلات…) gardent l'ambre
   « contenu » par défaut. */
.section-title--geo .icon { color: var(--olive); }
.coord-bar {
  background: var(--surface-2); border-radius: 10px; padding: 8px 14px;
  display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin-top: 12px;
}
/* [T23] lien/indicateur de coordonnées : icône olive (lieu), texte inchangé */
.coord-bar .icon { color: var(--olive); }
.coord-bar code { font-family: var(--font-mono); font-size: 12.5px; direction: ltr; }
.sidebar { display: flex; flex-direction: column; gap: 18px; align-self: start;
  position: sticky; top: 84px; }
.sidebar .section-card { margin-top: 0; }
.sidebar .section-title { font-size: 17px; }
#mini-map { height: 210px; border-radius: var(--radius-card); overflow: hidden; }
.field label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }
.field select {
  width: 100%; min-height: var(--tap); padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); font-family: var(--font-body); font-size: 14px;
  transition: border-color var(--fast) var(--ease);
}
.distance-result { text-align: center; font-weight: 700; color: var(--accent-text); margin-top: 8px; }
.poet-row { display: flex; align-items: center; gap: 10px; padding-block: 8px; }
.poet-row + .poet-row { border-top: 1px solid var(--border); }
.poet-row .nom { font-weight: 700; font-size: 15px; }
.poet-row .epithete { color: var(--muted); font-size: 12.5px; }
audio { width: 100%; margin-top: 8px; }

/* ---- قصيدة (poème) façon aldiwan : bayt en deux colonnes équilibrées ---- */
.poems-list { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; }
.poem {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: var(--surface);
  /* [P1] lien profond popup carte (#qasida-1, atlas/views.py places_geojson) :
     compense l'en-tête collant (--header-h) pour que le scroll d'ancrage
     n'atterrisse pas la carte du poème sous le header. */
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.poem-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.poem-poet {
  /* [T23] titre de carte poème : Reem Kufi (jugée à l'écran plus proche du
     tracé calligraphique des قصائد qu'un Baloo Bhaijaan 2 gardé pour la
     marque/nav — cf. captures desktop dans le rapport T23) */
  font-family: var(--font-poem-title); font-weight: 500; font-size: 18px;
  color: var(--amber-text); transition: color var(--fast) var(--ease);
}
.poem-poet:hover { text-decoration: underline; }
.poem-poet--anonyme { font-family: var(--font-body); font-weight: 700; font-size: 15px; color: var(--muted); }
.poem-source {
  /* [T23] tag source discret : --text-mute (≥ 4.5:1 vérifié) plutôt que
     --muted, cf. rapport T23 §contraste */
  margin-inline-start: auto; font-size: 12px; color: var(--text-mute);
  background: var(--surface); border-color: var(--border);
}
/* [T17] chip lieu sur les cartes poème de la fiche poète — [T23] accent
   « lieu » olive (au lieu de l'ambre « action ») */
.poem-place { font-size: 13px; }
.poem-place .icon { color: var(--olive); }
/* [T19] chip discrète لغن/فصيح — même registre visuel que poem-source (muette,
   pas de couleur d'accent : une métadonnée de classement, pas un appel à l'action) */
.poem-genre { font-size: 12px; color: var(--muted); background: var(--surface); border-color: var(--border); }
/* [T19] onglets-pilules الكل/لغن/الفصيح du catalogue الشعراء + recherche */
.genre-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 4px 18px; }
.genre-tabs .chip.is-active {
  background: var(--primary-grad); color: var(--primary-ink);
  font-weight: 700; border-color: transparent;
}
.genre-tabs .chip .count-badge { color: var(--muted); font-size: 12px; }
.genre-tabs .chip.is-active .count-badge { color: inherit; opacity: .85; }
/* [T17] lien poète sur une piste audio */
.audio-poet { font-weight: 700; }
.audio-poet:hover { text-decoration: underline; }
/* [T17] section قصائده de la fiche poète */
.poet-qasidas { margin-bottom: 50px; }
/* [T23] largeur de lecture confortable, centrée dans la carte/section
   (contrat ~700px) — couvre aussi le repli .poem-more-body (imbriqué). */
.poem-body { padding: 6px 4px; max-width: 700px; margin-inline: auto; }
.bayt {
  display: grid; grid-template-columns: 1fr 1fr; align-items: baseline;
  gap: 10px 30px; padding: 15px 20px;
  /* [T23] Amiri pour le corps des vers, taille ajustable par la barre de
     lecture (A-/A+, cf. static/js/poem-reader.js) — 20px par défaut,
     dans la fourchette 19-21px du guide expert */
  font-family: var(--font-verse); font-size: var(--verse-size); line-height: 2.15;
}
/* [T23] ombrage alterné adouci (--surface-alt, quasi-blanc) au lieu du
   --bg crème plus marqué : une ligne sur deux, à peine perceptible */
.bayt:nth-of-type(even) { background: var(--surface-alt); }
.bayt--single { grid-template-columns: 1fr; text-align: center; }
.hemistich--sadr { text-align: end; }
.hemistich--ajaz {
  text-align: start; padding-inline-start: 24px;
  border-inline-start: 1px solid var(--border);
}
.poem-more { border-top: 1px dashed var(--border); margin: 4px 20px 8px; padding-top: 4px; }
.poem-more summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  margin-block: 8px; padding: 8px 16px; min-height: var(--tap);
  border-radius: var(--radius-pill); background: var(--surface-2);
  font-weight: 700; font-size: 14px; color: var(--accent-text);
  transition: background var(--fast) var(--ease);
}
.poem-more summary:hover { background: var(--border); }
.poem-more summary::-webkit-details-marker { display: none; }
.poem-more summary::after {
  content: "▾"; font-size: 10px; transition: transform var(--fast) var(--ease);
}
.poem-more[open] summary::after { transform: rotate(180deg); }
.poem-more .summary-moins { display: none; }
.poem-more[open] .summary-plus { display: none; }
.poem-more[open] .summary-moins { display: inline-flex; }
.poem-more-body .bayt:first-child { border-top: 1px solid var(--border); }

/* ---- [T23] Barre de lecture par poème : A-/A+ (--verse-size global,
   persisté localStorage) + bascule تشكيل (par carte, static/js/poem-reader.js).
   Ce sont des actions (pas des lieux) : accent ambre, cohérent avec le
   système à deux accents. Cible tactile réduite (36px, sous les --tap 44px
   du reste du site) : 3 boutons secondaires par carte, potentiellement 8
   cartes/page — préserve le compactage mobile T17, cf. rapport T23. ---- */
.poem-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 18px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.poem-toolbar .label { color: var(--text-mute); font-size: 12px; margin-inline-end: auto; }
.reader-btn {
  display: inline-grid; place-items: center;
  min-height: 34px; min-width: 34px; padding: 0 10px; line-height: 1;
  border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius-pill);
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  color: var(--ink); cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}
.reader-btn:hover { background: var(--amber-hover); color: var(--primary-ink); border-color: transparent; }
.reader-btn[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: transparent; }

/* ---- [T20] لِيَست بمكانٍ (texte↔carte) : lien discret dans le vers ----
   [T23] accent « lieu » olive (auparavant ambre --accent-text) — markup de
   surligner_mentions() inchangé (class="mention-lieu" seule), CSS only. */
.mention-lieu {
  text-decoration: underline dotted var(--olive); text-underline-offset: 3px;
  text-decoration-thickness: 1.5px; transition: color var(--fast) var(--ease);
}
.mention-lieu:hover { color: var(--olive); }
/* [T23] fond olive-bg très pâle : ce bloc est la sous-section « géographie »
   de la carte poème (mini-carte + lieux non localisés) */
.poem-mentions { padding: 10px 18px; background: var(--olive-bg); border-bottom: 1px solid var(--border); }
.poem-mini-map { height: 180px; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.poem-mentions-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.poem-mention-chip { font-size: 12.5px; color: var(--muted); }
.poem-mention-chip .icon { color: var(--olive); }
.coord-bar--inconnu { color: var(--muted); }
/* [W7 n°2] Bandeau « موضع قيد التحقيق » (fiche d'un lieu provisoire,
   precision=inconnu) : pattern bandeaux Wikipedia — fond ambre très pâle,
   liseré latéral, jamais criard. */
.bandeau-provisoire {
  background: #FBF3E2; border: 1px solid #EAD7A8;
  border-inline-start: 4px solid #C99A3B;
  border-radius: 8px; padding: 7px 12px; margin-block: 8px 4px;
  color: #7A5A1E; font-size: 13.5px;
}

/* [W6 — hiérarchie] Fil « يقع ضمن » (تجكجة ← تكانت) : ligne discrète sous le
   titre, maillons cliquables — modèle gazetier. Chips « مواضع فرعية » en
   colonne latérale (réutilise poem-mention-chip). */
.fil-contenants {
  color: var(--muted); font-size: 13.5px; margin-block: 2px 6px;
}
/* [W6 n°2] Nom vocalisé : Amiri rend les harakat correctement (Tajawal les
   écrase) ; interligne large pour laisser respirer le تشكيل. */
.nom-vocalise {
  font-family: "Amiri", serif; font-size: 21px; line-height: 2;
  color: var(--accent-text); margin-block: 0 2px;
}
.note-prononciation { color: var(--muted); font-size: 13.5px; margin-block: 0 6px; }

/* [W6 — portraits] Portrait du poète en tête de fiche : rond, liseré ambre,
   crédit dessous en petit — sans portrait, rien (pas de placeholder ici). */
.poet-portrait { margin-bottom: 12px; }
.poet-portrait img {
  width: 128px; height: 128px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.poet-portrait-credit { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
/* [21/07] portrait provisoire : médaillon-initiale (cohérent cartes), jamais
   de visage générique. */
.poet-initiale-medaillon {
  width: 128px; height: 128px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-ink, #fff);
  font-family: var(--font-display); font-size: 56px; font-weight: 800;
  border: 3px solid var(--accent-text); box-shadow: 0 2px 10px rgba(0,0,0,.10);
}

/* [Audit 21/07] texte lecteur-d'écran uniquement (pattern sr-only standard) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* [Marque 20/07] Mot-marque officiel = calligraphie koufie du logo (image
   transparente extraite) — partout où «ديار» est un élément de marque. */
/* align-self : SANS lui, le flex-column .brand-text étire l'image à la
   largeur du sous-titre (ratio écrasé ~4:1 au lieu de 2:1 — vu par le
   porteur). height+width:auto + align-self = ratio d'origine garanti. */
.brand-wordmark {
  height: 34px; width: auto; display: block; align-self: flex-start;
}
.footer-wordmark { height: 24px; width: auto; display: block; }
/* [Design 21/07] footer PRO : marque (tente+calligraphie+devise) / nav / meta */
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px 28px; flex-wrap: wrap; width: 100%;
}
.footer-marque { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.footer-tente { width: 52px; height: 52px; object-fit: contain; }
.footer-marque-txt { display: flex; flex-direction: column; gap: 3px; }
.footer-marque-txt small { color: var(--muted); font-size: 12px; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: var(--ink); font-size: 13.5px; text-decoration: none; }
.footer-nav a:hover { color: var(--accent-text); text-decoration: underline; }
.footer-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12.5px; }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
}

/* [Portraits] vignette ronde du poète dans l'en-tête du panneau carte —
   uniquement quand un portrait réel existe. */
.panel-poet-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  vertical-align: middle; margin-inline-end: 7px;
  border: 1.5px solid var(--primary);
}

/* [20/07 — OUI porteur] outils du poème dans l'EN-TÊTE : permalien 🔗 + أ−/أ+
   poussés en fin de ligne (RTL : à gauche) — la barre قراءة dédiée disparaît. */
.poem-head .poem-outils {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px;
}
.poem-permalien {
  text-decoration: none; font-size: 14px; opacity: .55; line-height: 1;
}
.poem-permalien:hover { opacity: 1; }

/* [W7 n°1 — GO porteur] Infobox lieu façon Wikipedia : fiche d'identité en
   tête de colonne latérale — lignes dt/dd, liseré ambre, jamais de ligne vide. */
.infobox { border-top: 3px solid var(--primary); }
.infobox-titre {
  font-size: 17px; font-weight: 700; color: var(--accent-text);
  margin: 0 0 8px; text-align: center;
}
.infobox-corps { margin: 0; }
.infobox-ligne {
  display: flex; gap: 10px; padding-block: 6px;
  border-top: 1px solid var(--border); font-size: 13.5px;
}
.infobox-ligne dt { color: var(--muted); min-width: 92px; font-weight: 600; }
.infobox-ligne dd { margin: 0; color: var(--ink); }
.infobox-ligne dd a { color: var(--accent-text); }
.infobox-ligne code { font-size: 12px; }

/* [Retour porteur 20/07 v2 — « comme le popup »] بيت-témoin des cartes dans la
   forme du ديوان : صدر aligné droite, عجز décalé gauche, chaque hémistiche
   INSÉCABLE (nowrap + ellipse) — un hémistiche ne se coupe jamais en deux. */
.quote--bayt {
  display: flex; flex-direction: column; gap: 1px;
  font-family: "Amiri", serif; font-size: 16.5px; line-height: 1.95;
}
.quote--bayt .qb-h {
  display: block; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quote--bayt .qb-h--sadr { align-self: flex-start; }  /* RTL : droite */
.quote--bayt .qb-h--ajaz { align-self: flex-end; }    /* RTL : gauche */

/* [Cartes v2 — 20/07] Bande de stats du pied de carte : compteurs réels,
   icônes discrètes, chiffres tabulaires — remplace les badges flottants qui
   chargeaient l'image. margin-top:auto = collée en bas (cartes homogènes). */
.card-stats {
  display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.card-stat { display: inline-flex; align-items: center; gap: 5px; }
.card-stat .icon { width: 14px; height: 14px; }

/* [Catalogues 20/07] Carte entièrement cliquable (pattern « stretched link »
   des listings pro) : le lien plein-carte est SOUS les liens internes (poète,
   région, tags — z-index 2) qui restent cliquables individuellement. */
.card { position: relative; }
.card-lien { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card .card-body a, .card .media-overlay a, .card .tags-row a,
.card .poete a, .card .chip { position: relative; z-index: 2; }
.card:has(.card-lien:hover) {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .10); transform: translateY(-2px);
  transition: box-shadow .15s, transform .15s;
}

/* [Retour porteur 20/07] Barre de filtres refondue au standard des toolbars
   pro : UNE rangée de contrôles homogènes (hauteur 40px, pilules assorties aux
   chips), recherche avec loupe intégrée, selects auto-appliqués, bouton
   discret (repli sans JS), « مسح » en lien sobre. */
.filtres-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-block: 4px 16px;
}
.filtres-bar input[type="search"],
.filtres-bar select,
.filtres-bar .filtres-appliquer {
  height: 40px; box-sizing: border-box; font: inherit; font-size: 14px;
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--border); border-radius: 999px;
}
.filtres-recherche { position: relative; flex: 1 1 240px; max-width: 360px; }
.filtres-recherche .icon {
  position: absolute; inset-inline-start: 14px; top: 50%;
  transform: translateY(-50%); width: 16px; height: 16px;
  color: var(--muted); pointer-events: none;
}
.filtres-bar input[type="search"] {
  width: 100%; padding: 0 40px 0 16px;  /* RTL : loupe côté droit */
}
.filtres-bar input[type="search"]::placeholder { color: var(--muted); }
.filtres-bar select {
  /* RTL : le texte part de la droite, le chevron vit à GAUCHE (fin de ligne) */
  padding: 0 14px 0 32px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23857a63' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: left 12px center;
}
.filtres-bar input[type="search"]:hover, .filtres-bar select:hover {
  border-color: var(--primary);
}
.filtres-bar input[type="search"]:focus, .filtres-bar select:focus {
  outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary);
}
.filtres-appliquer {
  padding: 0 18px; cursor: pointer; color: var(--accent-text);
  border-color: var(--primary); background: transparent; width: auto; flex: 0 0 auto;
}
.filtres-appliquer:hover { background: var(--primary); color: #fff; }
.filtres-reinit {
  color: var(--muted); font-size: 13.5px; text-decoration: underline dotted;
  margin-inline-start: 2px;
}

/* [Revue porteur 20/07] Extrait « ذُكر في » : carte compacte — vers citant
   seulement, contexte (taille du poème) + CTA vers la page d'ancrage. */
.poem--extrait .poem-body--extrait { margin-top: 4px; }
.poem-extrait-pied {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-top: 10px;
  border-top: 1px dashed var(--border); padding-top: 10px;
}
.poem-extrait-contexte { color: var(--muted); font-size: 13px; }
.poem-extrait-cta { font-size: 13.5px; }

/* [W6 n°3] شرح المفردات : repli discret sous le poème — le mot en Amiri
   (comme les vers), l'explication en texte courant. */
.poem-gloses { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.poem-gloses summary {
  cursor: pointer; color: var(--accent-text); font-size: 13.5px; font-weight: 600;
}
.gloses-liste { margin: 8px 0 0; }
.glose-item { display: flex; gap: 10px; margin-block: 6px; align-items: baseline; }
.glose-item dt {
  font-family: "Amiri", serif; font-size: 17px; color: var(--accent-text);
  min-width: 72px; font-weight: 700;
}
.glose-item dd { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.8; }
.fil-contenants a { color: var(--accent-text); text-decoration: none; }
.fil-contenants a:hover { text-decoration: underline; }
.enfants-lieux { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- [T18→P4] Galerie photos : crédit par diapositive + lightbox + fly-to carte ---- */
.hero-slide[data-lightbox-src] { cursor: zoom-in; }
.hero-credit {
  color: var(--muted); font-size: 12px; margin-top: 6px; text-align: end;
}
/* [P4] Une ligne de crédit par photo, une seule visible à la fois (l'attribut
   `hidden` posé côté serveur pour toutes sauf la première ; static/js/
   gallery.js bascule lequel selon la diapositive visible). */
.hero-credit[hidden] { display: none; }
.coord-bar--link {
  text-decoration: none; color: inherit; cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.coord-bar--link:hover { background: var(--border); }
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(20, 14, 4, .92);
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw; max-height: 92vh; border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}
.lightbox-close {
  position: absolute; top: 18px; inset-inline-end: 22px; width: 42px; height: 42px;
  border-radius: 50%; border: none; background: var(--surface); color: var(--primary-ink);
  font-size: 18px; cursor: pointer; box-shadow: var(--shadow-lg);
}
.lightbox-close:hover { background: var(--primary); }
/* Marqueur mis en avant par fly-to (?fly=slug) : persiste tant que la page
   n'est pas rechargée sur une autre cible (hors du cycle sync() du clustering). */
.marker-pin--vedette { filter: drop-shadow(0 0 8px var(--primary)); transform: scale(1.2); }

/* [T17] Bayt mobile compact : un بيت = une unité visuelle — صدر et عجز
   empilés à interligne serré, صدر au début (droite en RTL), عجز en retrait
   fixe constant (rythme de lecture régulier, aucun texte flottant), fine
   séparation entre أبيات au lieu des grands blocs alternés. */
@media (max-width: 640px) {
  .bayt {
    grid-template-columns: 1fr; gap: 2px; padding: 9px 14px;
    /* [T23] même variable --verse-size que le desktop (A-/A+ reste
       cohérent partout) mais mise à l'échelle 0.85 : identique au 17px
       fixe d'avant T23 quand --verse-size vaut 20px par défaut — zéro
       régression du compactage mobile T17 tant que l'utilisateur ne
       touche pas la barre de lecture. */
    font-size: calc(var(--verse-size) * 0.85); line-height: 1.75; text-align: start;
  }
  .bayt:nth-of-type(even) { background: none; }
  .bayt + .bayt, .poem-more-body .bayt + .bayt { border-top: 1px solid var(--border); }
  .hemistich--sadr { text-align: start; }
  .hemistich--ajaz {
    /* Deux variantes testées (captures avant/après T17) : text-align:end
       fait « flotter » le début de chaque عجز à une position imprévisible ;
       le retrait fixe garde un rythme de lecture stable côté droit. */
    text-align: start; padding-inline-start: 30px;
    border-inline-start: 0; color: var(--ink);
  }
  .bayt--single { text-align: center; }
  .poem-body { padding: 2px 0 6px; }
  .poem-more { margin-inline: 14px; }
  .poem-more-body .bayt:first-child { border-top: 0; }
  .poem-source { margin-inline-start: 0; }
}

/* ---- Fiche poète (en-tête) ---- */
.poet-hero { padding-block: 26px 8px; }
.poet-hero .chips-top { display: flex; gap: 8px; margin-bottom: 8px; }
/* Titre hero à la même échelle visuelle que la maquette (mesure : hauteur de
   fonte ≈ 5.5% de la largeur de page dans la maquette, contre ~2.9% avant ce
   correctif) */
.poet-hero h1 { font-size: 64px; line-height: 1.2; }
.poet-hero .pills { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 14px; }
.poet-hero .pills .chip--solid { padding: 7px 14px; font-size: 14px; }
.lieux-lies { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-block: 8px 16px; }
.lieux-lies .label { color: var(--muted); font-size: 14px; }
/* [T23] chips « مواضع بارزة » : icône lieu olive */
.lieux-lies .icon { color: var(--olive); }
.bio { max-width: 900px; }

/* ---- Carte plein écran (accueil) ---- */
body.page-carte { overflow: hidden; }
#map { position: fixed; inset-block: var(--header-h) 0; inset-inline: 0; }
.marker-pin { width: 34px; height: 44px; cursor: pointer; }
/* [Étiquette d'épingle] nom du lieu sous la pointe, comme les toponymes du
   fond de carte : halo blanc pour la lisibilité, absolu pour ne pas décaler
   l'ancrage bottom du marqueur. */
.marker-wrap { position: relative; cursor: pointer; }
.marker-label {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 1px; white-space: nowrap;
  font-family: var(--font-body); font-size: 11.5px; font-weight: 700;
  color: #3A2B14;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 1px 2px #fff, 0 -1px 2px #fff;
  pointer-events: none;
}
/* [W7 n°2] Lieu provisoire (precision=inconnu) : point ambre discret devant
   l'étiquette + soulignement pointillé — signal de statut, pas une alarme. */
.marker-label--provisoire {
  text-decoration: underline dotted #C99A3B;
  text-underline-offset: 3px;
}
.marker-label--provisoire::before {
  content: ""; display: inline-block; vertical-align: 1px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #C99A3B; box-shadow: 0 0 0 1.5px #fff;
  margin-inline-end: 4px;
}

/* [W3a] Les popups MapLibre ont disparu de la carte principale (remplacés
   par le panneau poème persistant #poem-panel, cf. map.js) : les classes
   .popup-* conservées ci-dessous sont celles RÉUTILISÉES par le panneau
   (bayts, disclosures, galerie, lightbox). */

/* [Fix شطر sur une ligne] chaque hémistiche ne doit JAMAIS être coupé sur deux
   lignes (ex. « احداد »). Colonnes dimensionnées au contenu + nowrap ; si un بيت
   dépasse la largeur du popup, la bande des أبيات défile horizontalement plutôt
   que de replier un hémistiche. */
.popup-bayts {
  padding: 14px 16px 6px;
  overflow-x: auto; scrollbar-width: none;
}
.popup-bayts::-webkit-scrollbar { display: none; }
.popup-bayt {
  display: grid; grid-template-columns: max-content max-content;
  justify-content: center; align-items: baseline;
  gap: 3px 14px; padding-block: 6px;
  font-family: var(--font-verse); font-size: 13.5px; line-height: 1.75;
  white-space: nowrap;
}
.popup-bayt .hemistich { white-space: nowrap; }
.popup-bayt + .popup-bayt { border-top: 1px dashed var(--border); }
.popup-bayt--single { grid-template-columns: 1fr; text-align: center; }
.popup-bayt .hemistich--sadr { text-align: end; }
.popup-bayt .hemistich--ajaz {
  text-align: start; padding-inline-start: 10px; border-inline-start: 1px solid var(--border);
}
/* [P1] accent « lieu » olive, cohérent avec .poem-place/.coord-bar ailleurs
   sur le site — le nom du lieu redescend au second plan derrière le poème. */
.popup-place-name {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--olive);
}
/* [P1-bis] Section « عن الموضع » repliée par défaut — même patron de
   disclosure que .poem-more (fiche, cf. templates/includes/poem.html). */
.popup-about { border-top: 1px dashed var(--border); margin: 2px 16px 0; }
.popup-about summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  margin-block: 8px; padding: 6px 12px; min-height: var(--tap);
  border-radius: var(--radius-pill); background: var(--surface-2);
  font-weight: 700; font-size: 12.5px; color: var(--accent-text);
  transition: background var(--fast) var(--ease);
}
.popup-about summary:hover { background: var(--border); }
.popup-about summary::-webkit-details-marker { display: none; }
.popup-about summary::after {
  content: "▾"; font-size: 9px; transition: transform var(--fast) var(--ease);
}
.popup-about[open] summary::after { transform: rotate(180deg); }
.popup-about-body { padding-bottom: 6px; }
.popup-about-body .extrait { padding: 0 16px 4px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }

/* [P1-bis directive 3] Audio repliable « ▸ تسجيل صوتي » — même patron de
   disclosure que .popup-about. Cible tactile ≥44px (var(--tap)) pour un
   usage mobile au doigt sans mires. */
.popup-audio { border-top: 1px dashed var(--border); }
.popup-audio summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  margin-block: 8px; padding: 6px 12px; min-height: var(--tap);
  border-radius: var(--radius-pill); background: var(--surface-2);
  font-weight: 700; font-size: 12.5px; color: var(--accent-text);
  transition: background var(--fast) var(--ease);
}
.popup-audio summary:hover { background: var(--border); }
.popup-audio summary::-webkit-details-marker { display: none; }
.popup-audio summary::after {
  content: "▸"; font-size: 10px; transition: transform var(--fast) var(--ease);
}
.popup-audio[open] summary::after { transform: rotate(90deg); }
.popup-audio-body { padding-bottom: 6px; }
.popup-audio-body audio { display: block; width: 100%; margin: 0; }

/* [Galerie popup façon تويتر] bande d'images défilable horizontalement +
   lightbox (map.js), même patron scroll-snap que la galerie P4 de la fiche. */
.popup-shots {
  display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 0 16px 6px; margin: 0; cursor: grab; touch-action: pan-x;
}
.popup-shots::-webkit-scrollbar { display: none; }
.popup-shots.is-dragging { cursor: grabbing; }
.popup-shots.is-dragging .popup-shot { pointer-events: none; }
.popup-shot {
  flex: 0 0 auto; scroll-snap-align: start; padding: 0; border: 0; cursor: zoom-in;
  border-radius: 8px; overflow: hidden; background: var(--surface-2);
}
.popup-shot img { display: block; width: 150px; height: 96px; object-fit: cover; }

.popup-rattach {
  width: 100%; font-size: 11px; color: var(--olive, #6f7a3a);
  font-family: var(--font-body); padding-top: 1px;
}
/* [Modèle Wikipédia] liens poète/lieu du popup : discrets (couleur héritée),
   soulignés au survol seulement. */
.popup-rattach a { color: inherit; text-decoration: none; }
.popup-rattach a:hover { text-decoration: underline; }

/* [Vers-témoin الشاهد] l'ellipse KWIC du popup n'a plus d'objet : le panneau
   affiche le texte complet — voir .popup-bayt--temoin / .mot-lieu.est-shahid
   (section panneau) pour la forme portée du témoin. */

/* [Playlist popup] pistes avec titre + interprète. */
.popup-track + .popup-track { margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 6px; }
.popup-track-meta { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; padding: 0 2px 2px; }
.popup-track-title { font-size: 12px; font-weight: 700; color: var(--text); }
/* [W4] Badge نوع التسجيل (غناء/إنشاد/قراءة) avant le titre de la piste —
   utilisé par la playlist du panneau carte (map.js) ET la fiche lieu. */
.popup-track-type { font-size: 10.5px; font-weight: 700; color: var(--accent-text);
  border: 1px solid currentColor; border-radius: var(--radius-pill); padding: 0 7px;
  line-height: 1.5; }
/* [W4] Piste saisie (clip YouTube) dont le mp3 n'est pas encore rapatrié. */
.audio-attente { font-size: 12px; color: var(--muted); font-style: normal;
  padding: 4px 2px; }

/* [W4 — P3] Accordéon par poète de la fiche lieu (multi-poètes ou >1 page) */
.poems-poete { border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface); margin-block: 10px; }
.poems-poete > summary { cursor: pointer; padding: 12px 16px; display: flex;
  align-items: baseline; justify-content: space-between; gap: 10px;
  font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.poems-poete > summary::-webkit-details-marker { display: none; }
.poems-poete > summary::after { content: "‹"; transition: transform .18s;
  transform: rotate(-90deg); color: var(--muted); }
.poems-poete[open] > summary::after { transform: rotate(90deg); }
.poems-poete[open] > summary { border-bottom: 1px solid var(--border); }
.poems-poete-compte { color: var(--muted); font-weight: 400; font-size: 13px;
  font-family: var(--font-body); margin-inline-start: auto; }
.poems-poete .poems-list { padding: 2px 12px 12px; }
.popup-track-artist { font-size: 11px; color: var(--text-mute, #8a7f6a); }

/* [Partage] barre d'icônes élégante en bas du popup. */
.popup-share {
  display: flex; justify-content: center; gap: 8px;
  padding: 2px 16px 12px; margin-top: -4px;
}
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-mute, #8a7f6a); cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}
.share-btn svg { width: 16px; height: 16px; }
.share-btn:hover { background: var(--olive, #6f7a3a); color: #fff; transform: translateY(-1px); }
.share-btn.is-copied { background: var(--olive, #6f7a3a); color: #fff; }
/* Web Share natif : pertinent sur mobile ; en desktop on montre les réseaux. */
@media (min-width: 601px) { .share-native { display: none; } }
@media (max-width: 600px) { .popup-share .share-btn:not(.share-native):not(.share-copy) { display: none; } }

/* [Lightbox popup] overlay plein écran autonome (les popups sont dynamiques). */
.popup-lightbox {
  position: fixed; inset: 0; z-index: 1000; display: flex;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .85); padding: 24px;
}
.popup-lightbox[hidden] { display: none; }
.popup-lightbox img {
  max-width: 94vw; max-height: 88vh; border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.popup-lightbox-close {
  position: absolute; top: 14px; inset-inline-end: 18px;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .15); color: #fff; font-size: 28px; cursor: pointer;
}
.popup-lightbox-close:hover { background: rgba(255, 255, 255, .3); }
/* [Navigation lightbox] flèches ‹ › + compteur — les DEUX lightbox (panneau
   carte .popup-lightbox-* et fiche .lightbox-*) partagent le style. */
.popup-lightbox-nav, .lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .15); color: #fff; font-size: 30px; line-height: 1;
  cursor: pointer; z-index: 2;
}
.popup-lightbox-nav:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .35); }
.popup-lightbox-prev, .lightbox-prev { left: 16px; }
.popup-lightbox-next, .lightbox-next { right: 16px; }
.popup-lightbox-count, .lightbox-count {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .85); font-size: 13px; font-family: var(--font-body);
  background: rgba(0, 0, 0, .4); padding: 3px 12px; border-radius: var(--radius-pill);
}
@media (max-width: 600px) {
  .popup-lightbox-nav, .lightbox-nav { width: 42px; height: 42px; }
  .popup-lightbox-prev, .lightbox-prev { left: 8px; }
  .popup-lightbox-next, .lightbox-next { right: 8px; }
}

/* [Toggle genre flottant] chips discrètes en coin de carte (haut-droit, loin du
   zoom en haut-gauche) — patron « filtre » Google/Airbnb, ne masque rien. */
.genre-toggle {
  position: absolute; z-index: 5; top: 12px; right: 12px;
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface, #fff); border: 1px solid var(--border);
  border-radius: var(--radius-pill); box-shadow: var(--shadow);
}
/* [QA 21/07] Cibles tactiles : sur petit écran, chips/tags/liens de cartes
   atteignent >=36px de hauteur (reco accessibilité tactile). */
@media (max-width: 640px) {
  .chip, .tags-row a, .poem-mention-chip { min-height: 36px; align-items: center; display: inline-flex; }
  .pagination a, .pagination span { min-width: 40px; min-height: 40px; }
  /* mesuré au QA : lien région des cartes 21px, footer 22px, مسح 24px,
     contrôles MapLibre 29px — remontés au seuil tactile. Les .mention-lieu
     restent des liens EN LIGNE dans les vers (exemption WCAG, l'agrandir
     casserait la mise en page du بيت). */
  .media-overlay .region { min-height: 32px; display: inline-flex; align-items: center; }
  /* zone tactile élargie SANS grossir le visuel (padding compensé) */
  .poem-permalien { padding: 10px; margin: -10px; }
  .breadcrumb a { min-height: 32px; display: inline-flex; align-items: center; padding-inline: 6px; margin-inline: -2px; }
  .poem-poet { min-height: 32px; display: inline-flex; align-items: center; }
  .filtres-reinit { padding: 8px 6px; display: inline-block; }
  .site-footer a { padding-block: 8px; display: inline-block; }
  .maplibregl-ctrl-group button { width: 36px !important; height: 36px !important; }
}

/* [21/07] Recherche discrète sur la carte : loupe ronde sous le toggle genre,
   champ qui se déplie, résultats en liste flottante — pattern géoportail. */
.map-search {
  position: absolute; z-index: 5; top: 64px; right: 12px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.map-search-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface, #fff); border: 1px solid var(--border);
  box-shadow: var(--shadow); cursor: pointer; color: var(--accent-text);
  display: inline-flex; align-items: center; justify-content: center;
}
.map-search-btn svg { width: 18px; height: 18px; }
.map-search-btn:hover { border-color: var(--primary); }
.map-search.is-open .map-search-btn { background: var(--primary); color: #fff; }
.map-search-input {
  width: min(260px, 72vw); height: 40px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--surface, #fff); box-shadow: var(--shadow);
  font: inherit; font-size: 14px; color: var(--ink);
}
.map-search-input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.map-search-resultats {
  list-style: none; margin: 0; padding: 4px;
  width: min(260px, 72vw); max-height: 46vh; overflow-y: auto;
  background: var(--surface, #fff); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); direction: rtl;
}
.map-search-resultats li {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px;
  display: flex; align-items: baseline; gap: 6px;
}
.map-search-resultats li:hover { background: var(--bg, #faf6ee); }
.map-search-resultats li small { color: var(--muted); font-size: 12px; }
.map-search-resultats .rs-vide { color: var(--muted); cursor: default; }
@media (max-width: 640px) { .map-search { top: 58px; right: 10px; } }

.genre-toggle button {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 12.5px;
  color: var(--text-mute, #8a7f6a); padding: 6px 13px; border-radius: var(--radius-pill);
  min-height: 34px; transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.genre-toggle button.is-active { background: var(--olive, #6f7a3a); color: #fff; }
.genre-toggle button:not(.is-active):hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 600px) {
  .genre-toggle { top: 10px; right: 10px; }
  .genre-toggle button { padding: 6px 11px; font-size: 12px; }
}

@media (max-width: 420px) {
  .popup-bayt { font-size: 13px; gap: 2px 10px; }
}

/* ---- [W3a] Panneau poème PERSISTANT (annexe architecture) ----------------
   Le poème n'existe qu'à UN SEUL endroit : cette lame, hors du canvas
   MapLibre — elle NE se ferme PAS quand la carte bouge (fermeture explicite
   ✕/Échap, patron StoryMap). Desktop : panneau latéral côté inline-start
   (droite en RTL) sous l'en-tête ; mobile <600px : bottom-sheet à défilement
   interne, comme Google/Apple Maps. */
#poem-panel {
  position: fixed; z-index: 95;
  display: flex; flex-direction: column;
  background: var(--surface); overscroll-behavior: contain;
  font-family: var(--font-body);
}
#poem-panel[hidden] { display: none; }
.panel-close {
  position: absolute; top: 8px; inset-inline-end: 8px; z-index: 6;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.panel-close:hover { background: var(--border); }
.panel-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 10px; }
@media (min-width: 601px) {
  #poem-panel {
    top: calc(var(--header-h) + 12px); bottom: 12px; right: 12px;
    width: min(400px, calc(100vw - 24px));
    border: 1px solid var(--border); border-radius: var(--radius-card);
    box-shadow: var(--shadow-lg);
  }
  /* le toggle genre (coin haut-droit de la carte) s'écarte du panneau ouvert */
  body.panel-open .genre-toggle { right: calc(min(400px, 100vw - 24px) + 24px); }
}
@media (max-width: 600px) {
  #poem-panel {
    inset: auto 0 0 0; max-height: 60vh;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  }
  /* poignée visuelle de la feuille */
  #poem-panel::before {
    content: ""; position: absolute; top: 8px; inset-inline: 0; margin-inline: auto;
    width: 42px; height: 4px; border-radius: 3px; background: rgba(0, 0, 0, .22);
    z-index: 5; pointer-events: none;
  }
  .panel-scroll { padding-top: 14px; }
}

/* En-tête poème : poète (lien), chips genre / رحلة. */
.panel-poem-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 14px 16px 0; padding-inline-end: 52px; /* place du ✕ */
}
.panel-poet { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.panel-poet:hover { color: var(--accent-text); }
.panel-chip-genre, .panel-chip-rihla {
  padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 700;
}
.panel-chip-genre { background: var(--surface-2); color: var(--amber-text); }
.panel-chip-rihla { background: var(--olive-bg); color: var(--olive); }

/* Texte complet du poème : mêmes gabarits bayt que partout (.popup-bayt),
   en corps de lecture un cran au-dessus du popup d'antan. */
.panel-bayts .popup-bayt { font-size: 15px; }
/* Mots-lieux (mentions VALIDÉES, servies par l'API) : surlignage vert
   discret, cliquable → fly-to + zoom rapproché sur CE lieu. */
.panel-bayts .mot-lieu {
  cursor: pointer; color: var(--olive); background: var(--olive-bg);
  border-radius: 6px; padding: 0 3px;
  transition: background var(--fast) var(--ease);
}
.panel-bayts .mot-lieu:hover { background: #D8E6C4; }
/* [Vers-témoin porté 14d1768] بيت nommant le lieu actif : lavis olive doux ;
   le mot du lieu passe en blanc sur olive (le panneau montre le texte
   COMPLET — l'intention KWIC du popup devient surlignage + défilement). */
.panel-bayts .popup-bayt--temoin {
  background: color-mix(in srgb, var(--olive-bg) 65%, transparent);
  border-radius: 8px;
}
.panel-bayts .mot-lieu.est-shahid { background: var(--olive); color: #fff; }

/* Rangée de puces « المواضع المذكورة » — numéro d'étape seulement en رحلة. */
.panel-lieux { padding: 8px 16px 2px; border-top: 1px dashed var(--border); margin-top: 8px; }
.panel-lieux-label { font-size: 12px; font-weight: 700; color: var(--text-mute); margin-bottom: 7px; }
.panel-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.panel-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; min-height: 34px; border: 0; cursor: pointer;
  border-radius: var(--radius-pill); background: var(--olive-bg); color: var(--olive);
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.panel-chip:hover { background: #D8E6C4; }
.panel-chip:active { transform: scale(.96); }
/* [Fix porteur] puce du lieu ACTIF (affiché dans le bloc aperçu) : olive plein,
   texte blanc — situe l'utilisateur dans la géographie du poème. */
.panel-chip--active { background: var(--olive); color: #fff; }
.panel-chip--active:hover { background: var(--olive); }
.panel-chip--active .panel-chip-num { background: rgba(255, 255, 255, .25); color: #fff; }
/* [Fix porteur] bouton SECONDAIRE (contour) : un seul CTA primaire par panneau
   — «اقرأ القصيدة» reste plein, «عرض تفاصيل الموضع» passe en contour ambre. */
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: var(--tap); padding: 10px 18px; cursor: pointer;
  background: transparent; color: var(--accent-text);
  border: 1.5px solid var(--primary); border-radius: var(--radius-pill);
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.btn-secondary:hover { background: var(--primary); color: var(--primary-ink); }
.btn-secondary:active { transform: scale(.97); }
/* puce-LIEN d'un lieu non localisé (modèle Wikipédia : mène à la fiche) —
   soulignement pointillé pour la distinguer des puces fly-to */
.panel-chip--page { text-decoration: underline dotted; text-underline-offset: 3px; }
.panel-chip-num {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--olive); color: #fff; font-size: 11px; font-weight: 800;
}

/* Aperçu du lieu cliqué, sous le poème (galerie/description/audio/CTA). */
.panel-place { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.panel-poem-slot:empty + .panel-place-slot .panel-place {
  border-top: 0; margin-top: 0; /* lieu sans poème : le bloc lieu ouvre le panneau */
}
.panel-place-head { padding: 4px 16px 2px; padding-inline-end: 52px; }
.panel-place-head .popup-place-name { font-size: 14px; }
.panel-cite { font-size: 11.5px; color: var(--text-mute); padding-top: 1px; }
.panel-place .popup-rattach { padding-top: 1px; }
/* [W7 n°2] même bandeau « قيد التحقيق » que la fiche, format court panneau. */
.panel-provisoire {
  background: #FBF3E2; border: 1px solid #EAD7A8;
  border-inline-start: 3px solid #C99A3B;
  border-radius: 8px; padding: 5px 10px; margin: 6px 16px 0;
  color: #7A5A1E; font-size: 12px;
}
.panel-place .popup-about, .panel-place .popup-audio { margin: 2px 16px 0; }
.panel-cta { margin: 12px 16px 4px; width: calc(100% - 32px); }
.panel-poem .panel-cta { margin-bottom: 0; }

/* ---- [W3a] Mode FOCUS : un poème actif, le reste s'estompe --------------
   Les épingles de base et les clusters passent en retrait (opacité, aussi
   appliquée aux couches cluster via setPaintProperty dans map.js) ; seuls
   les lieux du poème actif restent illuminés — marqueurs dédiés hors source
   clusterisée (jamais fusionnés au dézoom), halo commun olive
   (co-illumination par défaut, la ligne n'existe qu'en رحلة). */
/* les épingles ont désormais un wrapper (.marker-wrap = img + étiquette de
   nom, cf. f7ae933) : l'estompe s'applique au wrapper ENTIER — l'étiquette
   d'une épingle hors-poème doit s'estomper avec elle. */
.marker-wrap { transition: opacity var(--normal) var(--ease); }
#map.poem-focus .marker-wrap:not(.marker-poeme) { opacity: .25; }
.marker-poeme { position: relative; cursor: pointer; }
.marker-poeme .marker-pin--poem {
  filter: drop-shadow(0 0 7px rgba(59, 109, 17, .85));
}
.marker-poeme:hover .marker-pin--poem {
  filter: drop-shadow(0 0 10px rgba(59, 109, 17, 1));
}
/* numéro d'étape (رحلة seulement) : pastille olive au coin du marqueur */
.marker-poeme-num {
  position: absolute; top: -7px; inset-inline-end: -7px;
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--olive); color: #fff;
  font-size: 11.5px; font-weight: 800; font-family: var(--font-body);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  pointer-events: none;
}

/* ---- Recherche ---- */
.search-bar { display: flex; gap: 10px; margin-block: 10px 24px; flex-wrap: wrap; }
.search-bar input {
  flex: 1; min-width: 0; min-height: var(--tap); padding: 12px 18px; border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--surface);
  font-family: var(--font-body); font-size: 16px;
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.search-bar .btn-primary { width: auto; padding-inline: 26px; }

/* ---- Pages statiques / vides ---- */
.prose { max-width: 780px; padding-block: 10px 50px; }
.empty { color: var(--muted); text-align: center; padding-block: 60px; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border); color: var(--muted);
  font-size: 13px; padding: 16px 22px; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.footer-brand strong { color: var(--ink); font-family: var(--font-display); }
.footer-copy { color: var(--text-mute, #8a7f6a); margin-inline-start: 8px; font-size: 12px; }

/* ---- [T26] Pont d'édition staff-only (pastille ✎ vers l'admin existant) ---- */
/* [Design 21/07 — retour porteur] pont staff = UNE barre horizontale sobre
   (badge · تحرير · لوحة · خروج), plus d'empilement qui chevauchait le footer. */
.edit-bridge {
  position: fixed; inset-inline-start: 12px; inset-block-end: 12px; z-index: 90;
  display: flex; flex-direction: row-reverse; align-items: center; gap: 8px;
  flex-wrap: wrap; max-width: calc(100vw - 24px);
  background: color-mix(in srgb, var(--surface, #fff) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; box-shadow: var(--shadow-lg);
}
.edit-bridge .staff-badge { font-size: 12px; color: var(--muted); }
.edit-bridge .edit-bridge-pill { min-height: 32px; padding: 5px 14px; font-size: 13px; box-shadow: none; }
.edit-bridge .edit-bridge-dash, .edit-bridge .staff-logout-btn { font-size: 12.5px; }
.edit-bridge-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap);
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--primary-grad); color: var(--primary-ink);
  font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.edit-bridge-pill:hover { transform: scale(1.04); }
.edit-bridge-dash {
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--badge-dark); color: #fff; font-size: 12px; font-weight: 600;
}
.poem-edit-link { background: var(--olive-bg); color: var(--olive); font-weight: 600; }
/* [Lot ergonomie 18/07] Badge de session staff + déconnexion, à côté du pont
   d'édition — discret mais toujours lisible (le porteur sait POURQUOI il voit
   les outils d'édition). */
.staff-badge {
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .92); color: #333;
  font-size: 12px; box-shadow: var(--shadow-lg);
}
.staff-logout { margin: 0; }
.staff-logout-btn {
  border: none; cursor: pointer;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--badge-dark); color: #fff; font-size: 12px; font-weight: 600;
}
.staff-logout-btn:hover { opacity: .85; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .detail-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .poet-hero h1 { font-size: 40px; }
}
@media (max-width: 640px) {
  .poet-hero h1 { font-size: 32px; }
  .card-media .titre { font-size: 19px; }
  .search-bar { flex-wrap: nowrap; }
  .search-bar .btn-primary { padding-inline: 18px; }
}

/* [W7 n°9] Cartes poètes de hauteur HOMOGÈNE : colonne flex, CTA collé en bas
   quelle que soit la longueur de la notice ; notice absente → placeholder
   discret «سيرة قيد الإعداد». (La grille .grid-cards étire déjà les rangées.) */
.grid-cards .card { display: flex; }
.grid-cards .card .card-body { display: flex; flex-direction: column; flex: 1; }
.card-cta-bottom { margin-top: auto; }
.bio-extrait--vide { color: var(--text-mute, #8a7f6a); font-style: italic; }

/* [Design 22/07] sous-titre interne de section (ذُكر في dans الأشعار) */
.section-sous-titre {
  font-size: 15px; font-weight: 700; color: var(--accent-text);
  margin: 18px 0 10px; padding-top: 14px; border-top: 1px dashed var(--border);
}

/* [Parcours 22/07] nom du poète cliquable dans l'accordéon (hérite du style,
   souligné au survol seulement). */
.poems-poete-nom a { color: inherit; text-decoration: none; }
.poems-poete-nom a:hover { text-decoration: underline; color: var(--accent-text); }

/* [Design 21/07] Replis (.pli) : TOUTE la ligne du titre est cliquable
   (min 44px), chevron NET 18px qui pivote — fini la flèche microscopique. */
details.pli > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; margin: -4px; padding: 4px; border-radius: 10px;
}
details.pli > summary::-webkit-details-marker { display: none; }
details.pli > summary::after {
  content: "‹"; margin-inline-start: auto;
  font-size: 22px; font-weight: 700; color: var(--accent-text);
  transform: rotate(-90deg); transition: transform var(--fast) var(--ease);
  line-height: 1; padding-inline: 4px;
}
details.pli[open] > summary::after { transform: rotate(90deg); }
details.pli > summary:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }

/* [W7 n°7] Outil «قياس المسافة» replié : summary = titre cliquable (marqueur
   natif retiré, chevron discret), corps révélé à l'ouverture. */
.distance-tool { cursor: pointer; }
.distance-tool > summary { list-style: none; display: flex; align-items: center; gap: 8px; }
.distance-tool > summary::-webkit-details-marker { display: none; }
.distance-tool > summary::after { content: "▾"; margin-inline-start: auto; font-size: 11px; color: var(--text-mute, #8a7f6a); transition: transform var(--fast) var(--ease); }
.distance-tool[open] > summary::after { transform: rotate(180deg); }
.distance-body { padding-top: 12px; }

/* [22/07] Zoom lightbox : la photo est zoomable (clic/molette/pincement) —
   curseur explicite, glisser fluide (pas de transition pendant le pan). */
#lightbox-img{touch-action:none;cursor:zoom-in;transition:transform .15s ease;user-select:none}
#lightbox-img.est-zoomee{cursor:grab;transition:none}

/* [22/07 — GO porteur] Médaillon calligraphique (poète sans portrait) : nom
   complet en koufi Reem Kufi (famille du mot-marque), teinte Diar STABLE par
   poète (identicon sobre — jamais de visage inventé, pattern طغراء). */
.medaillon-calligraphie {
  width: 148px; height: 148px; border-radius: 50%;
  display: grid; place-items: center; padding: 18px; box-sizing: border-box;
  text-align: center; overflow: hidden;
  font-family: 'Reem Kufi', var(--font-display), sans-serif;
  font-weight: 600; font-size: 21px; line-height: 1.8; color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px var(--accent-text), 0 2px 10px rgba(0,0,0,.12);
}
.medaillon-calligraphie--long { font-size: 16.5px; line-height: 1.7; }
/* Teintes déterministes (palette Diar) — partagées fiche + cartes. */
.medaillon--t0 { background: radial-gradient(circle at 30% 25%, #12906d, #0b6a50); }
.medaillon--t1 { background: radial-gradient(circle at 30% 25%, #c79a4d, #a3742e); }
.medaillon--t2 { background: radial-gradient(circle at 30% 25%, #96714e, #6e5136); }
.medaillon--t3 { background: radial-gradient(circle at 30% 25%, #5a7a86, #3f5a64); }
/* Les initiales de repli des cartes prennent la même écriture koufie. */
.avatar-s, .avatar-l { font-family: 'Reem Kufi', var(--font-display), sans-serif; }
.avatar-s.medaillon--t0, .avatar-l.medaillon--t0,
.avatar-s.medaillon--t1, .avatar-l.medaillon--t1,
.avatar-s.medaillon--t2, .avatar-l.medaillon--t2,
.avatar-s.medaillon--t3, .avatar-l.medaillon--t3 { color: #fff; }

/* [22/07 — demande porteur] Les أبيات des FICHES adoptent l'écriture du
   panneau carte (aimée sur الحاج ولد الكتاب) : deux hémistiches resserrés
   autour d'une barre fine, séparateurs POINTILLÉS entre les vers — fini le
   zébrage de fond. Sur petit écran : une colonne centrée (pas de nowrap qui
   déborde). */
.poem-body .bayt {
  grid-template-columns: max-content max-content; justify-content: center;
  gap: 8px 26px; padding: 10px 20px;
}
.poem-body .bayt:nth-of-type(even) { background: transparent; }
.poem-body .bayt + .bayt { border-top: 1px dashed var(--border); }
.poem-body .hemistich--ajaz { padding-inline-start: 14px; }
@media (min-width: 720px) {
  .poem-body .bayt .hemistich { white-space: nowrap; }
}
@media (max-width: 719px) {
  .poem-body .bayt { grid-template-columns: 1fr; text-align: center; }
  .poem-body .hemistich--ajaz { border-inline-start: none; padding-inline-start: 0; }
}
