

/* ══ FONTS LOCALES ══ */
@font-face {
    font-family: 'Tajawal';
    src: url('assets/fonts/tajawal/tajawal-300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Tajawal';
    src: url('assets/fonts/tajawal/tajawal-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Tajawal';
    src: url('assets/fonts/tajawal/tajawal-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Tajawal';
    src: url('assets/fonts/tajawal/tajawal-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Tajawal';
    src: url('assets/fonts/tajawal/tajawal-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Amiri';
    src: url('assets/fonts/amiri/amiri-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Amiri';
    src: url('assets/fonts/amiri/amiri-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ══ VARIABLES — couleurs du logo ══ */
:root {
    --bordeaux:       #3d0c11;
    --bordeaux-dark:  #250608;
    --bordeaux-light: #5c1219;
    --gold:           #c9a84c;
    --gold-light:     #e2c97a;
    --gold-pale:      #f0e4c0;
    --cream:          #d4b896;
    --cream-light:    #f5ede0;
    --cream-bg:       #faf6ef;
    --text:           #2d1a1e;
    --text-muted:     #6b4c52;
    --border:         #e8d5c0;
    --shadow-sm:      0 2px 8px rgba(61,12,17,0.08);
    --shadow-md:      0 8px 25px rgba(61,12,17,0.13);
    --shadow-lg:      0 20px 50px rgba(61,12,17,0.18);
}

/* ══ BASE ══ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* RTL uniquement sur le front-end (pas dans wp-admin) */
body:not(.wp-admin) {
    font-family: 'Tajawal', sans-serif;
    direction: rtl; text-align: right;
    background: var(--cream-bg);
    color: var(--text);
    margin: 0; padding: 0;
}

/* ══ TOPBAR ══ */
.mosque-topbar {
    background: var(--bordeaux-dark);
    color: var(--gold);
    padding: 8px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(201,168,76,0.25);
}

/* ══ NAVBAR ══ */
.mosque-navbar {
    background: #fff;
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--gold);
    position: sticky; top: 0; z-index: 999;
}
.mosque-nav-logo img { height: 54px; width: auto; object-fit: contain; }
.mosque-nav-link {
    color: var(--text) !important;
    font-weight: 600; font-size: 0.95rem;
    padding: 8px 14px !important;
    border-radius: 6px;
    text-decoration: none !important;
    transition: color .2s, background .2s;
    display: inline-block;
}
.mosque-nav-link:hover { color: var(--bordeaux) !important; background: var(--cream-light); }
.mosque-nav-cta {
    background: var(--bordeaux) !important;
    color: #fff !important; font-weight: 700 !important;
    padding: 10px 22px !important; border-radius: 8px !important;
    text-decoration: none !important; font-size: 0.9rem;
    transition: background .2s, transform .2s;
    display: inline-flex; align-items: center; gap: 7px;
    border: 2px solid var(--bordeaux);
}
.mosque-nav-cta:hover { background: var(--bordeaux-light) !important; transform: translateY(-1px); }

/* ══ HERO ══ */
.mosque-hero {
    position: relative; min-height: 600px;
    display: flex; align-items: center; overflow: hidden;
    background: linear-gradient(135deg, var(--bordeaux-dark) 0%, var(--bordeaux) 65%, var(--bordeaux-light) 100%);
}
.mosque-hero-pattern {
    position: absolute; inset: 0; opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c9a84c' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}
.mosque-hero-accent {
    position: absolute; right: -80px; top: -80px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(201,168,76,0.35) 0%, transparent 70%);
}
.mosque-hero-accent-2 {
    position: absolute; left: 5%; bottom: -100px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(201,168,76,0.2) 0%, transparent 70%);
}
.mosque-hero-content { position: relative; z-index: 10; }
.mosque-hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(201,168,76,0.18); border: 1px solid rgba(201,168,76,0.4);
    color: var(--gold-light); font-size: 0.82rem; font-weight: 600;
    padding: 6px 18px; border-radius: 30px; margin-bottom: 22px;
}
.mosque-hero-title {
    font-family: 'Amiri', serif;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700; color: #fff;
    line-height: 1.25; margin: 0 0 18px;
}
.mosque-hero-title span { color: var(--gold); }
.mosque-hero-sub {
    font-size: 1.05rem; color: rgba(255,255,255,0.8);
    line-height: 1.8; margin-bottom: 36px; max-width: 500px;
}

/* Buttons */
.mosque-btn-primary {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--gold); color: var(--bordeaux-dark) !important;
    font-weight: 800; font-size: 1rem;
    padding: 14px 30px; border-radius: 8px;
    text-decoration: none !important;
    transition: all .25s; box-shadow: 0 4px 20px rgba(201,168,76,.4);
    border: none; cursor: pointer; font-family: 'Tajawal', sans-serif;
}
.mosque-btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); }
.mosque-btn-outline {
    display: inline-flex; align-items: center; gap: 10px;
    background: transparent; color: #fff !important;
    font-weight: 600; font-size: 1rem;
    padding: 12px 28px; border-radius: 8px;
    text-decoration: none !important;
    border: 2px solid rgba(255,255,255,0.4); transition: all .25s;
}
.mosque-btn-outline:hover { border-color: var(--gold); color: var(--gold) !important; }

/* Hero stat cards */
.mosque-hero-cards { position: relative; z-index: 20; margin-top: -50px; }
.mosque-hero-card {
    background: #fff; border-radius: 12px;
    padding: 24px 20px; box-shadow: var(--shadow-md);
    border-top: 4px solid var(--gold);
    transition: transform .3s, box-shadow .3s; text-align: center;
}
.mosque-hero-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.mosque-hero-card-icon {
    width: 50px; height: 50px;
    background: linear-gradient(135deg, var(--bordeaux), var(--bordeaux-light));
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px; color: var(--gold); font-size: 1.3rem;
}

/* ══ SECTIONS ══ */
.mosque-section { padding: 90px 0; }
.mosque-section-alt { background: var(--cream-light); }
.mosque-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.mosque-section-badge {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--gold); font-size: 0.8rem; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px;
}
.mosque-section-badge::before {
    content: ''; display: inline-block;
    width: 22px; height: 2px; background: var(--gold); border-radius: 2px;
}
.mosque-section-title {
    font-family: 'Amiri', serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700;
    color: var(--bordeaux); margin: 0 0 16px; line-height: 1.3;
}
.mosque-section-desc {
    font-size: 1rem; color: var(--text-muted);
    line-height: 1.8; max-width: 580px;
}

/* ══ ABOUT (présentation) ══ */
.mosque-about-img-wrap { position: relative; }
.mosque-about-img-wrap::before {
    content: ''; position: absolute;
    top: -14px; right: -14px;
    width: 100%; height: 100%;
    border: 3px solid var(--gold); border-radius: 16px; z-index: 0;
}
.mosque-about-img {
    position: relative; z-index: 1;
    border-radius: 16px; width: 100%; object-fit: cover;
    box-shadow: var(--shadow-lg);
}
.mosque-about-badge-float {
    position: absolute; bottom: -18px; left: -18px;
    background: var(--gold); color: var(--bordeaux-dark);
    font-weight: 800; border-radius: 12px;
    padding: 14px 18px; z-index: 5; text-align: center;
    box-shadow: 0 4px 20px rgba(201,168,76,.45);
}
.mosque-check-list { list-style: none; padding: 0; margin: 0; }
.mosque-check-list li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 7px 0; font-size: 0.95rem; color: var(--text);
}
.mosque-check-list li i { color: var(--gold); margin-top: 3px; flex-shrink: 0; }

