/* filepath: d:\Documents\Minerva\Websites\domains1\domains\theportolife.com\public_html\wp-content\themes\theportolife\assets\css\header.css */
/**
 * Magazine Theme Header Styles
 * Supports RTL/LTR and fully responsive
 */

/* ===================================
   Reset and Base Styles
   =================================== */
.site-header {
    position: relative;
    width: 100%;
    background: var(--color-bg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 1;
    transition: opacity var(--transition-base);
}

.site-header *,
.site-header *::before,
.site-header *::after {
    box-sizing: border-box;
}

/* Screen Reader Text - uses common styles from main.css */

/* ===================================
   Banner Section
   =================================== */
.header-banner {
    position: relative;
    height: 256px;
    background-color: var(--color-primary);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* Darkens the image by 40% */
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0 20px;
}

/* Site Branding */
.site-branding {
    text-align: center;
}

.site-logo img {
    max-height: 120px;
    width: auto;
    height: auto;
}

.site-title {
    margin: 0;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
}

.site-title a {
    color: var(--white);
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    transition: opacity var(--transition-base);
}

.site-title a:hover {
    opacity: 0.9;
}

.site-description {
    margin: 10px 0 0;
    font-size: 18px;
    color: #f0f0f0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.nav-brand {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

[dir="rtl"] .nav-brand {
    margin-right: 0;
    margin-left: 20px;
}

.site-name {
    font-family: var(--font-display); /* Using your Didot/Bodoni stack */
    font-size: 1.5rem; /* Adjust as needed */
    font-weight: 600;
    color: #333; /* Adjust to match your design */
    text-decoration: none;
    letter-spacing: 0.5px;

    /* Optional: Make it slightly transparent to be less dominant */
    opacity: 0.9;

    /* Responsive sizing */
    @media (max-width: 768px) {
        font-size: 1.25rem;
    }
}

/* If you want it to be clickable as a home link */
.site-name:hover {
    opacity: 1;
    transition: opacity 0.2s ease;
}


/* Navigation Bar Base Styles - uses common container from main.css */

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    visibility: visible !important;
}

/* Primary Menu */
.primary-menu-wrapper {
    flex: 1;
}

.primary-menu-container {
    display: flex;
    align-items: center;
}

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.primary-menu li {
    position: relative;
    margin: 0;
    padding: 0;
}

.primary-menu > li > a {
    display: block;
    padding: 15px 20px;
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a,
.primary-menu > li.current-menu-parent > a {
    color: var(--color-primary);
    background: rgba(44, 62, 80, 0.05);
}

/* Dropdown Menu */
.primary-menu ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-bg);
    min-width: 220px;
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 999;
}

.primary-menu li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu ul li {
    margin: 0;
}

