/*
Theme Name: Aqari Real Estate
*/

/* ØªØ£ÙƒØ¯ Ù…Ù† ØªØ­Ù…ÙŠÙ„ Ø®Ø· Dashicons */
/* Google Fonts loaded via wp_enqueue_style in enqueue-scripts.php */

:root {
    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       Colors are injected dynamically by inc/color-system.php
       as inline CSS on wp_enqueue_scripts priority 99.
       DO NOT define --primary-color / --secondary-color etc.
       here â€” they will override the dynamic values!
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    /* Layout & UI tokens (non-color, safe to hardcode) */
    --container-width: 1200px;
    --radius:          12px;
    --radius-sm:       6px;
    --shadow:          0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-sm:       0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md:       0 6px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover:    0 8px 30px rgba(0, 0, 0, 0.12);
    --transition:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Neutral tokens */
    --text-color:   #333;
    --text-light:   #666;
    --text-lighter: #999;
    --text-dark:    #1a1a1a;
    --bg-color:     #f5f7fa;
    --bg-light:     #fafbfc;
    --bg-dark:      #e8edf3;
    --border-color: #eee;
    --success-color:#25D366;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Invert dark logo to white on transparent homepage hero */
body.home .site-header:not(.header-scrolled) .site-logo img {
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* Homepage transparent */
body.home .site-header:not(.header-scrolled) {
    background: rgba(8, 14, 26, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

body.home .site-header:not(.header-scrolled) .nav-menu a {
    color: rgba(255, 255, 255, 0.90);
}

body.home .site-header:not(.header-scrolled) .nav-menu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

body.home .site-header:not(.header-scrolled) .nav-menu .current-menu-item a {
    color: var(--color-gold-accent);
    background: rgba(232, 185, 122, 0.10);
}

body.home .site-header:not(.header-scrolled) .site-title a {
    color: #fff;
}

body.home .site-header:not(.header-scrolled) .mobile-menu-toggle span {
    background: #fff;
}

body.home .site-header:not(.header-scrolled) .lang-menu {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.15);
}

body.home .site-header:not(.header-scrolled) .lang-menu li a {
    color: rgba(255, 255, 255, 0.85);
}

body.home .site-header:not(.header-scrolled) .lang-menu li.current-lang a {
    background: rgba(255, 255, 255, 0.20);
    color: #fff;
    box-shadow: none;
}

/* Scrolled State — premium transparent glass with subtle shadow */
.site-header.header-scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.header-inner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 24px;
    height: 72px;
    transition: height 0.3s ease;
}

.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo a {
    display: inline-flex;
    align-items: center;
}

.site-logo img,
.custom-logo {
    max-height: 50px;
    height: 50px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* ─── Header Developer Badge ─── */
.header-dev-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: -8px;
}

.header-dev-badge__sep {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.15), transparent);
}

