/*
Theme Name:  Lebrief MA (Arabe)
Theme URI:   https://ar.lebrief.ma
Author:      Lebrief
Description: Thème Arabic RTL pour ar.lebrief.ma
Version:     1.0.1
Text Domain: lebriefma
Tags:        rtl, arabic, news
*/

/* ar-website.css — UI kit styles, RTL */
/* Lebrief Arabe (ar.lebrief.ma) — Design tokens
 * RTL by default. Pair with <html dir="rtl" lang="ar">.
 */

:root {
  /* ---------- COLORS ---------- */
  --bg:               #FFFFFF;
  --bg-alt:           #F7F7F7;
  --bg-ad:            #F0F0F0;
  --bg-dossier:       #2C2C2C;
  --bg-inverse:       #1A1A1A;

  --fg:               #1A1A1A;
  --fg-muted:         #666666;
  --fg-faint:         #999999;
  --fg-on-dark:       #FFFFFF;
  --fg-on-dark-muted: #cccccc;   /* secondary text on dark bg */
  --fg-on-accent:     #1A1A1A;   /* text on --accent (yellow) */

  --accent:           #FFCB21;
  --accent-spec:      #F5A623;
  --accent-hover:     #E6B408;

  --border:           #E5E5E5;
  --border-strong:    #D1D1D1;
  --border-inverse:   #2a2a2a;   /* dividers on dark backgrounds */

  --footer-legal-bg:  #0d0d0d;

  --social-whatsapp:  #25D366;
  --social-facebook:  #1877F2;
  --social-x:         #000000;

  /* ---------- TYPE ---------- */
  --font-display: "Cairo", "Tajawal", "Arabic Typesetting", system-ui, sans-serif;
  --font-body:    "Noto Naskh Arabic", "Cairo", "Traditional Arabic", serif;
  --font-latin:   "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-h1:      32px; --lh-h1:   1.25;
  --fs-h2:      20px; --lh-h2:   1.35;
  --fs-h3:      18px; --lh-h3:   1.4;
  --fs-section: 22px;              /* section/block headings */
  --fs-body:    17px; --lh-body: 1.8;
  --fs-md:      16px;              /* sub-headings, drawer links */
  --fs-sm:      14px;              /* secondary UI text, excerpts */
  --fs-meta:    13px; --lh-meta: 1.5;
  --fs-tiny:    12px;
  --fs-xs:      11px;              /* badge counts, ad labels, category chips */

  /* ---------- SPACING ---------- */
  --container-max:         1300px;
  --gutter:                24px;
  --pad-container:         24px;
  --pad-container-mobile:  16px;
  --space-1:  4px;
  --space-2:  8px;
  --space-2b: 10px;   /* between space-2 and space-3; used for list row gaps */
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;

  /* ---------- RADIUS ---------- */
  --radius-card:  4px;
  --radius-badge: 2px;
  --radius-pill:  999px;

  /* ---------- ELEVATION ---------- */
  --shadow-1:     0 1px 2px rgba(0,0,0,.04);
  --shadow-2:     0 2px 6px rgba(0,0,0,.08);
  --shadow-hover: 0 4px 14px rgba(0,0,0,.12);

  /* ---------- TRANSITION ---------- */
  --t-fast: 120ms ease-out;
  --t-base: 200ms ease-out;

  /* ---------- LAYOUT ---------- */
  --header-h:  96px;
  --subnav-h:  40px;
}

@media (max-width: 767px) {
  :root {
    --fs-h1: 24px;
    --fs-h2: 18px;
    --fs-h3: 16px;
    --fs-body: 16px;
    --pad-container: var(--pad-container-mobile);
    --header-h: 64px;
  }
}

/* ============ RESET / BASE ============ */

*, *::before, *::after { box-sizing: border-box; }

html[dir="rtl"], [dir="rtl"] { text-align: right; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--fg);
  background: var(--bg);
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  color: var(--fg);
  letter-spacing: -0.01em;
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  color: var(--fg);
}

h3, .h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  color: var(--fg);
}

p, .body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.meta {
  font-family: var(--font-body);
  font-size: var(--fs-meta);
  line-height: var(--lh-meta);
  color: var(--fg-muted);
}

.label-latin {
  font-family: var(--font-latin);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ============ PRIMITIVES ============ */

.lb-badge {
  display: inline-block;
  padding: 3px var(--space-2);
  background: var(--accent);
  color: var(--fg-on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-tiny);
  border-radius: var(--radius-badge);
  line-height: 1.4;
}

.lb-badge--dark {
  background: var(--bg-inverse);
  color: var(--fg-on-dark);
}

.lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2b) 20px;
  background: var(--accent);
  color: var(--fg-on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  border: none;
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: background var(--t-fast);
}
.lb-btn:hover { background: var(--accent-hover); }

.lb-card {
  background: var(--bg);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.lb-divider {
  height: 1px;
  background: var(--border);
  border: 0;
}

.lb-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--pad-container);
}

/* Les emplacements publicitaires sont définis dans la section AD, plus bas. */

/* ============ HEADER ============ */

.lb-header { position: sticky; top: 0; z-index: 50; background: var(--bg); }

/* Topbar (black) */
.lb-topbar { background: var(--bg-inverse); color: var(--fg-on-dark-muted); font-size: var(--fs-tiny); }
.lb-topbar__inner { display: flex; justify-content: space-between; align-items: center; padding: var(--space-2) var(--pad-container); gap: var(--space-3); }
.lb-topbar__links { display: none; }
.lb-topbar__links li { list-style: none; }
.lb-topbar__count { background: var(--accent); color: var(--fg-on-accent); padding: 0 5px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; margin-right: var(--space-1); }
.lb-lang-switch { border: 1px solid var(--accent); color: var(--accent); padding: 1px var(--space-2); font-family: var(--font-latin); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .04em; }

/* Logo */
.lb-logo { display: inline-flex; align-items: center; text-decoration: none; margin-top: 5px; margin-bottom: 5px; }
.lb-logo img { display: block; height: 65px; width: auto; }
@media (min-width: 768px) { .lb-logo { margin-top: 8px; margin-bottom: 8px; } }

/* Icon buttons */
.lb-iconbtn { background: transparent; border: 0; padding: 6px; cursor: pointer; color: var(--fg); display: flex; align-items: center; justify-content: center; }
.lb-iconbtn--inverse { color: var(--fg-on-dark); }
.lb-iconbtn:hover { color: var(--accent); }

.lb-hamburger   { display: flex; }
.lb-search-mobile { display: flex; }

/* Desktop nav row — hidden on mobile */
.lb-nav { display: none; }
.lb-nav__cats, .lb-nav__cats li { list-style: none; margin: 0; padding: 0; }

/* Mobile drawer */
.lb-drawer { position: fixed; top: 50px; right: 0; left: 0; bottom: 0; background: var(--bg-inverse); color: var(--fg-on-dark); z-index: 100; overflow-y: auto; }
.lb-drawer__scroll { padding: var(--space-4); padding-top: var(--space-8); position: relative; }
.lb-drawer__close { position: absolute; top: var(--space-4); left: var(--space-4); color: var(--fg-on-dark); background: var(--bg-inverse); border: 1px solid var(--border-inverse); border-radius: var(--radius-pill); }
.lb-drawer__close:hover { color: var(--accent); }
.lb-drawer__section { margin-bottom: var(--space-5); }
.lb-drawer__heading { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-tiny); letter-spacing: .08em; color: var(--accent); text-transform: uppercase; margin: 0 0 var(--space-2); }
.lb-drawer__list { list-style: none; padding: 0; margin: 0; }
.lb-drawer__list li { border-bottom: 1px solid var(--border-inverse); }
.lb-drawer__list a { display: block; padding: 14px var(--space-1); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); color: var(--fg-on-dark); }
.lb-drawer__list a.is-active { color: var(--accent); }
.lb-drawer__lang { display: inline-block; margin-top: var(--space-2); color: var(--accent); font-family: var(--font-latin); font-size: var(--fs-sm); padding: var(--space-2b) 0; }

