/**
 * Header Styles - Dailydishy Theme
 * Extracted from header.php inline styles
 */

/* Top Strip */
.header-top-strip {
    background: var(--dh-green);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-align: center;
    padding: 6px 24px;
    text-transform: uppercase;
}

.header-top-strip a {
    color: var(--dh-white);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Main Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: var(--dh-white);
    border-bottom: 1px solid var(--dh-border);
    box-shadow: var(--dh-shadow-sm);
    transition: box-shadow var(--dh-ease);
}

.site-header.scrolled {
    box-shadow: var(--dh-shadow-md);
}

.header-inner {
    width: 100%;
    max-width: 100%;
    padding: 0 40px;
    height: var(--dh-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

/* Logo */
.site-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.site-logo a {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.site-logo img,
.site-logo .custom-logo {
    max-height: 52px !important;
    width: auto !important;
    display: block;
    object-fit: contain;
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-name {
    font-family: var(--dh-font-serif-display);
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--dh-green);
    letter-spacing: -0.3px;
    line-height: 1;
}

.logo-sub {
    font-family: var(--dh-font-ui);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dh-text-muted);
    margin-top: 4px;
}

/* Primary Nav */
.primary-nav-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.primary-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    height: 100%;
}

.primary-nav > li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.primary-nav > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 15px;
    height: 100%;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--dh-text-muted);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    letter-spacing: 0.01em;
    transition: color var(--dh-ease);
}

.primary-nav > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 2.5px;
    background: var(--dh-green);
    border-radius: 2px 2px 0 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--dh-ease);
}

.primary-nav > li > a:hover {
    color: var(--dh-text);
}

.primary-nav > li > a:hover::after {
    transform: scaleX(1);
}

.primary-nav > li.current-menu-item > a,
.primary-nav > li.current-menu-parent > a {
    color: var(--dh-green);
    font-weight: 600;
}

.primary-nav > li.current-menu-item > a::after,
.primary-nav > li.current-menu-parent > a::after {
    transform: scaleX(1);
}

/* Chevron */
.has-dropdown > a .chevron {
    width: 10px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: transform var(--dh-ease);
}

.has-dropdown > a .chevron svg {
    display: block;
}

.has-dropdown:hover > a .chevron,
.has-dropdown:focus-within > a .chevron {
    transform: rotate(180deg);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--dh-white);
    border-radius: var(--dh-radius);
    box-shadow: var(--dh-shadow-lg);
    min-width: 210px;
    padding: 8px;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--dh-ease), transform var(--dh-ease), visibility var(--dh-ease);
    border: 1px solid var(--dh-border);
    contain: layout;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 11px;
    height: 11px;
    background: var(--dh-white);
    border-left: 1px solid var(--dh-border);
    border-top: 1px solid var(--dh-border);
    border-radius: 2px 0 0 0;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
    display: block;
}

.dropdown-menu li + li {
    margin-top: 2px;
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--dh-radius-sm);
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--dh-text);
    text-decoration: none;
    transition: background var(--dh-ease), color var(--dh-ease);
    line-height: 1.3;
}

.dropdown-menu li a .dd-icon {
    width: 28px;
    height: 28px;
    background: var(--dh-green-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--dh-ease);
}

.dropdown-menu li a .dd-icon svg {
    width: 14px;
    height: 14px;
    stroke: var(--dh-green);
}

.dropdown-menu li a:hover {
    background: var(--dh-green-light);
    color: var(--dh-green);
}

.dropdown-menu li a:hover .dd-icon {
    background: var(--dh-green-mid);
}

.dropdown-menu .dd-divider {
    height: 1px;
    background: var(--dh-border);
    margin: 6px 8px;
}

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--dh-border);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--dh-radius-sm);
    color: var(--dh-text);
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    transition: border-color var(--dh-ease), background var(--dh-ease);
}

.nav-toggle:hover {
    background: var(--dh-green-light);
    border-color: var(--dh-green);
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 1.8px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] {
    background: var(--dh-green-light);
    border-color: var(--dh-green);
    color: var(--dh-green);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(5.8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-5.8px) rotate(-45deg);
}

/* Responsive */
@media (max-width: 960px) {
    .header-inner {
        padding: 0 20px;
        gap: 16px;
    }

    .header-top-strip {
        display: none;
    }

    .primary-nav-wrap {
        display: none;
        position: fixed;
        top: var(--dh-header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--dh-white);
        overflow-y: auto;
        padding: 16px 16px 48px;
        z-index: 9998;
        border-top: 1px solid var(--dh-border);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        height: auto;
        will-change: transform;
    }

    .primary-nav-wrap.is-open {
        display: flex;
    }

    .primary-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        height: auto;
    }

    .primary-nav > li {
        height: auto;
        display: block;
        border-bottom: 1px solid var(--dh-border);
    }

    .primary-nav > li:last-child {
        border-bottom: none;
    }

    .primary-nav > li > a {
        height: auto;
        padding: 14px 12px;
        font-size: 0.95rem;
        color: var(--dh-text);
        justify-content: space-between;
    }

    .primary-nav > li > a::after {
        display: none;
    }

    .has-dropdown > a .chevron {
        transform: none !important;
    }

    .has-dropdown.mob-open > a .chevron {
        transform: rotate(180deg) !important;
    }

    .dropdown-menu {
        position: static;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--dh-green-light);
        border-left: 3px solid var(--dh-green);
        pointer-events: auto;
        display: none;
        padding: 6px 8px;
        margin: 0 0 8px 12px;
        contain: none;
    }

    .dropdown-menu::before {
        display: none;
    }

    .has-dropdown.mob-open .dropdown-menu {
        display: block;
    }

    .has-dropdown:hover .dropdown-menu,
    .has-dropdown:focus-within .dropdown-menu {
        opacity: 1 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .has-dropdown.mob-open .dropdown-menu {
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .dropdown-menu li a {
        padding: 10px;
        border-radius: 6px;
        font-size: 0.88rem;
    }

    .nav-toggle {
        display: flex;
    }
}

@media (max-width: 480px) {
    .logo-sub {
        display: none;
    }
}
