/* -----------------------------------------------------------
   RESET BÁSICO
----------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables de color - Consistentes con la app principal */
:root {
    --color-principal: #f06529;
    --color-secundario: #b7410e;
    --color-fondo: #f5f0e6;
    --color-texto: #2c2c2c;
    --color-header: #2f2f2f;
    --color-hover: #ec4a04;
    --color-hover-dark: #8a2e0a;
}

body {
    font-family: "Roboto", sans-serif;
    background-color: #f4f1ec; /* tono suave, elegante */
    color: #2b2b2b;
    line-height: 1.6;
}

/* -----------------------------------------------------------
   HEADER
----------------------------------------------------------- */
.page-header {
    background-color: var(--color-header);
    color: #ffffff;
    padding: 40px 0;
    text-align: center;
    border-bottom: 4px solid var(--color-secundario);
}

.page-header h1 {
    font-family: "Playfair Display", serif;
    font-size: 2.4rem;
    letter-spacing: 2px;
    font-weight: 600;
    color: var(--color-principal);
}

/* -----------------------------------------------------------
   CONTENEDOR PRINCIPAL
----------------------------------------------------------- */
main {
    width: 100%;
    max-width: 1200px;
    margin: 50px auto;
}

/* -----------------------------------------------------------
   SECCIÓN 1: INTRO + IMAGEN PRINCIPAL
----------------------------------------------------------- */
.intro-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
    align-items: center;
}

.intro-text p {
    margin-bottom: 18px;
    text-align: justify;
    font-size: 1.1rem;
}

.intro-image img {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
}

/* -----------------------------------------------------------
   SECCIÓN 2: HISTORIA Y REFERENCIAS
----------------------------------------------------------- */
.history-section {
    background-color: #fff;
    padding: 40px;
    border-left: 6px solid var(--color-secundario);
    margin-bottom: 60px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-block p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

/* Galería de imágenes históricas */
.history-imgs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
    padding: 20px 0;
}

.history-imgs img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.history-imgs img:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    border: 2px solid var(--color-principal);
}

.history-block a {
    color: var(--color-principal);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.3s ease;
}

.history-block a:hover {
    color: var(--color-hover);
    text-decoration: none;
}

.citation {
    font-style: italic;
    color: #5a4636;
    padding: 20px;
    background-color: #f9f7f4;
    border-radius: 4px;
    border-left: 3px solid var(--color-principal);
}

/* -----------------------------------------------------------
   SECCIÓN 3: CONTEXTO ACTUAL
----------------------------------------------------------- */
.current-section {
    margin-bottom: 40px;
}

.current-section h2 {
    font-family: "Playfair Display", serif;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--color-secundario);
}

.current-section p {
    margin-bottom: 20px;
    text-align: justify;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Contenedor del mosaico */
.mosaico {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: center;
    align-items: center;
}

.mosaico img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
}

.mosaico img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* -----------------------------------------------------------
   BOTÓN REGRESAR
----------------------------------------------------------- */
.regresar {
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

#regresar {
    width: 100%;
    max-width: 1200px;
    background-color: var(--color-secundario);
    border: 2px solid var(--color-secundario);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 5px;
    text-align: center;
    display: inline-block;
}

#regresar:hover {
    background-color: var(--color-hover-dark);
    border-color: var(--color-hover-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#regresar:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#regresar i {
    margin-right: 0.5rem;
}

/* -----------------------------------------------------------
   FOOTER
----------------------------------------------------------- */
.page-footer {
    background-color: var(--color-header);
    color: white;
    padding: 25px 10px;
    text-align: center;
    margin-top: 60px;
    font-size: 0.95rem;
}

/* -----------------------------------------------------------
   RESPONSIVE DESIGN
----------------------------------------------------------- */
@media (max-width: 900px) {
    .intro-section {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    /* Grid de 2 columnas en tablets */
    .history-imgs {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .history-imgs img {
        height: 200px;
    }

    /* Mosaico en tablets */
    .mosaico {
        max-width: 100%;
        padding: 15px;
        margin: 30px auto;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 0.95rem;
    }

    main {
        width: 94%;
    }

    .page-header {
        padding: 25px 0;
    }

    .page-header h1 {
        font-size: 1.6rem;
        letter-spacing: 1px;
    }

    .history-section {
        padding: 25px 20px;
    }

    /* Una sola columna en móviles */
    .history-imgs {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }

    .history-imgs img {
        height: 220px;
    }

    .intro-text p,
    .history-block p,
    .current-section p {
        font-size: 1rem;
        text-align: left;
    }

    .citation {
        padding: 15px;
        font-size: 0.95rem;
    }

    .regresar #regresar {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }

    /* Mosaico en móviles */
    .mosaico {
        padding: 10px;
        margin: 25px auto;
    }
}

@media (max-width: 400px) {
    .page-header h1 {
        font-size: 1.4rem;
    }

    .history-imgs img {
        height: 180px;
    }

    main {
        width: 96%;
        margin: 30px auto;
    }

    .history-section {
        padding: 20px 15px;
    }

    /* Mosaico en pantallas muy pequeñas */
    .mosaico {
        padding: 8px;
        margin: 20px auto;
    }
}