/* Search overlay */
.lb-search-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 110; display: none; align-items: flex-start; padding-top: 120px; }
.lb-search-overlay.is-open { display: flex; }
.lb-search-input { width: 100%; padding: 18px 20px; border: 0; background: var(--bg); font-size: var(--fs-h3); font-family: var(--font-body); border-radius: var(--radius-card); }

/* Desktop (≥768px) */
@media (min-width: 768px) {
  .lb-hamburger    { display: none; }
  .lb-search-mobile { display: none; }
  .lb-drawer       { display: none; }

  .lb-topbar__inner { padding-top: 6px; padding-bottom: 6px; }
  .lb-topbar__links { display: flex; gap: var(--space-4); align-items: center; }
  .lb-topbar__links a { color: var(--fg-on-dark-muted); }
  .lb-topbar__links a:hover { color: var(--accent); }

  .lb-nav { display: block; background: var(--bg); border-bottom: 1px solid var(--border); }
  .lb-nav__inner { display: flex; justify-content: space-between; align-items: center; padding-top: var(--space-2); padding-bottom: var(--space-2); gap: var(--space-3); }
  .lb-nav__cats { display: flex; gap: 18px; overflow-x: auto; flex: 1; list-style: none; padding: 0; margin: 0; }
  .lb-nav__cats li { list-style: none; }
  .lb-nav__item { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-meta); color: var(--fg); padding: var(--space-1) 2px; white-space: nowrap; text-decoration: none; }
  .lb-nav__item.is-active { border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
  .lb-nav__item:hover { color: var(--accent-hover); }

  .lb-nav__utility { display: flex; gap: var(--space-4); align-items: center; }
  .lb-nav__utility ul { display: flex; gap: var(--space-4); list-style: none; padding: 0; margin: 0; }
  .lb-nav__utility li { list-style: none; }
  .lb-nav__utility a { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-meta); color: var(--fg); text-decoration: none; white-space: nowrap; }
  .lb-nav__utility a:hover { color: var(--accent-hover); }
}

/* ============ PAGE LAYOUT ============ */

#page-wrap { margin-top: 15px; }
.lb-page { padding: 0 0 var(--space-7); background: var(--bg); }
.lb-leaderboard { margin: 0 0 var(--space-4); display: flex; justify-content: center; }

/* ============ HOME HERO ============ */

.lb-hp-hero { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gutter); align-items: start; margin-bottom: var(--gutter); }
.lb-hp-hero__side { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-4); }

.lb-hp-hero3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
  margin-bottom: var(--gutter);
}
.lb-hp-hero3__big { display: flex; flex-direction: column; min-width: 0; }
.lb-hp-hero3__big .lb-card { display: flex; flex-direction: column; }
.lb-hp-hero3__big .lb-card__thumb { aspect-ratio: 16/10; }
.lb-hp-hero3__big .lb-card__title { font-size: var(--fs-md); line-height: 1.3; }
.lb-hp-hero3__pair { display: grid; grid-template-rows: auto auto; gap: 18px; }
.lb-hp-hero3__pair .lb-card { display: grid; grid-template-rows: 1fr auto; }
.lb-hp-hero3__pair .lb-card__thumb { aspect-ratio: 16/10; }
.lb-hp-hero3__pair .lb-card__title { font-size: var(--fs-md); line-height: 1.3; }
.lb-hp-hero3__pair .lb-card__body { padding: var(--space-2); }
.lb-hp-hero3__side { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px; }
.lb-hp-hero3__side .lb-side-list { overflow: hidden; }
.lb-hp-hero3__side .lb-side-list li { padding: 6px 0; font-size: var(--fs-meta); }

/* Mobile-only ad inside hero grid */
.lb-hp-hero3__mobile-ad { display: flex; justify-content: center; }
@media (min-width: 768px) {
  .lb-hp-hero3__mobile-ad { display: none; }
}

@media (min-width: 768px) {
  .lb-hp-hero3 {
    grid-template-columns: 1fr 2.2fr 1fr;
    align-items: stretch;
  }
  .lb-hp-hero3__big  { grid-column: 2; min-height: 0; }
  .lb-hp-hero3__pair { grid-column: 1; grid-row: 1; min-height: 0; }
  .lb-hp-hero3__side { grid-column: 3; grid-row: 1; min-height: 0; overflow: hidden; }

  .lb-hp-hero3__big .lb-card { height: 100%; }
  .lb-hp-hero3__big .lb-card__thumb { flex: 1 1 auto; aspect-ratio: 16/10; min-height: 0; }
  .lb-hp-hero3__big .lb-card__title { font-size: 22px; }
  .lb-hp-hero3__pair .lb-card { height: 100%; min-height: 0; }
  .lb-hp-hero3__pair .lb-card__thumb { height: 100%; min-height: 0; }
  .lb-hp-hero3__pair .lb-card__title { font-size: var(--fs-sm); }
  .lb-hp-hero3__side .lb-side-list { flex: 1 1 auto; min-height: 0; }
}

.lb-hp-hero3__main { display: none; }

.lb-side-title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-md); margin: 0 0 var(--space-3); padding: 0 0 var(--space-2); border-bottom: 2px solid var(--accent); display: inline-block; }
.lb-side-list { list-style: none; padding: 0; margin: 0; }
.lb-side-list li { display: flex; gap: var(--space-2b); padding: var(--space-2b) 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.lb-side-list li:last-child { border: 0; }
.lb-side-time { font-family: var(--font-latin); font-weight: 700; font-size: var(--fs-tiny); color: var(--accent-hover); flex-shrink: 0; }
.lb-side-list a { font-family: var(--font-body); font-size: var(--fs-sm); line-height: 1.5; color: var(--fg); }
.lb-side-list a:hover { color: var(--accent-hover); }
.lb-side-more { display: inline-block; margin-top: var(--space-3); background: var(--bg-inverse); color: var(--fg-on-dark); padding: var(--space-2) var(--space-4); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-meta); border-radius: var(--radius-card); }

/* ============ ARTICLE CARDS ============ */

.lb-card { display: block; text-decoration: none; color: inherit; transition: transform var(--t-base); }
.lb-card__thumb { aspect-ratio: 16/9; position: relative; overflow: hidden; border-radius: var(--radius-card); }
/* Image d'illustration en balise <img> : remplit son conteneur comme un background cover */
.lb-thumb-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lb-badge--cat { position: absolute; top: 10px; right: 10px; background: var(--accent); color: var(--fg-on-accent); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-tiny); padding: 3px var(--space-2); border-radius: var(--radius-badge); }
.lb-card__body { padding: var(--space-3) 14px var(--space-4); }
.lb-card__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h3); line-height: 1.4; margin: 0 0 var(--space-2); color: var(--fg); }
.lb-card__excerpt { font-size: var(--fs-sm); color: var(--fg-muted); margin: 0 0 var(--space-2); line-height: 1.6; }
.lb-card__meta { font-size: var(--fs-tiny); color: var(--fg-muted); }
.lb-card:hover .lb-card__title { color: var(--accent-hover); }

