/* index.css - Inspired by Ensaf Lawyer Theme */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #1C3F3F; /* Dark Teal */
    --primary-light: #2A5A5A;
    --accent: #C5A059;  /* Gold/Brass */
    --accent-hover: #A68545;
    --bg-light: #F9F9F9;
    --bg-white: #FFFFFF;
    --text-main: #1A1A1A;
    --text-muted: #666666;
    --text-light: #F8F8F8;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .serif {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    background: transparent;
}

header.sticky {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 15px 5%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header.sticky .logo, header.sticky nav a {
    color: var(--primary);
}

.logo {
    font-size: 1.8rem;
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.02);
}

.logo i {
    background: linear-gradient(135deg, #C5A059, #ff477e, #7209b7, #4cc9f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
}

nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #C5A059, #ff477e, #7209b7, #4cc9f0);
    transition: var(--transition);
    transform: translateX(-50%);
    border-radius: 4px;
}

nav a:hover, nav a.active {
    background: linear-gradient(135deg, #C5A059, #ff477e, #7209b7, #4cc9f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-contact {
    background: var(--accent);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--accent);
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.2);
}

.btn-contact:hover {
    background: transparent;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.35);
}

/* --- Language Switcher --- */
.lang-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

header.sticky .lang-switcher {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition);
}

header.sticky .lang-btn {
    color: var(--text-muted);
}

header.sticky .lang-btn.active {
    color: var(--text-light);
    background: var(--primary);
}

.lang-btn.active {
    background: var(--accent);
    color: white;
}

.lang-btn:hover:not(.active) {
    opacity: 0.8;
}

/* --- Hamburger Menu Toggle --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: var(--transition);
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #C5A059, #ff477e, #7209b7, #4cc9f0);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: right center;
}

header.sticky .menu-toggle span {
    background: linear-gradient(90deg, #C5A059, #ff477e, #7209b7, #4cc9f0);
}

.menu-toggle.open span:nth-child(1) {
    transform: rotate(-45deg);
    background-color: var(--accent);
}

.menu-toggle.open span:nth-child(2) {
    width: 0%;
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: rotate(45deg);
    background-color: var(--accent);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    background: linear-gradient(rgba(28, 63, 63, 0.85), rgba(28, 63, 63, 0.7)), 
                url('https://images.unsplash.com/photo-1505664194779-8beaceb93744?q=80&w=2000') center/cover;
    background-attachment: scroll;
    display: flex;
    align-items: center;
    padding: 160px 8% 110px;
    color: var(--text-light);
}

.hero-content {
    max-width: 800px;
}

.hero-subtitle {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin-bottom: 20px;
    display: block;
}

.hero h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 40px;
    max-width: 600px;
}

/* --- Stats Bar --- */
.stats-bar {
    display: flex;
    background: var(--bg-white);
    padding: 40px;
    margin-top: -80px;
    position: relative;
    z-index: 10;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    justify-content: space-around;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Section Styling --- */
section {
    padding: 100px 8%;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-subtitle {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    display: block;
}

.section-header h2 {
    font-size: 2.8rem;
    color: var(--primary);
}

/* --- Practice Areas --- */
.practice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.practice-card {
    background: var(--bg-light);
    padding: 50px 40px;
    border-radius: 15px;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
    text-align: center;
}

.practice-card:hover {
    background: var(--primary);
    transform: translateY(-10px);
}

.practice-card i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 25px;
    display: block;
}

.practice-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.practice-card p {
    color: var(--text-muted);
}

.practice-card:hover h3, .practice-card:hover p {
    color: var(--text-light);
}

/* --- About Section --- */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-img {
    position: relative;
}

.about-img img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.about-img::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 20px;
    z-index: -1;
}

.about-content h2 {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 25px;
}

.about-features {
    margin-top: 30px;
}

.about-feat {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.about-feat i {
    color: var(--accent);
    font-size: 1.2rem;
    margin-top: 5px;
}

/* --- Articles --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--bg-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.article-card:hover {
    box-shadow: var(--shadow-md);
}

.article-img {
    height: 250px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 4rem;
}

.article-body {
    padding: 30px;
}

.article-body h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.share-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.share-links a {
    color: var(--text-muted);
    transition: var(--transition);
}

.share-links a:hover {
    color: var(--accent);
}

/* --- Footer --- */
footer {
    background: var(--primary);
    color: var(--text-light);
    padding: 80px 8% 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-logo {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 20px;
    display: block;
}

.footer-links h4, .footer-contact h4 {
    color: var(--accent);
    margin-bottom: 25px;
    font-size: 1.2rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent);
}

.footer-contact p {
    margin-bottom: 15px;
    opacity: 0.8;
    display: flex;
    gap: 10px;
}

.footer-contact i {
    color: var(--accent);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    opacity: 0.6;
}

@media (max-width: 992px) {
    .about-container { grid-template-columns: 1fr; }
    .hero h1 { font-size: 3.5rem; }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    header { padding: 15px 5%; padding-top: max(15px, env(safe-area-inset-top)); }
    .nav-links { display: none; }
    .hero h1 { font-size: 2.6rem; }
    .hero { padding: 140px 6% 100px; }
    .stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 25px;
        margin-top: -50px;
        padding: 30px 20px;
    }
    .stat-item h3 { font-size: 2rem; }

    /* Hide desktop-only components in header right */
    .header-right .lang-switcher,
    .header-right .btn-contact {
        display: none !important;
    }

    /* Show hamburger menu toggle */
    .menu-toggle {
        display: flex;
    }

    /* Footer mobile alignments to keep within bounds */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-contact p {
        justify-content: center;
    }

    .footer-info .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2.1rem; }
    .hero p { font-size: 1.05rem; }
    .drawer-header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
}

