/* =================================================================
   ASTRA HEADER — Responsive to Theme Toggle
   ================================================================= */

/* ─────────────────────────────────────────────────────────────── */
/* Specificity Fix: Ensure these rules override Astra defaults    */
/* ─────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════ */
/*  LIGHT MODE (default & explicit)                                 */
/* ═══════════════════════════════════════════════════════════════ */

/* Standard pages (Contatti, Blog, etc.) — LIGHT header */
html:not([data-theme="dark"]) body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead,
html:not([data-theme="dark"]) body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead .main-header-bar,
html:not([data-theme="dark"]) body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead .ast-primary-header-bar {
    background: var(--header-bg-light) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid var(--header-border-light) !important;
    box-shadow: 0 1px 3px var(--header-shadow-light) !important;
}

html:not([data-theme="dark"]) body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead a {
    color: var(--header-text-light) !important;
}

html:not([data-theme="dark"]) body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead a:hover {
    color: var(--moodhera-pink) !important;
}

/* Home/Eventi/Chi-siamo — LIGHT mode (clear header on hero pages) */
html:not([data-theme="dark"]) body.page-template-page-eventi #masthead,
html:not([data-theme="dark"]) body.page-template-page-chi-siamo #masthead,
html:not([data-theme="dark"]) body.home #masthead,
html:not([data-theme="dark"]) body.page-template-page-eventi #masthead .main-header-bar,
html:not([data-theme="dark"]) body.page-template-page-chi-siamo #masthead .main-header-bar,
html:not([data-theme="dark"]) body.home #masthead .main-header-bar,
html:not([data-theme="dark"]) body.page-template-page-eventi #masthead .ast-primary-header-bar,
html:not([data-theme="dark"]) body.page-template-page-chi-siamo #masthead .ast-primary-header-bar,
html:not([data-theme="dark"]) body.home #masthead .ast-primary-header-bar {
    background: var(--header-bg-light-hero) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid var(--header-border-light) !important;
    box-shadow: 0 1px 3px var(--header-shadow-light) !important;
}

html:not([data-theme="dark"]) body.page-template-page-eventi #masthead a,
html:not([data-theme="dark"]) body.page-template-page-chi-siamo #masthead a,
html:not([data-theme="dark"]) body.home #masthead a {
    color: var(--header-text-light) !important;
}

html:not([data-theme="dark"]) body.page-template-page-eventi #masthead a:hover,
html:not([data-theme="dark"]) body.page-template-page-chi-siamo #masthead a:hover,
html:not([data-theme="dark"]) body.home #masthead a:hover {
    color: var(--moodhera-pink) !important;
}

html:not([data-theme="dark"]) body.page-template-page-eventi .ast-mobile-menu-trigger-fill,
html:not([data-theme="dark"]) body.page-template-page-chi-siamo .ast-mobile-menu-trigger-fill,
html:not([data-theme="dark"]) body.home .ast-mobile-menu-trigger-fill {
    background: var(--header-mobile-bg-light) !important;
}

/* ═══════════════════════════════════════════════════════════════ */
/*  DARK MODE                                                        */
/* ═══════════════════════════════════════════════════════════════ */

/* Standard pages — DARK header */
[data-theme="dark"] body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead,
[data-theme="dark"] body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead .main-header-bar,
[data-theme="dark"] body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead .ast-primary-header-bar {
    background: var(--header-bg-dark) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid var(--header-border-dark) !important;
    box-shadow: none !important;
}

[data-theme="dark"] body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead a {
    color: var(--header-text-dark) !important;
}

[data-theme="dark"] body:not(.page-template-page-eventi):not(.page-template-page-chi-siamo):not(.home) #masthead a:hover {
    color: var(--header-hover-dark) !important;
}

