@charset "utf-8";

/* Import de fuentes */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Roboto:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@0,400..900;1,400..900&display=swap');

/* ===============================
   ESTILOS DE ENCABEZADO
=============================== */
.encabezado-artitico {
    text-align: left;
    margin-bottom: 40px;
    padding: 0 20px;
}

.titulo-principal {
    font-family: 'Cinzel Decorative', serif;
    font-size: 40px;
    color: #dd910d;
    text-transform: uppercase;
    font-weight: bold;
    margin: 0;
    letter-spacing: 2px;
}

.subtitulo-seccion {
    font-family: 'Cinzel Decorative', serif;
    font-size: 30px;
    color: #dd910d;
    text-transform: uppercase;
    font-weight: bold;
    margin: 0;
    letter-spacing: 2px;
}

.subtitulo-frase {
    font-family: 'Alegreya', serif;
    font-size: 20px;
    font-style: italic;
    color: #ffffff;
    margin-top: 10px;
    opacity: 0.9;
}

/* ===============================
   CONTENEDOR GRID (3 COLUMNAS)
=============================== */
.contenedor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===============================
   ESTILO DE LAS CARDS
=============================== */
.card-obra {
    background-color: #1a1a1a;
    border-radius: 25px;
    overflow: hidden;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    height: 520px; 
    position: relative; 
}

.card-img-container {
    width: 100%;
    height: 375px;
    overflow: hidden;
}

.card-img-container img {
    width: 100%;
    height: 100%; /* Ajustado para llenar el contenedor */
    object-fit: cover; /* Evita que la imagen se estire */
    display: block;
    transition: transform 0.5s ease;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    text-align: left;
    background-color: #1a1a1a;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* CORRECCIÓN: Un valor menor (40%) permite que el título y el botón 
       se queden dentro del área visible antes del hover */
    transform: translateY(2%); 
    z-index: 2;
}

.card-info h3 {
    font-family: 'Cinzel Decorative', serif;
    color: #dd910d;
    margin-bottom: 10px;
    font-size: 1.2rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    /* justify-content eliminado para respetar tu text-align: left */
}

/* Texto del resumen */
.card-resumen {
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0;
    
    /* CORRECCIÓN: Al poner max-height en 0, el botón sube y se pega al título 
       haciéndose visible antes del hover */
    max-height: 0; 
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.4s ease, margin 0.4s ease;
    margin-bottom: 0;
    text-align: justify;
}

/* --- EFECTO HOVER --- */
.card-obra:hover .card-info {
    transform: translateY(0);
}

.card-obra:hover .card-resumen {
    opacity: 1;
    max-height: 200px; /* Se expande para mostrar el texto */
    margin-bottom: 20px; /* Crea espacio hacia el botón */
}

.card-obra:hover .card-img-container img {
    transform: scale(1.1);
    filter: brightness(0.5);
}

/* ===============================
   ESTILO DEL BOTÓN
=============================== */
.btn-card {
    display: inline-block;
    padding: 10px 30px;
    border-radius: 30px;
    background: linear-gradient(145deg, #9d0606, #600000);
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 5px 15px rgba(157, 6, 6, 0.4);
    transition: 0.3s;
}

.btn-card:hover {
    box-shadow: 0 8px 20px rgba(157, 6, 6, 0.6);
    transform: scale(1.05);
}

/* ===============================
   RESPONSIVE (COMBINADO Y CORREGIDO)
=============================== */
@media (max-width: 1024px) {
    .contenedor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .contenedor-grid {
        grid-template-columns: 1fr;
    }
    .titulo-principal { font-size: 24px; }
    .subtitulo-seccion { font-size: 22px; }
    .subtitulo-frase { font-size: 18px; }
    
    .card-obra {
        height: 480px; 
    }
    .card-info {
        transform: translateY(45%); /* Ajuste proporcional para móvil */
    }
}