/* --- Drawer Overlay --- */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

/* --- Mobile Drawer --- */
.mobile-drawer {
    position: fixed;
    top: 0;
    width: 320px;
    max-width: 85%;
    height: 100vh;
    height: 100dvh;
    background: rgba(28, 63, 63, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
    
    /* Default Right position for RTL direction */
    right: -340px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* RTL Slide in */
html[dir="rtl"] .mobile-drawer {
    right: -340px;
    left: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
}
html[dir="rtl"] .mobile-drawer.open {
    right: 0;
}

/* LTR Slide in */
html[dir="ltr"] .mobile-drawer {
    left: -340px;
    right: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
}
html[dir="ltr"] .mobile-drawer.open {
    left: 0;
}

.drawer-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-header .logo {
    color: var(--text-light);
    font-size: 1.3rem;
}

.drawer-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.drawer-close-btn:hover {
    background: var(--accent);
    color: white;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
}

.drawer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-links a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 12px;
    transition: var(--transition);
    border-right: 4px solid transparent;
}

html[dir="ltr"] .drawer-links a {
    border-right: none;
    border-left: 4px solid transparent;
}

.drawer-links a i {
    font-size: 1.1rem;
    color: var(--accent);
    width: 24px;
    text-align: center;
    transition: var(--transition);
}

.drawer-links a:hover, .drawer-links a.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-right-color: var(--accent);
}

html[dir="ltr"] .drawer-links a:hover, html[dir="ltr"] .drawer-links a.active {
    border-left-color: var(--accent);
    border-right-color: transparent;
}

.drawer-links a:hover i {
    transform: scale(1.1);
}

.drawer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 25px 0;
}

.drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: auto;
}

.drawer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 2px solid transparent;
}

.drawer-btn i {
    font-size: 1.1rem;
}

.consult-btn {
    background: #25D366;
    color: white;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2);
}

.consult-btn:hover {
    background: transparent;
    color: #25D366;
    border-color: #25D366;
}

.portal-btn {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.2);
}

.portal-btn:hover {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.drawer-footer {
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
}

.drawer-lang-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-lang-switcher .lang-btn {
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
}

.drawer-lang-switcher .lang-btn.active {
    background: var(--accent);
    color: white;
}

/* ===================================================
   ANIMATIONS & SCROLL REVEALS
   =================================================== */

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Keyframes (compositor-only: transform + opacity) --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(34px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-26px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* --- Hero entrance --- */
.hero-subtitle {
    animation: fadeDown 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.hero h1 {
    animation: fadeUp 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.25s both;
}

.hero p {
    animation: fadeUp 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.hero-btns {
    animation: fadeUp 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.55s both;
}

/* --- Logo icon float --- */
.logo i {
    animation: floatIcon 3.2s ease-in-out infinite;
}

/* --- Scroll reveal base (JS adds .visible, hidden only when JS is on) --- */
.js .reveal {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.js .reveal-left { transform: translateX(50px); }
.js .reveal-right { transform: translateX(-50px); }
.js .reveal-zoom { transform: scale(0.94); }

.js .reveal.visible {
    opacity: 1;
    transform: none;
}

/* Stagger reveals for grids */
.practice-card.reveal:nth-child(2),
.article-card.reveal:nth-child(2),
.about-feat.reveal:nth-child(2) { transition-delay: 0.1s; }

.practice-card.reveal:nth-child(3),
.article-card.reveal:nth-child(3) { transition-delay: 0.2s; }

.practice-card.reveal:nth-child(4),
.article-card.reveal:nth-child(4) { transition-delay: 0.3s; }

.article-card.reveal:nth-child(5),
.article-card.reveal:nth-child(5) { transition-delay: 0.4s; }

.article-card.reveal:nth-child(6) { transition-delay: 0.5s; }

/* --- Stats bar entrance --- */
.stats-bar.reveal {
    transition-delay: 0.15s;
}

.stat-item h3 {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-item:hover h3 {
    transform: scale(1.08);
}

/* --- Practice card hover polish --- */
.practice-card i {
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.practice-card:hover i {
    transform: translateY(-6px) scale(1.1);
}

.practice-card h3,
.practice-card p {
    transition: color 0.35s ease;
}

/* --- About image reveal --- */
.about-img.reveal {
    transition-delay: 0.05s;
}

.about-img img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s ease;
}

.about-img:hover img {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* --- Article cards --- */
.article-card {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

/* --- Button shine sweep --- */
.btn-contact {
    position: relative;
    overflow: hidden;
}

.btn-contact::after {
    content: '';
    position: absolute;
    top: 0;
    right: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: right 0.6s ease;
}

.btn-contact:hover::after {
    right: 130%;
}

/* --- Protection alert entrance --- */
#protection-alert {
    animation: fadeUp 0.4s ease both;
}
