/* Parallax header styles */
.header-section {
    position: relative;
    width: 100%;
    height: 100vh; /* Fallback for browsers that don't support dvh */
    height: 100dvh; /* Dynamic viewport height for mobile */
    overflow: hidden;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    /* Prevent text selection on mobile */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Prevent layout shifts */
    contain: content;
    /* Ensure smooth scrolling on iOS */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
}

/* Fix for mobile viewport height changes */
@supports (height: 100dvh) {
    .header-section {
        height: 100dvh;
    }
}

/* Prevent any horizontal scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.header-background.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    z-index: 1;
}

/* Add readability gradient over the header image only */
.header-background.parallax-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.65) 100%);
    pointer-events: none;
}

/* Content styling */
.header-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 20px;
    box-sizing: border-box;
}

/* Ensure content is below the header */
#content {
    position: relative;
    z-index: 5;
    background: white;
}

/* Adjust header title and logo */
.header-logo {
    width: 600px;
    margin: 0 auto 20px;
    max-width: 70vw;
    margin: 0 auto 20px;
}

.header-title {
    font-size: 1.9rem;
    margin: 20px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Performance optimizations */
.parallax-bg {
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000;
    -webkit-transform: translate3d(0,0,0);
    -webkit-transform-style: preserve-3d;
    backface-visibility: hidden;
    perspective: 1000;
    transform: translate3d(0,0,0);
    transform-style: preserve-3d;
    /* Prevent tap highlight on mobile */
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-tap-highlight-color: transparent;
    /* Prevent callout on tap-hold */
    -webkit-touch-callout: none;
    /* Prevent image dragging */
    -webkit-user-drag: none;
}

/* Disable double-tap zoom on mobile */
@media (max-width: 768px) {
    .header-section {
        touch-action: manipulation;
    }
    
    /* Reset touch-action for interactive elements */
    .header-section a,
    .header-section button,
    .header-section [role="button"] {
        touch-action: manipulation;
    }
}
