/*
|--------------------------------------------------------------------------
| Se mantiene el CSS anterior (con estilos para el grid, candado y modal)
|--------------------------------------------------------------------------
| Asegúrate de que este archivo esté en 'css/styles.css'.
*/

/* RESET BOX MODEL */
* {
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

/* BODY STYLING */
body {
    font-family: 'Raleway', sans-serif; 
    background-color: #202125; 
}

/* GALLERY HEADING, GALLERY GRID, IMG-BOX, IMAGE, CAPTION... (Mantenemos el estilo anterior) */
.heading {
    text-align: center;
    font-size: 2.0em;
    letter-spacing: 1px;
    padding: 40px;
    color: white;
}

.gallery-image {
    padding: 20px;
    display: flex;
    flex-wrap: wrap; 
    justify-content: center; 
}

.img-box {
    box-sizing: content-box;
    margin: 10px;
    height: 250px;
    width: 350px;
    overflow: hidden; 
    display: inline-block;
    color: white;
    position: relative;
    background-color: #111; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); 
    transition: box-shadow 0.3s ease; 
}

.gallery-image img {
    height: 100%; 
    width: 100%; 
    object-fit: cover; 
    transform: scale(1.0);
    transition: transform 0.4s ease, filter 0.5s ease; 
}

.img-box.locked img {
    filter: brightness(0.2) grayscale(0.8);
    cursor: default;
}
.img-box.unlocked img {
    filter: brightness(1) grayscale(0);
}
/* Importante: El cursor de click ahora lo maneja el .img-box desbloqueado */
.img-box.unlocked { 
    cursor: pointer;
}

.transparent-box {
    height: 100%;
    width: 100%;
    background-color:rgba(0, 0, 0, 0);
    position: absolute;
    top: 0;
    left: 0;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: flex-end;
    opacity: 0; 
    transition: opacity 0.5s ease;
}

.img-box.unlocked .transparent-box {
    opacity: 1; 
}

.caption {
    position: absolute;
    bottom: 5px;
    left: 20px;
    opacity: 0.0; 
    transition: transform 0.3s ease, opacity 0.3s ease; 
}

.img-box.unlocked:hover img { 
    transform: scale(1.1);
}

.img-box.unlocked:hover .transparent-box {
    background-color:rgba(0, 0, 0, 0.5); 
}

.img-box.unlocked:hover .caption {
    transform: translateY(-20px);
    opacity: 1.0;
}

/* CANDADO Y ANIMACIÓN */
.lock-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10; 
    pointer-events: none; 
}

.lock-icon {
    font-size: 4em;
    cursor: pointer;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    transition: transform 0.2s ease, opacity 0.2s ease;
    pointer-events: all; 
    position: relative;
}

.lock-icon:hover {
    transform: scale(1.1);
}

.lock-fall {
    animation: fall-and-fade 0.8s forwards cubic-bezier(0.6, -0.2, 0.735, 0.045);
}

@keyframes fall-and-fade {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
        transform: rotate(0deg);
    }
    100% {
        transform: translateY(300px) scale(0.5); 
        opacity: 0;
        transform: rotate(30deg);
    }
}

.caption > p:nth-child(2) {
    font-size: 0.8em;
}

.opacity-low {
    opacity: 0.7; 
}

/* 🖼️ ESTILOS DEL MODAL/LIGHTBOX */
.modal {
    display: none; 
    position: fixed; 
    z-index: 20; 
    padding-top: 50px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.95); 
    animation: fadeIn 0.3s;
}

.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1000px;
    position: relative;
}

#modal-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.modal-caption-container {
    padding: 15px 0 30px 0;
    text-align: center;
    color: #f1f1f1;
    font-size: 1.1em; 
}

#modal-caption-title {
    font-size: 1.5em; 
    font-weight: 700;
    margin-bottom: 5px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}