
/* ---------- Variables ---------- */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #17201c;
  --muted: #5d6a64;
  --line: #e7e3da;
  --brand: #0b6b53;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1ec;
  --alert: #c8341f;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(23 32 28 / .06), 0 8px 24px rgb(23 32 28 / .06);
  --font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Noto Kufi Arabic", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --w: 1200px;
}
:root[data-theme="dark"] {
  --bg: #0e1412;
  --surface: #151d1a;
  --ink: #eef2ef;
  --muted: #9aa8a1;
  --line: #243029;
  --brand: #3fc29b;
  --brand-ink: #06231a;
  --brand-soft: #16302a;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1412; --surface: #151d1a; --ink: #eef2ef; --muted: #9aa8a1;
    --line: #243029; --brand: #3fc29b; --brand-ink: #06231a; --brand-soft: #16302a;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.75 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.4; margin: 0; letter-spacing: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.screen-reader-text, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; right: 8px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: .6rem 1rem; border-radius: 8px; }

.wrap { width: min(100% - 2.5rem, var(--w)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2.5rem, 740px); }
.section { padding-block: 2.75rem; }
.mt { margin-top: 2rem; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--brand); color: var(--brand-ink); font: 800 1.4rem var(--font-head);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font: 700 1.15rem var(--font-head); }
.brand-text small { color: var(--muted); font-size: .78rem; }
.custom-logo { max-height: 44px; width: auto; }

.primary-nav { flex: 1; }
.menu { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.menu a { display: block; padding: .45rem .8rem; border-radius: 999px; font-weight: 500; font-size: .98rem; color: var(--muted); }
.menu a:hover, .menu .is-active > a { background: var(--brand-soft); color: var(--brand); }
.menu .sub-menu { display: none; }

.header-tools { display: flex; gap: .25rem; margin-inline-start: auto; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.menu-btn { display: none; }

.search-panel { border-top: 1px solid var(--line); padding: 1rem 0; background: var(--surface); }
.searchform { display: flex; gap: .5rem; }
.searchform input[type="search"] {
  flex: 1; padding: .8rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink); font: inherit;
}

/* ---------- Bandeau d'actualités ---------- */
.ticker { background: var(--ink); color: var(--bg); font-size: .92rem; }
.ticker-row { display: flex; align-items: center; gap: 1rem; min-height: 42px; overflow: hidden; }
.ticker-label { background: var(--alert); color: #fff; font-weight: 700; padding: .15rem .75rem; border-radius: 999px; flex: none; font-size: .82rem; }
.ticker-list { display: flex; gap: 2.25rem; list-style: none; margin: 0; padding: 0; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.ticker-list::-webkit-scrollbar { display: none; }
.ticker-list a:hover { color: #fff; text-decoration: underline; }

/* ---------- À la une ---------- */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; grid-template-rows: 1fr 1fr; gap: 1rem; margin-top: 1.75rem; }
.hero-item { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--ink); min-height: 220px; }
.hero-item--main { grid-row: span 2; min-height: 460px; }
.hero-link, .hero-link img, .hero-link .thumb-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-link img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.hero-item:hover img { transform: scale(1.04); }
.hero-overlay {
  position: absolute; inset: auto 0 0 0; padding: 3rem 1.5rem 1.4rem; color: #fff;
  background: linear-gradient(to top, rgb(8 14 11 / .88), rgb(8 14 11 / 0));
}
.hero-overlay h2 { font-size: 1.15rem; margin-block: .6rem .4rem; text-wrap: balance; }
.hero-item--main h2 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); }
.hero-item:hover .hero-overlay h2 { text-decoration: underline; text-underline-offset: 5px; }

/* ---------- Sections et grilles ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.section-head h2, .section-head h1 { font-size: 1.5rem; position: relative; }
.section-head h2::before { content: ""; display: inline-block; width: 6px; height: 1.1em; margin-inline-end: .6rem; background: var(--brand); border-radius: 3px; vertical-align: -.15em; }
.section-head--page { display: block; border: 0; }
.section-head--page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.lead { color: var(--muted); font-size: 1.15rem; }
.more { color: var(--brand); font-weight: 600; font-size: .95rem; }
.hl { color: var(--brand); }
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Cartes ---------- */
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--brand-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem 1.2rem 1.25rem; flex: 1; }
.card-title { font-size: 1.08rem; text-wrap: balance; }
.card-title a { background: linear-gradient(currentColor, currentColor) 100% 100% / 0 2px no-repeat; transition: background-size .3s; }
.card:hover .card-title a { background-size: 100% 2px; }
.card-excerpt { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: .4rem; }
.thumb-fallback { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--brand-soft), var(--surface)); }