/* ══ SERVICE CARDS ══ */
.mosque-service-card {
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    transition: transform .3s, box-shadow .3s;
    display: flex; flex-direction: column;
}
.mosque-service-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.mosque-service-card-img-wrap {
    width: 100%; height: 160px;
    background: linear-gradient(135deg, var(--bordeaux-dark), var(--bordeaux-light));
    display: flex; align-items: center; justify-content: center;
    color: var(--gold); font-size: 3.2rem;
}
.mosque-service-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.mosque-service-card-icon {
    width: 46px; height: 46px;
    background: linear-gradient(135deg, var(--bordeaux), var(--bordeaux-light));
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: var(--gold); font-size: 1.15rem; margin-bottom: 14px;
    margin-top: -44px; position: relative; z-index: 2;
    box-shadow: var(--shadow-md);
}
.mosque-service-card-title {
    font-weight: 700; font-size: 1.05rem;
    color: var(--bordeaux); margin-bottom: 8px;
}
.mosque-service-card-desc {
    font-size: 0.87rem; color: var(--text-muted);
    line-height: 1.7; flex: 1;
}
.mosque-service-card-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--bordeaux); font-weight: 700; font-size: 0.87rem;
    text-decoration: none; margin-top: 14px;
    padding-top: 14px; border-top: 1px solid var(--border);
    transition: gap .2s, color .2s;
}
.mosque-service-card-link:hover { gap: 10px; color: var(--gold); }

