/* ====================================================
   Carré Vert Créations — Grille Réalisations
   Abalone Studio – v1.0.0
==================================================== */

/* ── Grille ── */
.cvr-grid {
    display: grid;
    grid-template-columns: repeat(var(--cvr-cols, 3), 1fr);
    gap: 12px;
    width: 100%;
}

/* ── Carte ── */
.cvr-card {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    /* ratio 450/800 = 56.25% → on utilise aspect-ratio */
    aspect-ratio: 450 / 800;
    background: #1a1a1a;
}

/* ── Image ── */
.cvr-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Overlay (part du bas, monte vers le haut) ── */
.cvr-card__overlay {
    position: absolute;
    inset: 0;
    /* gradient noir transparent → noir opaque au bas */
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.82) 0%,
        rgba(0, 0, 0, 0.30) 45%,
        rgba(0, 0, 0, 0.00) 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 22px 18px;
    /* État initial : overlay invisible, translateY positif */
    opacity: 0;
    transform: translateY(100%);
    transition:
        opacity  0.42s ease,
        transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── Label ── */
.cvr-card__label {
    color: #ffffff;
    font-family: inherit;
    font-size: clamp(0.85rem, 1.1vw, 1.1rem);
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1.3;
    text-transform: uppercase;
    /* légère ligne verte en dessous du texte */
    padding-bottom: 4px;
    border-bottom: 2px solid #7ab648; /* vert naturel Carré Vert */
}

/* ── Hover ── */
.cvr-card:hover .cvr-card__overlay,
.cvr-card:focus-visible .cvr-card__overlay {
    opacity: 1;
    transform: translateY(0);
}

.cvr-card:hover .cvr-card__img,
.cvr-card:focus-visible .cvr-card__img {
    transform: scale(1.04);
}

/* ── Focus accessible ── */
.cvr-card:focus-visible {
    outline: 3px solid #7ab648;
    outline-offset: 2px;
}

/* ── Message vide ── */
.cvr-empty {
    font-style: italic;
    color: #666;
    padding: 1rem 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .cvr-grid {
        grid-template-columns: repeat(
            min(var(--cvr-cols, 3), 2),
            1fr
        );
    }
}

@media (max-width: 540px) {
    .cvr-grid {
        grid-template-columns: 1fr;
    }
}
