@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css');

body {
    font-family: 'Manrope', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header-wrapper {
    padding-left: 7%;
    padding-right: 7%;
    background-color: white;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    height: 7vw;
    padding-left: 7px;
    padding-right: 7px;
}

.header .logo {
    max-height: 8vw;
    width: 150px;
}

.header .links {
    display: flex;
    gap: 20px;
}

.header .links a {
    font-size: 16px;
    text-decoration: none;
    color: inherit;
}

.container {
    margin: 0 auto;
    padding: 0;
    width: 86%;
    flex: 1;
}

.masonry {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    margin: 0;
    box-sizing: border-box;
}

.row {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    align-items: flex-start;
}

.masonry-item {
    position: relative;
    margin: 7px;
    box-sizing: border-box;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease-in-out;
    flex-grow: 1;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border: none;
    margin: 0;
    padding: 0;
}

.masonry-item .description {
    position: absolute;
    top: 0;
    left: 0;
    color: white;
    padding: 10%;
    text-align: left;
    opacity: 0;
    font-weight: 200;
    transition: all 0.3s ease-in-out;
}

.masonry-item .description.bright-bg {
    color: black;
}

.masonry-item:hover .description {
    opacity: 1;
}

.masonry-item .description strong {
    color: inherit;
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.masonry-item .description em {
    display: block;
    font-style: italic;
}

.masonry-item .description .tag {
    display: block;
    font-size: 0.35em;
    text-transform: uppercase;
    background-color: white;
    color: black;
    padding: 2px 5px;
    margin-top: 10px;
    box-sizing: border-box;
}

/* Image Containers */
.col25 {
    flex: 0 0 calc(50% - 14px);
}

.col2 {
    flex: 0 0 calc(40% - 14px);
}

.col3 {
    flex: 0 0 calc(60% - 14px);
}

.col5 {
    flex: 0 0 calc(100% - 14px);
}

/* Text Containers */
.txt25 {
    flex: 0 0 calc(50% - 14px);
    margin: 7px;
    box-sizing: border-box;
    text-align: left;
}

.txt2 {
    flex: 0 0 calc(40% - 14px);
    margin: 7px;
    box-sizing: border-box;
    text-align: left;
}

.txt3 {
    flex: 0 0 calc(60% - 14px);
    margin: 7px;
    box-sizing: border-box;
    text-align: left;
}

.txt5 {
    flex: 0 0 calc(100% - 14px);
    margin: 7px;
    box-sizing: border-box;
    text-align: left;
}

@media (max-width: 1200px) {
    .col2, .col25, .col3, .col5 {
        width: 100%;
        margin-bottom: 14px;
    }
}

@media (max-width: 800px) {

    #animation-container {
        position: relative;
        width: 97%; /* Adjusted to prevent trimming */
    }

    .header-wrapper {
        padding-top: 7%;
    }

    .header {
        flex-direction: column;
        align-items: center;
        height: auto;
    }

    .header .logo {
        max-height: 80px;
        width: auto;
        text-align: center;
        margin-bottom: 10px;
    }

    .header .links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-top: 15px;
        padding-bottom: 15px;
    }

    .container {
        padding-top: 5vw;
    }

    .col2, .col25, .col3, .col5 {
        width: 100%;
    }

    .row {
        flex-direction: column;
    }

    /* New Behavior: Show description for center image only */
    .masonry-item .description {
        opacity: 0;
        transition: opacity 0.8s ease-in-out;

    }

    .masonry-item.in-view .description {
        opacity: 1; /* Fade-in effect for the center image */
    }
}

.footer {
    text-align: center;
    padding: 20px;
    background-color: #ffffff;
    font-size: 16px;
}

/* Style for the animation container - FIXED FOR 4 IMAGES */
#animation-container {
    position: relative;
    width: 97%; /* Adjusts to parent container */
    aspect-ratio: 16 / 9; /* Ensures proper aspect ratio */
    overflow: hidden;
}

.frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure images fill without distortion */
}

/* Display the active frame with a delay - Updated for 4 images with smooth loop */
.frame:nth-child(1) {
    animation: fadeAnimation 4s steps(1, end) infinite 0s;
}
.frame:nth-child(2) {
    animation: fadeAnimation 4s steps(1, end) infinite 1s;
}
.frame:nth-child(3) {
    animation: fadeAnimation 4s steps(1, end) infinite 2s;
}
.frame:nth-child(4) {
    animation: fadeAnimation 4s steps(1, end) infinite 3s;
}

@keyframes fadeAnimation {
    0%, 25% { opacity: 1; }
    25.01%, 100% { opacity: 0; }
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}