/*
 * Video Component Styles
 */

/* Container for the video and its overlay. */
#homepage-video-section.video-background {
    position: relative;
    width: 100%;
    /* This line uses your existing CSS variable to subtract the header height */
    /* The JavaScript will now dynamically set this height for a more accurate result */
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* The video element itself. */
#homepage-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    display: block;
}

/* The static fallback image. */
#mobile-fallback-image {
    display: none; /* Hide the mobile image by default on desktop */
}

/* The overlay for the text. */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* Heading style in the overlay. */
.video-overlay h1 {
    font-family: 'Caveat', cursive;
    font-size: 3em;
    font-weight: 300;
    margin: 0;
    padding: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Paragraph style in the overlay. */
.video-overlay p {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.5em;
    font-weight: 300;
    margin-top: 10px;
    padding: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/*
 * Media Queries for Responsiveness
 */

@media (max-width: 999px) {
    #homepage-video-section.video-background {
        height: 50vh; /* Set a shorter height on mobile */
    }
    
    #homepage-video {
        display: none; /* Hide the video on mobile */
    }

    #mobile-fallback-image {
        display: block; /* Show the mobile image on mobile */
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .video-overlay h1 {
        font-size: 1.8em; /* Adjust font sizes for smaller screens */
    }
    
    .video-overlay p {
        font-size: 1em;
    }
}