/* ==========================================================================
   NAFSUK — feuille de style commune (charte « Émeraude & or »)
   Site public, appli (app.nafsuk.fr) et admin partagent ces jetons.
   Toute nouvelle couleur passe par une variable ci-dessous.
   ========================================================================== */
@import url("fonts.css");

:root {
  --vert-nuit: #0A3D2E;
  --emeraude: #0F7A55;
  --emeraude-fonce: #0B6646;
  --menthe: #DDEFE6;
  --menthe-clair: #F0F7F3;
  --or: #C9A24B;
  --or-clair: #E3C77A;
  --or-texte: #8A6420;

  --fond: #F5F8F6;
  --surface: #FFFFFF;
  --encre: #0F1C17;
  --texte: #2D3B35;
  --texte-doux: #4C5C55;
  --bord: #DCE8E1;
  --bord-fort: #C4D7CC;
  --champ: #F9FBFA;

  --info-fond: #FFF7E6;
  --info-bord: #EBD39A;
  --info-texte: #5C4415;
  --erreur: #B42318;
  --erreur-fond: #FDECEA;

  --entete-fond: var(--vert-nuit);
  --entete-texte: #FFFFFF;
  --entete-doux: #CFE3D9;
  --accent-sur-sombre: #3FC48F;

  --rayon: 20px;
  --rayon-petit: 12px;
  --ombre: 0 10px 30px rgba(10, 61, 46, .12);
  --police: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-arabe: "Amiri", "Traditional Arabic", "Scheherazade New", serif;
  --largeur: 1200px;
  color-scheme: light;
}