.chip { align-self: flex-start; font-size: .8rem; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: .15rem .7rem; border-radius: 999px; }
.chip:hover { background: var(--brand); color: var(--brand-ink); }
.chip--solid { background: var(--brand); color: var(--brand-ink); display: inline-block; }
.meta { display: flex; flex-wrap: wrap; gap: .45rem; color: var(--muted); font-size: .85rem; }
.meta--light { color: rgb(255 255 255 / .8); }

/* ---------- Article ---------- */
.article { padding-bottom: 2rem; }
.article-head { padding-block: 2.5rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.article-head h1 { font-size: clamp(1.7rem, 4.2vw, 2.7rem); text-wrap: balance; line-height: 1.45; }
.article-cover { margin-block: 0 2rem; }
.article-cover img { width: 100%; border-radius: var(--radius); }
.article-cover figcaption { color: var(--muted); font-size: .88rem; margin-top: .6rem; }
.prose { font-size: 1.15rem; line-height: 2; }
.prose > * + * { margin-top: 1.3em; }
.prose h2 { font-size: 1.6rem; margin-top: 2em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.8em; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.prose img { border-radius: 10px; }
.prose blockquote { margin-inline: 0; padding: .4rem 1.4rem; border-inline-start: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; font-weight: 500; }
.article-foot { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.tags a { font-size: .88rem; padding: .15rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.share { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.share > span { font-weight: 600; margin-inline-end: .5rem; }
.progress { position: fixed; top: 0; inset-inline: 0; height: 3px; background: var(--brand); transform: scaleX(0); transform-origin: right; z-index: 60; }

/* ---------- Boutons, pagination ---------- */
.btn { display: inline-block; padding: .55rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 500 .95rem var(--font-body); cursor: pointer; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn--primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn--primary:hover { color: var(--brand-ink); filter: brightness(1.1); }
.pagination ul { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; list-style: none; padding: 0; margin: 2.5rem 0 0; }
.pagination .page-numbers { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pagination .current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.empty, .not-found { text-align: center; color: var(--muted); }
.big-404 { font: 800 clamp(5rem, 18vw, 9rem) var(--font-head); color: var(--brand-soft); margin: 0; line-height: 1; }

/* ---------- Commentaires ---------- */
.comments { margin-top: 3rem; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit;
}
.comment-form .submit { background: var(--brand); color: var(--brand-ink); border: 0; padding: .7rem 1.6rem; border-radius: 999px; font: 600 1rem var(--font-body); cursor: pointer; }

/* ---------- Pied de page ---------- */
.site-footer { margin-top: 3rem; background: var(--surface); border-top: 1px solid var(--line); padding-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; }
.footer-grid h3 { font-size: 1rem; margin-bottom: .8rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; color: var(--muted); }
.footer-about { color: var(--muted); max-width: 38ch; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; margin-top: 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* ---------- Adaptatif ---------- */
@media (max-width: 960px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; grid-template-rows: auto; }
  .hero-item--main { grid-row: auto; min-height: 380px; }
  .menu-btn { display: grid; }
  .primary-nav { position: fixed; inset: 68px 0 auto 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.5rem; display: none; max-height: calc(100vh - 68px); overflow: auto; }
  .nav-open .primary-nav { display: block; }
  .menu { flex-direction: column; }
  .menu a { padding: .75rem 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
  .prose { font-size: 1.08rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Services ---------- */
.svc-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.svc-tile { display: flex; flex-direction: column; gap: .35rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .25s, box-shadow .25s, border-color .25s; }
.svc-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand); }
.svc-tile strong { font: 700 1.1rem var(--font-head); }
.svc-tile span { color: var(--muted); font-size: .9rem; }
.duty { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); border-radius: var(--radius); padding: 1.25rem 1.5rem; display: grid; gap: .9rem; }
.duty h2 { font-size: 1.2rem; }
.duty-list { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.duty-item { background: var(--surface); border-radius: 10px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.duty-item a.call { color: var(--brand); font-weight: 600; direction: ltr; text-align: right; }
.svc-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.svc-list { display: grid; gap: .8rem; }
.svc-row h3 { font-size: 1.05rem; }
.svc-row p { margin: .2rem 0 0; color: var(--muted); font-size: .92rem; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; display: grid; gap: .6rem; }
.info-card dt { color: var(--muted); font-size: .85rem; }
.info-card dd { margin: 0 0 .4rem; font-weight: 500; }
.hours { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hours td { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: left; direction: ltr; }
