/* --------------------------------------------------------------------------- */
/* Front Page Slider Cards Styles                                              */
/* --------------------------------------------------------------------------- */

.slider-container {
    position: relative;
    width: 100%;
}

.slider {
    width: 100%;
}

.slider-cards {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 0 auto;
    padding: 10px;
    max-width: 1000px;
}

.card {
    position: relative;
    border-radius: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 180px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 25%;
    z-index: 0;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.card.visible {
    opacity: 1;
    visibility: visible;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 1.2rem;
    color: var(--teal);
    padding-bottom: 10px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    height: 1.2em;
    overflow: hidden;
}

.card-excerpt {
    font-size: 0.8rem;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 5px;
    max-height: 4.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.button {
    display: inline-block;
    text-align: center;
    background-color: var(--teal);
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: var(--yellow);
    color: var(--teal);
    text-decoration: none;
}

/* --------------------------------------------------------------------------- */
/* Responsive hiding of card-containers                                        */
/* --------------------------------------------------------------------------- */

@media (max-width: 1500px) {
    .card-container:nth-child(3),
    .card-container:nth-child(4) {
        display: none;
    }
}

@media (max-width: 1200px) {
    .card-container:nth-child(2),
    .card-container:nth-child(3),
    .card-container:nth-child(4) {
        display: none;
    }
}

/* 
NOTE: This last media query hides ALL .card-containers at <= 1200px,
which overlaps with the previous one. 
If intentional, keep it, otherwise remove or adjust. 
*/

@media (max-width: 1200px) {
    .card-container:nth-child(1),
    .card-container:nth-child(2),
    .card-container:nth-child(3),
    .card-container:nth-child(4) {
        display: none;
    }
}
