/* Card List View Animations */

.category-container.hidden {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    border-top: none;
}

.category-container.appearing {
    animation: categoryAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes categoryAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-list-grid {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-container.hidden .card-list-grid {
    opacity: 0;
    transform: translateY(-20px);
}

.category-container {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-height: 2000px;
    overflow: hidden;
    margin: 0;
    padding: 12px 15px 14px 15px;
}

.category-container .modal-category {
    margin: 0 0 10px 0;
}

.card-list-grid {
    display: grid;
    gap: 6px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-list-grid.mobile {
    grid-template-columns: repeat(3, 1fr);
}

.card-list-grid.desktop {
    grid-template-columns: repeat(4, 1fr);
}

.card-list-card {
    position: relative;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    height: auto;
    overflow: hidden;
    background: #222; /* Default background color */
}

.card-list-card .background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.card-list-card .background-image.loaded {
    opacity: 1;
}

.card-list-card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.35);
}

.card-list-card .title {
    position: absolute;
    left: 12px;
    top: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
}

.card-list-card .title-text {
    font-family: "aktiv-grotesk-extended", sans-serif;
    font-weight: 800;
    font-style: normal;
    font-size: 0.8em;
    color: #fff;
    text-transform: uppercase;
    hyphens: auto;
    /* Multi-line text truncation with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Desktop-specific card title styling */
.card-list-card .title.desktop .title-text {
    font-size: 1.1em;
} 