/**
 * @license MIT, https://opensource.org/license/MIT
 */

.cards .card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.cards .card-list.cols-1 {
    grid-template-columns: 1fr;
}

.cards .card-item {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    border: 1px solid var(--pico-muted-border-color);
    border-top: 0.2rem solid var(--pico-primary);
    background-color: var(--pico-contrast-background);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.cards .card-item:hover {
    border-color: var(--pico-primary);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .cards .card-item:hover {
        transform: translateY(-0.2rem);
    }
}

.cards .card-image {
    display: block;
    margin: -2rem -2rem 1.75rem;
}

.cards .card-item picture {
    display: block;
    aspect-ratio: 16 / 10;
    margin: -2rem -2rem 1.75rem;
    overflow: hidden;
}

.cards .card-image picture {
    margin: 0;
}

.cards .card-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .cards .card-item:hover img {
        transform: scale(1.025);
    }
}

.cards .card-item .title {
    margin: 0 0 1rem;
    color: var(--pico-contrast);
    font-size: calc(var(--pico-font-size) * 1.05);
    font-weight: 700;
}

.cards .card-item .cms-text {
    color: var(--pico-muted-color);
    font-size: calc(var(--pico-font-size) * 0.85);
    line-height: 1.65;
}

.cards .card-item .cms-text > :last-child {
    margin-bottom: 0;
}

.cards .card-list.layout-catalog .card-item {
    border: 0;
}

.cards .card-list.layout-catalog .card-image,
.cards .card-list.layout-catalog .card-item > picture {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 7rem;
    margin: 0 0 1.75rem;
    border-bottom: 1px solid #ccc;
}

.cards .card-list.layout-catalog .card-image picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    margin: 0;
}

.cards .card-list.layout-catalog .card-item > picture {
    aspect-ratio: auto;
}

.cards .card-list.layout-catalog .card-item img {
    width: auto;
    max-width: 100%;
    height: 5rem;
    object-fit: contain;
}

