@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&family=Roboto:wght@400;500&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2em;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    font-family: "Roboto", sans-serif;
}

.container {
    display: flex;
    width: 90vw;
    flex-wrap: wrap; /* Allow items to wrap */
}

.panel {
    background-size: cover;
    background-position: center;
    height: 80vh;
    border-radius: 1em;
    color: white;
    cursor: pointer;
    flex: 0.5;
    margin: 1em;
    position: relative;
    transition: flex 0.5s ease-in;
}

.panel h3 {
    position: absolute;
    bottom: 1em;
    left: 1em;
    margin: 0;
    opacity: 0;
    font-size: 2em;
    transition: opacity 0.3s ease-in 0.4s;
}

.panel.active {
    flex: 3;
}

.panel.active h3 {
    opacity: 1;
}

@media (max-width: 768px) {
    .panel {
        height: 60vh; /* Reduce height */
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
    }

    .panel:nth-of-type(n+4) {
        display: none; /* Hide cards 4 and above */
    }

    .panel {
        margin: 0.5em;
    }

    .panel h3 {
        font-size: 1.5em; /* Smaller font size */
    }
}
