/* ═══════════════════════════════════════════════════════════════
   Knoz Navigation Widget — knoz-nav.css
   Palette vars are set inline via Elementor controls where needed.
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset / base ────────────────────────────────────────────── */
.knoz-nav-wrapper *,
.knoz-nav-wrapper *::before,
.knoz-nav-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Nav Bar ─────────────────────────────────────────────────── */
.knoz-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px;
    background: #f0ebe3;
    border-radius: 14px;
    border: 2px solid;
    direction: rtl;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(45, 26, 14, .08);
}

.knoz-home-link {
    font-family: 'Tajawal', 'Cairo', 'Noto Kufi Arabic', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #2d1a0e;
    text-decoration: none;
    letter-spacing: .01em;
    transition: opacity .2s;
    padding: 4px 18px;
}
.knoz-home-link:hover { opacity: .7; }

/* ── Menu Button ─────────────────────────────────────────────── */
.knoz-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row-reverse;
    background: #2d1a0e;
    color: #f0ebe3;
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    cursor: pointer;
    font-family: 'Tajawal', 'Cairo', 'Noto Kufi Arabic', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    direction: rtl;
    transition: transform .15s, box-shadow .15s;
    position: relative;
}
.knoz-menu-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(45, 26, 14, .25);
}
.knoz-menu-btn:active { transform: translateY(0); }

/* DG Agnadeen font for button text and overlay current label */
.knoz-btn-text,
.knoz-overlay-current {
    font-family: "DG Agnadeen", 'Tajawal', 'Cairo', sans-serif !important;
    font-weight: 400 !important;
}

/* Hamburger icon */
.knoz-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
    order: 1; /* icon goes after text in RTL flow */
}
.knoz-line {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #f0ebe3;
    transition: transform .3s, opacity .3s;
}
.line-1 { width: 100%; }
.line-2 { width: 70%; background: #c8722a !important; }
.line-3 { width: 85%; background: #c8722a !important; }
.knoz-btn-text { order: 2; }

/* Animated state when open */
.knoz-menu-btn[aria-expanded="true"] .line-1 { transform: translateY(6px) rotate(45deg); }
.knoz-menu-btn[aria-expanded="true"] .line-2 { opacity: 0; transform: scaleX(0); }
.knoz-menu-btn[aria-expanded="true"] .line-3 { transform: translateY(-6px) rotate(-45deg); width: 100%; background: #f0ebe3 !important; }

/* ── Overlay ─────────────────────────────────────────────────── */
.knoz-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(45, 26, 14, .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}
.knoz-overlay[hidden] {
    display: flex !important; /* override hidden so CSS can animate */
    pointer-events: none;
    opacity: 0;
}
.knoz-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Overlay Inner card ───────────────────────────────────────── */
.knoz-overlay-inner {
    position: relative;
    background: #f5f0e8;
    border-radius: 20px;
    width: 100%;
    max-width: 860px;
    min-height: 420px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(45, 26, 14, .30);
    transform: scale(.94) translateY(20px);
    transition: transform .4s cubic-bezier(.22, 1, .36, 1), opacity .35s ease;
    opacity: 0;
    direction: rtl;
}
.knoz-overlay.is-open .knoz-overlay-inner {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Overlay Header ──────────────────────────────────────────── */
.knoz-overlay-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 12px;
    direction: rtl;
}
.knoz-overlay-current {
    opacity: .6;
}

/* Close button */
.knoz-close-btn {
    background: #2d1a0e;
    color: #f5f0e8;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    order: 2;
    transition: transform .2s, background .2s;
}
.knoz-close-btn:hover {
    transform: rotate(90deg);
    background: #4a2c10;
}

/* ── Image Panel (left in RTL = visually left) ───────────────── */
.knoz-image-panel {
    grid-row: 2;
    grid-column: 2; /* LTR col 2 = visual left in RTL */
    padding: 0 0 24px 24px;
    display: flex;
    align-items: stretch;
}
.knoz-image-bg {
    position: relative;
    flex: 1;
    background: #e8e0d0;
    border-radius: 14px;
    overflow: hidden;
    min-height: 280px;
}

/* Topographic SVG */
.knoz-topo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Compass rose */
.knoz-compass {
    position: absolute;
    top: 18px;
    right: 18px; /* visual right inside the RTL panel */
    width: 64px;
    height: 64px;
    opacity: .85;
}

/* Hover image */
.knoz-hover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    opacity: 0;
    transition: opacity .45s ease;
    z-index: 2;
}
.knoz-hover-img.is-visible { opacity: 1; }

/* ── Menu List ───────────────────────────────────────────────── */
.knoz-menu-list {
    grid-row: 2;
    grid-column: 1; /* visual right in RTL */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 28px 28px 16px;
    direction: rtl;
}

.knoz-menu-item {
    font-family: 'Tajawal', 'Cairo', 'Noto Kufi Arabic', sans-serif;
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 500;
    color: #2d1a0e;
    text-decoration: none;
    text-align: right;
    line-height: 1.35;
    padding: 6px 0;
    position: relative;
    transition: color .2s, transform .25s cubic-bezier(.22, 1, .36, 1);
    display: block;
    opacity: 0;
    transform: translateX(30px);
}

/* Staggered entrance */
.knoz-overlay.is-open .knoz-menu-item {
    opacity: 1;
    transform: translateX(0);
}
.knoz-overlay.is-open .knoz-menu-item:nth-child(1) { transition-delay: .08s; }
.knoz-overlay.is-open .knoz-menu-item:nth-child(2) { transition-delay: .13s; }
.knoz-overlay.is-open .knoz-menu-item:nth-child(3) { transition-delay: .18s; }
.knoz-overlay.is-open .knoz-menu-item:nth-child(4) { transition-delay: .23s; }
.knoz-overlay.is-open .knoz-menu-item:nth-child(5) { transition-delay: .28s; }
.knoz-overlay.is-open .knoz-menu-item:nth-child(6) { transition-delay: .33s; }
.knoz-overlay.is-open .knoz-menu-item:nth-child(7) { transition-delay: .38s; }
.knoz-overlay.is-open .knoz-menu-item:nth-child(8) { transition-delay: .43s; }

/* Hover state */
.knoz-menu-item:hover {
    color: rgba(45, 26, 14, .5);
    transform: translateX(-6px);
}

/* Active state */
.knoz-menu-item.is-active {
    font-weight: 700;
    color: #2d1a0e;
    pointer-events: none;
}
.knoz-menu-item.is-active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 0;
    left: 0;
    height: 2px;
    background: #c8722a;
    border-radius: 2px;
    opacity: .6;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .knoz-overlay { padding: 12px; }

    .knoz-overlay-inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        max-width: 100%;
    }

    .knoz-image-panel {
        grid-column: 1;
        grid-row: 2;
        padding: 0 16px;
    }
    .knoz-image-bg { min-height: 160px; }

    .knoz-menu-list {
        grid-column: 1;
        grid-row: 3;
        padding: 12px 20px 20px;
    }
}

/* ── Arabic font import (if not loaded by theme) ─────────────── */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');