.lb-card--hero .lb-card__title { font-size: 26px; line-height: 1.3; }
.lb-card--hero .lb-card__thumb { aspect-ratio: 16/10; }
.lb-card--grid { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.lb-card--mini { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.lb-card--mini .lb-card__thumb-sm { aspect-ratio: 4/3; border-radius: var(--radius-card); }
.lb-card--mini:last-child { border: 0; }
.lb-card__thumb-sm { aspect-ratio: 16/9; position: relative; overflow: hidden; border-radius: var(--radius-card); }
.lb-card__body-sm { padding: 0; }
.lb-card__title-sm { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); line-height: 1.4; margin: var(--space-1) 0 0; color: var(--fg); }
.lb-card__excerpt-sm { font-size: var(--fs-meta); color: var(--fg-muted); margin: var(--space-1) 0 0; line-height: 1.5; }
.lb-cat-line { font-family: var(--font-latin); font-size: var(--fs-xs); font-weight: 700; color: var(--accent-hover); letter-spacing: .04em; }
.lb-card--list { display: grid; grid-template-columns: 60px 1fr; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.lb-time { font-family: var(--font-latin); font-weight: 700; font-size: var(--fs-meta); color: var(--accent-hover); }

/* ============ CATEGORY BLOCK ============ */

.lb-cat-block { margin: var(--space-6) 0; padding-top: var(--space-5); border-top: 2px solid var(--fg); }
.lb-cat-block__header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-4); }
.lb-cat-block__title { font-family: var(--font-display); font-weight: 800; font-size: 24px; margin: 0; }
.lb-cat-block__more { font-size: var(--fs-meta); color: var(--fg-muted); }
.lb-cat-block__grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gutter); align-items: start; }
.lb-cat-block__list { display: flex; flex-direction: column; }

/* ============ DOSSIER BAND ============ */

.lb-dossier-block { background: var(--bg-dossier); color: var(--fg-on-dark); padding: var(--space-6) 0 var(--space-5); margin: var(--space-6) 0; }
.lb-dossier-block__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.lb-dossier-block__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-section); margin: 0; color: var(--accent); }
.lb-dossier-block__more { color: var(--fg-on-dark-muted); font-size: var(--fs-meta); }
.lb-dossier-block__more:hover { color: var(--accent); }

.lb-dossier-block__row {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-3);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255,255,255,.12);
}
.lb-dossier-block__row::-webkit-scrollbar { height: 4px; }
.lb-dossier-block__row::-webkit-scrollbar-track { background: rgba(255,255,255,.12); border-radius: var(--radius-badge); }
.lb-dossier-block__row::-webkit-scrollbar-thumb { background: var(--accent); border-radius: var(--radius-badge); }

.lb-dossier-card {
  position: relative;
  flex: 0 0 calc(25% - 12px);
  aspect-ratio: 7/10;
  border-radius: var(--radius-card);
  overflow: hidden;
  display: block;
  text-decoration: none;
  scroll-snap-align: start;
}
@media (max-width: 767px) {
  .lb-dossier-card { flex: 0 0 72vw; }
}
.lb-dossier-card__img { position: absolute; inset: 0; overflow: hidden; transition: transform 300ms ease; }
.lb-dossier-card:hover .lb-dossier-card__img { transform: scale(1.03); }
.lb-dossier-card__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 20%); }

/* ============ NEWSLETTER ============ */

.lb-newsletter { background: var(--accent); padding: 18px 20px; border-radius: var(--radius-card); margin: var(--space-6) 0; display: flex; flex-direction: column; gap: 14px; }
.lb-newsletter__copy-wrap { flex: 1; }
.lb-newsletter__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-md); margin: 0 0 var(--space-1); color: var(--fg-on-accent); }
.lb-newsletter__copy { font-size: var(--fs-tiny); color: var(--fg); margin: 0; }
.lb-newsletter__form { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; min-width: 0; }
.lb-newsletter__field { display: flex; background: var(--bg); border-radius: var(--radius-card); padding: 2px; gap: 2px; }
.lb-newsletter__field input { flex: 1; border: 0; padding: var(--space-2b) var(--space-4); outline: 0; font-family: var(--font-body); background: transparent; text-align: right; border-radius: var(--radius-card); min-width: 100px; }
.lb-newsletter__field button { background: var(--bg-inverse); color: var(--fg-on-dark); border: 0; padding: var(--space-2b) 20px; border-radius: var(--radius-card); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-meta); cursor: pointer; flex-shrink: 0; }
.lb-newsletter__consent { display: flex; align-items: flex-start; gap: 8px; }
.lb-newsletter__consent input[type="checkbox"] { flex-shrink: 0; margin-top: 3px; accent-color: var(--bg-inverse); }
.lb-newsletter__consent label { font-size: var(--fs-tiny); color: var(--fg-on-accent); line-height: 1.4; }
.lb-newsletter__consent label a { color: var(--fg-on-accent); text-decoration: underline; }

@media (min-width: 768px) {
  .lb-newsletter { flex-direction: row; align-items: center; }
  .lb-newsletter__form { flex-basis: 360px; }
}

/* ============ AD ============ */

/* Emplacements publicitaires.
   Aucune hauteur ni display imposés sur le slot : GPT le dimensionne selon la
   création servie et le replie lui-même s'il est invendu (collapseEmptyDivs).
   Une règle display ou min-height ici s'opposerait au display:none inline qu'il
   pose, et laisserait un trou blanc.

   Contrepartie assumée : sans réservation d'espace, la page se décale quand la
   publicité arrive.

   Le centrage combine deux règles, jamais flex : text-align couvre l'iframe
   d'une création classique (élément en ligne), margin auto couvre un conteneur
   en bloc — GPT rend l'un ou l'autre selon le type de création. */
.lb-ad-wrap { max-width: 100%; }
.lb-ad { max-width: 100%; text-align: center; }
.lb-ad > div,
.lb-ad > iframe { margin-inline: auto; }

/* Espacement sous un emplacement.
   Posé sur le slot et non sur l'enveloppe : le display:none de GPT emporte
   alors la marge avec lui, et un emplacement invendu ne laisse aucun blanc.
   Pas de marge en colonne latérale, où l'espacement vient du gap de la pile. */
.lb-ad { margin-block: 0 20px; }
.lb-ad-wrap--sidebar .lb-ad { margin-block: 0; }

/* Colonne latérale — centrée, et suit la lecture sur desktop.
   .lb-article-sidebar est un conteneur flex en colonne : sans align-self,
   l'emplacement s'étire sur toute la largeur de la colonne. « center » le
   ramène à sa largeur propre tout en le centrant — indispensable aussi au
   sticky, qui n'aurait aucune course sur un élément étiré. */
.lb-ad-wrap--sidebar { align-self: center; }

/* Seuil calé sur celui de .lb-article-layout (max-width: 900px, section
   RESPONSIVE) : au-delà, la colonne latérale existe vraiment et l'emplacement
   peut suivre la lecture. En deçà, elle est empilée sous l'article et un sticky
   ferait suivre la publicité sur toute la fin de page.

   .lb-article-layout porte align-items: start, donc la colonne s'arrête après
   son contenu et un sticky n'y aurait aucune course : on l'étire à la hauteur
   de l'article, et c'est l'emplacement qui défile à l'intérieur. */
@media (min-width: 901px) {
  .lb-article-layout > .lb-article-sidebar { align-self: stretch; }
  .lb-ad-wrap--sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--space-3));
  }
}

