/* =========================================================
   frequence.tn — style.css
   Tout ce qui précède le marqueur "critical-end" est copié en
   ligne (<style>) dans chaque page par gen.py ; le reste est chargé
   en asynchrone => aucune feuille de style ne bloque le rendu.
   Compatible LTR (fr) et RTL (ar) grâce aux propriétés logiques.
   ========================================================= */

/* ---------- 1. Variables ---------- */
:root{
  color-scheme:light dark;
  --bg:#f6f7f9;--surface:#fff;--surface-2:#f1f3f7;--zebra:#fafbfc;
  --ink:#111827;--muted:#4b5563;--line:#e3e6ec;
  --accent:#1d4ed8;--accent-soft:#e8efff;--on-accent:#fff;
  --amber:#9a4a07;--amber-soft:#fff3df;
  --radius:12px;--nav-h:56px;--w:760px;
  --font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans Arabic",Tahoma,Arial,sans-serif;
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#0b1020;--surface:#121a2e;--surface-2:#18223a;--zebra:#0f1729;
    --ink:#e8ecf5;--muted:#a9b3c8;--line:#232e49;
    --accent:#8ab0ff;--accent-soft:#1c2c58;--on-accent:#0b1020;
    --amber:#f5b25c;--amber-soft:#3b2a0f;
  }
}

/* ---------- 2. Base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{
  margin:0;min-height:100vh;display:flex;flex-direction:column;
  font:1.0625rem/1.7 var(--font);color:var(--ink);background:var(--bg);
}
main{flex:1}
img{display:block;max-width:100%;height:auto}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
h1,h2,h3{margin:0;line-height:1.25;font-weight:700;color:var(--ink)}
h1{font-size:clamp(1.6rem,5.5vw,2.25rem);letter-spacing:-.01em}
h2{font-size:clamp(1.25rem,4vw,1.5rem);margin:2rem 0 .75rem}
p{margin:0 0 1rem}
[dir=rtl] h1,[dir=rtl] th{letter-spacing:0}
[dir=rtl] body{line-height:1.9}
.wrap{width:100%;max-width:var(--w);margin-inline:auto;padding-inline:16px}
.muted{color:var(--muted)}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.vh.skip:focus{position:fixed;top:8px;inset-inline-start:8px;width:auto;height:auto;clip:auto;
  padding:8px 14px;background:var(--surface);border-radius:8px;z-index:50}

/* ---------- 3. En-tête & menu (sans JS) ---------- */
.site-header{position:sticky;top:0;z-index:20;background:var(--surface);border-bottom:1px solid var(--line)}
.bar{position:relative;display:flex;align-items:center;justify-content:space-between;height:var(--nav-h)}
.logo{display:flex;align-items:center}
.logo img{height:40px;width:auto}
.burger{display:grid;place-items:center;width:44px;height:44px;border-radius:10px;cursor:pointer;color:var(--ink)}
.burger span,.burger span::before,.burger span::after{display:block;width:22px;height:2px;border-radius:2px;background:currentColor;transition:transform .2s,background .2s}
.burger span{position:relative}
.burger span::before,.burger span::after{content:"";position:absolute;inset-inline-start:0}
.burger span::before{top:-7px}
.burger span::after{top:7px}
#menubtn:checked + .burger span{background:transparent}
#menubtn:checked + .burger span::before{top:0;transform:rotate(45deg)}
#menubtn:checked + .burger span::after{top:0;transform:rotate(-45deg)}
#menubtn:focus-visible + .burger{outline:2px solid var(--accent)}
.menu{display:none;position:absolute;top:100%;inset-inline:0;flex-direction:column;gap:2px;
  padding:8px 16px 16px;background:var(--surface);border-bottom:1px solid var(--line);
  box-shadow:0 14px 24px -14px rgba(0,0,0,.35)}
#menubtn:checked ~ .menu{display:flex}
.menu a{display:block;padding:12px 10px;border-radius:8px;font-weight:600;color:var(--ink)}
.menu a:hover,.menu a[aria-current]{background:var(--accent-soft);color:var(--accent);text-decoration:none}
.menu .lang{margin-top:6px;text-align:center;border:1px solid var(--line)}
@media (min-width:760px){
  .burger{display:none}
  .menu{display:flex;position:static;flex-direction:row;align-items:center;gap:4px;padding:0;
    background:none;border:0;box-shadow:none}
  .menu a{padding:8px 12px}
  .menu .lang{margin:0;margin-inline-start:8px}
}

/* ---------- 4. En-tête de page ---------- */
.page-head{padding:24px 0 4px}
.crumbs{margin:16px 0 0;font-size:.875rem;color:var(--muted)}
.crumbs a{color:var(--muted)}
.crumbs .sep{margin-inline:6px}
.updated{display:block;margin:.5rem 0 1rem;font-size:.875rem;color:var(--muted)}
.updated span{font-weight:600}

