/* Sticky Header - Transparent to White on Scroll */
#masthead,
.ast-theme-transparent-header #masthead {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
}

/* Force transparency on Astra's internal wrappers initially */
#masthead,
#masthead .ast-primary-header-bar,
#masthead .ast-main-header-wrap,
#ast-mobile-header .ast-primary-header-bar {
    background-color: transparent !important;
    background-image: none !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Add a subtle dark gradient from top to bottom to improve text contrast when transparent */
#masthead:not(.header-scrolled)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none; /* Allows clicking through to the menu */
    z-index: -1;
}

/* Improve text and icon legibility when transparent using shadows */
#masthead:not(.header-scrolled) .site-title a,
#masthead:not(.header-scrolled) .site-description,
#masthead:not(.header-scrolled) .main-header-menu .menu-link {
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#masthead:not(.header-scrolled) .ast-mobile-svg {
    fill: #ffffff !important;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.5));
}

#masthead .ast-builder-grid-row {
    transition: padding 0.3s ease;
}

/* Apply background and blur when scrolled */
#masthead.header-scrolled {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Ensure inner wrappers stay transparent so background blur works properly */
#masthead.header-scrolled .ast-primary-header-bar,
#masthead.header-scrolled .ast-main-header-wrap,
#masthead.header-scrolled #ast-mobile-header .ast-primary-header-bar {
    background-color: transparent !important;
}

/* Change text and icon colors when scrolled */
#masthead.header-scrolled .site-title a,
#masthead.header-scrolled .site-description,
#masthead.header-scrolled .main-header-menu .menu-link,
#masthead.header-scrolled .ast-mobile-svg {
    color: #1a1a1a !important;
    fill: #1a1a1a !important;
}

/* Add vertical padding when scrolled */
.ast-builder-grid-row {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}
#masthead.header-scrolled .ast-builder-grid-row {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

/* Ensure content below header doesn't jump since header is fixed */
.site-content {
    margin-top: 0;
}


.image-contain img{
    object-fit: contain !important;
    margin: auto !important;
}