/* Player vidéo outstream Brid.tv (régie distincte de Google Ad Manager).
   Les deux règles ci-dessous viennent du tag fourni par la régie : elles
   dégagent le bas de l'écran sous 1100px, où le player passe en mode collant. */
@media (max-width: 1100px) {
  .brid-sticky { margin-bottom: 160px !important; }
  .brid-close  { margin-bottom: 200px !important; }
}

/* Bloc gris de réserve, affiché tant que AD_NETWORK_ROOT vaut sa valeur par
   défaut : GPT n'intervient pas, une hauteur peut donc être fixée sans risque. */
.lb-ad--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  background: var(--bg-ad);
  color: var(--fg-faint);
  font-size: var(--fs-xs);
  letter-spacing: .1em;
}
.lb-ad--placeholder::before { content: "إعلان"; }

/* Le corps d'article est dans [data-reader-scope] : sans cette règle, le
   sélecteur de taille de police agrandirait aussi le libellé de l'emplacement. */
.lb-article__content .lb-ad-wrap,
.lb-dossier__content .lb-ad-wrap { font-size: var(--fs-xs); line-height: normal; }

/* ============ 404 ============ */

.lb-404 { text-align: center; padding: var(--space-8) 0 var(--space-7); max-width: 560px; margin: 0 auto; }
.lb-404__code {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 120px;
  line-height: 1;
  color: var(--accent);
  -webkit-text-stroke: 2px var(--fg);
}
.lb-404__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h1); margin: var(--space-3) 0 var(--space-3); }
.lb-404__text { color: var(--fg-muted); font-size: var(--fs-body); margin: 0 0 var(--space-6); }
.lb-404__search { max-width: 420px; margin: 0 auto var(--space-5); background: var(--bg-alt); border-radius: var(--radius-card); }
.lb-404__home { text-decoration: none; }
.lb-404__suggestions { border-top: 1px solid var(--border); padding-top: var(--space-6); margin-bottom: var(--space-6); }

@media (max-width: 767px) {
  .lb-404 { padding: var(--space-6) 0 var(--space-5); }
  .lb-404__code { font-size: 80px; }
}

/* ============ CATEGORY PAGE ============ */

.lb-cat-header { padding: var(--space-5) 0; border-bottom: 2px solid var(--fg); margin-bottom: var(--space-5); }
.lb-cat-header__title { font-family: var(--font-display); font-weight: 900; font-size: 36px; margin: 0; }
.lb-cat-header__sub { color: var(--fg-muted); font-size: var(--fs-sm); margin: var(--space-2) 0 0; }
.lb-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); margin-bottom: var(--space-6); }

.lb-author-header { display: flex; align-items: center; gap: var(--space-4); }
.lb-author-header__avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lb-author-header__info { min-width: 0; }
.lb-author-header .lb-cat-header__title { font-size: var(--fs-h2); margin-bottom: var(--space-1); }
.lb-author-header__bio { color: var(--fg-muted); font-size: var(--fs-sm); line-height: 1.7; margin: var(--space-2) 0 0; }

.lb-pagination { display: flex; gap: var(--space-2); justify-content: center; padding: var(--space-5) 0; }
.lb-page-btn { background: var(--bg); border: 1px solid var(--border); padding: var(--space-2) 14px; font-family: var(--font-latin); font-size: var(--fs-meta); font-weight: 700; cursor: pointer; }
.lb-page-btn--active { background: var(--accent); border-color: var(--accent); }

/* ============ ARTICLE PAGE ============ */

.lb-breadcrumb { display: flex; gap: var(--space-2); font-size: var(--fs-tiny); color: var(--fg-muted); padding: var(--space-4) 0; }
.lb-breadcrumb a { color: var(--fg-muted); }
.lb-breadcrumb a:hover { color: var(--accent-hover); }

.lb-article-layout { display: grid; grid-template-columns: 56px 1fr 320px; gap: var(--gutter); align-items: start; }

/* Pages simples : pas de rail de partage ni de sidebar, article pleine largeur */
.lb-static-page .lb-article-layout { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; }
/* Un item de grille a min-width:auto par defaut : il refuse de passer sous la
   largeur de son contenu. Sans ca, un contenu large (tableau, <pre>) elargit la
   colonne au lieu de defiler dans son propre conteneur. */
.lb-article-layout > * { min-width: 0; }
.lb-article-rail { position: sticky; top: 200px; }
.lb-share { display: flex; flex-direction: column; gap: var(--space-2); }
.lb-share__btn { width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius-card); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
/* Le bouton de partage natif est un <button> : neutralise les styles UA. */
.lb-share__btn--native { -webkit-appearance: none; appearance: none; }
.lb-share__btn[hidden] { display: none; }

.lb-article { background: var(--bg); }
.lb-article > .lb-badge--cat { position: static; display: inline-block; margin: 0 0 var(--space-3) var(--space-2); }
.lb-article > .lb-badge--topic { position: static; display: inline-block; margin: 0 0 var(--space-3) 0; }
.lb-article__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h1); line-height: 1.3; margin: var(--space-2) 0 var(--space-4); }
.lb-article__byline { display: flex; gap: var(--space-5); padding: var(--space-3) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.lb-article__author { display: flex; gap: var(--space-2b); align-items: center; }
.lb-article__author img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.lb-article__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); }
.lb-article__date, .lb-article__role { font-size: var(--fs-tiny); color: var(--fg-muted); }
.lb-article__date-value, .lb-article__reading-time { display: inline-block; unicode-bidi: isolate; }
.lb-article__reading-time { margin-inline-start: var(--space-2); padding-inline-start: var(--space-2); border-inline-start: 1px solid var(--border); }
.lb-article__figure { margin: 0 0 var(--space-5); }
.lb-article__figure img { width: 100%; height: auto; display: block; border-radius: var(--radius-card); }
.lb-article__figure figcaption { font-size: var(--fs-tiny); color: var(--fg-muted); margin-top: var(--space-2); }

/* Légende en overlay : bandeau sombre dégradé au bas de l'image, texte blanc.
   position:relative sur <figure> + <img> en display:block permet à figcaption
   de se caler en position:absolute sans toucher au flux normal. */
.lb-article__figure--captioned { position: relative; }
.lb-article__figure--captioned img { border-radius: var(--radius-card); }
.lb-article__figure--captioned figcaption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  margin-top: 0;
  padding: var(--space-6) var(--space-3) var(--space-2);
  background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .5) 55%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
  font-size: var(--fs-tiny);
  line-height: 1.5;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  animation: lb-caption-in .5s ease-out .15s both;
}

@keyframes lb-caption-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .lb-article__figure--captioned figcaption { animation: none; }
}
.lb-article__lede { font-size: calc(var(--reader-font-size, var(--fs-body)) * 1.06); font-weight: 700; line-height: 1.7; margin: 0 0 var(--space-5); color: var(--fg); }
.lb-article__content { font-size: var(--reader-font-size, var(--fs-body)); line-height: 1.9; }
.lb-article__content p { font-size: inherit; line-height: inherit; }
.lb-article__content img,
.lb-article__content video,
.lb-article__content figure,
.lb-article__content table { max-width: 100%; height: auto; }

/* Les iframes n'heritent pas du height:auto ci-dessus.

   Une iframe n'a pas de hauteur intrinseque : height:auto ecrase son attribut
   height (609 pour un post Facebook) sans rien pour le remplacer, et le cadre
   s'effondre — le post s'affiche tronque. Les images, elles, ont un ratio
   naturel : height:auto y est indispensable et reste en place.

   Les iframes qui ont besoin d'une hauteur calculee (video 16/9, embed
   d'article) la recoivent explicitement dans la section EMBEDS. */
