/* ============================================================
   SITE HEADER
============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #0F1117;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 72px;
}

/* ============================================================
   LOGO
============================================================ */

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
    flex-shrink: 0;
    max-width: 180px;
}

.logo-text {
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* WordPress custom logo */
.custom-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.custom-logo {
    max-height: 48px;
    max-width: 160px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}
/* When a custom logo image is used, the wrapper is a <div>
   and the_custom_logo() outputs its own <a> inside it */
.logo-has-image {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-has-image .custom-logo-link {
    display: flex;
    align-items: center;
    line-height: 0;
}

.logo-has-image .custom-logo {
    max-height: 48px;
    max-width: 160px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}


/* ============================================================
   DESKTOP NAV
============================================================ */

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.main-nav a {
    color: #c7c9d3;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 10px;
    white-space: nowrap;
    transition: .2s;
}

.main-nav a:hover {
    color: #fff;
    background: rgba(124, 92, 255, .12);
}

/* ============================================================
   DESKTOP SEARCH
============================================================ */

.header-search {
    width: 260px;
    flex-shrink: 0;
}

.header-search form {
    display: flex;
}

.header-search input {
    flex: 1;
    height: 42px;
    border: none;
    outline: none;
    background: #171B26;
    color: #fff;
    padding: 0 14px;
    border-radius: 12px 0 0 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-right: none;
    min-width: 0;
}

.header-search input::placeholder {
    color: var(--muted);
}

.header-search input:focus {
    border-color: var(--accent);
    background: #1B2030;
}

.header-search button {
    width: 46px;
    height: 42px;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    border-radius: 0 12px 12px 0;
    font-size: 16px;
    transition: .2s;
    flex-shrink: 0;
}

.header-search button:hover {
    background: #6a4ae8;
}

/* ============================================================
   HAMBURGER BUTTON (mobile only — hidden on desktop)
============================================================ */

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: #171B26;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: .2s;
}

.hamburger:hover {
    border-color: var(--accent);
    background: rgba(124, 92, 255, .1);
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: .3s;
    transform-origin: center;
}

/* Hamburger → X animation */
.hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   MOBILE MENU DRAWER
============================================================ */

.mobile-menu {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    background: #0F1117;
    border-top: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.is-open {
    transform: translateX(0);
}

.mobile-menu-inner {
    padding: 20px 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mobile search bar */
.mobile-search {
    display: flex;
    margin-bottom: 12px;
}

.mobile-search input {
    flex: 1;
    height: 48px;
    background: #171B26;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 14px 0 0 14px;
    color: #fff;
    padding: 0 16px;
    font-size: 15px;
    outline: none;
    min-width: 0;
}

.mobile-search input::placeholder {
    color: var(--muted);
}

.mobile-search input:focus {
    border-color: var(--accent);
}

.mobile-search button {
    width: 52px;
    height: 48px;
    background: var(--accent);
    border: none;
    border-radius: 0 14px 14px 0;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Mobile nav links */
.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #171B26;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: .2s;
}

.mobile-nav a:hover,
.mobile-nav a:active {
    background: rgba(124, 92, 255, .12);
    border-color: rgba(124, 92, 255, .4);
    color: var(--accent);
}

.mobile-nav-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

/* ============================================================
   BACKDROP (closes menu when tapped outside)
============================================================ */

.mobile-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 997;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .3s;
}

.mobile-menu-backdrop.is-visible {
    opacity: 1;
}

/* ============================================================
   BREAKPOINTS
============================================================ */

/* Tablet: hide search, keep nav */
@media (max-width: 1100px) {
    .header-search {
        width: 200px;
    }
    .main-nav a {
        font-size: 13px;
        padding: 8px 8px;
        gap: 2px;
    }
    .main-nav {
        gap: 2px;
    }
}

/* Mobile: hide desktop nav + search, show hamburger */
@media (max-width: 768px) {
    .main-nav,
    .header-search {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .mobile-menu {
        display: block;
    }

    .mobile-menu-backdrop {
        display: block;
    }

    .header-inner {
        min-height: 64px;
    }

    .logo {
        max-width: 160px;
        font-size: 20px;
    }

    .logo-has-image {
        max-width: 160px;
    }

    .logo-has-image .custom-logo {
        max-height: 40px;
        max-width: 140px;
    }

    .custom-logo {
        max-height: 40px;
        max-width: 140px;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .logo {
        max-width: 130px;
        font-size: 17px;
    }

    .logo-has-image {
        max-width: 130px;
    }

    .logo-has-image .custom-logo,
    .custom-logo {
        max-height: 34px;
        max-width: 110px;
    }

    .hamburger {
        width: 38px;
        height: 38px;
    }
}
