/*---------------Card---------------*/
.main__container{
    display: grid;
    place-items: center;
    margin-inline: 1.5rem;
    padding-block: 5rem;
}
h2 {
    color: brown;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-decoration: underline;
    text-transform: uppercase;
}

.card__container {
    display: grid;
    row-gap: 3.5rem;
}

.card__article {
    position: relative;
    overflow: hidden;
}

.card__img {
    width: 300px;
    border-radius: 1.5rem;
}
.card__data {
    width: 250px;
    background-color: #FFFFE0;
    padding: 1.5rem 2.0rem;
    box-shadow: 0 8px 24px #004225;
    border-radius: 1rem;
    position: absolute;
    bottom: -2rem;
    left: 0;
    right: 0;
    margin-inline: auto;
    opacity: 0;
    transition: opacity 1s 1s;
}
.card__title {
    font-size: 2rem;
    font-weight: 700;
    color:#191970;
    margin-bottom: .75rem;
}
.card__description {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #0020C2;
    margin-bottom: .25rem;
}
.card__button {
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    color: #EB5406;
}
/* Naming animation in hover */
.card__article:hover .card__data {
    animation: show-data 1s forwards;
    opacity: 1;
    transition: opacity 3s;
}
.card__article:hover {
    animation: remove-overflow 2s forwards;
}
.card__article:not (:hover) {
    animation: show-overflow 2s forwards;
}
.card__article:not (:hover) .card__data {
    animation: remove-data 1s forwards;
}
/* Card Animation */
@keyframes show-data {
    50% {
        transform: translateY(-10rem);
    }
    100% {
        transform: translateY(-7rem);
    }
}
@keyframes remove-overflow {
    to {
        overflow: initial;
    }
}
@keyframes remove-data {
    0% {
        transform: translateY(-7rem);
    }
    50% {
        transform: translateY(-10rem);
    }
    100% {
        transform: translateY(.5rem);
    }
}
@keyframes show-overflow {
    0% {
        overflow: initial;
        pointer-events: none;
    }
    50% {
        overflow: hidden;
    }
}

/* ==================== Breakpoints =================*/
/* For Small Devices */
@media screen and (max-width: 340px) {
    .main__container {
        margin-inline: 1rem;
    }
    .card__data {
        width: 205px;
        padding: 1rem;
    }
}

/* For Medium devices */
@media screen and (min-width:768px ) {
    .card__container {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 1.5rem;
    }
}

/* For Large Devices */

@media screen and (min-width: 1120px) {
   
    .card__container{
        grid-template-columns: repeat(4, 2fr);
    }
    .card__img {
        width: 348px;
    }
    .card__data {
        width: 316px;
        padding-inline: 2.5rem;
    }
}