/* ══ PROCESSUS ══ */
.mosque-step { text-align: center; position: relative; }
.mosque-step-icon {
    width: 80px; height: 80px;
    background: #fff; border: 2px solid var(--border);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 1.8rem; color: var(--bordeaux);
    box-shadow: var(--shadow-sm); transition: all .3s; position: relative; z-index: 2;
}
.mosque-step:hover .mosque-step-icon {
    background: var(--bordeaux); color: var(--gold);
    border-color: var(--bordeaux); transform: scale(1.08);
}
.mosque-step-num {
    position: absolute; top: -8px; right: calc(50% - 48px);
    width: 24px; height: 24px;
    background: var(--gold); color: var(--bordeaux-dark);
    font-size: 0.72rem; font-weight: 800;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    z-index: 3;
}

/* ══ CTA SECTION ══ */
.mosque-cta-section {
    background: linear-gradient(135deg, var(--bordeaux-dark), var(--bordeaux));
    position: relative; overflow: hidden;
}
.mosque-cta-section::before {
    content: ''; position: absolute; inset: 0; opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c9a84c'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ══ FOOTER ══ */
.mosque-footer {
    background: var(--bordeaux-dark);
    color: rgba(255,255,255,0.72);
    border-top: 4px solid var(--gold);
}
.mosque-footer-title { color: var(--gold); font-weight: 700; font-size: 1.05rem; margin-bottom: 18px; }
.mosque-footer-link {
    color: rgba(255,255,255,0.6); text-decoration: none;
    font-size: 0.88rem; display: block; padding: 4px 0;
    transition: color .2s, padding-right .2s;
}
.mosque-footer-link:hover { color: var(--gold); padding-right: 6px; }
.mosque-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 18px; margin-top: 40px;
    font-size: 0.82rem; color: rgba(255,255,255,0.38);
}

/* ══ INSCRIPTION ══ */
.mosque-insc-header {
    background: linear-gradient(135deg, var(--bordeaux-dark), var(--bordeaux));
    padding: 50px 0 30px;
}
.mosque-module-card {
    border: 2px solid var(--border); border-radius: 14px;
    padding: 20px 16px; text-align: center; cursor: pointer;
    transition: all .25s; background: #fff;
}
.mosque-module-card:hover { border-color: var(--bordeaux); background: var(--cream-light); }
.mosque-module-card.selected {
    border-color: var(--bordeaux); background: var(--cream-light);
    box-shadow: 0 0 0 3px rgba(61,12,17,.1);
}
.mosque-input-field {
    width: 100%; border: 2px solid var(--border); border-radius: 10px;
    padding: 12px 16px; font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem; color: var(--text); background: #fff;
    transition: border-color .2s, box-shadow .2s; outline: none;
}
.mosque-input-field:focus {
    border-color: var(--bordeaux);
    box-shadow: 0 0 0 3px rgba(61,12,17,.1);
}

/* ══════════════════════════════════════════════════════════
   ADMIN — CORRECTIONS DIRECTION ET LARGEUR
══════════════════════════════════════════════════════════ */

/*
 * WP admin est natif LTR. On ne touche PAS à #wpcontent.
 * On applique RTL UNIQUEMENT à l'intérieur de nos .wrap[dir=rtl]
 * et on s'assure que tout reste dans les marges du menu WP.
 */

/* Forcer notre contenu admin en RTL proprement */
body.wp-admin .mosque-admin-wrap {
    direction: rtl;
    text-align: right;
    font-family: 'Tajawal', sans-serif;
    max-width: 100%;
    box-sizing: border-box;
}

/* Empêcher débordement horizontal */
body.wp-admin .mosque-admin-wrap .grid,
body.wp-admin .mosque-admin-wrap .flex {
    max-width: 100%;
}

/* Tailwind max-width overrides dans admin */
body.wp-admin .mosque-admin-wrap .max-w-6xl,
body.wp-admin .mosque-admin-wrap .max-w-4xl,
body.wp-admin .mosque-admin-wrap .max-w-2xl,
body.wp-admin .mosque-admin-wrap .max-w-lg,
body.wp-admin .mosque-admin-wrap .max-w-md {
    max-width: 100% !important;
}

/* ── Corriger margin WP en mode sidebar ouverte ── */
@media screen and (min-width: 783px) {
    body.wp-admin #wpcontent,
    body.wp-admin #wpfooter {
        margin-left: 160px;  /* sidebar WP normale */
        margin-right: 0 !important;
    }
    body.wp-admin.folded #wpcontent,
    body.wp-admin.folded #wpfooter {
        margin-left: 36px;
        margin-right: 0 !important;
    }
    /* Notre thème RTL ne doit pas inverser le margin du menu WP */
    body.wp-admin #adminmenuwrap,
    body.wp-admin #adminmenuback,
    body.wp-admin #adminmenu {
        float: left !important;
        right: auto !important;
        left: 0 !important;
    }
}