@media screen and (min-width: 768px) {
    .cards .card-list.cols-auto,
    .cards .card-list.cols-2,
    .cards .card-list.cols-3,
    .cards .card-list.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 992px) {
    .cards .card-list.cols-auto,
    .cards .card-list.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

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


footer.cms-content > .cards > .container {
    max-width: 1140px !important;
    padding: 32px 20px;
}

footer.cms-content .cards .card-list {
    grid-template-columns: 1fr;
    justify-self: auto;
    gap: 0;
    padding: 20px 0;
}

@media screen and (min-width: 768px) {
    footer.cms-content .cards .card-list {
        display: block;
        column-count: 3;
        column-gap: 0;
    }

    footer.cms-content .cards .card-item {
        break-inside: avoid;
    }
}

footer.cms-content .cards .card-item {
    width: min(100%, 240px);
    min-width: 0;
    margin-inline: auto;
    background-color: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    text-align: start;
}

footer.cms-content .cards .card-item:has(.card-image):not(:has(.cms-text ul)) {
    padding-block: 40px;
}

footer.cms-content .cards .card-item:hover {
    box-shadow: none;
    transform: none;
}

footer.cms-content .cards :is(.title, .cms-text h2) {
    color: var(--pico-contrast);
    font-size: 20px;
    font-weight: 700;
    line-height: 24px;
    text-align: start;
}

footer.cms-content .cards .title {
    width: min(100%, 12em);
    margin: 0.5em auto;
}

footer.cms-content .cards .cms-text h2 {
    margin: 40px 0 16px;
}

footer.cms-content .cards .card-item:last-child .title,
footer.cms-content .cards .card-item:has(.card-image):not(:has(.cms-text ul)) .title,
footer.cms-content .cards .card-item:has(.cms-text img):not(:has(.cms-text ul)) .title,
footer.cms-content .cards .cms-text h2:has(+ p img) {
    display: none;
}

footer.cms-content .cards :is(.text, .cms-text) {
    color: var(--pico-contrast);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
}

footer.cms-content .cards :is(.text, .cms-text) p {
    line-height: 1.5;
    margin: 0;
}

footer.cms-content .cards :is(.text, .cms-text) a,
footer.cms-content .cards :is(.text, .cms-text) a:visited,
footer.cms-content .cards :is(.text, .cms-text) a:hover,
footer.cms-content .cards :is(.text, .cms-text) a:focus,
footer.cms-content .cards :is(.text, .cms-text) a:active {
    color: var(--pico-contrast);
    text-decoration: none;
    padding: 0;
}

footer.cms-content .cards :is(.text, .cms-text) a:hover {
    color: var(--pico-primary-hover);
}

footer.cms-content .cards :is(.text, .cms-text) ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

footer.cms-content .cards :is(.text, .cms-text) li {
    padding: 3px 0;
    list-style: none;
    line-height: 24px;
}

footer.cms-content .cards :is(.text, .cms-text) li::marker {
    content: "";
}

footer.cms-content .cards .cms-text img {
    display: block;
    width: auto;
    max-width: 160px;
    height: auto;
    max-height: none;
    object-fit: contain;
    transform: none;
}

footer.cms-content .cards .cms-text p:has(img) {
    padding: 40px 0;
}

footer.cms-content .cards .card-image {
    width: min(160px, 100%);
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

footer.cms-content .cards .card-item picture {
    width: min(160px, 100%);
    aspect-ratio: auto;
    margin: 0 auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

footer.cms-content .cards .card-image picture {
    width: 100%;
    margin: 0;
}

footer.cms-content .cards .card-item picture img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

footer.cms-content .cards .card-item:last-child .cms-text ul {
    display: grid;
    grid-template-columns: max-content;
    width: min(160px, 100%);
    margin: 32px auto 0;
    justify-items: start;
    gap: 0;
}

footer.cms-content .cards .card-item:last-child .cms-text li {
    padding: 0;
}

footer.cms-content .cards .card-item:last-child .cms-text li a {
    --footer-social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.4 10.7 5.3 9.6l4.3-4.3 1.1 1.1-4.3 4.3ZM4.2 12.9l-1.1-1.1a3 3 0 0 1 0-4.2l2.1-2.1 1.1 1.1-2.1 2.1a1.5 1.5 0 0 0 0 2.1l1.1 1.1a1.5 1.5 0 0 0 2.1 0l2.1-2.1 1.1 1.1L8.5 13a3 3 0 0 1-4.3-.1Zm5.5-3.4L8.6 8.4l2.1-2.1a1.5 1.5 0 0 0 0-2.1L9.6 3.1a1.5 1.5 0 0 0-2.1 0L5.4 5.2 4.3 4.1 6.4 2a3 3 0 0 1 4.2 0l1.1 1.1a3 3 0 0 1 0 4.2L9.7 9.5Z'/%3E%3C/svg%3E");
    display: grid;
    grid-template-columns: 44px auto;
    align-items: center;
    gap: 8px;
    width: 160px;
    min-height: 60px;
    padding: 8px 0;
    font-size: 14.5px;
    line-height: 14.5px;
}

footer.cms-content .cards .card-item:last-child .cms-text li a::before {
    width: 44px;
    height: 44px;
    background-color: currentColor;
    content: "";
    -webkit-mask-image: var(--footer-social-icon);
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-image: var(--footer-social-icon);
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
}

footer.cms-content .cards .card-item:last-child .cms-text a[href*="github.com"] {
    --footer-social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82A7.65 7.65 0 0 1 8 4.58c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z'/%3E%3C/svg%3E");
}

footer.cms-content .cards .card-item:last-child .cms-text a[href*="youtube.com"] {
    --footer-social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4 2h8a4 4 0 0 1 4 4v4a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4Zm3 3.5v5L11.5 8 7 5.5Z'/%3E%3C/svg%3E");
}

footer.cms-content .cards .card-item:last-child .cms-text a[href*="mastodon."] {
    --footer-social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M15.5 9.3c-.2 1.3-1.8 2.8-3.6 3.1-.9.2-1.8.3-2.8.2-1.6-.1-2.9-.4-2.9-.4v.7c.2 1.4 1.4 1.5 2.9 1.6 1.5 0 2.8-.4 2.8-.4l.1 1.3s-1 .6-2.9.7c-1 .1-2.2 0-3.6-.4-2.9-.8-3.4-4-3.5-7.2V5.8c0-3.3 2.2-4.3 2.2-4.3C5.3 1 7.2.8 9 .8h.1c1.8 0 3.7.2 4.8.7 0 0 2.2 1 2.2 4.3 0 0 0 2.4-.6 3.5ZM13.2 6V4.4c0-1.3-.8-2-1.9-2-1.2 0-1.8.8-2.2 1.4l-.5.8-.5-.8C7.7 3.2 7 2.4 5.9 2.4c-1.1 0-1.9.7-1.9 2V9h1.8V4.6c0-.5.2-.8.7-.8s.8.3.8 1v2.5h1.8V4.8c0-.7.3-1 .8-1 .5 0 .7.3.7.8V9h1.8V6Z'/%3E%3C/svg%3E");
}

footer.cms-content .cards .card-item:last-child .cms-text a[href*="facebook.com"] {
    --footer-social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 3h3V0H9C6.8 0 5 1.8 5 4v2H2v3h3v7h3V9h3l1-3H8V4c0-.6.4-1 1-1Z'/%3E%3C/svg%3E");
}

footer.cms-content .cards .card-item:last-child .cms-text :is(a[href*="twitter.com"], a[href*="x.com"]) {
    --footer-social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 1h3.5l3.8 5L12.5 1H15L9.5 7.7 15 15h-3.5L7.3 9.4 2.5 15H0l6.1-7.3L1 1Z'/%3E%3C/svg%3E");
}

footer.cms-content .cards .card-item:last-child .cms-text a[href$="/contact"] {
    --footer-social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M0 3h16v10H0V3Zm2 2 6 4 6-4H2Zm12 6V7l-6 4-6-4v4h12Z'/%3E%3C/svg%3E");
}


footer.cms-content .cards h2 {
    color: var(--pico-contrast);
}
