.home-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.home-cards.home-cards--products {
    padding: 0;
    list-style: none;
}

.home-cards .home-card {
    position: relative;
    isolation: isolate;
    display: block;
    height: 100%;
    box-sizing: border-box;
    padding: 1px;
    border-radius: 12px;
    background: #45423c;
    color: #f5f2eb;
    text-decoration: none;
}

.home-card::before,
.home-card::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity .4s;
    content: "";
}

.home-card::before {
    z-index: 2;
    background: radial-gradient(220px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 237, 187, .17), transparent 75%);
}

.home-card::after {
    z-index: -1;
    background: radial-gradient(200px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), #f0c14b, transparent 80%);
}

.home-card__surface {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 11px;
    background: #171717;
}

.home-card__surface img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.home-card__label {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 12px 14px;
    color: inherit;
    font-weight: 600;
    line-height: 1.4;
}

.home-cards .home-card:focus-visible {
    outline: 2px solid #f0c14b;
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .home-cards.is-pointing .home-card::after,
    .home-cards.is-pointing .home-card:hover::before { opacity: 1; }
}

@media (max-width: 900px) {
    .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
    .home-cards { grid-template-columns: minmax(0, 1fr); }
}

/* Photos in legacy galleries and content retain their original dimensions. */
.media-image-card {
    position: relative;
    isolation: isolate;
    display: inline-block;
    max-width: 100%;
    vertical-align: middle;
    border-radius: 11px;
    padding: 3px;
    box-sizing: border-box;
    background: #171717;
    box-shadow: inset 0 0 0 1px #45423c;
}

a.media-image-card > img,
a.media-image-card > picture > img {
    display: block;
    max-width: 100%;
    border-radius: 8px;
}

.media-image-card:focus-visible {
    outline: 2px solid #f0c14b;
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    a.media-image-card:hover {
        background: radial-gradient(180px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), #f0c14b, #171717 85%);
    }

    img.media-image-card:hover { box-shadow: inset 0 0 0 1px #f0c14b; }
}