/* ---------- 5. Recherche ---------- */
.tools{margin:16px 0 8px}
.search{position:relative}
.search::before{content:"";position:absolute;inset-inline-start:14px;top:50%;width:18px;height:18px;margin-top:-9px;
  background:var(--muted);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 105.3 14l5.4 5.4 1.4-1.4-5.4-5.4A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 105.3 14l5.4 5.4 1.4-1.4-5.4-5.4A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/%3E%3C/svg%3E") center/contain no-repeat}
.search input{width:100%;height:48px;padding-inline:44px 14px;font:inherit;color:var(--ink);
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.search input::placeholder{color:var(--muted)}

/* ---------- 6. Tableaux de fréquences ---------- */
.sat{margin:20px 0 28px}
.sat h2{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px;font-size:1.25rem}
.orb{padding:2px 10px;font-size:.8125rem;font-weight:600;color:var(--muted);
  background:var(--surface-2);border:1px solid var(--line);border-radius:99px}
.tbl{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;overflow:clip}
table{width:100%;border-collapse:collapse;font-size:.9375rem;font-variant-numeric:tabular-nums}
thead th{position:sticky;top:var(--nav-h);z-index:1;padding:10px 12px;text-align:start;
  font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);
  background:var(--surface-2);border-bottom:1px solid var(--line)}
td{padding:11px 12px;border-bottom:1px solid var(--line)}
tbody tr:last-child td{border-bottom:0}
tbody tr:nth-child(even){background:var(--zebra)}
tbody tr:hover{background:var(--accent-soft)}
td.ch{font-weight:700}
td.ch a{color:var(--accent)}
.p{display:inline-block;padding:2px 9px;border-radius:99px;font-size:.8125rem;font-weight:600;white-space:nowrap}
.p-v{background:var(--accent-soft);color:var(--accent)}
.p-h{background:var(--amber-soft);color:var(--amber)}
@media (max-width:480px){
  table{font-size:.875rem}
  thead th,td{padding:10px 8px}
  .p{padding:1px 7px;font-size:.75rem}
}
@media (max-width:360px){
  thead th,td{padding-inline:6px}
  thead th{font-size:.6875rem}
}

/* ---------- 7. Fiche d'une chaîne ---------- */
.specs{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin:0 0 20px}
.specs div{padding:12px 14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.specs div:first-child{grid-column:1/-1}
.specs dt{font-size:.75rem;font-weight:600;color:var(--muted)}
.specs dd{margin:2px 0 0;font-size:1.125rem;font-weight:700;font-variant-numeric:tabular-nums}
.specs small{font-size:.8125rem;font-weight:600;color:var(--muted)}
@media (min-width:600px){
  .specs{grid-template-columns:repeat(5,1fr)}
  .specs div:first-child{grid-column:auto}
}
.hero{width:100%;height:auto;margin:16px 0;border-radius:var(--radius)}
/*@@critical-end*/

/* ---------- 8. Texte ---------- */
.prose ul,.prose ol{margin:0 0 1rem;padding-inline-start:1.25rem}
.prose li{margin-bottom:.35rem}
.prose h3{margin:1.5rem 0 .5rem;font-size:1.125rem}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 1rem;padding:0;list-style:none}
.chips a{display:inline-block;padding:8px 16px;font-weight:600;color:var(--ink);
  background:var(--surface);border:1px solid var(--line);border-radius:99px}
.chips a:hover{color:var(--accent);border-color:var(--accent);text-decoration:none}
.steps{margin:0 0 1rem;padding:0;list-style:none;counter-reset:s}
.steps li{position:relative;margin:0 0 8px;padding:12px 14px;padding-inline-start:54px;counter-increment:s;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.steps li::before{content:counter(s);position:absolute;inset-inline-start:14px;top:50%;transform:translateY(-50%);
  display:grid;place-items:center;width:28px;height:28px;border-radius:50%;
  font-size:.875rem;font-weight:700;color:var(--on-accent);background:var(--accent)}
.cv{content-visibility:auto;contain-intrinsic-size:auto 500px}

/* ---------- 9. FAQ ---------- */
.faq{margin:2rem 0}
.faq details{margin-bottom:10px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.faq summary{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;
  font-weight:600;cursor:pointer;list-style:none}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";font-size:1.4rem;line-height:1;color:var(--accent)}
.faq details[open] summary::after{content:"\2013"}
.faq details p{margin:0;padding:0 16px 14px;color:var(--muted)}

/* ---------- 10. Partage (rempli par majditn.js) ---------- */
.share{display:flex;flex-wrap:wrap;align-items:center;gap:10px;min-height:44px;margin:2rem 0}
.share>span{font-weight:600}
.share a,.share button{display:inline-grid;place-items:center;width:44px;height:44px;padding:0;
  color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:50%;
  cursor:pointer;transition:transform .15s,color .15s,border-color .15s}
.share a:hover,.share button:hover{transform:translateY(-2px);text-decoration:none}
.share svg{width:20px;height:20px;fill:currentColor}
.share .fb:hover{color:#1877f2;border-color:#1877f2}
.share .wa:hover{color:#1da851;border-color:#1da851}
.share .x:hover,.share .cp:hover{color:var(--accent);border-color:var(--accent)}
.share .msg{font-size:.875rem;color:var(--muted)}

/* ---------- 11. Auteur ---------- */
.author{display:flex;gap:14px;align-items:flex-start;margin:2rem 0;padding:18px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.author img{flex:none;height:44px;width:auto}
.author strong{display:block;margin-bottom:4px}
.author p{margin:0;font-size:.9375rem;color:var(--muted)}
@media (max-width:600px){.author{flex-direction:column;align-items:center;text-align:center}}

/* ---------- 12. Pied de page ---------- */
.site-footer{margin-top:48px;padding:28px 0;font-size:.9rem;text-align:center;color:var(--muted);
  background:var(--surface);border-top:1px solid var(--line)}
.site-footer .wrap{display:flex;flex-direction:column;align-items:center;gap:14px}
.site-footer a{color:var(--ink);font-weight:600}
.foot-links{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px}
.foot-links a{font-weight:500;font-size:.875rem}
.social{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:50%;
  background:var(--surface-2);border:1px solid var(--line)}
.social svg{width:18px;height:18px;fill:currentColor}
.social:hover{color:#1877f2;text-decoration:none}

/* ---------- 13. Mouvement réduit ---------- */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{transition:none!important;animation:none!important}
}
