/**
 * Header Layout Styles
 * 
 * Provides layout, height, and spacing variations for the site header.
 * These styles are opt-in - they only apply when the corresponding
 * customizer settings are explicitly set.
 * 
 * @package Love_Words_Press_Full
 */

/* ==========================================================================
   Header Dynamic Colors (set via CSS custom properties in header.php)
   ========================================================================== */

#header {
    background-color: var(--lwp-navbar-bg, transparent);
}

#header .container {
    background-color: var(--lwp-navbar-container-bg, transparent);
}

#header .navbar-nav .nav-link,
#header .navbar-nav .nav-link i,
#header .collapse.navbar-collapse {
    color: var(--lwp-navbar-text-color, white);
}

/* ==========================================================================
   Header Layout Variants
   ========================================================================== */

/* Base header container for layout control */
#header .container {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
}

/* Layout 1: Logo Left, Nav Right (Default horizontal) */
.header-layout-horizontal #header .container {
    flex-direction: row !important;
}
.header-layout-horizontal #header .navbar-brand {
    order: 1 !important;
    margin-right: var(--header-spacing, 2rem) !important;
}
.header-layout-horizontal #header .navbar-nav {
    order: 2 !important;
    margin-left: auto !important;
}

/* Layout 2: Logo Center, Nav Below */
.header-layout-centered #header .container,
.header-layout-centered #header .collapse.navbar-collapse {
    flex-direction: column !important;
    text-align: center !important;
}
.header-layout-centered #header .navbar-brand {
    order: 1 !important;
    margin-bottom: 0.5rem !important;
}
.header-layout-centered #header .navbar-nav {
    order: 2 !important;
}
.header-layout-centered #header .sm-icons {
    order: 3 !important;
    margin-top: 0.5rem !important;
}

/* Layout 3: Logo Right, Nav Left (Reverse) */
.header-layout-reverse #header .container {
    flex-direction: row !important;
}
.header-layout-reverse #header .navbar-brand {
    order: 3 !important;
    margin-left: auto !important;
}
.header-layout-reverse #header .navbar-nav {
    order: 1 !important;
    margin-right: auto !important;
}

/* Layout 4: Text Only (No Logo) */
.header-layout-text-only #header .navbar-brand img {
    display: none !important;
}
.header-layout-text-only #header .navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   Header Height Variants
   ========================================================================== */

/* Compact Height (60px) */
.header-height-compact #header {
    min-height: 60px !important;
}
.header-height-compact #header .navbar {
    padding: 0.5rem 1rem !important;
}
.header-height-compact #header .navbar-brand img {
    max-height: 32px !important;
}
.header-height-compact #header .navbar-brand {
    font-size: 1.1rem !important;
}

/* Normal Height (80px) */
.header-height-normal #header {
    min-height: 80px !important;
}
.header-height-normal #header .navbar {
    padding: 0.75rem 1rem !important;
}
.header-height-normal #header .navbar-brand img {
    max-height: 48px !important;
}
.header-height-normal #header .navbar-brand {
    font-size: 1.25rem !important;
}

/* Tall Height (200px) */
.header-height-tall #header {
    min-height: 200px !important;
}
.header-height-tall #header .navbar {
    padding: 1.5rem 1rem !important;
}
.header-height-tall #header .navbar-brand img {
    max-height: 200px !important;
}
.header-height-tall #header .navbar-brand {
    font-size: 1.75rem !important;
}

/* ==========================================================================
   Header Spacing Variants
   ========================================================================== */

/* Compact Spacing */
.header-spacing-compact #header .navbar-brand {
    margin-right: 1rem !important;
}
.header-spacing-compact #header .navbar-nav {
    margin-left: 1rem !important;
}
.header-spacing-compact #header .navbar-toggler {
    margin-left: 1rem !important;
}

/* Normal Spacing */
.header-spacing-normal #header .navbar-brand {
    margin-right: 2rem !important;
}
.header-spacing-normal #header .navbar-nav {
    margin-left: 2rem !important;
}
.header-spacing-normal #header .navbar-toggler {
    margin-left: 2rem !important;
}

/* Spacious Spacing */
.header-spacing-spacious #header .navbar-brand {
    margin-right: 3rem !important;
}
.header-spacing-spacious #header .navbar-nav {
    margin-left: 3rem !important;
}
.header-spacing-spacious #header .navbar-toggler {
    margin-left: 3rem !important;
}

/* ==========================================================================
   Combined Layout + Height Adjustments
   ========================================================================== */

/* Centered layout with tall height - extra spacing */
.header-layout-centered.header-height-tall #header .navbar-brand {
    margin-bottom: 1rem !important;
}

/* Compact layout with compact height - tighter spacing */
.header-layout-horizontal.header-height-compact #header .navbar-brand {
    margin-right: 1rem !important;
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */

@media (max-width: 991.98px) {
    /* Always use hamburger on mobile */
    #header .navbar-collapse {
        background: inherit !important;
        padding: 1rem !important;
        margin-top: 1rem !important;
        border-radius: 0.25rem !important;
    }
    
    /* Compact mobile header */
    .header-height-compact #header .navbar-collapse {
        padding: 0.5rem !important;
        margin-top: 0.5rem !important;
    }
    
    /* Normal mobile header */
    .header-height-normal #header .navbar-collapse {
        padding: 1rem !important;
        margin-top: 1rem !important;
    }
    
    /* Tall mobile header */
    .header-height-tall #header .navbar-collapse {
        padding: 1.5rem !important;
        margin-top: 1.5rem !important;
    }
    
    /* Centered layout on mobile */
    .header-layout-centered #header .navbar-collapse {
        text-align: center !important;
    }
    
    /* Logo scales down on mobile */
    #header .navbar-brand img {
        max-height: 40px !important;
    }
    
    .header-height-compact #header .navbar-brand img {
        max-height: 32px !important;
    }
    
    .header-height-normal #header .navbar-brand img {
        max-height: 48px !important;
    }
    
    .header-height-tall #header .navbar-brand img {
        max-height: 80px !important;
    }
}

/* ==========================================================================
   Accessibility & Focus States
   ========================================================================== */

#header .navbar-nav .nav-link:focus,
#header .navbar-nav .nav-link:hover {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    #header {
        min-height: auto !important;
    }
    
    #header .navbar-brand img {
        max-height: 100px !important;
    }
}