* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

/* --- TEMA BLANCO PRINCIPAL --- */
body { 
    background-color: #ffffff; 
    color: #333333; 
    overflow-x: hidden; 
}

/* --- CONTENEDORES DE VISTAS --- */
.view-active { display: block; animation: fadeIn 0.5s ease; }
.view-hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- ENCABEZADOS Y TEXTOS --- */
main, section { padding: 40px 20px; max-width: 1400px; margin: 0 auto; min-height: 100vh; }

.main-title { 
    text-align: center; margin-bottom: 10px; 
    font-size: 3rem; letter-spacing: 3px; 
    color: #111111; /* Texto oscuro para fondo blanco */
}
.subtitle { text-align: center; margin-bottom: 50px; color: #666666; font-size: 1.2rem; }

/* --- CABECERA DE LA VISTA DE PROYECTO --- */
.project-header { position: relative; margin-bottom: 50px; display: flex; flex-direction: column; align-items: center; }
.back-btn { 
    position: absolute; left: 0; top: 10px; 
    background: none; border: none; 
    color: #d35400; /* Un naranja más oscuro para mayor contraste */
    font-size: 1.2rem; 
    cursor: pointer; transition: transform 0.2s, color 0.2s; font-weight: bold;
}
.back-btn:hover { transform: translateX(-5px); color: #111111; }

/* --- REJILLA DE TARJETAS --- */
.projects-grid { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; }

/* Tarjeta y Efecto Hover Espectacular */
.project-card {
    position: relative;
    width: 100%; max-width: 400px; height: 300px;
    border-radius: 15px; overflow: hidden; cursor: pointer;
    /* Sombra mucho más suave y difuminada para fondos claros */
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1); }

/* Mantenemos el overlay oscuro para que el texto blanco resalte al hacer hover */
.overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 60%);
    opacity: 0.5; transition: opacity 0.5s ease;
}

/* El texto dentro de la tarjeta sigue siendo blanco */
.project-info {
    position: absolute; bottom: -30px; left: 0; width: 100%; padding: 30px;
    text-align: left; opacity: 0; transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    color: #ffffff; 
}

.project-info h2 { font-size: 1.8rem; margin-bottom: 5px; transform: translateY(20px); transition: transform 0.5s ease; color: #ffffff;}
.project-info p { color: #f39c12; font-weight: bold; }

/* EFECTOS HOVER */
.project-card:hover img { transform: scale(1.1); }
.project-card:hover .overlay { opacity: 0.8; }
.project-card:hover .project-info { bottom: 0; opacity: 1; }
.project-card:hover .project-info h2 { transform: translateY(0); }

/* --- GALERÍA FULLSCREEN (AHORA CON FONDO BLANCO) --- */
#fullscreen-gallery {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    /* Fondo blanco al 95% de opacidad */
    background-color: rgba(255, 255, 255, 0.95); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease; backdrop-filter: blur(10px);
}
.gallery-hidden { opacity: 0; visibility: hidden; }
.gallery-visible { opacity: 1; visibility: visible; }

#close-btn {
    position: absolute; top: 30px; right: 40px; background: none; border: none; 
    color: #333333; /* Botón oscuro */
    font-size: 2rem; cursor: pointer; transition: transform 0.2s; z-index: 1001;
}
#close-btn:hover { transform: scale(1.2); color: #000000; }

.carousel-container { display: flex; align-items: center; width: 100%; max-width: 1200px; padding: 0 20px; }
.image-wrapper { position: relative; width: 100%; height: 80vh; display: flex; justify-content: center; align-items: center; flex-direction: column; touch-action: pan-y; }

#current-img { 
    max-width: 100%; max-height: 100%; border-radius: 10px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.15); /* Sombra de imagen más suave */
    transition: opacity 0.3s ease; user-select: none; 
}

/* Botones de navegación del carrusel adaptados al fondo blanco */
.nav-btn {
    background: rgba(0, 0, 0, 0.05); border: none; 
    color: #333333; 
    font-size: 3rem; padding: 10px 20px; cursor: pointer; border-radius: 10px; transition: background 0.3s, color 0.3s; z-index: 10;
}
.nav-btn:hover { background: rgba(0, 0, 0, 0.15); color: #000000; }

/* Contador de imágenes oscuro */
#image-counter { margin-top: 15px; font-size: 1.2rem; letter-spacing: 2px; color: #555555; font-weight: 500; }

@media (max-width: 768px) {
    .nav-btn { display: none; }
    .main-title { font-size: 2rem; }
    .project-header { margin-top: 40px; } 
    .back-btn { top: -30px; left: 10px; }
}