/* ===== Hero/Opening Section Styles ===== */

/* CSS Variables for maintainability */
:root {
    --overlay-bg: rgba(0, 0, 0, 0.4);
    --text-shadow: 0.2em 0.2em 0.2em rgba(0, 0, 0, 1);
    --hero-height: 90vh;
    --hero-h1-size: clamp(2.5rem, 6vw, 5rem);
    --hero-h2-size: clamp(1.7rem, 4vw, 3rem);
    --hero-h3-size: clamp(1.2rem, 3vw, 2rem);
}

/* Main text container */
.main_text_opening {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

/* Spacer element (hidden dot for layout) */
.space {
    display: block;
    opacity: 0;
    pointer-events: none;
}

/* Overlay text on hero image */
.text-over-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--overlay-bg);
    border-radius: 1em;
    padding: 2%;
    text-align: center;
    text-shadow: var(--text-shadow);
    z-index: 10;
}

.text-over-image h1 {
    font-size: var(--hero-h1-size);
}

.text-over-image h2 {
    font-size: var(--hero-h2-size);
}

.text-over-image h3 {
    font-size: var(--hero-h3-size);
}

/* Image container wrapper */
.image-container {
    user-select: none;
    position: relative;
    height: 80%;
}

.main-picture-container {
    overflow: hidden;
    height: 100%;
    position: relative;
}

/* Main hero image */
#main_picture {
    width: 100%;
    height: var(--hero-height);
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Second picture (hidden by default, shown on very large screens) */
.second-picture {
    display: none;
}

/* Animated text effect */
.animated-text {
    word-wrap: break-word;
    white-space: nowrap;
    line-height: 1.3;
    animation: tracking-in-expand 1.7s ease-out;
}

/* Animation: expanding letter spacing */
@keyframes tracking-in-expand {
    0% {
        letter-spacing: -0.7em;
        opacity: 0;
    }
    40% {
        opacity: 0.6;
    }
    100% {
        letter-spacing: normal;
        opacity: 1;
    }
}

/* ===== Responsive Design ===== */

/* Very large screens: dual image layout */
@media (min-width: 2700px) {
    .main-picture-container {
        display: flex;
        width: 100vw;
        height: 100vh;
    }

    #main_picture, 
    .second-picture {
        width: 50vw;
        height: 100vh;
        object-fit: cover;
        object-position: center;
        display: block;
    }
}

/* Tablet and smaller */
@media (max-width: 1000px) {
    .text-over-image {
        padding: 1%;
        font-size: clamp(14px, 2vw + 14px, 28px);
    }
}

/* Mobile */
@media (max-width: 600px) {
    :root {
        --hero-h1-size: clamp(2.4rem, 9vw, 3.6rem);
        --hero-h2-size: clamp(1.4rem, 5.5vw, 2.3rem);
        --hero-h3-size: clamp(1.05rem, 4.2vw, 1.6rem);
    }

    .space {
        display: block;
        flex-basis: 100%;
        height: 0;
        font-size: 0;
        line-height: 0;
    }

    .main_text_opening {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        white-space: normal;
        font-size: clamp(16px, 2vw + 16px, 32px);
    }

    .text-over-image h1 {
        font-size: var(--hero-h1-size);
    }

    .text-over-image h2 {
        font-size: var(--hero-h2-size);
    }

    .text-over-image h3 {
        font-size: var(--hero-h3-size);
    }

    .animated-text {
        animation: none;
    }

    .animated-text h1 {
        animation: tracking-in-expand 1.7s ease-out;
    }
}