/* ========================================================= */
/* FICHA DE OBRA (assets/obra.css) - VERSIÓN GRID */
/* ========================================================= */

@charset "UTF-8";

/* REGLAS GLOBALES Y RESET DE DESBORDE */
* {
    box-sizing: border-box;
    /* Fundamental para que el ancho no desborde */
}

html,
body {
    max-width: 100%;
    /* Forzar el ancho máximo */
    overflow-x: hidden;
    /* Ocultar la barra de desplazamiento horizontal */
    margin: 0;
    padding: 0;
}

/* VARIABLES DE COLOR Y FUENTE */
:root {
    --color-azul-fuerte: #004d99;
    --color-negrita-suave: #333333;
    --fuente-titulo: Arial, sans-serif;
    --fuente-valor: Arial, sans-serif;
    --fuente-label: Arial, sans-serif;
}

/* ------------------------------------ */
/* CONTENEDOR PRINCIPAL (GRID) */
/* ------------------------------------ */

.ficha-contenedor {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background-color: #fcfcfc;

    /* PROPIEDADES GRID ORIGINALES */
    display: grid;
    grid-template-columns: 40% 1fr;
    /* 40% para la imagen, 1fr para detalles */
    gap: 30px;

    /* SOLUCIÓN DE TEXTO LARGO Y DESBORDE EN GRID */
    word-break: break-word;
    min-width: 0;
    /* Solución Grid para evitar desborde */
}

/* ------------------------------------ */
/* ELEMENTOS DEL GRID */
/* ------------------------------------ */

.ficha-titulo-obra {
    grid-column: 1 / 3;
    /* Ocupa ambas columnas */
    font-size: 2.5em;
    color: #111;
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-azul-fuerte);
    font-family: var(--fuente-titulo);
    font-weight: normal;
}

.ficha-imagen {
    grid-column: 1 / 2;
    /* Columna 1 */
}

.ficha-imagen img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    object-fit: cover;
}

.ficha-detalles {
    grid-column: 2 / 3;
    /* Columna 2 */
}

.ficha-continuacion {
    grid-column: 1 / 3;
    /* Ocupa ambas columnas al 100% */
    margin-top: 30px;
}

/* ------------------------------------ */
/* ESTILOS DE TEXTO */
/* ------------------------------------ */

.ficha-bloque {
    margin-bottom: 15px;
}

.ficha-label {
    font-size: 1.1em;
    color: var(--color-azul-fuerte);
    font-weight: 700;
    margin-bottom: 3px;
    font-family: var(--fuente-label);
}

.ficha-valor {
    font-size: 1.15em;
    color: var(--color-negrita-suave);
    font-weight: 400;
    line-height: 1.7;
    font-family: var(--fuente-valor);
    word-break: break-all;
    /* SOLUCIÓN MÁS FUERTE PARA TEXTO */
}

.ficha-justificado {
    text-align: justify;
}

/* ------------------------------------ */
/* RESPONSIVE (MÓVIL) */
/* ------------------------------------ */

@media (max-width: 768px) {
    .ficha-contenedor {
        /* En móvil, la cuadrícula se convierte en una sola columna */
        grid-template-columns: 1fr;
        gap: 20px;
        width: 95%;
        margin: 20px auto;
        padding: 10px;
    }

    /* Todos los elementos ocupan la única columna */
    .ficha-titulo-obra,
    .ficha-imagen,
    .ficha-detalles,
    .ficha-continuacion {
        grid-column: 1 / 2;
    }

    .ficha-imagen {
        max-width: 100%;
    }

    .ficha-titulo-obra {
        font-size: 1.8em;
    }

    .ficha-label {
        font-size: 1em;
    }

    .ficha-valor {
        font-size: 1.05em;
    }
}

/* ========================================================= */
/* ESTILOS DE ELEMENTOS COMPLEMENTARIOS (PRE-LOADER & TOAST) */
/* (Cambiados de alerta.css o donde estuvieran para consolidar) */
/* ========================================================= */

/* OCULTAR CONTENIDO MIENTRAS CARGA (relacionado con el JS del pre-loader) */
#contenido {
    opacity: 0;
    /* Asegura que el contenido esté invisible al inicio */
    transition: opacity 0.6s ease-in-out;
    /* Transición para mostrar el contenido suavemente */
}

/* ========================================= */
/* 1. ESTILOS DEL PRE-LOADER (CARGADOR DE PÁGINA) */
/* ========================================= */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ffffff;
    /* Fondo blanco (donde veías el spinner azul) */
    z-index: 9999;
    /* Asegura que esté por encima de todo lo demás */
    transition: opacity 0.6s ease-out;
}

#status {
    width: 200px;
    height: 200px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -100px 0 0 -100px;
}

.loader-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    /* Spinner Azul */
    border-radius: 50%;
    width: 100px;
    height: 100px;
    animation: spin 2s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========================================= */
/* 2. ESTILOS PARA EL TOAST (MENSAJE SIN URL) */
/* ========================================= */

#custom-alert-toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    bottom: 30px;
    font-family: Arial, sans-serif;
    opacity: 0;
    transition: opacity 0.5s, visibility 0.5s;
}

#custom-alert-toast.show {
    visibility: visible;
    opacity: 1;
}