* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1a1a1a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 20px;
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1300px;
}

.item {
    width: 240px;
    height: 360px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
    text-decoration: none;
    overflow: hidden;
    border-radius: 12px;
}

@media (max-width: 780px) {
    .container {
        gap: 10px;
        padding: 0 10px;
    }
    
    .item {
        width: calc((100% - 20px) / 3);
        height: 0;
        padding-bottom: calc((100% - 20px) / 3 * 1.5);
    }
}

.item:hover {
    filter: grayscale(0%);
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 30%;
}

.overlay-hidden {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 30%;
}

.item:hover .overlay,
.item:hover .overlay-hidden {
    opacity: 1;
}

.overlay span,
.overlay-hidden span {
    color: #fff;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

@media (max-width: 780px) {
    .overlay span,
    .overlay-hidden span {
        font-size: 11px;
    }
}

/* --- ESTADO DE CARGA (SKELETON OSCURO) --- */
.item.is-loading {
    background-color: #1a1a1a !important; /* Gris muy oscuro casi negro */
    position: relative;
    overflow: hidden;
}

/* El brillo animado en tonos oscuros */
.skeleton-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: none;
    background: linear-gradient(
        90deg, 
        #1a1a1a 25%, 
        #252525 50%, 
        #1a1a1a 75%
    );
    background-size: 200% 100%;
    animation: placeholderShimmer 2s infinite linear;
}

.item.is-loading .skeleton-shimmer {
    display: block;
}

/* --- TRANSICIÓN DE APARICIÓN --- */
.item {
    transition: background-image 0.8s ease-in-out, background-color 0.8s ease-in-out;
    background-size: cover;
    background-position: center;
}

/* Ocultar contenido mientras carga para que no estorbe al skeleton */
.item.is-loading .overlay, 
.item.is-loading .overlay-hidden {
    opacity: 0;
}

.overlay, .overlay-hidden {
    transition: opacity 0.8s ease-in-out;
}

/* --- ANIMACIÓN --- */
@keyframes placeholderShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}