.lb-article__content iframe { max-width: 100%; }
.lb-article__content img { display: block; margin-inline: auto; border-radius: var(--radius-card); }
.lb-article__content figure { margin: var(--space-5) 0; }

/* Légende en overlay sur les images du corps de texte, même traitement que
   l'image à la une (.lb-article__figure--captioned). Les figures d'embed
   (Twitter, TikTok…) gardent leur légende classique sous le bloc — pas
   d'image de fond adaptée à un bandeau sombre. */
.lb-article__content figure:not(.wp-block-embed),
.lb-article__content .wp-caption { position: relative; }
.lb-article__content figure:not(.wp-block-embed) figcaption,
.lb-article__content .wp-caption .wp-caption-text {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: var(--space-6) var(--space-3) var(--space-2);
  background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .5) 55%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
  font-size: var(--fs-tiny);
  line-height: 1.5;
  text-align: center;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  animation: lb-caption-in .5s ease-out .15s both;
}
.lb-article__para { margin: 0 0 var(--space-4); }

/* Blockquote (citation) — RTL-safe : la bordure/le retrait suivent le sens du texte
   Double selecteur : .lb-article__content pour le rendu front, #tinymce pour l'apercu editeur.

   :not() exclut les blockquotes des plateformes sociales : X et TikTok rendent
   leurs embeds dans un <blockquote>, que ces styles de citation habilleraient
   en double (fond gris + bordure) avant et apres le passage de leur script. */
.lb-article__content blockquote:not(.twitter-tweet):not(.tiktok-embed):not(.instagram-media),
#tinymce blockquote:not(.twitter-tweet):not(.tiktok-embed):not(.instagram-media) {
  margin: var(--space-5) 0;
  padding: var(--space-3) var(--space-4);
  background: #f1f1f1;
  border-inline-start: 4px solid var(--accent);
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  font-size: calc(var(--reader-font-size, var(--fs-body)) * 1.06);
  line-height: 1.6;
  color: var(--fg);
}
.lb-article__content blockquote:not(.twitter-tweet):not(.tiktok-embed):not(.instagram-media) p,
#tinymce blockquote:not(.twitter-tweet):not(.tiktok-embed):not(.instagram-media) p { margin: 0 0 var(--space-2); }
.lb-article__content blockquote:not(.twitter-tweet):not(.tiktok-embed):not(.instagram-media) p:last-child,
#tinymce blockquote:not(.twitter-tweet):not(.tiktok-embed):not(.instagram-media) p:last-child { margin-bottom: 0; }
.lb-article__content blockquote:not(.twitter-tweet):not(.tiktok-embed):not(.instagram-media) cite,
#tinymce blockquote:not(.twitter-tweet):not(.tiktok-embed):not(.instagram-media) cite {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 400;
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}

/* Highlight (encadré emphase) — RTL-safe, guillemets typographiques en CSS pur
   (pas de Font Awesome chargé sur ce site). */
.lb-article__content span.dt-highlight,
#tinymce span.dt-highlight {
  font-size: 25px;
  font-style: italic;
  line-height: 30px;
  padding: 16px 35px;
  display: inline-block;
  margin: var(--space-3) 0;
  color: var(--fg);
}
span.dt-highlight::before,
span.dt-highlight::after {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--fg);
  font-size: 38px;
  line-height: 38px;
}
span.dt-highlight::before {
  content: "\00AB";
  margin-inline-end: var(--space-2b);
}
span.dt-highlight::after {
  content: "\00BB";
  margin-inline-start: var(--space-2b);
}

/* Encadré (bloc mise en avant) */
.lebrief-encadre,
#tinymce div.lebrief-encadre {
  margin: 30px 5%;
  padding: 20px;
  background-color: #f8fbff;
  border: 1px double #cfe0f5;
  border-radius: 4px;
}

.font-resizer { display: flex; flex-direction: column; gap: var(--space-1); margin: 0 0 var(--space-5); max-width: 260px; }
.font-resizer input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  margin: 0;
}
.font-resizer input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--fg);
  cursor: pointer;
}
.font-resizer input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--fg);
  cursor: pointer;
}
.font-resizer .ticks { display: flex; justify-content: space-between; padding: 0 2px; }
.font-resizer .ticks span { width: 1px; height: 5px; background: var(--border-strong); }
.font-resizer .range-labels { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 2px; color: var(--fg-muted); font-family: var(--font-latin); line-height: 1; }
.lb-article__tags { display: flex; gap: var(--space-2); padding: var(--space-4) 0; border-top: 1px solid var(--border); margin-top: var(--space-5); }
.lb-tag { background: var(--bg-alt); color: var(--fg-muted); font-size: var(--fs-tiny); padding: var(--space-1) var(--space-2b); border-radius: var(--radius-card); }
.lb-article__comments { display: inline-block; color: var(--accent-hover); font-weight: 700; margin-top: var(--space-4); }

.lb-article-sidebar { display: flex; flex-direction: column; gap: var(--space-4); }

.lb-mostread { background: var(--bg-alt); padding: var(--space-4); border-radius: var(--radius-card); }
.lb-mostread__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-md); margin: 0 0 var(--space-3); padding-bottom: var(--space-2); border-bottom: 2px solid var(--accent); display: inline-block; }
.lb-mostread__list { list-style: none; padding: 0; margin: 0; }
.lb-mostread__list li { display: flex; gap: var(--space-2); padding: var(--space-2b) 0; border-bottom: 1px solid var(--border); }
.lb-mostread__list li:last-child { border: 0; }
.lb-mostread__num { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h3); color: var(--accent-hover); flex-shrink: 0; }
.lb-mostread__list a { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-meta); line-height: 1.4; color: var(--fg); }
.lb-mostread__list p { font-size: var(--fs-tiny); color: var(--fg-muted); margin: var(--space-1) 0 0; }

.lb-related { margin: var(--space-7) 0 var(--space-6); padding-top: var(--space-5); border-top: 2px solid var(--fg); }
.lb-related__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-section); margin: 0 0 20px; }
.lb-related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ============ FOOTER ============ */

.lb-footer { background: var(--bg-inverse); color: var(--fg-on-dark); padding: var(--space-7) 0 0; margin-top: var(--space-7); }
.lb-footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-6); padding-bottom: var(--space-6); }
.lb-footer__logo { margin-bottom: var(--space-3); }
.lb-footer__logo a { display: inline-flex; }
.lb-footer__logo img { display: block; height: 55px; width: auto; }
.lb-footer__about { color: var(--fg-faint); font-size: var(--fs-meta); line-height: 1.7; margin: 0 0 var(--space-4); }
.lb-footer__col h4 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); margin: 0 0 var(--space-3); color: var(--accent); }
.lb-footer__col ul { list-style: none; padding: 0; margin: 0; }
.lb-footer__col li { padding: 0; }
.lb-footer__col a { color: var(--fg-on-dark-muted); font-size: var(--fs-meta); }
.lb-footer__col a:hover { color: var(--accent); }
.lb-footer__socials { display: flex; gap: var(--space-2); }
.lb-footer__socials a { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--border-inverse); color: var(--fg-on-dark); font-family: var(--font-latin); font-weight: 700; font-size: var(--fs-meta); border-radius: var(--radius-card); }
.lb-footer__socials a:hover { background: var(--accent); color: var(--fg-on-accent); }
.lb-footer__legal { background: var(--footer-legal-bg); padding: var(--space-4) 0; font-size: var(--fs-tiny); color: var(--fg-faint); text-align: center; }
.lb-footer__mentions { margin-top: var(--space-4); }
.lb-footer__mentions p { color: var(--accent); font-size: var(--fs-meta); line-height: 1.7; margin: 0; }

