/* =========================================================
   KAKO GOURMET · QUESOS
   Requiere Estilos-Kako.css (variables, header, footer, hero, split, process)
   Este archivo solo estiliza la galería 3x2 (paleta cálida)
   ========================================================= */

#galeria { padding: 4rem 0 6rem; background: var(--bg-white); }

.meat-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6rem;
    padding: 0 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #1a1208;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.5s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.9s cubic-bezier(0.25, 1, 0.5, 1);
    isolation: isolate;
}
.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.gallery-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.9s cubic-bezier(0.25, 1, 0.5, 1);
    filter: saturate(1.05);
}
.gallery-item:hover .gallery-image { transform: scale(1.12); }

/* Overlay temática queso · degradado marrón cálido */
.item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(42,20,5,0.94) 0%,
        rgba(42,20,5,0.55) 45%,
        rgba(42,20,5,0.15) 75%,
        transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 1.8rem 1.6rem;
    text-align: left;
    color: #fff;
    transition: background 0.5s ease;
}
.gallery-item:hover .item-overlay {
    background: linear-gradient(to top,
        rgba(42,20,5,0.97) 0%,
        rgba(42,20,5,0.78) 55%,
        rgba(42,20,5,0.35) 100%);
}

.item-overlay::before {
    content: '';
    position: absolute;
    top: 1.4rem; left: 1.6rem;
    width: 28px; height: 2px;
    background: var(--gold-accent);
    transition: width 0.5s ease;
}
.gallery-item:hover .item-overlay::before { width: 64px; }

.item-overlay h3 {
    color: var(--gold-light);
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.15rem, 1.6vw, 1.55rem);
    margin-bottom: 0.4rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
    line-height: 1.15;
}
.item-overlay .origin {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.7rem;
    margin-bottom: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
}
.item-overlay .info-text {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    line-height: 1.55;
    font-style: italic;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.4s ease, margin-top 0.4s ease;
}
.gallery-item:hover .info-text {
    max-height: 260px;
    opacity: 1;
    margin-top: 0.6rem;
}

/* RESPONSIVE ------------------------------------------------------ */
@media (max-width: 1024px) {
    .meat-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
    .item-overlay .info-text { max-height: 260px; opacity: 1; margin-top: 0.6rem; }
    .item-overlay::before { width: 50px; }
}

@media (max-width: 640px) {
    #galeria { padding: 3rem 0 4rem; }
    .meat-gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 0 5%;
    }
    .gallery-item { aspect-ratio: 3 / 4; }
    .item-overlay { padding: 1.5rem 1.4rem; }
    .item-overlay h3 { font-size: 1.35rem; }
}

@media (max-width: 400px) {
    .gallery-item { aspect-ratio: 4 / 5; }
}
