/* ==================================================
   VARIABLES DE IDENTIDAD
   ================================================== */

:root {
    --color-identidad: #7a2d2d;
    --color-fondo: #fafafa;
    --color-texto: #222;
    --color-menu: #2f3e4e;
}

/* ==================================================
   RESET BÁSICO
   ================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background: var(--color-fondo);
    color: var(--color-texto);
}

/* ==================================================
   PORTADA
   ================================================== */

.portada {
    position: relative;
    height: 70vh;
    min-height: 420px;
    background-image: url("../images/vista1.jfif");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portada::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.portada-contenido {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    max-width: 900px;
    padding: 2rem 1.5rem;
}

/* Escudo */
.escudo-portada {
    width: 90px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.9);
    border-radius: 50% / 60%;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    margin-bottom: 1.4rem;
}

/* Título */
.portada h1 {
    font-size: 3.4rem;
    letter-spacing: 0.08em;
    margin: 0.5rem 0;
    text-shadow: 0 3px 12px rgba(0,0,0,0.6);
}

/* Subtítulo */
.portada .subtitulo {
    font-size: 1.05rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-top: 1.1rem;
}

/* ==================================================
   MENÚ PRINCIPAL
   ================================================== */

.menu-principal {
    background: var(--color-menu);
}

.menu-principal ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.menu-principal a {
    display: block;
    padding: 1rem 1.2rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

.menu-principal a:hover,
.menu-principal a:focus-visible {
    background: rgba(255,255,255,0.15);
    outline: none;
}

/* ==================================================
   CONTENIDO GENERAL
   ================================================== */

main {
    margin-top: 3.5rem;
}

section {
    max-width: 820px;
    margin: 0 auto 4.5rem;
    padding: 0 1.5rem;
}

section p {
    font-size: 1.05rem;
    line-height: 1.85;
    text-align: justify;
    margin-bottom: 1.3rem;
}

/* Títulos */
section h2 {
    font-size: 2rem;
    margin-bottom: 1.8rem;
    border-bottom: 3px solid var(--color-identidad);
    display: inline-block;
    padding-bottom: 0.3rem;
}

section h3 {
    margin-top: 2.6rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* ==================================================
   FIGURAS
   ================================================== */

figure {
    background: #f7f7f7;
    padding: 1.4rem;
    border-radius: 4px;
    margin: 3.5rem auto;
    width: 100%;
}

figure img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}

figcaption {
    margin-top: 0.9rem;
    text-align: center;
    font-style: italic;
    font-size: 0.9rem;
    color: #666;
}

/* ==================================================
   BLOQUES PORTADA (TARJETAS – AJUSTADAS)
   ================================================== */

.bloques-portada {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2.2rem;
    max-width: 1200px;
    margin: 4.5rem auto;
    padding: 0 1.5rem;
}

.bloques-portada article {
    background: #ffffff;
    padding: 2.2rem 1.8rem;
    border-radius: 6px;
    text-align: center;
    border-top: 4px solid var(--color-identidad);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bloques-portada article:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}

.bloques-portada article h2 {
    font-size: 1.45rem;
    margin-bottom: 1rem;
    border: none;
}

.bloques-portada article p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.6rem;
}

.bloques-portada article a {
    color: var(--color-identidad);
    text-decoration: none;
    font-weight: bold;
}

.bloques-portada article a:focus-visible {
    outline: 2px solid var(--color-identidad);
    outline-offset: 3px;
}

/* ==================================================
   GALERÍA
   ================================================== */

.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.6rem;
    max-width: 1100px;
    margin: 3.5rem auto 4.5rem;
    padding: 0 1.5rem;
}

.galeria figure {
    margin: 0;
    background: #ffffff;
    padding: 0.9rem;
}

.galeria img {
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galeria img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* ==================================================
   FOOTER
   ================================================== */

footer {
    text-align: center;
    padding: 2.2rem 1.5rem;
    font-size: 0.85rem;
    background: #f4f4f4;
    border-top: 4px solid var(--color-identidad);
}

/* ==================================================
   RESPONSIVE
   ================================================== */

@media (max-width: 1024px) {
    .bloques-portada {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .bloques-portada {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .portada {
        height: 60vh;
    }

    .portada h1 {
        font-size: 2.4rem;
        letter-spacing: 0.05em;
    }

    .portada .subtitulo {
        font-size: 0.85rem;
        letter-spacing: 0.1em;
    }

    .menu-principal a {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    section {
        margin-bottom: 3.5rem;
    }

    section h2 {
        font-size: 1.7rem;
    }

    section p {
        font-size: 1rem;
    }

    figure {
        padding: 1rem;
        margin: 3rem auto;
    }
}

@media (max-width: 480px) {

    .portada h1 {
        font-size: 2rem;
    }

    .escudo-portada {
        width: 70px;
    }
}
