/* --- Estilos Generales y Reseteo Básico --- */

.container-all {
    /* Establece un ancho máximo para que el contenido no se extienda demasiado */
    max-width: 900px;
    /* Puedes ajustar este valor (por ejemplo, 800px, 700px) */
    /* Centra el contenedor en la página */
    margin-left: auto;
    margin-right: auto;
}

/* --- Título Principal (h1) --- */
.titulo-pagina-teodolina {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

/* --- Layout Principal: Responsive (Flexbox) --- */
.contenido-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.columna-imagenes {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    max-width: 400px;
    /* Límite para que la columna no se estire excesivamente */
}

.columna-texto {
    flex: 2 1 400px;
    font-family: Arial, Helvetica, sans-serif;
}

/* --- Imágenes: Responsivas y Separación --- */
.imagen-item {
    margin-bottom: 2cm;
}

.imagen-item:last-child {
    margin-bottom: 0;
}

.imagen-item a {
    cursor: zoom-in;
}

.imagen-responsive {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


/* ======================================================= */
/* *** MODAL / ZOOM PURO CSS (Solución al Agrandamiento) *** */
/* ======================================================= */

.modal-css {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mostrar el modal cuando se hace clic (se convierte en :target) */
.modal-css:target {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    max-width: 90vw;
    cursor: default;
}

/* LA REGLA CLAVE PARA QUE LA IMAGEN SE AGRANDE SIN DESBORDAR */
.modal-content img {
    width: auto;
    height: auto;
    max-width: 90vw;
    /* Máximo 90% del ancho del viewport */
    max-height: 80vh;
    /* Máximo 80% de la altura del viewport */
    display: block;
    cursor: zoom-out;
    object-fit: contain;
}

.modal-content figcaption {
    text-align: center;
    color: #333;
    padding-top: 10px;
}




/* ======================================================= */


/* --- Tipografía y Estilos de Texto --- */
.subtitulo-teodolina {
    font-size: 1rem;
    color: #00008b;
    font-weight: 800;
    margin-top: 15px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.negrita-suave {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 10px;
}

.justificado {
    text-align: justify;
}

@media (max-width: 768px) {
    .contenido-layout {
        flex-direction: column;
    }

    .columna-imagenes,
    .columna-texto {
        flex-basis: auto;
        max-width: 100%;
    }

    .titulo-pagina-teodolina {
        font-size: 2rem;
    }
}

/* Botón de cierre */
.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    text-decoration: none;
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
}

.modal-close:hover {
    color: #ccc;
}

.modal-content figcaption {
    text-align: center;
    color: #333;
    /* AUMENTAMOS EL PADDING SUPERIOR Y APLICAMOS LOS ESTILOS DE TEXTO */
    padding-top: 15px;
    font-size: 1.15rem;
    font-weight: 500;
    font-family: Tahoma, Verdana, sans-serif;
    /* Fuente sans-serif */
}