.primary-menu ul a {
    display: block;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.primary-menu ul a:hover {
    color: #0073aa;
    background: #f8f8f8;
    padding-left: 25px;
}

/* Dropdown Indicator */
.primary-menu li.menu-item-has-children > a::after {
    content: '\25BC';
    font-size: 10px;
    margin-left: 5px;
    opacity: 0.5;
}

/* Third Level Dropdown */
.primary-menu ul ul {
    left: 100%;
    top: 0;
}

/* Social Icons & Language Switcher */
.header-social-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Language Switcher Styles */
.language-switcher {
    list-style: none;
    margin: 0 15px 0 0;
    padding: 0 15px 0 0;
    border-right: 1px solid #e0e0e0;
    min-height: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rtl .language-switcher {
    margin: 0 0 0 15px;
    padding: 0 0 0 15px;
    border-right: none;
    border-left: 1px solid #e0e0e0;
}

.language-switcher li {
    margin: 0;
    padding: 0;
}

.language-switcher a {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.language-switcher a:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.language-switcher .current-lang a {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.language-switcher .current-lang a:hover {
    background: #005580;
    border-color: #005580;
}

/* Language flag styles */
.language-switcher img {
    width: 20px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Language name styles */
.language-switcher .lang-item {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Mobile Language Switcher Styles */
@media (max-width: 768px) {
    .language-switcher {
        margin-right: 10px;
        padding-right: 10px;
    }

    .rtl .language-switcher {
        margin-left: 10px;        padding-left: 10px;
    }

    .language-switcher {
        gap: 5px;
    }

    .language-switcher a {
        padding: 4px 8px;
        font-size: 12px;
    }

    .language-switcher img {
        width: 18px;
    }

    .language-switcher .lang-item {
        font-size: 11px;
    }

    /* Hide language names on very small screens, show only flags */
    @media (max-width: 480px) {
        .language-switcher .lang-item {
            display: none;
        }

        .language-switcher a {
            padding: 5px;
        }

        .language-switcher {
            margin-right: 8px;
            padding-right: 8px;
        }

        .rtl .language-switcher {
            margin-left: 8px;
            padding-left: 8px;
        }
    }
}

/* Alternative Language Switcher Style - Dropdown (if dropdown option is enabled) */
.language-switcher select {
    padding: 5px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-switcher select:hover {
    border-color: #0073aa;
}

.language-switcher select:focus {
    outline: none;
    border-color: #0073aa;    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

/* Header Social Icons */

.header-social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
    transition: all var(--transition-base);
    text-decoration: none;
}

.header-social-icons a:hover {
    background: var(--color-primary);
    color: var(--white);
    transform: translateY(-2px);
}

.header-social-icons svg {
    width: 18px;
    height: 18px;
}

/* Search Toggle */
.header-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-left: 10px;
}

.header-search-toggle:hover {
    background: var(--color-primary);
    color: var(--white);
}

/* ===================================
   Search Form Dropdown
   =================================== */
.header-search-form {
    position: sticky;
    top: 57px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 2px solid #0073aa;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 998;
    display: none;
}

.header-search-form.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form-container {
    /* Uses common container from main.css */
    position: relative;
    padding: 30px var(--spacing-lg);
}

.search-form-container form {
    display: flex;
    gap: 10px;
}

.search-field {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.search-field:focus {
    outline: none;
    border-color: #0073aa;
}

.search-submit {
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-submit:hover {
    background: #005580;
}

.search-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.search-close:hover {
    color: #333;
}

/* ===================================
   Mobile Menu Toggle
   =================================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1001;
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -2px;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 30px;
    height: 3px;
    background-color: #333;
    border-radius: 3px;
    position: absolute;
    transition: transform 0.3s ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: "";
    display: block;
}

.hamburger-inner::before {
    top: -10px;
}

.hamburger-inner::after {
    bottom: -10px;
}

.menu-toggle.active .hamburger-inner {
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger-inner::before {
    top: 0;
    opacity: 0;
}

.menu-toggle.active .hamburger-inner::after {
    bottom: 0;
    transform: rotate(-90deg);
}

/* ===================================
   RTL Support
   =================================== */
.rtl .primary-menu {
    flex-direction: row-reverse;
}

.rtl .primary-menu ul {
    left: auto;
    right: 0;
}

.rtl .primary-menu ul ul {
    left: auto;
    right: 100%;
}

.rtl .primary-menu li.menu-item-has-children > a::after {
    margin-left: 0;
    margin-right: 5px;
}

.rtl .primary-menu ul a:hover {
    padding-left: 20px;
    padding-right: 25px;
}

.rtl .header-social-icons {
    flex-direction: row;
}

.rtl .header-search-toggle {
    margin-left: 0;
    margin-right: 10px;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 15px;
    }

    .primary-menu > li > a {
        padding: 15px 15px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    /* Banner Responsive */
    .header-banner {
        height: 180px;
    }

    .site-title {
        font-size: 32px;
    }

    .site-description {
        font-size: 14px;
    }

    .site-logo img {
        max-height: 80px;
    }

    /* Mobile Navigation */
    .menu-toggle {
        display: block;
    }

    .nav-wrapper {
        position: relative;
    }

    .primary-menu-wrapper {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .rtl .primary-menu-wrapper {
        left: auto;
        right: -100%;
        transition: right 0.3s ease;
    }

    .primary-menu-wrapper.active {
        left: 0;
    }

    .rtl .primary-menu-wrapper.active {
        left: auto;
        right: 0;
    }

    .primary-menu {
        flex-direction: column;
        align-items: stretch;
        padding-top: 60px;
    }

    .primary-menu li {
        border-bottom: 1px solid #f0f0f0;
    }

    .primary-menu > li > a {
        padding: 15px 20px;
    }

    /* Mobile Dropdowns */
    .primary-menu ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f8f8;
        display: none;
    }

    .primary-menu li.menu-open > ul {
        display: block;
    }

    .primary-menu ul ul {
        left: 0;
        top: 0;
        background: #f0f0f0;
    }

    /* Mobile Social Icons */
    .header-social-icons {
        gap: 10px;
    }

    .header-social-icons a {
        width: 32px;
        height: 32px;
    }

    /* Mobile Search */
    .search-field {
        font-size: 14px;
        padding: 10px 15px;
    }

    .search-submit {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Mobile Overlay */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .mobile-menu-overlay.active {
        display: block;
    }
}

@media (max-width: 480px) {
    .header-banner {
        height: 150px;
    }

    .site-title {
        font-size: 24px;
    }

    .site-logo img {
        max-height: 60px;
    }

    .header-social-icons {
        gap: 5px;
    }

    .header-social-icons a {
        width: 28px;
        height: 28px;
    }

    .header-social-icons svg {
        width: 14px;
        height: 14px;
    }
}

/* ===================================
   Main Navigation
   =================================== */

.main-navigation {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    border-bottom: 2px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all var(--transition-base);
}

@media (max-width: 782px) {
    .admin-bar .main-navigation {
        top: 46px;
    }

    .menu-toggle {
        display: flex !important;
    }

    .primary-menu-wrapper {
        display: block !important;
    }
}

/* ===================================
   Accessibility - uses common focus styles from main.css
   =================================== */

/* High Contrast Mode Support - common styles in main.css */

/* Reduced Motion Support - common styles in main.css */

/* ===================================
   Print Styles - common styles in main.css
   =================================== */

/* Additional Header Enhancements */

/* Ensure proper loading states */
.site-header {
    opacity: 1;
    transition: opacity var(--transition-base);
}

/* Ensure mobile menu works on all devices */
@media (max-width: 782px) {
    .menu-toggle {
        display: flex !important;
    }

    .primary-menu-wrapper {
        display: block !important;
    }
}

/* Fix language switcher spacing */
.language-switcher {
    min-height: 24px;
    display: flex;
    align-items: center;
}

/* Ensure social icons are properly aligned */
.header-social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

