/**
 * Premium Header Styles for Märsta Centrum
 */

:root {
    --header-height-full: 110px;
    --header-height-shrink: 80px;
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-text: #1a1a1a;
    --header-accent: #0099cc; /* Primary Blue */
    --header-accent-dark: #0077a3;
    --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Enable native smooth scrolling and offset for the fixed header */
html {
    scroll-behavior: smooth;
    /* Uses the shrunk header height + a 2rem breathing room buffer */
    scroll-padding-top: calc(var(--header-height-shrink) + 2rem);
}

.site-header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed; /* Fixed for the shrink effect */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0;
    height: var(--header-height-full);
    display: flex;
    align-items: center;
    transition: var(--transition-smooth);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Fix for WordPress Admin Bar */
.admin-bar .site-header {
    top: 32px;
}
.admin-bar {
    scroll-padding-top: calc(var(--header-height-shrink) + 2rem + 32px);
}
@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
    .admin-bar {
        scroll-padding-top: calc(var(--header-height-shrink) + 2rem + 46px);
    }
}

/* Offset for fixed header */
#page {
    padding-top: var(--header-height-full);
}

/* Scrolled state */
.site-header.is-shrunk {
    height: var(--header-height-shrink);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.98);
}

.site-header .site-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-max, 1400px); /* Slightly wider for premium feel */
    width: 100%;
    margin: 0 auto;
    padding: 0 3rem;
}

.site-branding {
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.site-header.is-shrunk .site-branding {
    transform: scale(0.9);
}

.site-logo {
    height: 55px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

/* Desktop Navigation */
.main-navigation {
    flex-grow: 1;
    display: flex;
    justify-content: center; /* Center the links */
}

.header-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2.5rem; /* More generous spacing */
    align-items: center;
}

.header-menu li {
    position: relative;
}

.header-menu a {
    text-decoration: none;
    color: var(--header-accent);
    font-family: 'Anton', sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: var(--transition-smooth);
    padding: 0.5rem 0;
    position: relative;
}

.header-menu a:hover {
    color: var(--header-text);
}

/* Premium Underline Animation */
.header-menu a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--header-accent);
    transition: var(--transition-smooth);
    border-radius: 2px;
}

.header-menu a:hover::after {
    width: 100%;
}

/* Subtle Separators - Using dots instead of bars for a cleaner look */
.header-menu li:not(:last-child)::before {
    content: "";
    position: absolute;
    right: -1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: rgba(0, 153, 204, 0.3);
    border-radius: 50%;
}

/* Search Bar - Refined */
.header-search {
    flex-shrink: 0;
    margin-left: 2rem;
}

.header-search .search-form {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #1a1a1a;
    border-radius: 30px; /* Fully rounded */
    padding: 0.2rem 1.2rem;
    transition: var(--transition-smooth);
    width: 260px;
    position: relative;
}

.header-search .search-form:hover {
    border-color: var(--header-accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.header-search .search-form:focus-within {
    border-color: var(--header-accent);
    box-shadow: 0 4px 15px rgba(0, 153, 204, 0.15);
    width: 300px; /* Expands on focus */
}

.header-search .search-field {
    border: none;
    background: transparent;
    font-family: 'Anton', sans-serif;
    font-size: 0.95rem;
    color: #1a1a1a;
    outline: none;
    padding: 0.4rem 0;
    width: 100%;
    letter-spacing: 0.02em;
}

.header-search .search-field::placeholder {
    color: #888;
    font-weight: 400;
    text-transform: none; /* Keep placeholder natural */
}

.header-search .search-submit {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    color: #1a1a1a;
}

.header-search .search-submit:hover {
    color: var(--header-accent);
    transform: scale(1.1);
}

/* Hamburger Menu - Sophisticated */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1100;
}

.hamburger-box {
    width: 32px;
    height: 20px;
    display: inline-block;
    position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 32px;
    height: 2px;
    background-color: var(--header-text);
    position: absolute;
    transition: var(--transition-smooth);
    border-radius: 4px;
}

.hamburger-inner {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-inner::before {
    content: "";
    top: -9px;
}

.hamburger-inner::after {
    content: "";
    bottom: -9px;
}

/* Mobile Navigation Overlay */
.mobile-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    clip-path: circle(0% at 100% 0%); /* Modern reveal effect */
    transition: clip-path 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-navigation.is-open {
    clip-path: circle(150% at 100% 0%);
}

.mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.mobile-menu li {
    margin: 2rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.mobile-navigation.is-open .mobile-menu li {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for mobile links */
.mobile-navigation.is-open li:nth-child(1) { transition-delay: 0.2s; }
.mobile-navigation.is-open li:nth-child(2) { transition-delay: 0.3s; }
.mobile-navigation.is-open li:nth-child(3) { transition-delay: 0.4s; }
.mobile-navigation.is-open li:nth-child(4) { transition-delay: 0.5s; }
.mobile-navigation.is-open li:nth-child(5) { transition-delay: 0.6s; }

.mobile-menu a {
    text-decoration: none;
    color: var(--header-accent);
    font-family: 'Anton', sans-serif;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 1200px) {
    .header-menu {
        gap: 1.5rem;
    }
    
    .header-menu a {
        font-size: 1.1rem;
    }
}

@media (max-width: 1024px) {
    .main-navigation {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .site-header {
        height: 80px;
    }
    
    .header-search {
        margin-left: auto;
        margin-right: 1.5rem;
    }

    .header-search .search-form {
        width: 200px;
    }
    
    .header-search .search-form:focus-within {
        width: 240px;
    }
}

@media (max-width: 600px) {
    .site-container {
        padding: 0 1.5rem;
    }
    
    .header-search {
        display: none;
    }
    
    .site-logo {
        height: 45px;
    }
}

/* Hamburger Active State */
.menu-toggle.is-active .hamburger-inner {
    background-color: transparent;
}

.menu-toggle.is-active .hamburger-inner::before {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-active .hamburger-inner::after {
    transform: translateY(-9px) rotate(-45deg);
}
