.card {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 35 / 58;
    flex-direction: column;
    background-color: var(--background);
    box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}

.card > img {
    height: 12.5em;
    width: 100%;
    object-fit: cover;
    object-position: 50% 20%;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5em;
    padding: 1em;
    padding-bottom: 5em;
}

.card-content > h3 {
    font-size: 1.5em;
    font-weight: 450;
    margin: 0;
}

.card-content > p {
    margin: 0;
    display: -webkit-box;
    line-clamp: 6;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-content > a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    background-color: var(--primary);
    border: 2px solid var(--secondary);
    border-radius: 8px;
    box-shadow: 6px 6px 8px rgba(0, 0, 0, 0.1);
    outline: none;
    position: absolute;
    height: 2.5em;
    left: 20%;
    right: 20%;
    bottom: 1.5em;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s ease;
}

.wide-cards {
    grid-template-columns: repeat(2, 555px);
}

.wide-cards .card {
    max-width: 555px;
    aspect-ratio: 1 / 1;
}

.wide-cards p {
    line-clamp: 7;
    -webkit-line-clamp: 7;
}

.card-content a:focus {
    transform: scale(1.12);
}

@media (max-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(2, 350px);
    }

    .wide-cards {
        grid-template-columns: 100%;
    }

    .wide-cards .card {
        width: 100%;
        aspect-ratio: auto;
    }
}

@media (max-width: 1085px) {
    .tags-select {
        flex-direction: row !important;
    }

    .tags > div {
        display: contents;
    }
}

@media (max-width: 768px) {
    #catalogue {
        padding: 60px 5%;
    }

    .card-grid {
        grid-template-columns: 100%;
        gap: 2.5em;
    }

    .card {
        aspect-ratio: auto;
    }
}

@media (hover: hover) and (pointer: fine) {
    .tag-inactive:hover {
        color: #6da2ca !important;
        background-color: #d4e9f2 !important;
    }

    .dark-mode .tag-inactive:hover {
        color: #E5C6A8 !important;
        background-color: #6F6861 !important;
    }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
    .wide-cards .card:hover {
        transform: scale(1.03);
    }

    #client-logos img:hover {
        transform: scale(1.12);
    }

    .card:hover {
        transform: scale(1.06);
        box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.3);
    }

    .card-content > a:hover {
        transform: scale(1.12);
    }

    .tags span:hover {
        transform: scale(1.05);
    }
}

@media (prefers-color-scheme: dark) {
    html:not(.light-mode) .card {
        background-color: var(--background-alt);
    }

    html:not(.light-mode) .tag-inactive {
        color: #a9a297 !important;
        background-color: #282b2d !important;
    }
}

@media (prefers-color-scheme: dark) and (hover: hover) and (pointer: fine) {
    html:not(.light-mode) .tag-inactive:hover {
        color: #E5C6A8 !important;
        background-color: #6F6861 !important;
    }
}

.dark-mode .card {
    background-color: var(--background-alt);
}

.dark-mode .tag-inactive {
    color: #a9a297 !important;
    background-color: #282b2d !important;
}