/* ==========================================================================
   MS LAW OFFICE — CANONICAL GLOBAL NAVIGATION & FOOTER DESIGN SYSTEM
   Unifying Header, Mobile Navigation, Drawer Overlay, and Footer Across All Pages
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL HEADER & FLOATING PILL
   -------------------------------------------------------------------------- */
.site-header {
    position: fixed;
    top: 16px;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
    padding: 0 16px;
    transition: top 0.3s ease, padding 0.3s ease;
}

.site-header.scrolled {
    top: 8px;
}

.nav-inner-pill {
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    background: rgba(11, 16, 24, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-gold-hairline, rgba(201, 169, 97, 0.28));
    border-radius: var(--radius-nav, 28px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    padding: 8px 14px 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: auto;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

html[lang="ar"] .nav-inner-pill {
    padding: 8px 20px 8px 14px;
}

.site-header.scrolled .nav-inner-pill {
    background: rgba(7, 11, 18, 0.97);
    border-color: var(--color-imperial-gold, #C9A961);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
}

/* Brand Link */
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

.brand-link:hover .brand-logo-img {
    transform: scale(1.03);
}

.brand-title-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-title {
    font-family: var(--font-display, 'Cinzel', Georgia, serif);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #ffffff;
    line-height: 1.1;
    white-space: nowrap;
}

.brand-heritage-beacon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-imperial-gold, #C9A961);
    background: var(--color-gold-wash, rgba(201, 169, 97, 0.12));
    border: 1px solid var(--color-gold-hairline, rgba(201, 169, 97, 0.28));
    padding: 2px 8px;
    border-radius: var(--radius-badge, 40px);
    margin-top: 3px;
    white-space: nowrap;
}

.beacon-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--color-imperial-gold, #C9A961);
    animation: pulseBeaconDot 2.5s infinite;
}

@keyframes pulseBeaconDot {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.75); }
    100% { opacity: 1; transform: scale(1); }
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.desktop-nav .nav-link {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-dark-secondary, #9BA3B0);
    padding: 7px 12px;
    border-radius: var(--radius-pill, 9999px);
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

html[lang="ar"] .desktop-nav .nav-link {
    font-family: var(--font-arabic, 'Alexandria', sans-serif);
    font-size: 0.84rem;
}

html[lang="en"] .desktop-nav .nav-link {
    font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
}

.desktop-nav .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.desktop-nav .nav-link.active {
    color: var(--color-imperial-gold, #C9A961);
    background: rgba(201, 169, 97, 0.12);
    font-weight: 600;
}

/* Header Action Controls */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lang-switch-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 13px;
    border-radius: var(--radius-pill, 9999px);
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 44px;
}

.lang-switch-btn:hover {
    border-color: var(--color-imperial-gold, #C9A961);
    color: var(--color-imperial-gold, #C9A961);
    background: var(--color-gold-wash, rgba(201, 169, 97, 0.14));
}

.header-cta-pill {
    background-color: var(--color-imperial-gold, #C9A961);
    color: var(--color-obsidian, #070B12);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 8px 18px;
    border-radius: var(--radius-pill, 9999px);
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(201, 169, 97, 0.25);
    white-space: nowrap;
    min-height: 36px;
}

html[lang="ar"] .header-cta-pill {
    font-family: var(--font-arabic, 'Alexandria', sans-serif);
}

.header-cta-pill:hover {
    background-color: var(--color-imperial-gold-hover, #DFBD72);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201, 169, 97, 0.35);
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    border-color: var(--color-imperial-gold, #C9A961);
    background: var(--color-gold-wash, rgba(201, 169, 97, 0.12));
    color: var(--color-imperial-gold, #C9A961);
}

.hamburger-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* --------------------------------------------------------------------------
   2. MOBILE DRAWER OVERLAY & PANEL ARCHITECTURE
   -------------------------------------------------------------------------- */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 7, 12, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(340px, 86vw);
    max-width: 100%;
    background: #0B1018;
    background: linear-gradient(180deg, #0E1420 0%, #070B12 100%);
    border-inline-start: 1px solid var(--color-gold-hairline, rgba(201, 169, 97, 0.28));
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.85);
    z-index: 1999;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease;
    visibility: hidden;
}

/* Slide in from right in LTR, slide in from right in RTL */
html[lang="ltr"] .mobile-drawer {
    right: 0;
    left: auto;
    transform: translateX(100%);
    border-left: 1px solid var(--color-gold-hairline, rgba(201, 169, 97, 0.28));
    border-right: none;
}

html[lang="ar"] .mobile-drawer {
    left: 0;
    right: auto;
    transform: translateX(-100%);
    border-right: 1px solid var(--color-gold-hairline, rgba(201, 169, 97, 0.28));
    border-left: none;
}

.mobile-drawer.active {
    transform: translateX(0) !important;
    visibility: visible;
}

/* Drawer Header */
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 16, 24, 0.85);
    position: sticky;
    top: 0;
    z-index: 2;
}

.drawer-brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.drawer-brand-logo {
    height: 32px;
    width: auto;
}

.drawer-brand-title {
    font-family: var(--font-display, 'Cinzel', Georgia, serif);
    font-weight: 800;
    font-size: 0.92rem;
    color: #ffffff;
    letter-spacing: 0.1em;
}

.drawer-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.drawer-close-btn:hover {
    background: rgba(201, 169, 97, 0.2);
    border-color: var(--color-imperial-gold, #C9A961);
    color: var(--color-imperial-gold, #C9A961);
}

/* Drawer Navigation Links */
.drawer-nav-list {
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
    gap: 4px;
    flex: 1;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text-dark-primary, #F8F7F2);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.25s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

html[lang="ar"] .mobile-nav-item {
    font-family: var(--font-arabic, 'Alexandria', sans-serif);
}

html[lang="en"] .mobile-nav-item {
    font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
}

.mobile-nav-item .nav-num {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-imperial-gold, #C9A961);
    letter-spacing: 0.1em;
    min-width: 22px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--color-imperial-gold, #C9A961);
    background: rgba(201, 169, 97, 0.1);
    padding-inline-start: 18px;
}

.mobile-nav-item.active {
    border-color: rgba(201, 169, 97, 0.35);
    font-weight: 600;
}

/* Drawer Action & Language Section */
.drawer-footer-actions {
    padding: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(7, 11, 18, 0.6);
}

.drawer-cta-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--color-imperial-gold, #C9A961);
    color: #070B12;
    padding: 12px 16px;
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    min-height: 46px;
}

.drawer-cta-primary:hover {
    background: var(--color-imperial-gold-hover, #DFBD72);
}

.drawer-phone-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-dark-secondary, #9BA3B0);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 14px;
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    min-height: 42px;
    direction: ltr;
}

.drawer-phone-link:hover {
    color: #ffffff;
    border-color: var(--color-imperial-gold, #C9A961);
}

.drawer-lang-toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 6px;
    font-size: 0.8rem;
    color: var(--text-dark-muted, #6B7482);
}

.drawer-lang-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill, 9999px);
    padding: 4px;
    display: inline-flex;
    gap: 4px;
}

.drawer-lang-option {
    background: transparent;
    border: none;
    color: var(--text-dark-secondary, #9BA3B0);
    padding: 6px 14px;
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drawer-lang-option.active {
    background: var(--color-imperial-gold, #C9A961);
    color: #070B12;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   3. CANONICAL GLOBAL FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: #060910;
    background: linear-gradient(180deg, #090E17 0%, #05080E 100%);
    color: var(--text-dark-primary, #F8F7F2);
    border-top: 1px solid rgba(201, 169, 97, 0.2);
    padding: clamp(60px, 8vw, 90px) 0 35px;
    position: relative;
    z-index: 10;
}

.footer-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.3fr;
    gap: clamp(32px, 5vw, 64px);
    margin-bottom: 50px;
}

.footer-brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.footer-brand-logo {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.footer-brand-name {
    font-family: var(--font-display, 'Cinzel', Georgia, serif);
    font-weight: 800;
    font-size: 1.18rem;
    color: #ffffff;
    letter-spacing: 0.1em;
    line-height: 1.2;
}

.footer-brand-heritage {
    font-size: 0.68rem;
    color: var(--color-imperial-gold, #C9A961);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 3px;
}

.footer-brand-text {
    font-size: 0.92rem;
    color: var(--text-dark-secondary, #9BA3B0);
    line-height: 1.8;
    max-width: 520px;
}

html[lang="ar"] .footer-brand-text {
    font-family: var(--font-arabic, 'Alexandria', sans-serif);
    line-height: 1.95;
}

.footer-nav-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-imperial-gold, #C9A961);
    margin-bottom: 20px;
}

html[lang="ar"] .footer-nav-title {
    font-family: var(--font-arabic, 'Alexandria', sans-serif);
    letter-spacing: normal;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links-list li {
    font-size: 0.88rem;
    line-height: 1.5;
}

.footer-links-list a {
    color: var(--text-dark-secondary, #9BA3B0);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links-list a:hover {
    color: #ffffff;
    padding-inline-start: 6px;
}

.footer-contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.footer-contact-label {
    font-size: 0.72rem;
    color: var(--text-dark-muted, #6B7482);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.footer-contact-val {
    color: var(--text-dark-secondary, #9BA3B0);
}

.footer-contact-val a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-contact-val a:hover {
    color: var(--color-imperial-gold, #C9A961);
}

.footer-bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-dark-muted, #6B7482);
    gap: 16px;
    flex-wrap: wrap;
}


/* --------------------------------------------------------------------------
   4. COMPREHENSIVE RESPONSIVE BREAKPOINT SYSTEM
   Explicit coverage: 1440px, 1280px, 1024px, 991px, 768px, 576px, 430px, 414px, 390px, 375px, 360px, 320px
   -------------------------------------------------------------------------- */

/* Large Desktop / 1440px */
@media (max-width: 1440px) {
    .nav-inner-pill {
        max-width: 1200px;
    }
}

/* Standard Desktop / 1280px */
@media (max-width: 1280px) {
    .nav-inner-pill {
        max-width: 1140px;
        padding: 8px 16px;
    }
    .desktop-nav .nav-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* Large Tablet / 1024px */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none !important;
    }
    .hamburger-btn {
        display: inline-flex !important;
    }
    .header-cta-pill, .btn-consult-nav {
        display: none !important;
    }
    .footer-content-grid {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }
    .footer-content-grid > div:first-child {
        grid-column: span 2;
    }
}

/* Tablet Portrait / 991px */
@media (max-width: 991px) {
    .site-header {
        top: 12px;
        padding: 0 14px;
    }
    .footer-content-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-content-grid > div:first-child {
        grid-column: span 1;
    }
}

/* Mobile Core / 768px */
@media (max-width: 768px) {
    .site-header {
        top: 10px;
        padding: 0 10px;
    }
    .nav-inner-pill {
        padding: 6px 12px;
        border-radius: 24px;
        gap: 8px;
    }
    .brand-logo-img {
        height: 28px;
    }
    .brand-title {
        font-size: 0.82rem;
        letter-spacing: 0.06em;
    }
    .brand-heritage-beacon, .brand-lawyer-title {
        display: none !important;
    }
    .lang-switch-btn {
        padding: 4px 10px;
        font-size: 0.72rem;
        min-height: 36px;
        min-width: 44px;
    }
    .hamburger-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 8px;
    }
    .footer-bottom-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Phablets / 576px */
@media (max-width: 576px) {
    .site-header {
        top: 8px;
        padding: 0 8px;
    }
    .nav-inner-pill {
        padding: 6px 10px;
        border-radius: 22px;
    }
    .mobile-drawer {
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* Large Smartphones / 430px (e.g. iPhone 14/15 Pro Max) */
@media (max-width: 430px) {
    .brand-title {
        font-size: 0.8rem;
    }
}

/* Standard Smartphones / 414px (e.g. iPhone Plus / XR) */
@media (max-width: 414px) {
    .brand-title {
        font-size: 0.78rem;
    }
}

/* Modern Compact / 390px (e.g. iPhone 12/13/14 Pro) */
@media (max-width: 390px) {
    .site-header {
        top: 6px;
        padding: 0 6px;
    }
    .nav-inner-pill {
        padding: 5px 10px;
        border-radius: 20px;
    }
    .brand-logo-img {
        height: 26px;
    }
    .brand-title {
        font-size: 0.75rem;
        letter-spacing: 0.04em;
    }
    .hamburger-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    .lang-switch-btn {
        padding: 4px 8px;
        font-size: 0.68rem;
        min-height: 32px;
    }
}

/* Classic Mobile / 375px (e.g. iPhone X / SE 2/3) */
@media (max-width: 375px) {
    .brand-title {
        font-size: 0.74rem;
    }
}

/* Android Compact / 360px (e.g. Galaxy S / Note Compact) */
@media (max-width: 360px) {
    .nav-inner-pill {
        padding: 5px 8px;
        gap: 6px;
    }
    .brand-title {
        font-size: 0.72rem;
    }
}

/* Ultra Compact / 320px (e.g. iPhone 5/SE1 / Fold cover) */
@media (max-width: 320px) {
    .site-header {
        padding: 0 4px;
        top: 4px;
    }
    .nav-inner-pill {
        padding: 4px 6px;
        gap: 4px;
    }
    .brand-logo-img {
        height: 22px;
    }
    .brand-title {
        font-size: 0.68rem;
        letter-spacing: 0.02em;
    }
    .lang-switch-btn {
        padding: 3px 6px;
        font-size: 0.64rem;
        min-width: 36px;
    }
    .hamburger-btn {
        width: 32px;
        height: 32px;
        padding: 5px;
    }
}

/* --------------------------------------------------------------------------
   5. UNIFIED SECTION SCROLL MARGINS & EXIT CARDS
   -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

#home, #about, #story, #knowledge, #articles, #articles-banner, #services, #practice, #charter, #record, #contact {
    scroll-margin-top: 90px;
}

.article-related-exit-section {
    padding: clamp(36px, 5vw, 60px) 0;
    background: linear-gradient(180deg, var(--color-charcoal, #111620) 0%, var(--color-obsidian, #070B12) 100%);
    border-top: 1px solid var(--color-dark-border, rgba(255, 255, 255, 0.08));
    position: relative;
    z-index: 1;
}

.related-exit-box {
    background: rgba(17, 22, 32, 0.7);
    border: 1px solid var(--color-gold-hairline, rgba(201, 169, 97, 0.28));
    border-radius: var(--radius-card, 14px);
    padding: clamp(28px, 4vw, 44px) clamp(20px, 4vw, 36px);
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.related-badge {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--color-imperial-gold, #C9A961);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.related-title {
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
}

.related-desc {
    font-size: clamp(0.9rem, 1.6vw, 1rem);
    color: var(--text-dark-secondary, #9BA3B0);
    max-width: 620px;
    margin: 0 auto 26px;
    line-height: 1.8;
}

.related-btn-group {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