/* ============ DOSSIER (LONGREAD) ============ */

.lb-badge--dossier { background: var(--accent); color: var(--fg-on-accent); }

/* Hero immersif pleine largeur : titre blanc seul */
.lb-dossier-hero {
  position: relative;
  aspect-ratio: 20 / 7;        /* desktop */
  background-color: var(--bg-dossier);
  color: var(--fg-on-dark);
  overflow: hidden;
}
.lb-dossier-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lb-dossier-hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.45) 55%, rgba(0,0,0,.25) 100%);
}
.lb-dossier-hero__inner {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; align-items: flex-end;
  padding: var(--space-8) 0 var(--space-6);
}
.lb-dossier-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.2;
  margin: 0;
  color: var(--fg-on-dark);
  max-width: 900px;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}

/* Layout 3 colonnes : rail partages / texte / colonne méta+liste */
.lb-dossier-page { padding-top: var(--space-6); }
.lb-dossier-page .lb-article-layout { grid-template-columns: 56px 1fr 320px; }

/* Corps : chapeau + contenu */
.lb-dossier-body .lb-breadcrumb { padding-top: 0; }
.lb-dossier__content { font-size: calc(var(--reader-font-size, var(--fs-body)) * 1.03); line-height: 1.95; }
.lb-dossier__content h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h2); margin: var(--space-7) 0 var(--space-3); }
.lb-dossier__content h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h3); margin: var(--space-6) 0 var(--space-2b); }

/* Colonne de droite : encadré méta (auteur + catégorie + resizer) */
.lb-dossier-meta {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}
.lb-dossier-meta .lb-article__byline { display: block; padding: 0; margin: 0; border: 0; }
.lb-dossier-meta .lb-article__author { display: flex; gap: var(--space-2b); align-items: center; }
.lb-dossier-meta .lb-article__author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.lb-dossier-meta__cat { display: inline-block; margin-top: var(--space-3); }
.lb-dossier-meta__cat .lb-badge--cat { position: static; }
.lb-dossier-meta .font-resizer { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); }

.lb-dossier-related .lb-related__title { border-bottom: 2px solid var(--accent); }

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  .lb-hp-hero, .lb-cat-block__grid, .lb-related__grid, .lb-cat-grid { grid-template-columns: 1fr; }
  .lb-hp-hero3__main { grid-template-columns: 1fr; }
  .lb-article-layout { grid-template-columns: 1fr; }
  .lb-dossier-page .lb-article-layout { grid-template-columns: 1fr; }
  /* Le rail de partage quitte le flux et devient une barre fixe en bas d'ecran.
     z-index sous le drawer (100) et l'overlay de recherche (110). */
  .lb-article-rail {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 90;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: var(--space-2b) var(--space-4);
    padding-bottom: calc(var(--space-2b) + env(safe-area-inset-bottom));
  }
  /* 6 boutons a 36px : le gap se resserre sur les petits ecrans (iPhone SE). */
  .lb-share { flex-direction: row; justify-content: center; gap: clamp(6px, 2.5vw, 14px); }

  /* Reserve la hauteur de la barre fixe (36px + paddings + bordure) sous le
     footer, sinon la barre en recouvre la derniere ligne. */
  body:has(.lb-article-page) .lb-footer {
    padding-bottom: calc(57px + env(safe-area-inset-bottom));
  }
  .lb-footer__inner { grid-template-columns: 1fr 1fr; }
  .lb-article__title { font-size: var(--fs-h1); }
  .lb-dossier-hero { aspect-ratio: 16 / 9; }
  .lb-dossier-hero__inner { padding: var(--space-6) 0 var(--space-5); }

  /* Dossier : l'encadré méta (auteur+resize+catégorie) remonte au-dessus du chapeau ;
     la liste des plus-lus reste, elle, sous l'article (ordre naturel). */
  .lb-dossier-aside { display: contents; }
  .lb-dossier-meta { order: -1; }
  .lb-dossier-page .lb-article-sidebar { order: 1; }
}

@media (max-width: 767px) {
  .lb-footer__inner { grid-template-columns: 1fr; gap: var(--space-5); text-align: center; }
  .lb-footer__logo { display: flex; justify-content: center; }
  .lb-footer__socials { justify-content: center; }
}


/* ============ HORAIRES DE PRIERE (mu-plugin lebrief-horaires-priere) ============ */

.lb-salat { margin: var(--space-5) 0; }

.lb-salat__filter {
  display: flex;
  align-items: center;
  gap: var(--space-2b);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.lb-salat__filter label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-md);
}
.lb-salat__filter select {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--bg);
  color: var(--fg);
}

/* Le tableau seul defile horizontalement : le body de la page ne bouge pas. */
.lb-salat__scroll { overflow-x: auto; }

.lb-salat__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  text-align: center;
  /* 7 colonnes lisibles sans defilement dans la colonne d'article (~800px).
     En dessous, .lb-salat__scroll prend le relais. */
  min-width: 640px;
}
.lb-salat__table th,
.lb-salat__table td {
  border: 1px solid var(--border);
  padding: var(--space-2b) var(--space-2);
  white-space: nowrap;
}
/* Les chiffres restent en lecture gauche-droite meme en contexte RTL. */
.lb-salat__table td { font-variant-numeric: tabular-nums; direction: ltr; }
.lb-salat__table thead th {
  background: var(--bg-alt);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}
.lb-salat__table tbody tr:nth-child(2n) { background: var(--bg-alt); }

/* La colonne date est la premiere en RTL, donc a droite. */
.lb-salat__table tbody th[scope="row"] { font-weight: 600; text-align: start; }
/* Cellule de date : 3 informations empilees, du plus au moins structurant —
   jour de la semaine, date gregorienne, date hegirienne. Elles etaient
   auparavant sur une seule ligne, ou « 01 16 محرم » se lisait comme un nombre. */
.lb-salat__weekday,
.lb-salat__day,
.lb-salat__hijri { display: block; }
.lb-salat__weekday { font-size: var(--fs-tiny); color: var(--fg-muted); font-weight: 400; }
.lb-salat__day     { font-weight: 700; }
.lb-salat__hijri   { color: var(--fg-muted); font-size: var(--fs-tiny); }

.lb-salat__table tr.is-today {
  background: var(--accent) !important;
  color: var(--fg-on-accent);
  font-weight: 700;
}
.lb-salat__table tr.is-today .lb-salat__hijri,
.lb-salat__table tr.is-today .lb-salat__weekday { color: var(--fg-on-accent); }

/* Libelle repete dans chaque cellule : masque en tableau, revele en cartes mobile. */
.lb-salat__label { display: none; }