/* Mode sombre : réglage du système, sauf si la personne a choisi le clair. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #07201A; --surface: #0E2E25; --encre: #E7F2EC; --texte: #CFE3D9; --texte-doux: #A9C9BA;
    --bord: #1C4537; --bord-fort: #2A5A48; --champ: #0B271F;
    --menthe: #16503D; --menthe-clair: #123F31; --emeraude: #3FC48F; --emeraude-fonce: #2FA877; --vert-nuit: #E7F2EC;
    --or-texte: #E3C77A; --info-fond: #2B2312; --info-bord: #5C4A20; --info-texte: #F1DFAE;
    --erreur: #FF8A80; --erreur-fond: #3A1512;
    --entete-fond: #0B2B22; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #07201A; --surface: #0E2E25; --encre: #E7F2EC; --texte: #CFE3D9; --texte-doux: #A9C9BA;
  --bord: #1C4537; --bord-fort: #2A5A48; --champ: #0B271F;
  --menthe: #16503D; --menthe-clair: #123F31; --emeraude: #3FC48F; --emeraude-fonce: #2FA877; --vert-nuit: #E7F2EC;
  --or-texte: #E3C77A; --info-fond: #2B2312; --info-bord: #5C4A20; --info-texte: #F1DFAE;
  --erreur: #FF8A80; --erreur-fond: #3A1512;
  --entete-fond: #0B2B22; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--police); font-size: 16px; line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: var(--emeraude); }
a:hover { color: var(--emeraude-fonce); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.015em; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.ar { font-family: var(--police-arabe); direction: rtl; line-height: 1.9; }
.saw { font-family: var(--police-arabe); font-size: 1.15em; line-height: 1; }
.ic { width: 24px; height: 24px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.conteneur { max-width: var(--largeur); margin: 0 auto; padding: 0 20px; }
.surtitre { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--emeraude); }
.doux { color: var(--texte-doux); }

/* Logo clair / sombre */
.logo-sombre { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-clair { display: none; } :root:not([data-theme="light"]) .logo-sombre { display: inline; } }
:root[data-theme="dark"] .logo-clair { display: none; }
:root[data-theme="dark"] .logo-sombre { display: inline; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent; font: 700 16px var(--police); text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.btn-principal { background: var(--emeraude); color: #fff; }
.btn-principal:hover { background: var(--emeraude-fonce); color: #fff; }
:root[data-theme="dark"] .btn-principal, :root[data-theme="dark"] .btn-principal:hover { color: #07201A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-principal, :root:not([data-theme="light"]) .btn-principal:hover { color: #07201A; } }
.btn-contour { background: transparent; color: var(--emeraude); border-color: var(--emeraude); }
.btn-doux { background: var(--menthe); color: var(--vert-nuit); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-bloc { width: 100%; }

/* Champs */
.champ { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--encre); }
.champ input, .champ select, .champ textarea { min-height: 48px; border: 1.5px solid var(--bord-fort); border-radius: var(--rayon-petit); padding: 10px 14px; font: 500 16px var(--police); color: var(--encre); background: var(--champ); width: 100%; }
.champ textarea { resize: vertical; min-height: 120px; }
.champ input:focus, .champ select:focus, .champ textarea:focus { border-color: var(--emeraude); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--emeraude) 25%, transparent); }
.champ small { font-weight: 500; color: var(--texte-doux); }

/* Cartes & encadrés */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 22px; }
.carte-sombre { background: #0A3D2E; color: #fff; border-radius: var(--rayon); padding: 24px; }
:root[data-theme="dark"] .carte-sombre { background: #0B2B22; border: 1px solid var(--bord); }
.avertissement { background: var(--info-fond); border: 1px solid var(--info-bord); color: var(--info-texte); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.55; }
.message-ok { background: var(--menthe); color: var(--vert-nuit); border-radius: 14px; padding: 14px 16px; font-weight: 600; }
.message-erreur { background: var(--erreur-fond); color: var(--erreur); border-radius: 14px; padding: 14px 16px; font-weight: 600; }
.pastille { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; background: var(--menthe); color: var(--vert-nuit); }

/* ===== En-tête du site ===== */
.entete { background: var(--surface); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 50; }
.entete-int { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.entete .logo { display: flex; align-items: center; }
.entete .logo img { height: 34px; width: auto; }
.nav-principale { display: flex; align-items: center; gap: 2px; }
.nav-principale a { color: var(--encre); text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: 10px; }
.nav-principale a:hover, .nav-principale a[aria-current="page"] { background: var(--menthe-clair); color: var(--emeraude); }
.entete-actions { display: flex; align-items: center; gap: 8px; }
.entete-actions .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn-icone { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--bord); background: var(--surface); color: var(--encre); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-menu { display: none; }
@media (max-width: 1020px) {
  .nav-principale { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--bord); flex-direction: column; align-items: stretch; padding: 10px 16px 18px; box-shadow: var(--ombre); max-height: calc(100dvh - 68px); overflow-y: auto; }
  .nav-principale.ouvert { display: flex; }
  .nav-principale a { padding: 14px 12px; font-size: 16px; }
  .btn-menu { display: inline-flex; }
  .entete-actions .btn-contour { display: none; }
}
@media (max-width: 420px) { .entete-actions .btn-principal { display: none; } }

/* ===== Sections ===== */
.section { padding: 56px 0; }
.titre-section { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
.grille-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }

/* Héros */
.heros { background: #0A3D2E; color: #fff; position: relative; overflow: hidden; }
:root[data-theme="dark"] .heros { background: #0B2B22; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .heros { background: #0B2B22; } }
.heros-motif { position: absolute; right: -120px; top: -90px; width: 520px; height: 520px; opacity: .1; pointer-events: none; }
.heros-int { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding: 64px 20px 72px; position: relative; }
.heros-texte { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.heros h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.08; }
.heros .lead { font-size: 18px; color: #CFE3D9; max-width: 560px; }
.heros .surtitre { color: var(--or-clair); }
.heros .btn-principal { background: #3FC48F; color: #07201A; }
.heros .btn-principal:hover { background: #5ad6a3; color: #07201A; }
.heros .btn-contour { color: #fff; border-color: #7FB79E; }
.carte-priere { flex: 1 1 320px; max-width: 420px; background: var(--surface); border: 1px solid var(--bord); color: var(--encre); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.prochaine { background: var(--menthe); border-radius: 16px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--vert-nuit); }
.prochaine strong { font-size: 22px; }
.liste-horaires { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; font-size: 15px; margin: 0; }
.liste-horaires div { display: flex; justify-content: space-between; }
.liste-horaires dt { margin: 0; } .liste-horaires dd { margin: 0; font-weight: 700; }
.liste-horaires .actuelle { color: var(--emeraude); }

/* Cartes de fonctionnalités */
.carte-lien { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; }
.carte-lien:hover { border-color: var(--emeraude); color: inherit; transform: translateY(-2px); }
.carte-lien strong { font-size: 18px; }
.carte-lien span { color: var(--texte-doux); font-size: 15px; line-height: 1.5; }
.pastille-icone { width: 48px; height: 48px; border-radius: 14px; background: var(--menthe); color: var(--vert-nuit); display: inline-flex; align-items: center; justify-content: center; }

/* Pied de page */
.pied { background: #07201A; color: #CFE3D9; margin-top: 40px; }
.pied-int { display: flex; flex-wrap: wrap; gap: 32px 48px; padding: 48px 20px 28px; }
.pied-marque { flex: 1 1 260px; display: flex; flex-direction: column; gap: 14px; }
.pied-marque img { width: 190px; }
.pied nav { flex: 1 1 150px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.pied nav strong { color: #fff; margin-bottom: 6px; }
.pied nav a { color: #CFE3D9; text-decoration: none; padding: 4px 0; }
.pied nav a:hover { color: #fff; text-decoration: underline; }
.pied-bas { border-top: 1px solid #16402F; padding: 18px 20px 28px; font-size: 13px; color: #8FB3A2; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.pied-bas button { background: none; border: 0; color: #CFE3D9; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }


/* ===== Bandeau de page (en-tête vert des pages intérieures) ===== */
.bandeau { background: #0A3D2E; color: #fff; }
:root[data-theme="dark"] .bandeau { background: #0B2B22; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bandeau { background: #0B2B22; } }
.bandeau-int { padding: 40px 20px 44px; display: flex; flex-direction: column; gap: 10px; }
.bandeau h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.bandeau p { color: #CFE3D9; font-size: 17px; max-width: 680px; }
.bandeau .surtitre { color: var(--or-clair); }
.bandeau .dates { color: var(--or-clair); font-weight: 600; font-size: 15px; }

/* ===== Choix de la ville ===== */
.barre-lieu { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.recherche-ville { position: relative; flex: 1 1 260px; min-width: 0; }
.liste-villes { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; box-shadow: var(--ombre); max-height: 320px; overflow-y: auto; }
.liste-villes li { padding: 12px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.liste-villes li span { color: var(--texte-doux); font-size: 13px; }
.liste-villes li:hover, .liste-villes li.actif { background: var(--menthe-clair); }
.liste-villes li.vide { cursor: default; color: var(--texte-doux); }

/* ===== Horaires ===== */
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.prieres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.prieres li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--bord); font-size: 17px; }
.prieres li:last-child { border-bottom: 0; }
.prieres li .nom { display: flex; align-items: center; gap: 10px; }
.prieres li .nom small { color: var(--texte-doux); font-size: 13px; }
.prieres li strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.prieres li.passee { color: var(--texte-doux); }
.prieres li.prochaine-p { background: var(--menthe); border-radius: 14px; padding: 14px 14px; border-bottom-color: transparent; color: var(--vert-nuit); }
.prieres li.secondaire { font-size: 15px; color: var(--texte-doux); }
.compte-rebours { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; color: var(--vert-nuit); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.table-boite { overflow-x: auto; border: 1px solid var(--bord); border-radius: 16px; background: var(--surface); }
.table-mois { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.table-mois th, .table-mois td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--bord); }
.table-mois th { position: sticky; top: 0; background: var(--menthe-clair); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-doux); }
.table-mois td:first-child, .table-mois th:first-child { text-align: left; white-space: nowrap; }
.table-mois td:first-child .hj { display: block; font-size: 12px; color: var(--texte-doux); font-weight: 500; }
@media (max-width: 600px) {
  .table-mois { min-width: 0; font-size: 14px; }
  .table-mois th, .table-mois td { padding: 9px 4px; }
  .table-mois th { font-size: 11px; letter-spacing: 0; }
  .table-mois td:first-child, .table-mois th:first-child { padding-left: 10px; }
  .table-mois td:first-child .hj { font-size: 11px; white-space: normal; max-width: 84px; line-height: 1.25; }
  .table-mois .col-ch { display: none; }
}
.table-mois tr.aujourdhui td { background: var(--menthe); font-weight: 700; color: var(--vert-nuit); }
.table-mois tr.vendredi td:first-child { color: var(--emeraude); font-weight: 700; }
.rangee-boutons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.reglages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
details.pliable > summary { cursor: pointer; list-style: none; font-weight: 700; font-size: 17px; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
details.pliable > summary::-webkit-details-marker { display: none; }
details.pliable > summary::after { content: "+"; font-size: 24px; color: var(--emeraude); }
details.pliable[open] > summary::after { content: "−"; }
.faq details { border-bottom: 1px solid var(--bord); padding: 6px 0; }
.faq details p { padding: 0 0 12px; color: var(--texte); }
.texte-long { display: flex; flex-direction: column; gap: 14px; font-size: 17px; max-width: 780px; }
.texte-long h2 { font-size: 24px; margin-top: 10px; }

/* ===== Qibla ===== */
.boussole { position: relative; width: min(320px, 80vw); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: var(--surface); border: 2px solid var(--bord-fort); box-shadow: var(--ombre); }
.boussole .cadran { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; transition: transform .25s ease-out; }
.boussole .point { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 15px; color: var(--texte-doux); }
.boussole .aiguille { position: absolute; left: 50%; top: 50%; width: 6px; height: 44%; margin-left: -3px; transform-origin: 50% 0; background: linear-gradient(var(--emeraude), var(--emeraude)); border-radius: 6px; }
.boussole .kaaba { position: absolute; left: 50%; top: 4%; width: 34px; height: 34px; margin-left: -17px; background: #0F1C17; border-radius: 6px; border-top: 6px solid var(--or); }
.boussole .centre { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--vert-nuit); border: 3px solid var(--surface); }
.boussole .repere-haut { position: absolute; left: 50%; top: -14px; margin-left: -9px; width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 14px solid var(--or); }

@media print { .entete, .pied, .btn, .no-print, .bandeau { display: none !important; } body { background: #fff; color: #000; } .table-boite { border: 0; overflow: visible; } .table-mois { min-width: 0; font-size: 11pt; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
