:root {
    --transition: 300ms;
    --header-bg: #0d6efd;
    --menu-bg: #f1f1f1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    row-gap: 20px;
    column-gap: 30px;
}

@media (max-width:900px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:600px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cell-grid {
    position: relative;
    width: 80%;
    aspect-ratio: 3 / 2; /* 100% ancho, 50% alto */
    overflow: hidden;
    --border-radius: 10px;
    --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.cell-grid>a {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;  /* centra verticalmente */
    justify-content: center; /* centra horizontalmente */
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.cell-grid img {
    width: 100%;
    object-fit: cover;
    transition: transform var(--transition) ease, filter var(--transition) ease;
    will-change: transform;
}

.cell-grid:hover img, .cell-grid:focus-within img {
    transform: scale(1.12);
    filter: contrast(1.03) saturate(1.02);
}