/* ── CORRECTION CRITIQUE : menu WP doit rester à GAUCHE ── */
/* WP admin n'est PAS RTL — on empêche notre direction RTL de casser le layout */
body.wp-admin {
    direction: ltr !important;
}
body.wp-admin #wpbody,
body.wp-admin #wpcontent,
body.wp-admin #wpbody-content,
body.wp-admin #adminmenuwrap,
body.wp-admin #adminmenu,
body.wp-admin #adminmenuback,
body.wp-admin #wpadminbar {
    direction: ltr !important;
}

/* On remet RTL seulement dans nos zones */
body.wp-admin .mosque-admin-wrap,
body.wp-admin .mosque-modal,
body.wp-admin .mosque-modal-box {
    direction: rtl !important;
    text-align: right;
}

/* ══ COMPOSANTS ADMIN ══ */

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 56px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc; border-radius: 28px; transition: .4s;
}
.toggle-slider:before {
    position: absolute; content: "";
    height: 22px; width: 22px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: .4s;
}
input:checked + .toggle-slider { background: var(--bordeaux); }
input:checked + .toggle-slider:before { transform: translateX(28px); }

/* Number input */
.num-btn {
    width: 32px; height: 32px; border: none; cursor: pointer;
    background: var(--bordeaux); color: var(--gold);
    font-size: 1.15rem; border-radius: 6px; line-height: 1;
    transition: background .2s; font-weight: 700;
}
.num-btn:hover { background: var(--bordeaux-light); }
.config-number-field {
    width: 64px; text-align: center; border: 2px solid var(--border);
    border-radius: 6px; padding: 4px; font-family: 'Tajawal', sans-serif; font-size: 1rem;
}

/* Table */
.mosque-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; direction: rtl; }
.mosque-table th {
    background: var(--bordeaux); color: var(--gold);
    padding: 11px 14px; font-weight: 700; white-space: nowrap;
    font-family: 'Tajawal', sans-serif; text-align: right;
}
.mosque-table td { padding: 10px 14px; border-bottom: 1px solid #f3e8e0; vertical-align: middle; text-align: right; }
.mosque-table tr:hover td { background: #fdf8f3; }
.mosque-table tr:nth-child(even) td { background: #faf4ef; }

/* Progress */
.progress-bar-fill {
    height: 100%; border-radius: 9999px;
    background: linear-gradient(90deg, var(--bordeaux), var(--gold));
    transition: width .6s ease;
}

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 9999px;
    font-size: 0.75rem; font-weight: 700;
}
.badge-open    { background: #f5ede0; color: var(--bordeaux); border: 1px solid var(--gold); }
.badge-closed  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-male    { background: #dbeafe; color: #1e40af; }
.badge-female  { background: #fce7f3; color: #9d174d; }
.badge-public  { background: #f5ede0; color: var(--bordeaux); }
.badge-admin   { background: #fef3c7; color: #92400e; }

/* Modal */
.mosque-modal {
    display: none; position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
.mosque-modal.active { display: flex; }
.mosque-modal-box {
    background: #fff; border-radius: 18px; padding: 32px;
    max-width: 560px; width: 90%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 30px 70px rgba(61,12,17,.3);
    animation: modalIn .28s ease;
}
@keyframes modalIn {
    from { opacity:0; transform: scale(.94) translateY(16px); }
    to   { opacity:1; transform: scale(1) translateY(0); }
}

/* Focus inputs admin */
.mosque-input:focus, .mosque-select:focus {
    outline: none !important;
    border-color: var(--bordeaux) !important;
    box-shadow: 0 0 0 3px rgba(61,12,17,.1);
}

/* KPI */
.kpi-card { transition: transform .2s, box-shadow .2s; }
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* Notices */
.mosque-notice {
    padding: 12px 16px; border-radius: 10px; font-weight: 500;
    display: flex; align-items: center; gap: 10px; font-size: 0.92rem;
}
.mosque-notice-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.mosque-notice-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.mosque-notice-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #f5ede0; }
::-webkit-scrollbar-thumb { background: var(--bordeaux); border-radius: 3px; }

@media print { .no-print { display: none !important; } }

@media (max-width: 768px) {
    .mosque-hero { min-height: 440px; }
    .mosque-section { padding: 60px 0; }
    .mosque-hero-cards { margin-top: -20px; }
    .mosque-table { font-size: 0.78rem; }
    .mosque-table td, .mosque-table th { padding: 7px 8px; }
}