.header-dev-badge__logo {
    max-height: 40px;
    width: auto;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.header-dev-badge__link:hover .header-dev-badge__logo {
    opacity: 1;
}

html[dir="ltr"] .header-dev-badge {
    margin-right: 0;
    margin-left: -8px;
}

.header-scrolled .header-inner {
    height: 64px;
}

.header-scrolled .site-logo img,
.header-scrolled .custom-logo {
    max-height: 50px;
    height: 50px;
}

.site-title {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

html[dir="rtl"] .site-title {
    letter-spacing: normal;
}

.site-title a {
    color: var(--secondary-color);
    font-weight: 800;
}

/* ─── Navigation ─── */
.main-navigation {
    flex: 0 1 auto;
}

@media (min-width: 769px) {
    .main-navigation {
        margin-right: 32px;
    }
    html[dir="ltr"] .main-navigation {
        margin-right: 0;
        margin-left: 32px;
    }
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow: hidden;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 15px;
    padding: 8px 14px;
    display: block;
    position: relative;
    transition: all 0.25s ease;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
}

/* Hover underline effect */
.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 16px;
    height: 2px;
    background: var(--primary-color, #0F2742);
    border-radius: 2px;
    transition: transform 0.25s ease;
}

.nav-menu > li > a:hover::after,
.nav-menu > li.current-menu-item > a::after {
    transform: translateX(-50%) scaleX(1);
}

/* â”€â”€â”€ Sub-menu Dropdown â”€â”€â”€ */
.nav-menu li>.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    z-index: 999;
    list-style: none;
    margin: 0;
}

.nav-menu li:hover>.sub-menu {
    display: block;
}

.nav-menu .sub-menu li {
    width: 100%;
}

.nav-menu .sub-menu a {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 0;
    white-space: nowrap;
    color: var(--secondary-color);
}

.nav-menu .sub-menu a:hover {
    background: #f5f6f8;
    color: var(--primary-color);
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: rgba(109, 16, 79, 0.05);
}

.nav-menu .current-menu-item > a {
    color: var(--primary-color);
    font-weight: 700;
}


/* â”€â”€â”€ Mobile Menu Toggle â”€â”€â”€ */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background: var(--secondary-color);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* â”€â”€â”€ Buttons â”€â”€â”€ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
    gap: 8px;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn i {
    font-size: 16px;
}

/* â”€â”€â”€ Desktop â”€â”€â”€ */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 8px;
    }

    .nav-menu a {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* â”€â”€â”€ Mobile â”€â”€â”€ */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header-inner {
        height: 60px;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: #fff;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.12);
        padding: 80px 24px 30px;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
    }

    .main-navigation.active {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .nav-menu li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .nav-menu a {
        padding: 14px 12px;
        border-radius: 0;
        font-size: 16px;
    }

    .nav-menu a:hover {
        background: rgba(193, 122, 74, 0.06);
    }

    .nav-menu .current-menu-item a {
        border-radius: 0;
        border-right: 3px solid var(--primary-color);
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }
}

@media (max-width: 480px) {
    .site-logo img {
        max-height: 46px;
    }

    .header-dev-badge__logo {
        max-height: 28px;
    }

    .header-dev-badge__sep {
        height: 24px;
    }

    .header-dev-badge {
        gap: 8px;
    }

    .header-inner {
        gap: 12px;
        height: 56px;
    }
}

/* ========================================
   Body padding for fixed header
   ======================================== */
body {
    padding-top: 72px;
}

/* Pages with hero that pulls up behind header */
body.home .site-main {
    margin-top: -72px;
}

/* ========================================
   Header Actions Area (Lang + Hamburger)
   ======================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-right: auto;
}

html[dir="ltr"] .header-actions {
    margin-right: 0;
    margin-left: auto;
}

/* ========================================
   Language Switcher (Polylang) - Toggle Pills
   ======================================== */
.language-switcher {
    position: relative;
}

.lang-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 3px;
    background: var(--bg-color, #f5f7fa);
    border-radius: 8px;
    border: 1px solid var(--border-color, #eee);
}

.lang-menu li {
    display: inline-flex;
}

.lang-menu li a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light, #666);
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--transition);
    background: transparent;
    border: none;
    letter-spacing: 0.5px;
}

.lang-menu li a:hover {
    color: var(--primary-color);
    background: rgba(193, 122, 74, 0.08);
}

/* Current language â†’ Active pill */
.lang-menu li.current-lang a {
    background: var(--secondary-color);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.25);
}




/* Flag images */
.lang-menu li a img {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Desktop 1024px
   ======================================== */
@media (max-width: 1024px) {
    .header-actions {
        gap: 8px;
    }

    .lang-menu li a {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* ========================================
   Mobile 768px
   ======================================== */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }


    .header-actions {
        gap: 8px;
    }

    /* Language switcher stays visible on mobile */
    .language-switcher {
        order: 0;
        margin: 0;
    }

    .lang-menu {
        padding: 2px;
        border-radius: 6px;
    }

    .lang-menu li a {
        padding: 5px 10px;
        font-size: 11px;
        gap: 4px;
    }

    /* Hide text, show only flags on small screens */
    .lang-menu li a span {
        display: none;
    }

    .lang-menu li a img {
        width: 20px;
        height: 14px;
    }

    /* Hamburger toggle visible on mobile */
    .mobile-menu-toggle {
        order: 1;
    }
}

/* ========================================
   Small Mobile 480px
   ======================================== */
@media (max-width: 480px) {
    .header-actions {
        gap: 6px;
    }

    .lang-menu li a {
        padding: 4px 8px;
    }

    .lang-menu li a img {
        width: 18px;
        height: 12px;
    }
}

/* ========================================
   GLOBAL GRID & IMAGE OVERFLOW FIX (Ultimate)
   Prevents CSS Grid columns and images from blowing out
   ======================================== */
.project-layout-enhanced > *,
.single-modern-layout > *,
.site-main > article,
.site-main > div,
.entry-content,
.project-content-area,
.project-linear-content {
    min-width: 0 !important; 
}

figure,
figure.wp-block-image,
.wp-block-image,
.wp-block-image img,
.site-main img:not(.makan-carousel-card img):not(.makan-carousel-slide img),
.entry-content img,
.project-content img {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
}

/* ========================================
   GLOBAL TABLE DESIGN (Gutenberg Fix)
   Ensures tables have borders and premium look
   ======================================== */
.site-main table,
.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.site-main table th,
.site-main table td,
.wp-block-table table th,
.wp-block-table table td {
    border: 1px solid #eef0f3;
    padding: 14px 18px;
    text-align: right;
}

.site-main table th,
.wp-block-table table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: var(--secondary-color, #1e3a5f);
    border-bottom: 2px solid #eef0f3;
}

.site-main table tr:nth-child(even) td,
.wp-block-table table tr:nth-child(even) td {
    background-color: #fafbfc;
}

.site-main table tr:hover td,
.wp-block-table table tr:hover td {
    background-color: #f0f4f8;
}
