/* =====================================================
   Farj Law — Public Website
   Luxury dark / gold legal design (2026)
   ===================================================== */

:root {
    --gold: #c9a24b;
    --gold-light: #e6c97a;
    --gold-dark: #a37f2c;
    --gold-text: #c9a24b;   /* ذهبي بدرجة مناسبة للنصوص (يتبدل في الوضع الفاتح) */
    --ink: #0d1117;
    --ink-2: #131a24;
    --ink-3: #1b2532;
    --ivory: #f6f2e9;
    --muted: #9aa5b1;
    --line: rgba(201, 162, 75, .22);
    --radius: 14px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .35);
    /* متغيرات دلالية للثيم */
    --header-bg: rgba(13, 17, 23, .82);
    --header-bg-solid: rgba(13, 17, 23, .96);
    --text-2: #cdd6e0;
    --text-3: #d5dce4;
    --card-border: rgba(255, 255, 255, .05);
    --card-border-2: rgba(255, 255, 255, .07);
    --input-bg: #0d1117;
    --input-border: rgba(255, 255, 255, .1);
    --footer-bg: #0a0e13;
    --footer-line: rgba(255, 255, 255, .06);
    --hero-bg: radial-gradient(1100px 500px at 85% -10%, rgba(201,162,75,.13), transparent 60%),
               radial-gradient(800px 420px at 8% 110%, rgba(43,66,100,.35), transparent 60%),
               linear-gradient(180deg, #101722 0%, #0d1117 100%);
    --page-hero-bg: radial-gradient(900px 380px at 50% -20%, rgba(201,162,75,.12), transparent 65%),
                    linear-gradient(180deg, #101722, #0d1117);
    --gold-soft-bg: rgba(201, 162, 75, .045);
    --gold-icon-bg: rgba(201, 162, 75, .1);
}

/* ---------- Light Mode ---------- */
[data-theme="light"] {
    --ink: #f6f3ec;
    --ink-2: #ffffff;
    --ink-3: #efe9db;
    --ivory: #1c2433;
    --muted: #5b6675;
    --line: rgba(163, 127, 44, .35);
    --shadow: 0 18px 45px rgba(28, 36, 51, .12);
    --header-bg: rgba(255, 255, 255, .85);
    --header-bg-solid: rgba(255, 255, 255, .97);
    --text-2: #3d4856;
    --text-3: #333d4b;
    --card-border: rgba(28, 36, 51, .08);
    --card-border-2: rgba(28, 36, 51, .1);
    --input-bg: #ffffff;
    --input-border: rgba(28, 36, 51, .16);
    --footer-bg: #efe9db;
    --footer-line: rgba(28, 36, 51, .1);
    --hero-bg: radial-gradient(1100px 500px at 85% -10%, rgba(201,162,75,.16), transparent 60%),
               radial-gradient(800px 420px at 8% 110%, rgba(201,162,75,.08), transparent 60%),
               linear-gradient(180deg, #efe8d6 0%, #f6f3ec 100%);
    --page-hero-bg: radial-gradient(900px 380px at 50% -20%, rgba(201,162,75,.14), transparent 65%),
                    linear-gradient(180deg, #efe8d6, #f6f3ec);
    --gold-soft-bg: rgba(201, 162, 75, .08);
    --gold-icon-bg: rgba(201, 162, 75, .14);
    --gold-text: #8a6d1f;   /* ذهبي داكن مقروء على الخلفيات الفاتحة (تباين ≥ 4.5) */
}
/* تجاوزات نصوص Light Mode — كل نص ذهبي على خلفية فاتحة يستخدم الدرجة الداكنة */
[data-theme="light"] a { color: var(--gold-text); }
[data-theme="light"] a:hover { color: #6f5716; }
[data-theme="light"] .hero-badge { color: var(--gold-text); background: rgba(201,162,75,.12); border-color: rgba(163,127,44,.45); }
[data-theme="light"] .site-nav a:hover { color: var(--gold-text); background: rgba(201,162,75,.1); }
[data-theme="light"] .site-nav a.active { color: var(--gold-text); }
[data-theme="light"] .nav-portal { color: var(--gold-text) !important; }
[data-theme="light"] .lang-btn,
[data-theme="light"] .theme-toggle-btn,
[data-theme="light"] .nav-toggle { color: var(--gold-text); }
[data-theme="light"] .lang-btn:hover { color: #6f5716; }
[data-theme="light"] .site-brand-mark { color: var(--gold-text); }
[data-theme="light"] .hero h1 em { color: var(--gold-text); }
[data-theme="light"] .btn-ghost:hover { color: var(--gold-text); }
[data-theme="light"] .section-kicker { color: var(--gold-text); }
[data-theme="light"] .svc-icon { color: var(--gold-text); }
[data-theme="light"] .stat-item i { color: var(--gold-text); }
[data-theme="light"] .stat-item .stat-v { color: var(--gold-text); }
[data-theme="light"] .team-body .team-role { color: var(--gold-text); }
[data-theme="light"] .article-date { color: var(--gold-text); }
[data-theme="light"] .faq-item summary::after { color: var(--gold-text); }
[data-theme="light"] .contact-line i { color: var(--gold-text); }
[data-theme="light"] .footer-brand { color: var(--gold-text); }
[data-theme="light"] .footer-contact i { color: var(--gold-text); }
[data-theme="light"] .footer-contact a:hover { color: var(--gold-text); }
[data-theme="light"] .footer-social a { color: var(--gold-text); }
[data-theme="light"] .team-photo { color: var(--gold); } /* خلفيته داكنة في الوضعين — يبقى الذهبي الفاتح */
[data-theme="light"] .svc-card,
[data-theme="light"] .team-card,
[data-theme="light"] .article-card { background: var(--ink-2); }

* { box-sizing: border-box; }

/* منع أي فيض أفقي غير مقصود — يحمي تثبيت الأزرار العائمة والتجاوب */
html, body { overflow-x: clip; }

.site-body {
    margin: 0;
    font-family: 'Tajawal', system-ui, sans-serif;
    background: var(--ink);
    color: var(--ivory);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

.container { width: min(1180px, 92%); margin-inline: auto; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

img { max-width: 100%; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, background .3s;
}
.site-header.scrolled {
    border-bottom-color: var(--line);
    background: var(--header-bg-solid);
}
.site-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-block: 14px;
}
.site-brand { display: flex; align-items: center; gap: 12px; color: var(--ivory); }
.site-brand:hover { color: var(--ivory); }
.site-brand-mark {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border: 1.5px solid var(--gold);
    border-radius: 10px;
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem; font-weight: 700;
    background: linear-gradient(145deg, rgba(201,162,75,.14), transparent);
}
.site-logo { height: 46px; width: auto; }
.site-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.site-brand-text strong { font-size: 1.15rem; letter-spacing: .3px; }
.site-brand-text small { color: var(--muted); font-size: .75rem; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.site-nav a {
    color: var(--text-2);
    padding: 8px 13px;
    border-radius: 8px;
    font-size: .95rem;
    transition: color .25s, background .25s;
}
.site-nav a:hover { color: var(--gold-light); background: rgba(201,162,75,.08); }
.site-nav a.active { color: var(--gold); }
.site-nav a.active::after {
    content: ''; display: block; height: 2px; margin-top: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.nav-portal {
    border: 1px solid var(--line);
    margin-inline-start: 8px;
    color: var(--gold) !important;
}
.site-header-actions { display: flex; align-items: center; gap: 10px; }
.lang-btn {
    color: var(--gold);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .85rem;
    transition: background .25s;
}
.lang-btn:hover { background: rgba(201,162,75,.12); color: var(--gold-light); }
.theme-toggle-btn {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    background: none;
    color: var(--gold);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    transition: background .25s, transform .2s;
}
.theme-toggle-btn:hover { background: rgba(201,162,75,.12); transform: rotate(12deg); }
.nav-toggle {
    display: none;
    background: none; border: 1px solid var(--line);
    color: var(--gold); border-radius: 8px;
    font-size: 1.3rem; padding: 4px 12px;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: clamp(70px, 12vw, 130px) 0 clamp(60px, 9vw, 110px);
    background: var(--hero-bg);
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(201,162,75,.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(201,162,75,.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
    pointer-events: none;
}
.hero-inner { position: relative; text-align: center; max-width: 860px; margin-inline: auto; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--line);
    color: var(--gold-light);
    padding: 7px 18px; border-radius: 999px;
    font-size: .85rem; letter-spacing: .4px;
    background: rgba(201,162,75,.07);
    margin-bottom: 26px;
}
.hero h1 {
    font-family: 'Amiri', 'Playfair Display', serif;
    font-size: clamp(2.1rem, 5.4vw, 3.6rem);
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 18px;
}
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p {
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 640px; margin: 0 auto 34px;
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn-gold, .btn-ghost {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 14px 32px; border-radius: 10px;
    font-weight: 700; font-size: 1rem;
    transition: transform .25s, box-shadow .25s, background .25s;
}
.btn-gold {
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
    color: #171307;
    box-shadow: 0 10px 30px rgba(201,162,75,.28);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(201,162,75,.4); color: #171307; }
.btn-ghost { border: 1px solid var(--line); color: var(--ivory); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-light); background: rgba(201,162,75,.06); }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section.alt { background: var(--ink-2); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section-kicker {
    color: var(--gold); font-size: .85rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
}
.section-head h2 {
    font-family: 'Amiri', 'Playfair Display', serif;
    font-size: clamp(1.7rem, 3.6vw, 2.5rem);
    margin: 10px 0 12px;
}
.section-head h2::after {
    content: ''; display: block; width: 64px; height: 2px; margin: 16px auto 0;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.section-head p { color: var(--muted); margin: 0; }

/* ---------- Cards grid ---------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}
.svc-card {
    background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 30px 26px;
    transition: transform .3s, border-color .3s, box-shadow .3s;
    position: relative;
    overflow: hidden;
}
.svc-card::before {
    content: '';
    position: absolute; inset-inline-start: 0; top: 0;
    width: 3px; height: 100%;
    background: linear-gradient(180deg, var(--gold), transparent);
    opacity: 0; transition: opacity .3s;
}
.svc-card:hover { transform: translateY(-6px); border-color: var(--line); box-shadow: var(--shadow); }
.svc-card:hover::before { opacity: 1; }
.svc-icon {
    width: 56px; height: 56px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--gold-icon-bg);
    border: 1px solid var(--line);
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 18px;
}
.svc-card h3 { font-size: 1.15rem; margin: 0 0 10px; }
.svc-card p { color: var(--muted); font-size: .94rem; margin: 0; }

/* ---------- Stats band ---------- */
.stats-band {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}
.stat-item {
    text-align: center;
    padding: 34px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--gold-soft-bg);
}
.stat-item i { color: var(--gold); font-size: 1.7rem; }
.stat-item .stat-v {
    font-family: 'Playfair Display', serif;
    font-size: 2.3rem; font-weight: 700; color: var(--gold-light);
    margin: 8px 0 2px;
}
.stat-item .stat-l { color: var(--muted); font-size: .9rem; }

/* ---------- Team ---------- */
.team-card {
    background: var(--ink-2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
    transition: transform .3s, border-color .3s;
}
.team-card:hover { transform: translateY(-6px); border-color: var(--line); }
.team-photo {
    aspect-ratio: 1 / 1;
    background: linear-gradient(160deg, var(--ink-3), var(--ink));
    display: grid; place-items: center;
    color: var(--gold); font-size: 4rem;
    font-family: 'Playfair Display', serif;
}
.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-body { padding: 20px; }
.team-body h3 { margin: 0 0 4px; font-size: 1.1rem; }
.team-body .team-role { color: var(--gold); font-size: .88rem; margin-bottom: 8px; }
.team-body p { color: var(--muted); font-size: .88rem; margin: 0; }

/* ---------- Articles ---------- */
.article-card {
    background: var(--ink-2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform .3s, border-color .3s;
    height: 100%;
}
.article-card:hover { transform: translateY(-6px); border-color: var(--line); }
.article-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.article-date { color: var(--gold); font-size: .8rem; letter-spacing: .5px; }
.article-body h3 { font-size: 1.08rem; margin: 8px 0 10px; }
.article-body h3 a { color: var(--ivory); }
.article-body h3 a:hover { color: var(--gold-light); }
.article-body p { color: var(--muted); font-size: .9rem; flex: 1; }
.article-link { font-weight: 700; font-size: .9rem; margin-top: 12px; }

.article-full { max-width: 820px; margin-inline: auto; }
.article-full h1 { font-family: 'Amiri', 'Playfair Display', serif; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.article-full .article-content { color: var(--text-3); line-height: 2; }
.article-full .article-content p { margin-bottom: 1.2em; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 820px; margin-inline: auto; }
.faq-item {
    border: 1px solid var(--card-border-2);
    border-radius: 12px;
    margin-bottom: 14px;
    background: var(--ink-2);
    overflow: hidden;
}
.faq-item summary {
    cursor: pointer;
    padding: 18px 22px;
    font-weight: 700;
    list-style: none;
    display: flex; justify-content: space-between; align-items: center;
    transition: color .25s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '\F282'; font-family: 'bootstrap-icons'; color: var(--gold); transition: transform .3s; }
.faq-item[open] summary { color: var(--gold-light); }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item .faq-answer { padding: 0 22px 18px; color: var(--muted); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 34px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
    background: var(--ink-2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 30px;
}
.contact-line { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.contact-line i { color: var(--gold); font-size: 1.25rem; margin-top: 3px; }
.contact-line .l { color: var(--muted); font-size: .82rem; }
.contact-line .v { font-weight: 700; }

.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 7px; }
.form-field input, .form-field textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--ivory);
    padding: 13px 16px;
    font-family: inherit;
    transition: border-color .25s, box-shadow .25s;
}
.form-field input:focus, .form-field textarea:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,162,75,.15);
}
.form-field textarea { min-height: 140px; resize: vertical; }

.form-alert { border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; font-weight: 500; }
.form-alert.ok { background: rgba(47,133,90,.15); border: 1px solid rgba(47,133,90,.4); color: #9ae6b4; }
.form-alert.err { background: rgba(197,48,48,.13); border: 1px solid rgba(197,48,48,.4); color: #feb2b2; }

.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-top: 22px; }
.map-frame iframe { width: 100%; height: 260px; border: 0; display: block; }

/* ---------- Page hero (الصفحات الداخلية) ---------- */
.page-hero {
    padding: clamp(48px, 8vw, 84px) 0;
    text-align: center;
    background: var(--page-hero-bg);
    border-bottom: 1px solid var(--line);
}
.page-hero h1 { font-family: 'Amiri', 'Playfair Display', serif; font-size: clamp(1.9rem, 4.4vw, 2.8rem); margin: 0 0 10px; }
.page-hero p { color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--line);
    padding: 60px 0 0;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 40px;
    padding-bottom: 40px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-brand { font-family: 'Amiri', 'Playfair Display', serif; font-size: 1.4rem; color: var(--gold); margin-bottom: 12px; }
.footer-about { color: var(--muted); font-size: .9rem; }
.site-footer h4 { color: var(--ivory); font-size: 1rem; margin-bottom: 16px; }
.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 9px; }
.footer-links a { color: var(--muted); transition: color .25s; }
.footer-links a:hover { color: var(--gold-light); }
.footer-contact li { color: var(--muted); margin-bottom: 12px; display: flex; gap: 10px; }
.footer-contact i { color: var(--gold); }
.footer-contact a { color: var(--muted); }
.footer-contact a:hover { color: var(--gold-light); }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 10px;
    color: var(--gold);
    transition: background .25s, transform .25s;
}
.footer-social a:hover { background: rgba(201,162,75,.12); transform: translateY(-2px); }
.footer-bottom {
    border-top: 1px solid var(--footer-line);
    padding: 18px 0;
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
}

/* ---------- WhatsApp float — دائماً أسفل اليمين (المساعدة دائماً أسفل اليسار) ---------- */
.wa-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    display: grid; place-items: center;
    font-size: 1.7rem;
    box-shadow: 0 12px 32px rgba(34,197,94,.4);
    z-index: 90;
    transition: transform .25s;
}
.wa-float:hover { transform: scale(1.08); color: #fff; }
@media (max-width: 480px) {
    .wa-float { bottom: 16px; right: 16px; width: 54px; height: 54px; font-size: 1.5rem; }
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1 !important; transform: none !important; }

/* ---------- Responsive nav ---------- */
@media (max-width: 960px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: fixed;
        inset: 74px 12px auto 12px;
        flex-direction: column;
        align-items: stretch;
        background: var(--ink-2);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 14px;
        box-shadow: var(--shadow);
        display: none;
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 12px 16px; }
}
