/* ===================== Noble Coran — feuille de style ===================== */
:root {
  --vert: #0f5c4a; --vert-2: #137a61; --vert-clair: #e6f2ee; --or: #b8892b; --or-clair: #f6eedb;
  --fond: #faf8f3; --carte: #ffffff; --texte: #1c2421; --texte-2: #5a6762; --bord: #e4e0d6;
  --ombre: 0 1px 2px rgba(20,40,30,.06), 0 4px 16px rgba(20,40,30,.06);
  --rayon: 14px; --police-ar: 2rem;
  --f-ui: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-ar: "Amiri Quran", "Amiri", "Scheherazade New", "Traditional Arabic", serif;
  --f-titre: "Cormorant Garamond", Georgia, serif;
}
:root[data-theme="nuit"] {
  --vert: #3fb592; --vert-2: #5cc9a7; --vert-clair: #15302a; --or: #d9b45f; --or-clair: #2c2615;
  --fond: #0e1513; --carte: #16201d; --texte: #e8efec; --texte-2: #9fb0aa; --bord: #26332f;
  --ombre: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-ui); font-size: 17px; line-height: 1.6; color: var(--texte); background: var(--fond); }
a { color: var(--vert); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1, h2 { font-family: var(--f-titre); font-weight: 700; font-variant-numeric: lining-nums; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); }
.conteneur { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.etroit { max-width: 860px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ar { font-family: var(--f-ar); direction: rtl; }
.muted { color: var(--texte-2); }
.section { padding: 48px 0; }
.section-titre { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.section-titre h2 { margin: 0; }

/* ----- Boutons & formulaires ----- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--vert);
  background: var(--vert); color: #fff; font: 600 15px var(--f-ui); cursor: pointer; text-decoration: none !important; transition: .15s; }
:root[data-theme="nuit"] .btn { color: #08130f; }
.btn:hover { background: var(--vert-2); border-color: var(--vert-2); }
.btn-ligne { background: transparent; color: var(--vert); }
:root[data-theme="nuit"] .btn-ligne { color: var(--vert); }
.btn-ligne:hover { background: var(--vert-clair); }
.btn-or { background: var(--or); border-color: var(--or); }
.btn-petit { padding: 6px 12px; font-size: 14px; }
.btn-danger { background: #b3261e; border-color: #b3261e; }
input, select, textarea { font: inherit; color: var(--texte); background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--vert) 35%, transparent); outline-offset: 2px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
.formulaire { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 24px; box-shadow: var(--ombre); }
.alerte { padding: 12px 16px; border-radius: 10px; margin: 16px 0; border: 1px solid; }
.alerte.ok { background: var(--vert-clair); border-color: var(--vert); }
.alerte.erreur { background: #fde8e7; border-color: #e3a19c; color: #7a1c16; }
.piege { position: absolute; left: -9999px; }

/* ----- En-tête ----- */
.entete { background: var(--carte); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 50; }
.entete .conteneur { display: flex; align-items: center; gap: 16px; min-height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--texte); font: 700 1.45rem var(--f-titre); text-decoration: none !important; white-space: nowrap; }
.logo svg { width: 38px; height: 38px; flex: none; }
.logo small { display: block; font: 500 .7rem var(--f-ui); color: var(--texte-2); letter-spacing: .08em; text-transform: uppercase; margin-top: -4px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav > details, .nav > a { position: relative; }
.nav summary, .nav > a { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 10px; font-weight: 600; color: var(--texte); font-size: 15px; display: block; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: "▾"; font-size: .75em; margin-left: 6px; color: var(--texte-2); }
.nav summary:hover, .nav > a:hover, .nav details[open] summary { background: var(--vert-clair); text-decoration: none; }
.sous-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 270px; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; box-shadow: var(--ombre); padding: 8px; z-index: 60; }
[dir="rtl"] .sous-menu { left: auto; right: 0; }
.sous-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--texte); font-size: 15px; }
.sous-menu a:hover { background: var(--vert-clair); text-decoration: none; }
.outils { display: flex; align-items: center; gap: 6px; }
.icone-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); cursor: pointer; font-size: 18px; text-decoration: none !important; }
.icone-btn:hover { background: var(--vert-clair); }
.langues { display: flex; gap: 2px; font-size: 13px; }
.langues a { padding: 4px 7px; border-radius: 6px; color: var(--texte-2); font-weight: 600; }
.langues a.actif { background: var(--vert); color: #fff; }
.burger { display: none; }
@media (max-width: 1020px) {
  .burger { display: inline-grid; margin-left: auto; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--carte); border-bottom: 1px solid var(--bord); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; max-height: calc(100vh - 66px); overflow: auto; }
  .nav.ouvert { display: flex; }
  .sous-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; min-width: 0; }
  .outils .langues { display: none; }
}