.lb-salat__source {
  margin-top: var(--space-3);
  font-size: var(--fs-tiny);
  color: var(--fg-muted);
  line-height: var(--lh-meta);
}
.lb-salat__error {
  padding: var(--space-4);
  background: var(--bg-alt);
  border-radius: var(--radius-card);
  color: var(--fg-muted);
}

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  /* Sur mobile, chaque jour devient une carte : plus de scroll horizontal,
     et chaque horaire porte son propre libelle de priere. */
  .lb-salat__table thead { display: none; }
  .lb-salat__table,
  .lb-salat__table tbody,
  .lb-salat__table tr,
  .lb-salat__table td,
  .lb-salat__table th { display: block; width: auto; }
  /* En mode cartes, plus de largeur plancher ni de defilement horizontal. */
  .lb-salat__table { min-width: 0; }
  .lb-salat__table td { direction: rtl; }
  .lb-salat__scroll { overflow-x: visible; }

  .lb-salat__table tr {
    margin-bottom: var(--space-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-card);
    overflow: hidden;
  }
  .lb-salat__table tbody th[scope="row"] {
    background: var(--bg-alt);
    border: 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
  }
  /* En-tete de carte : les 3 dates tiennent sur une ligne, separees par des
     espaces reels plutot que par des retours a la ligne. */
  .lb-salat__weekday,
  .lb-salat__day,
  .lb-salat__hijri { display: inline; }
  .lb-salat__table tr.is-today tbody th[scope="row"] { background: transparent; }
  .lb-salat__table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 0;
    border-bottom: 1px solid var(--border);
    text-align: start;
  }
  .lb-salat__table td:last-child { border-bottom: 0; }
  .lb-salat__label { display: inline; color: var(--fg-muted); }
  .lb-salat__table tr.is-today .lb-salat__label { color: var(--fg-on-accent); }
}

/* Variante "oneline" : une seule journee, affichee en bandeau compact.
   La ligne est deja filtree cote serveur (cf. lb_salat_render), on ne masque
   donc rien en CSS — on se contente de la mettre en forme. */
.lb-salat--oneline .lb-salat__scroll { overflow-x: visible; }
.lb-salat--oneline .lb-salat__table { table-layout: fixed; min-width: 0; }
.lb-salat--oneline .lb-salat__table thead th { position: static; }
.lb-salat--oneline .lb-salat__table tbody tr { background: none; }
.lb-salat--oneline .lb-salat__hijri { display: block; }

@media (max-width: 700px) {
  /* En bandeau une-ligne, on garde la grille (2 lignes x 3 colonnes) plutot que
     la pile verticale du calendrier complet : plus lisible dans un article. */
  .lb-salat--oneline .lb-salat__table,
  .lb-salat--oneline .lb-salat__table tbody,
  .lb-salat--oneline .lb-salat__table tr { display: block; }
  .lb-salat--oneline .lb-salat__table tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-card);
    overflow: hidden;
  }
  .lb-salat--oneline .lb-salat__table tbody th[scope="row"] {
    grid-column: 1 / -1;
    text-align: center;
  }
  .lb-salat--oneline .lb-salat__table td {
    display: block;
    text-align: center;
    border: 1px solid var(--border);
  }
  .lb-salat--oneline .lb-salat__label { display: block; font-size: var(--fs-tiny); }
}

/* ==========================================================================
   Carrousel d'images (inséré par le bouton « Créer un carrousel »)
   Markup natif, pas de shortcode. Le JS est chargé en inline depuis
   inc/carousel.php, uniquement sur les articles qui en contiennent un.
   ========================================================================== */

.lebrief-carousel {
  /* Hauteur de la bande de légende, partagée par la légende elle-même, le
     centrage des flèches et la position des pastilles. */
  --lb-carousel-caption-h: 40px;
  position: relative;
  max-width: 700px;
  margin: 32px auto;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(10, 99, 194, .14);
  background: #000;
}

/* direction:ltr volontaire — neutralise l'inversion de l'axe flex en RTL pour
   que le calcul du translateX reste identique quelle que soit la langue. */
.lebrief-carousel__track {
  display: flex;
  direction: ltr;
  transition: transform .6s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

.lebrief-carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
}

/* Le lien enveloppe l'image : en block pour qu'il n'ajoute pas la ligne de
   base d'un inline (sinon un liseré sous la photo). */
.lebrief-carousel__link {
  display: block;
  line-height: 0;
}

/* width/height sont posés dans le HTML à l'insertion, et aspect-ratio fige la
   hauteur du bloc : sans ça, chaque slide d'un ratio différent ferait sauter
   la mise en page pendant le défilement (CLS). */
.lebrief-carousel__slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Bande de légende sous l'image. Hauteur fixe et non « auto » : une slide sans
   légende doit occuper exactement la même place qu'une slide légendée, sinon
   la hauteur du carrousel saute à chaque défilement.
   direction:rtl rétabli ici — le track est forcé en ltr pour le calcul du
   translateX, mais le texte, lui, doit se lire dans le sens du site. */
.lebrief-carousel__caption {
  direction: rtl;
  box-sizing: border-box;
  height: var(--lb-carousel-caption-h);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #000;
  font-size: var(--fs-tiny, 13px);
  line-height: 1.3;
  text-align: center;
  /* Légende longue : une seule ligne, coupée proprement. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Centrées sur l'image seule : sans retrancher la bande de légende, les
   flèches paraîtraient décalées vers le bas. */
.lebrief-carousel__btn {
  position: absolute;
  top: calc((100% - var(--lb-carousel-caption-h)) / 2);
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .86);
  color: #0a63c2;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  transition: background .2s;
  z-index: 2;
}
.lebrief-carousel__btn:hover { background: #fff; }

/* inset-inline-* plutôt que left/right : les flèches et les pastilles
   s'inversent d'elles-mêmes selon la direction du document. */
.lebrief-carousel__btn--prev { inset-inline-start: 12px; }
.lebrief-carousel__btn--next { inset-inline-end: 12px; }

/* Pastilles remontées au-dessus de la bande de légende (12px + sa hauteur),
   sinon elles se superposeraient au texte. */
.lebrief-carousel__dots {
  position: absolute;
  bottom: calc(12px + var(--lb-carousel-caption-h));
  inset-inline: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
  z-index: 2;
}

.lebrief-carousel__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
  padding: 0;
  transition: background .2s;
}
.lebrief-carousel__dot.is-active { background: #fff; }

@media (max-width: 600px) {
  .lebrief-carousel { --lb-carousel-caption-h: 34px; }
  .lebrief-carousel__btn { width: 34px; height: 34px; font-size: 18px; }
  .lebrief-carousel__caption { font-size: 12px; padding: 0 10px; }
}

/* Dans TinyMCE (add_editor_style charge cette feuille), aucun JS ne tourne :
   le track resterait figé sur la première slide, les autres hors cadre. On
   déplie donc en grille pour que le rédacteur voie toutes ses images, et on
   masque flèches et pastilles qui n'y sont pas cliquables. */
#tinymce .lebrief-carousel__track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 4px;
  transform: none !important;
}
#tinymce .lebrief-carousel__slide { flex: none; }
#tinymce .lebrief-carousel__btn,
#tinymce .lebrief-carousel__dots { display: none; }
/* Vignettes de 120px : une bande de 40px serait hors de proportion. La légende
   reste lisible pour vérifier ce qui a été saisi dans la médiathèque. */
#tinymce .lebrief-carousel__caption {
  height: auto;
  min-height: 22px;
  padding: 3px 6px;
  font-size: 11px;
  white-space: normal;
}
/* Le lien ne doit pas être suivable depuis l'éditeur. */
#tinymce .lebrief-carousel__link { pointer-events: none; }

/* ============ UTILITAIRES DE CONTENU ============
   Classes destinées au contenu saisi dans l'éditeur (pages simples, articles).
   Volontairement génériques : elles resservent d'une page à l'autre. */

