/**
 * BoltPress Header Styles
 *
 * Default header styles for when custom header templates are not used
 * @package BoltPress
 */

/* CSS Custom Properties for Dynamic Values */
:root {
    --header-bg: #ffffff;
    --header-link-color: #333333;
    --header-link-hover: #0073aa;
    --header-padding-top: 16px;
    --header-padding-bottom: 16px;
    --header-logo-height: 60px;
    --header-border-color: #e0e0e0;
    --header-border-width: 1px;
    --header-z-index: 1000;
    --sticky-transition: 300ms;
}

/* Pre-Header Section */
.site-preheader {
    background: #000000;
    color: #ffffff;
    padding: 8px 0;
    font-size: 0.875rem;
    transition: transform var(--sticky-transition) ease, opacity var(--sticky-transition) ease;
}

.site-preheader.hide-on-scroll {
    transform: translateY(-100%);
    opacity: 0;
    position: absolute;
    width: 100%;
}

.site-preheader .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.site-preheader a {
    color: inherit;
    text-decoration: underline;
}

.site-preheader a:hover {
    opacity: 0.8;
}

/* Header Wrapper */
.site-header-wrapper {
    position: relative;
    z-index: var(--header-z-index);
}

/* Main Header */
.site-header {
    background: var(--header-bg);
    padding: var(--header-padding-top) 0 var(--header-padding-bottom);
    position: relative;
    transition: all var(--sticky-transition) ease;
}

/* Sticky Header States */
.site-header.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--header-z-index);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header.is-sticky.shrink {
    padding-top: 8px;
    padding-bottom: 8px;
}

.site-header.is-sticky.shrink .custom-logo {
    max-height: 40px;
}

/* Header Container */
.site-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Header Full Width */
.site-header.full-width .container {
    max-width: 100%;
}

/* Flexible Layout Support */
/* Logo positions */
.site-header .container.logo-left {
    flex-direction: row;
}

.site-header .container.logo-center {
    flex-direction: column;
    text-align: center;
}

.site-header .container.logo-right {
    flex-direction: row-reverse;
}

/* Menu positions */
.site-header .container.menu-left .main-navigation {
    order: -1;
    margin-left: 0;
    margin-right: auto;
}

.site-header .container.menu-center .main-navigation {
    margin-left: auto;
    margin-right: auto;
}

.site-header .container.menu-right .main-navigation {
    margin-left: auto;
    margin-right: 0;
}

/* Site Branding */
.site-branding {
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: inherit;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.site-title a {
    text-decoration: none;
    color: var(--header-link-color);
    transition: color 0.2s ease;
}

.site-title a:hover {
    color: var(--header-link-hover);
}

.site-description {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

/* Custom Logo */
.custom-logo-link {
    display: inline-block;
    line-height: 0;
    transition: all var(--sticky-transition) ease;
}

.custom-logo {
    max-height: var(--header-logo-height);
    width: auto;
    vertical-align: middle;
    transition: max-height var(--sticky-transition) ease;
}

/* Main Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    text-decoration: none;
    color: var(--header-link-color);
    font-weight: 500;
    padding: 0.5rem 0;
    display: block;
    transition: color 0.2s ease;
}

.main-navigation a:hover,
.main-navigation a:focus {
    color: var(--header-link-hover);
}

/* Header Buttons */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-buttons.before-menu {
    order: -1;
}

.header-buttons.after-menu {
    order: 1;
    margin-left: auto;
}

.header-button {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    text-decoration: none;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-button.primary {
    background: #0073aa;
    color: #ffffff;
}

.header-button.primary:hover {
    background: #005177;
}

.header-button.secondary {
    background: transparent;
    color: var(--header-link-color);
    border: 2px solid currentColor;
}

.header-button.secondary:hover {
    background: var(--header-link-color);
    color: #ffffff;
}

/* Header Border */
.site-header.has-border-top {
    border-top: var(--header-border-width) solid var(--header-border-color);
}

.site-header.has-border-bottom {
    border-bottom: var(--header-border-width) solid var(--header-border-color);
}

.site-header.has-border-both {
    border-top: var(--header-border-width) solid var(--header-border-color);
    border-bottom: var(--header-border-width) solid var(--header-border-color);
}

/* Menu Toggle */
.menu-toggle {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: 1rem;
}

.menu-toggle:hover {
    border-color: #0073aa;
}

.menu-toggle-icon {
    width: 20px;
    height: 2px;
    background: #333;
    position: relative;
    transition: background 0.2s ease;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #333;
    transition: transform 0.2s ease;
}

.menu-toggle-icon::before {
    top: -6px;
}

.menu-toggle-icon::after {
    top: 6px;
}

/* Mobile Menu States */
.menu-toggle[aria-expanded="true"] .menu-toggle-icon {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::before {
    transform: rotate(45deg) translate(0, 6px);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::after {
    transform: rotate(-45deg) translate(0, -6px);
}

/* Skip Link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: -9999px;
    z-index: 999999;
    background: #000;
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
}

.skip-link:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .site-header .container.logo-center {
        flex-direction: row;
        text-align: left;
    }
}

@media (max-width: 768px) {
    /* Pre-header mobile */
    .site-preheader .container {
        font-size: 0.8125rem;
        padding: 0 0.75rem;
    }

    /* Header mobile */
    .site-header .container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .menu-toggle {
        display: flex;
        order: 2;
    }

    .site-branding {
        flex: 1;
        order: 1;
    }

    /* Header buttons mobile */
    .header-buttons {
        flex-basis: 100%;
        order: 4;
        justify-content: center;
        margin-left: 0 !important;
    }

    .header-buttons.before-menu {
        order: 4;
    }

    .header-button {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    /* Navigation mobile */
    .main-navigation {
        flex-basis: 100%;
        order: 3;
        margin: 0 !important;
    }

    .main-navigation ul {
        flex-direction: column;
        width: 100%;
        background: #f9f9f9;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        padding: 0.5rem 0;
        display: none;
        gap: 0;
    }

    .main-navigation.toggled ul {
        display: flex;
    }

    .main-navigation li {
        margin: 0;
        border-bottom: 1px solid #e0e0e0;
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        padding: 0.75rem 1rem;
    }

    .site-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .site-preheader {
        font-size: 0.75rem;
        padding: 6px 0;
    }

    .site-header {
        --header-padding-top: 12px;
        --header-padding-bottom: 12px;
    }

    .site-header .container {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

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

    .site-title {
        font-size: 1.125rem;
    }

    .site-description {
        font-size: 0.8125rem;
    }

    .header-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .header-button {
        width: 100%;
        text-align: center;
    }
}

/* Utility Classes */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* Print Styles */
@media print {
    .menu-toggle,
    .main-navigation,
    .skip-link {
        display: none;
    }
}