/* ----- Accueil ----- */
.hero { background: radial-gradient(1200px 400px at 50% -10%, var(--vert-clair), transparent 70%), var(--fond); padding: 48px 0 32px; text-align: center; border-bottom: 1px solid var(--bord); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .05; background-image: url("/img/motif.svg"); background-size: 80px; pointer-events: none; }
.hero .basmala { font-family: var(--f-ar); font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--or); margin-bottom: 8px; }
.hero p.sous { max-width: 720px; margin: 0 auto 22px; color: var(--texte-2); font-size: 1.1rem; }
.onglets { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; background: var(--carte); border: 1px solid var(--bord); border-radius: 999px; padding: 5px; margin-bottom: 20px; }
.onglets a { padding: 7px 16px; border-radius: 999px; font-weight: 600; color: var(--texte-2); font-size: 15px; }
.onglets a.actif, .onglets a:hover { background: var(--vert); color: #fff; text-decoration: none; }
.barre-recherche { display: flex; max-width: 640px; margin: 0 auto; background: var(--carte); border: 1px solid var(--bord); border-radius: 999px; padding: 5px; box-shadow: var(--ombre); position: relative; }
.barre-recherche input { border: 0; background: transparent; padding: 10px 16px; }
.barre-recherche input:focus { outline: none; }
.suggestions { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; box-shadow: var(--ombre); text-align: left; z-index: 20; overflow: hidden; }
.suggestions a { display: block; padding: 9px 16px; color: var(--texte); border-bottom: 1px solid var(--bord); font-size: 15px; }
.suggestions a:hover { background: var(--vert-clair); text-decoration: none; }
.acces { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 28px; }
.acces a { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; color: var(--texte); font-weight: 600; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; transition: .15s; }
.acces a:hover { border-color: var(--vert); transform: translateY(-2px); text-decoration: none; }
.acces .ico { font-size: 26px; }
.grille-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
@media (max-width: 860px) { .grille-2 { grid-template-columns: 1fr; } }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 22px; box-shadow: var(--ombre); }
.carte h3 { font-size: 1.15rem; }
.progression { height: 8px; background: var(--vert-clair); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progression span { display: block; height: 100%; background: linear-gradient(90deg, var(--vert), var(--or)); border-radius: 99px; }
.vdj .ar { font-size: 1.8rem; line-height: 2.2; color: var(--texte); }
.vdj blockquote { margin: 10px 0; font-style: italic; color: var(--texte-2); }

/* Grille des sourates */
.selecteur { display: flex; gap: 10px; max-width: 520px; }
.sourates { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.carte-sourate { display: flex; align-items: center; gap: 14px; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 12px 14px; color: var(--texte); transition: .15s; }
.carte-sourate:hover { border-color: var(--vert); text-decoration: none; box-shadow: var(--ombre); }
.num { width: 42px; height: 42px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--vert);
  background: var(--vert-clair); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.carte-sourate .info { flex: 1; min-width: 0; }
.carte-sourate .nom { font-weight: 700; display: block; }
.carte-sourate .sens { font-size: 14px; color: var(--texte-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte-sourate .droite { text-align: right; }
.carte-sourate .ar { font-size: 1.35rem; display: block; line-height: 1.3; }
.carte-sourate .nb { font-size: 12px; color: var(--texte-2); }
.filtre-liste { max-width: 320px; }

.ressources { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.ressources .carte a.lien { font-weight: 700; }
.bandeau { background: var(--vert); color: #fff; border-radius: 20px; padding: 32px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
:root[data-theme="nuit"] .bandeau { background: var(--vert-clair); color: var(--texte); }
.bandeau h2 { margin: 0 0 6px; }
.bandeau .btn { background: #fff; color: var(--vert); border-color: #fff; }
.editorial { columns: 2 340px; column-gap: 40px; color: var(--texte-2); }
.editorial p { margin-top: 0; }

/* ----- Page sourate ----- */
.tete-sourate { text-align: center; padding: 36px 0 20px; background: linear-gradient(var(--vert-clair), transparent); }
.tete-sourate .ar { font-size: clamp(2.4rem, 7vw, 3.6rem); color: var(--vert); line-height: 1.4; }
.tete-sourate h1 { margin: 0; }
.tete-sourate .meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--carte); border: 1px solid var(--bord); font-size: 13px; color: var(--texte-2); }
.barre-outils { position: sticky; top: 66px; z-index: 40; background: color-mix(in srgb, var(--fond) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bord); padding: 10px 0; }
.barre-outils .conteneur { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bascule { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--bord); background: var(--carte); cursor: pointer; font-size: 14px; font-weight: 600; user-select: none; margin: 0; }
.bascule input { width: auto; margin: 0; accent-color: var(--vert); }
.barre-outils select { width: auto; padding: 6px 10px; font-size: 14px; border-radius: 999px; }
.barre-outils .espace { flex: 1; }
.basmala-tete { text-align: center; font-family: var(--f-ar); font-size: 2rem; color: var(--or); margin: 26px 0 6px; }
.versets { padding: 10px 0 40px; }
.verset { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px 20px; margin: 14px 0; scroll-margin-top: 140px; transition: border-color .2s, box-shadow .2s; }
.verset.actif { border-color: var(--or); box-shadow: 0 0 0 3px var(--or-clair); }
.verset.cible { border-color: var(--vert); }
.verset .haut { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.verset .haut .num { width: 36px; height: 36px; font-size: 13px; }
.verset .haut .espace { flex: 1; }
.act { border: 0; background: transparent; color: var(--texte-2); cursor: pointer; padding: 7px; border-radius: 8px; line-height: 0; display: inline-grid; place-items: center; }
.act svg { display: block; }
.act[data-action="favori"] svg { fill: none; stroke: currentColor; stroke-width: 2; }
.act[data-action="favori"].on svg { fill: currentColor; }
.act:hover { background: var(--vert-clair); color: var(--vert); }
.act.on { color: var(--or); }
.act.memo-en_cours { color: #c77c00; background: #fff4e0; }
.act.memo-memorise { color: #fff; background: var(--vert); }
.ligne-ar { font-family: var(--f-ar); direction: rtl; text-align: right; font-size: var(--police-ar); line-height: 2.1; margin: 4px 0 10px; }
.ligne-ar .fin { font-size: .8em; color: var(--or); margin-right: 6px; }
.ligne-ph { color: var(--vert); font-style: italic; margin: 6px 0; }
.ligne-tr { margin: 6px 0 0; }
.masque-ar .ligne-ar, .masque-ph .ligne-ph, .masque-tr .ligne-tr { display: none; }
.sajda { color: var(--or); font-size: 13px; font-weight: 700; }
.nav-sourates { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 20px 0 40px; }
.lecteur { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--carte); border-top: 1px solid var(--bord); box-shadow: 0 -4px 20px rgba(0,0,0,.08); padding: 10px 0; display: none; }
.lecteur.visible { display: block; }
.lecteur .conteneur { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lecteur .titre { font-weight: 700; flex: 1; min-width: 160px; }
.lecteur audio { flex: 2; min-width: 240px; height: 40px; }
body.avec-lecteur { padding-bottom: 90px; }

/* Juz & hizb */
.tableau { width: 100%; border-collapse: collapse; background: var(--carte); border-radius: var(--rayon); overflow: hidden; border: 1px solid var(--bord); }
.tableau th, .tableau td { padding: 10px 14px; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: top; }
.tableau th { background: var(--vert-clair); font-size: 14px; }
.tableau-defile { overflow-x: auto; }
.grille-juz { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.grille-juz .carte { padding: 16px; }
.grille-juz h3 { margin: 0 0 4px; }
.titre-groupe { margin: 32px 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--or); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* Recherche */
.resultat { padding: 14px 0; border-bottom: 1px solid var(--bord); }
.resultat mark { background: var(--or-clair); color: inherit; padding: 0 2px; border-radius: 3px; }

/* Quiz */
.question { margin: 18px 0; }
.choix { display: grid; gap: 8px; }
.choix button { text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); font: inherit; cursor: pointer; }
.choix button:hover:not(:disabled) { border-color: var(--vert); }
.choix button.bon { background: var(--vert-clair); border-color: var(--vert); font-weight: 700; }
.choix button.faux { background: #fde8e7; border-color: #e3a19c; color: #7a1c16; }

/* Apprendre */
.cache-texte .zone-texte { filter: blur(7px); user-select: none; }
.cache-texte .zone-texte:hover { filter: blur(4px); }
.etapes { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.etapes button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); cursor: pointer; font-weight: 700; }
.etapes button.actif { background: var(--vert); color: #fff; border-color: var(--vert); }
.etapes button.fait { border-color: var(--vert); color: var(--vert); }

/* Articles */
.article { font-size: 1.08rem; }
.article h2 { margin-top: 1.4em; }
.article blockquote { margin: 1em 0; padding: 12px 18px; border-left: 4px solid var(--or); background: var(--or-clair); border-radius: 0 10px 10px 0; }
pre.code { background: #0f1a17; color: #d9f0e7; padding: 16px; border-radius: 12px; overflow-x: auto; font-size: 14px; white-space: pre-wrap; word-break: break-all; }

/* Pied de page */
.pied { background: #0b2b23; color: #c8d9d3; padding: 44px 0 24px; margin-top: 40px; }
.pied a { color: #e6efe9; }
.pied .colonnes { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.pied h4 { color: #fff; margin: 0 0 10px; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin: 6px 0; font-size: 15px; }
.pied .bas { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 14px; }
.pied .logo { color: #fff; }
@media (max-width: 760px) { .pied .colonnes { grid-template-columns: 1fr 1fr; } }

/* Impression */
.impression { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
@media print {
  .entete, .pied, .barre-outils, .lecteur, .non-imprimable, .verset .haut .act { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .verset { border: 0; border-bottom: 1px solid #ccc; border-radius: 0; break-inside: avoid; box-shadow: none; padding: 8px 0; }
  .titre-groupe { break-before: page; }
  .titre-groupe:first-of-type { break-before: auto; }
}
/* RTL */
[dir="rtl"] .carte-sourate .droite { text-align: left; }
[dir="rtl"] .tableau th, [dir="rtl"] .tableau td { text-align: right; }
@media (max-width: 760px) {
  .barre-outils { position: static; }
  .barre-outils .espace { display: none; }
  .verset { padding: 14px; scroll-margin-top: 80px; }
  .lecteur audio { min-width: 0; width: 100%; order: 5; flex-basis: 100%; }
  .lecteur .bascule { display: none; }
  body.avec-lecteur { padding-bottom: 130px; }
}

/* ===== Horaires de prière & calendrier ===== */
.banniere { background-size: cover; background-position: center; color: #fff; padding: 64px 0 56px; position: relative; }
.banniere::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,20,25,.75), rgba(5,20,25,.25)); }
.banniere .conteneur { position: relative; }
.banniere h1 { color: #fff; margin-bottom: 8px; }
.banniere p { margin: 0; max-width: 680px; font-size: 1.08rem; }
.banniere .ar { color: #f3dc94; }
.surtitre { text-transform: uppercase; letter-spacing: .1em; font-size: 13px !important; font-weight: 700; color: #f3dc94; margin-bottom: 6px !important; }
.filtres-priere { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; padding: 18px; }
.filtres-priere label { margin-top: 0; }
.filtres-priere .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.prochaine { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 20px 0 14px; padding: 16px 22px; border-left: 5px solid var(--or); }
.prochaine strong { font-size: 1.4rem; font-family: var(--f-titre); }
.prochaine .compte { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.3rem; color: var(--vert); }
.prieres { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 900px) { .prieres { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .prieres { grid-template-columns: repeat(2, 1fr); } }
.priere { text-align: center; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.priere .ar { font-size: 1.3rem; color: var(--or); line-height: 1.6; }
.priere .nom { font-weight: 700; }
.priere .heure { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--vert); }
.priere[data-cle="sunrise"] { opacity: .8; }
.priere.actuelle { background: var(--vert); border-color: var(--vert); }
.priere.actuelle .nom, .priere.actuelle .heure { color: #fff; }
:root[data-theme="nuit"] .priere.actuelle .nom, :root[data-theme="nuit"] .priere.actuelle .heure { color: #08130f; }
.tableau-priere td, .tableau-priere th { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; padding: 8px 10px; }
.tableau-priere td:first-child, .tableau-priere th:first-child { text-align: left; }
.tableau-priere tr.vendredi { background: color-mix(in srgb, var(--vert-clair) 60%, transparent); }
.tableau-priere tr.aujourdhui { background: var(--or-clair); font-weight: 700; outline: 2px solid var(--or); }
.villes { display: flex; flex-wrap: wrap; gap: 8px; }
.villes a { padding: 6px 12px; border: 1px solid var(--bord); border-radius: 999px; background: var(--carte); color: var(--texte); font-size: 14px; }
.villes a:hover, .villes a.actif { background: var(--vert); color: #fff; border-color: var(--vert); text-decoration: none; }
.illustration-carte { background-size: cover; background-position: center; color: #fff; position: relative; overflow: hidden; min-height: 190px; display: flex; align-items: flex-end; }
.illustration-carte::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,20,25,.85), rgba(5,20,25,.15)); }
.illustration-carte > div { position: relative; }
.illustration-carte h3, .illustration-carte p { color: #fff; }
.evenements { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.evenement { display: flex; gap: 14px; align-items: flex-start; }
.evenement .icone { font-size: 2rem; line-height: 1; }
.evenement h3 { margin: 0 0 4px; }
.evenement p { margin: 2px 0; }
.evenement.majeur { border-color: var(--or); box-shadow: 0 0 0 2px var(--or-clair); }
.evenement.passe { opacity: .6; }
.rebours { font-weight: 700; color: var(--vert); }
.mois-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.mois h3 { margin: 0 0 4px; }
.jours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.entete-j { font-size: 12px; font-weight: 700; color: var(--texte-2); padding: 4px 0; }
.jour { border-radius: 8px; padding: 4px 0; display: flex; flex-direction: column; line-height: 1.15; cursor: default; }
.jour b { font-size: 14px; }
.jour small { font-size: 10.5px; color: var(--texte-2); }
.jour.ramadan { background: var(--vert-clair); }
.jour.ev { background: var(--or); color: #fff; }
.jour.ev small { color: #fff; }
.jour.auj { outline: 2px solid var(--vert); }
.pastille { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }
.pastille.ramadan { background: var(--vert-clair); border: 1px solid var(--vert); }
.pastille.ev { background: var(--or); }
.pastille.auj { outline: 2px solid var(--vert); }
.vignettes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
@media print { .banniere { color: #000; background: none !important; padding: 10px 0; } .banniere::before { display: none; } .banniere h1, .banniere .ar { color: #000; } .prochaine, .prieres, .villes, .illustration-carte { display: none !important; } }

/* ======================= Design moderne (v2) ======================= */
:root { --rayon: 18px; --ombre: 0 1px 2px rgba(15,40,30,.05), 0 8px 28px rgba(15,40,30,.08); --ombre-forte: 0 18px 50px rgba(15,40,30,.16); }
.entete { background: color-mix(in srgb, var(--carte) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); }
.btn { box-shadow: 0 2px 10px color-mix(in srgb, var(--vert) 22%, transparent); }
.btn:hover { transform: translateY(-1px); }
.btn-or { background: linear-gradient(135deg, #d2a645, #b8892b); border-color: #b8892b; color: #fff !important; box-shadow: 0 4px 16px rgba(184,137,43,.35); }
.btn-or:hover { background: linear-gradient(135deg, #ddb453, #a77a22); border-color: #a77a22; }
.btn-ligne { box-shadow: none; }
.btn-large { width: 100%; justify-content: center; padding: 14px 20px; font-size: 16px; }
.carte { transition: transform .2s, box-shadow .2s; }

/* Héros sombre avec illustration */
.hero-sombre { background: linear-gradient(180deg, rgba(6,22,28,.55), rgba(6,22,28,.88)), url('/img/illustrations/mosquee-nuit.svg') center/cover no-repeat; color: #fff; padding: 76px 0 120px; border: 0; }
.hero-sombre::before { display: none; }
.hero-sombre h1 { color: #fff; font-size: clamp(2.4rem, 6vw, 3.8rem); text-shadow: 0 2px 20px rgba(0,0,0,.35); }
.hero-sombre .basmala { color: #f3dc94; }
.hero-sombre p.sous { color: rgba(255,255,255,.85); }
.hero-sombre .onglets { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); backdrop-filter: blur(8px); }
.hero-sombre .onglets a { color: rgba(255,255,255,.85); }
.hero-sombre .onglets a.actif, .hero-sombre .onglets a:hover { background: #fff; color: var(--vert); }
.hero-sombre .barre-recherche { background: #fff; border: 0; box-shadow: 0 12px 40px rgba(0,0,0,.3); padding: 6px; }
.hero-sombre .barre-recherche input { color: #1c2421; font-size: 17px; }
.stats-hero { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-top: 26px; color: rgba(255,255,255,.8); font-size: 15px; }
.stats-hero strong { color: #f3dc94; font-size: 1.25rem; margin-right: 4px; }

/* Accès rapides : 4 colonnes sur PC, 2 sur mobile */
.acces-section { margin-top: -70px; position: relative; z-index: 2; }
.acces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 0; }
.acces a { flex-direction: row; align-items: center; text-align: left; gap: 14px; padding: 20px; border-radius: var(--rayon); box-shadow: var(--ombre); border: 1px solid var(--bord); }
.acces a:hover { transform: translateY(-4px); box-shadow: var(--ombre-forte); border-color: var(--or); }
.acces .ico { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; font-size: 26px; background: linear-gradient(135deg, var(--vert-clair), var(--or-clair)); }
.acces strong { display: block; font-size: 16px; color: var(--texte); line-height: 1.25; }
.acces small { display: block; color: var(--texte-2); font-weight: 400; font-size: 13.5px; margin-top: 2px; }
@media (max-width: 900px) { .acces { grid-template-columns: repeat(2, 1fr); } .acces-section { margin-top: -60px; } }
@media (max-width: 480px) { .acces { gap: 10px; } .acces a { padding: 14px; gap: 10px; } .acces .ico { width: 42px; height: 42px; font-size: 21px; } .acces small { display: none; } .stats-hero { gap: 14px; } }

/* Vignettes illustrées (accueil) */
.vignettes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .vignettes { grid-template-columns: 1fr; } }
.illustration-carte { min-height: 240px; padding: 28px; border: 0; color: #fff !important; box-shadow: var(--ombre); }
.illustration-carte:hover { transform: translateY(-4px); box-shadow: var(--ombre-forte); text-decoration: none; }
.illustration-carte h3 { font-size: 1.4rem; font-family: var(--f-titre); margin-bottom: 6px; }
.illustration-carte p { opacity: .9; max-width: 460px; }

.carte-sourate { border-radius: 14px; }
.carte-sourate:hover { transform: translateY(-2px); border-color: var(--or); }

/* ======================= Connexion / inscription ======================= */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 66px); }
.auth-visuel { position: relative; background-size: cover; background-position: center; color: #fff; display: flex; align-items: flex-end; padding: 56px; }
.auth-visuel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,22,28,.15) 0%, rgba(6,22,28,.9) 75%); }
.auth-visuel-contenu { position: relative; max-width: 480px; }
.auth-verset { font-size: clamp(2rem, 4vw, 2.8rem); color: #f3dc94; line-height: 1.8; margin: 0; }
.auth-trad { font-size: 1.15rem; margin: 6px 0 24px; }
.auth-trad small { opacity: .75; }
.avantages { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.avantages li { padding-left: 32px; position: relative; }
.avantages li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: #b8892b; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.auth-panneau { display: flex; align-items: center; justify-content: center; padding: 40px 16px; background: radial-gradient(600px 300px at 80% 0%, var(--vert-clair), transparent), var(--fond); }
.auth-carte { width: 100%; max-width: 440px; background: var(--carte); border: 1px solid var(--bord); border-radius: 24px; padding: 36px 32px; box-shadow: var(--ombre-forte); text-align: center; }
.auth-logo img { display: block; margin: 0 auto 10px; }
.auth-carte h1 { font-size: 2rem; margin-bottom: 6px; }
.auth-sous { margin: 0 0 22px; font-size: 15px; }
.auth-onglets { display: grid; grid-template-columns: 1fr 1fr; background: var(--vert-clair); border-radius: 14px; padding: 5px; margin-bottom: 22px; }
.auth-onglets a { padding: 10px; border-radius: 10px; font-weight: 700; color: var(--texte-2); }
.auth-onglets a.actif { background: var(--carte); color: var(--vert); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.auth-onglets a:hover { text-decoration: none; color: var(--vert); }
.auth-form { text-align: left; }
.champ { margin-bottom: 14px; }
.champ label { margin: 0 0 6px; font-size: 14px; }
.champ input { padding: 13px 14px; border-radius: 12px; background: var(--fond); }
.champ input:focus { background: var(--carte); border-color: var(--vert); }
.mdp { position: relative; }
.mdp input { padding-right: 48px; }
.voir-mdp { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--texte-2); cursor: pointer; padding: 8px; border-radius: 8px; line-height: 0; }
.voir-mdp:hover, .voir-mdp.on { color: var(--vert); background: var(--vert-clair); }
.force { height: 5px; background: var(--bord); border-radius: 99px; margin: -6px 0 14px; overflow: hidden; }
.force span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }
.lien-oubli { text-align: right; margin: -4px 0 16px; font-size: 14px; font-weight: 600; }
.lien-oubli a { color: var(--or); }
.petit { font-size: 13px; }
.auth-retour { margin: 20px 0 0; font-size: 15px; }
.auth .alerte { text-align: left; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visuel { min-height: 220px; padding: 28px 20px; order: 2; }
  .auth-panneau { padding: 28px 16px; }
  .auth-carte { padding: 28px 20px; }
}
.acces { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.acces a { min-width: 0; }
.acces strong { overflow-wrap: anywhere; }
@media (max-width: 900px) { .acces { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.barre-recherche .btn { white-space: nowrap; flex: none; }
.barre-recherche input { min-width: 0; }
@media (max-width: 480px) { .hero-sombre { padding: 48px 0 100px; } .barre-recherche .btn { padding: 10px 14px; } }
.bandeau-annonce { text-align: center; font-weight: 600; font-size: 15px; padding: 9px 0; color: #fff; }
.bandeau-annonce a { color: #fff; }
.couleur-or { background: linear-gradient(90deg, #b8892b, #d2a645); }
.couleur-vert { background: linear-gradient(90deg, #0f5c4a, #137a61); }
.couleur-rouge { background: linear-gradient(90deg, #a8261f, #d0453c); }
.article-couverture { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--rayon); margin: 10px 0 24px; }
.carte-blog-image { display: block; height: 170px; margin: -22px -22px 16px; background: var(--vert-clair) center/cover; border-radius: var(--rayon) var(--rayon) 0 0; }

/* ===================== Accueil façon « plateforme » (v3) ===================== */
.hero-app { background: linear-gradient(180deg, #e3efe9 0%, #eef5f1 70%, var(--fond) 100%); padding: 36px 0 34px; text-align: center; position: relative; overflow: hidden; }
.hero-app::before { content: ""; position: absolute; inset: 0; opacity: .045; background: url('/img/motif.svg') 0 0 / 72px; pointer-events: none; }
:root[data-theme="nuit"] .hero-app { background: linear-gradient(180deg, #13261f 0%, #111d19 70%, var(--fond) 100%); }
.hero-app .conteneur { position: relative; }
.calligraphie { font-family: var(--f-ar); font-size: clamp(3.4rem, 11vw, 7rem); line-height: 1.5; margin: 0 0 6px; color: #8db7a6; text-shadow: 0 1px 0 rgba(255,255,255,.6); direction: rtl; }
:root[data-theme="nuit"] .calligraphie { color: #4f8f78; text-shadow: none; }
.recherche-app { position: relative; max-width: 760px; margin: 0 auto; }
.recherche-app input { height: 54px; border-radius: 999px; border: 1px solid transparent; background: #fff; padding: 0 22px 0 56px; font-size: 17px; box-shadow: 0 2px 12px rgba(15,60,45,.08); }
:root[data-theme="nuit"] .recherche-app input { background: var(--carte); }
.recherche-app input:focus { border-color: var(--vert); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--vert) 15%, transparent); }
.recherche-app .ico-loupe { position: absolute; left: 20px; top: 16px; color: var(--texte); pointer-events: none; }
.recherche-app .suggestions { top: 60px; }
.actions-app { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.actions-app .btn { border-radius: 10px; padding: 11px 20px; font-size: 16px; box-shadow: none; }
.btn-blanc { background: #fff; color: var(--texte) !important; border-color: #fff; }
:root[data-theme="nuit"] .btn-blanc { background: var(--carte); border-color: var(--bord); }
.btn-blanc:hover, .btn-blanc.actif { background: #fff; border-color: var(--vert); color: var(--vert) !important; }
.panneau-populaire { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 18px auto 0; max-width: 860px; }
.panneau-populaire a { display: flex; align-items: center; gap: 10px; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 8px 14px; color: var(--texte); font-weight: 600; }
.panneau-populaire a:hover { border-color: var(--vert); text-decoration: none; }
.panneau-populaire .ar { font-size: 1.35rem; color: var(--vert); }
.langues-lecture { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 22px; font-size: 15px; color: var(--texte-2); }
.langues-lecture a { color: var(--texte); font-weight: 600; padding: 2px 4px; border-bottom: 2px solid transparent; }
.langues-lecture a.actif { border-color: var(--vert); color: var(--vert); }
.langues-lecture a:hover { text-decoration: none; color: var(--vert); }
.lien-ar { font-family: var(--f-ar) !important; font-size: 1.25em; line-height: 1; }
.langues .lien-ar { font-size: 15px; }
.slogan { font: 500 15px/1.5 var(--f-ui); color: var(--texte-2); margin: 16px auto 0; max-width: 760px; }
.commencer { padding: 26px 0 8px; }
.etroit-l { max-width: 1000px; }
.titre-espace { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.titre-espace h2, .titre-espace-c { font: 600 18px var(--f-ui); letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.titre-espace-c { text-align: center; margin-bottom: 20px; }
.titre-espace a { font-weight: 600; text-decoration: underline; }
.carte-lecture { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 18px 26px 22px; background: #e8f1ec; border: 1px solid #d3e3da; border-radius: 16px; color: var(--texte); overflow: hidden; transition: .15s; }
:root[data-theme="nuit"] .carte-lecture { background: var(--vert-clair); border-color: var(--bord); }
.carte-lecture:hover { text-decoration: none; border-color: var(--vert); box-shadow: var(--ombre); }
.carte-lecture .nom-ar { font-size: clamp(2rem, 5vw, 2.6rem); line-height: 1.4; color: var(--texte); min-width: 110px; text-align: center; }
.lecture-info { display: flex; flex-direction: column; min-width: 0; }
.lecture-info strong { font-size: 1.35rem; font-weight: 600; }
.lecture-info span { color: var(--texte-2); font-size: 1.15rem; }
.lecture-verset { color: var(--vert); font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.lecture-barre { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: transparent; }
.lecture-barre span { display: block; height: 100%; background: var(--vert); }
.objectif { text-align: center; margin: 14px 0 0; }
.objectif a { font-weight: 600; text-decoration: underline; }
.explorer { padding-top: 34px; }
@media (max-width: 600px) {
  .carte-lecture { grid-template-columns: auto 1fr; gap: 6px 14px; padding: 14px 16px 18px; }
  .carte-lecture .nom-ar { grid-row: span 2; min-width: 70px; font-size: 1.8rem; }
  .lecture-verset { grid-column: 2; font-size: 1rem; }
  .lecture-info strong { font-size: 1.1rem; } .lecture-info span { font-size: 1rem; }
  .actions-app .btn { flex: 1 1 auto; justify-content: center; }
}
.panneau-populaire[hidden] { display: none; }
@media (max-width: 600px) { .titre-espace h2, .titre-espace-c { font-size: 15px; letter-spacing: .08em; } .calligraphie { margin-bottom: 0; } }
:root { --f-ui: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Amiri Quran", sans-serif; }
[dir="rtl"] .recherche-app input { padding: 0 56px 0 22px; }
[dir="rtl"] .recherche-app .ico-loupe { left: auto; right: 20px; }
[dir="rtl"] .recherche-app .suggestions { text-align: right; }