/* Home/Eventi/Chi-siamo — DARK translucent header */
[data-theme="dark"] body.page-template-page-eventi #masthead,
[data-theme="dark"] body.page-template-page-chi-siamo #masthead,
[data-theme="dark"] body.home #masthead,
[data-theme="dark"] body.page-template-page-eventi #masthead .main-header-bar,
[data-theme="dark"] body.page-template-page-chi-siamo #masthead .main-header-bar,
[data-theme="dark"] body.home #masthead .main-header-bar,
[data-theme="dark"] body.page-template-page-eventi #masthead .ast-primary-header-bar,
[data-theme="dark"] body.page-template-page-chi-siamo #masthead .ast-primary-header-bar,
[data-theme="dark"] body.home #masthead .ast-primary-header-bar {
    background: var(--header-bg-dark-hero) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid var(--header-border-dark-hero) !important;
    box-shadow: none !important;
}

[data-theme="dark"] body.page-template-page-eventi #masthead a,
[data-theme="dark"] body.page-template-page-chi-siamo #masthead a,
[data-theme="dark"] body.home #masthead a {
    color: var(--header-text-dark-hero) !important;
}

[data-theme="dark"] body.page-template-page-eventi #masthead a:hover,
[data-theme="dark"] body.page-template-page-chi-siamo #masthead a:hover,
[data-theme="dark"] body.home #masthead a:hover {
    color: var(--header-hover-dark-hero) !important;
}

[data-theme="dark"] body.page-template-page-eventi .ast-mobile-menu-trigger-fill,
[data-theme="dark"] body.page-template-page-chi-siamo .ast-mobile-menu-trigger-fill,
[data-theme="dark"] body.home .ast-mobile-menu-trigger-fill {
    background: var(--header-mobile-bg-dark) !important;
}

/* ═══════════════════════════════════════════════════════════════ */
/*  MOBILE FLYOUT MENUS                                             */
/* ═══════════════════════════════════════════════════════════════ */

.page-template-page-eventi .ast-mobile-header-content,
.page-template-page-eventi #ast-hfb-mobile-header,
.page-template-page-chi-siamo .ast-mobile-header-content,
.page-template-page-chi-siamo #ast-hfb-mobile-header,
.home .ast-mobile-header-content,
.home #ast-hfb-mobile-header {
    background: var(--header-mobile-menu-bg) !important;
    backdrop-filter: blur(12px);
}

.page-template-page-eventi .ast-mobile-header-content .main-navigation a,
.page-template-page-eventi .ast-mobile-header-content .ast-nav-menu > li > a,
.page-template-page-chi-siamo .ast-mobile-header-content .main-navigation a,
.page-template-page-chi-siamo .ast-mobile-header-content .ast-nav-menu > li > a,
.home .ast-mobile-header-content .main-navigation a,
.home .ast-mobile-header-content .ast-nav-menu > li > a {
    color: var(--header-text-dark-hero) !important;
    border-bottom-color: var(--header-border-dark) !important;
}

/* ═══════════════════════════════════════════════════════════════ */
/*  STICKY / FIXED HEADER BEHAVIOR                                  */
/* ═══════════════════════════════════════════════════════════════ */

#masthead {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: var(--z-fixed);
    transition: background var(--transition-base), 
                border-color var(--transition-base),
                box-shadow var(--transition-base);
}

/* Ensure non-hero pages have padding to account for fixed header */
body:not(.home):not(.page-template-page-eventi):not(.page-template-page-chi-siamo) .site-content {
    padding-top: var(--moodhera-header-height);
}

/* Hero pages: no extra padding needed since hero height is already reduced */
body.home .site-content,
body.page-template-page-eventi .site-content,
body.page-template-page-chi-siamo .site-content {
    padding-top: 0;
}

/* ═══════════════════════════════════════════════════════════════ */
/*  HEADER TYPOGRAPHY - Soft, readable font                         */
/* ═══════════════════════════════════════════════════════════════ */

#masthead a,
#masthead .main-header-bar a,
#masthead .ast-primary-header-bar a,
#masthead .site-navigation a,
#masthead .main-header-menu a {
    font-family: var(--font-header) !important;
    font-weight: var(--font-weight-header) !important;
    letter-spacing: 0.01em;
}