/* Séquences latines (numéros de téléphone, références, codes) au milieu d'un
   texte arabe. Sans ça, l'algorithme bidi Unicode traite les groupes de chiffres
   séparés par des espaces comme des runs distincts et les réordonne de droite à
   gauche : « 08 08 526 739 » s'affiche « 739 526 08 08 ».
   - direction: ltr  → ordre de lecture interne latin
   - unicode-bidi: isolate → le contenu n'influence plus le texte arabe autour
     (sans quoi tirets et espaces adjacents se déplacent encore)
   Doubler avec dir="ltr" dans le HTML : l'attribut survit à une réédition dans
   l'éditeur visuel, la classe peut être perdue. */
.lb-ltr,
.lb-tel {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Un numéro ne doit jamais être coupé en fin de ligne : les deux moitiés
   seraient illisibles. Réservé au téléphone — sur une adresse ou une référence
   longue, nowrap provoquerait un débordement horizontal sur mobile. */
.lb-tel { white-space: nowrap; }

/* Grille de contenu. Le thème n'a que des grilles liées à un composant
   (lb-hp-hero, lb-footer__inner…) : celle-ci est la seule réutilisable dans le
   contenu saisi. Mobile d'abord — une colonne, puis le découpage à partir de
   768px, le breakpoint utilisé partout ailleurs dans cette feuille. */
.lb-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
  margin: var(--space-5) 0;
}
/* Un item de grille a min-width:auto par défaut : il refuse de passer sous la
   largeur de son contenu. Sans ça, une image ou un tableau large élargit la
   colonne au lieu de rester dans ses limites. */
.lb-grid > * { min-width: 0; }

@media (min-width: 768px) {
  .lb-grid--2      { grid-template-columns: 1fr 1fr; }
  .lb-grid--3      { grid-template-columns: repeat(3, 1fr); }
  /* Colonne principale + colonne d'appoint (texte + carte, article + encadré) */
  .lb-grid--2-1    { grid-template-columns: 2fr 1fr; }
  .lb-grid--1-2    { grid-template-columns: 1fr 2fr; }
}

/* Contenus embarqués (carte, vidéo). L'espace est réservé avant le chargement
   de l'iframe : sans ça, l'insertion décale le contenu déjà peint et dégrade le
   CLS — le défaut relevé sur le site FR à ne pas reproduire. */
.lb-embed {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  margin: var(--space-5) 0;
}
.lb-embed--map { aspect-ratio: 4 / 3; }
.lb-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ============ EMBEDS ============ */

/* Embeds reseaux sociaux ([instablock], [fbpost], [tweet], [tiktok]).

   min-height reserve la hauteur avant que le script de la plateforme ne
   remplace le blockquote/l'iframe : sans elle, le contenu deja peint se decale
   au chargement — le defaut CLS releve sur le site FR.

   C'est un plancher, jamais un plafond : les scripts des plateformes mesurent
   leur contenu et poussent la hauteur finale. Pas de height ni d'overflow
   hidden ici, sinon un post long (carrousel Instagram, tweet cite) se retrouve
   tronque. */
.lebrief-embed {
  margin: var(--space-5) auto;
  max-width: 540px;
  display: flow-root;
}
.lebrief-embed--instagram { min-height: 660px; }
.lebrief-embed--facebook  { min-height: 600px; }
.lebrief-embed--tweet     { min-height: 250px; }
.lebrief-embed--tiktok    { min-height: 740px; }

/* Largeur neutralisee, hauteur preservee.

   width en !important : l'attribut width="500" pose par la plateforme gagnerait
   sinon sur un ecran plus etroit.

   Mais surtout, pas de height ici : l'attribut height de l'iframe (609 pour un
   post Facebook) doit survivre. Une iframe n'ayant pas de hauteur intrinseque,
   un height:auto la ferait s'effondrer — c'est ce que faisait la regle
   generique .lb-article__content iframe avant qu'elle en soit retiree. */
.lebrief-embed iframe {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-inline: auto;
  border: 0;
}

/* Idem pour les blockquotes : Instagram et TikTok posent un min-width en
   inline (326px chez Instagram) qui deborde sur mobile. */
.lebrief-embed blockquote {
  margin-inline: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Embeds natifs WordPress (oEmbed) : YouTube, Vimeo, articles WordPress.
   Ceux-la ne passent pas par nos shortcodes, WordPress les enveloppe lui-meme
   dans .wp-block-embed (Gutenberg) ou un simple iframe (editeur classique). */
.lb-article__content .wp-block-embed,
.lb-article__content .wp-block-embed figure,
.lb-article__content .wp-block-embed__wrapper {
  margin-inline: auto;
  max-width: 100%;
}

/* Video : ratio 16/9, 90% de large plafonne a 600px.

   Selecteur sur l'URL et non sur une classe : l'auto-embed WordPress (une URL
   nue sur sa propre ligne, le cas courant en redaction) rend un <p><iframe>
   sans wrapper .wp-block-embed. Cibler la source couvre les deux formes —
   bloc Gutenberg et URL nue — a n'importe quelle profondeur. */
.lb-article__content iframe[src*="youtube.com/embed"],
.lb-article__content iframe[src*="youtube-nocookie.com/embed"],
.lb-article__content iframe[src*="player.vimeo.com"],
.lb-article__content iframe[src*="dailymotion.com/embed"] {
  display: block;
  width: 90%;
  max-width: 700px;
  height: auto;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-card);
}

/* Le <p> genere par l'auto-embed n'apporte que ses marges de paragraphe. */
.lb-article__content p:has(> iframe[src*="youtube.com/embed"]),
.lb-article__content p:has(> iframe[src*="youtube-nocookie.com/embed"]),
.lb-article__content p:has(> iframe[src*="player.vimeo.com"]),
.lb-article__content p:has(> iframe[src*="dailymotion.com/embed"]) {
  margin: var(--space-5) 0;
  text-align: center;
}

/* Embed d'un article WordPress (wp-embedded-content) : l'iframe arrive avec
   width="600" height="338" en dur et un sandbox qui bride son contenu, d'ou
   la carte etriquee. On la laisse prendre la largeur utile.

   min-height sans height : wp-embed.js mesure la carte et pousse la hauteur
   par postMessage. Une hauteur fixe couperait les titres longs — frequent en
   arabe, ou le titre se replie sur plus de lignes qu'en latin. */
.lb-article__content iframe.wp-embedded-content {
  display: block;
  width: 100% !important;
  max-width: 600px;
  min-height: 200px;
  margin-inline: auto;
  /* Pas de bordure ici : la carte porte la sienne, dans css/embed.css.
     En poser une sur l'iframe donnerait un double filet. */
  border: 0;
  background: transparent;
}

/* Le blockquote de secours et la carte s'affichent tous les deux : le premier
   est le fallback sans JS, que wp-embed.js est cense masquer une fois l'iframe
   en place. On le retire au profit de la carte, seule version stylee. */
.lb-article__content blockquote.wp-embedded-content {
  display: none;
}

/* Legendes des embeds : centrees comme celles des images. */
.lb-article__content .wp-block-embed figcaption {
  text-align: center;
  font-size: var(--fs-tiny);
  color: var(--fg-muted);
  margin-top: var(--space-2);
}

@media (max-width: 767px) {
  /* Sur mobile, la largeur utile est deja contrainte par le conteneur :
     les 90% des videos y coutent une marge inutile. */
  .lb-article__content iframe[src*="youtube.com/embed"],
  .lb-article__content iframe[src*="youtube-nocookie.com/embed"],
  .lb-article__content iframe[src*="player.vimeo.com"],
  .lb-article__content iframe[src*="dailymotion.com/embed"] {
    width: 100%;
  }
}
