/* Variables de color según manual de marca */
:root {
    --azul-oscuro: #253D6B;
    --rojo: #D21B10;
    --amarillo: #FEC900;
    --azul-claro: #63B9E9;
    --blanco: #FFFFFF;
    --gris-oscuro: #333333;
    --gris-claro: #F5F5F5;
}

/* Tipografía - Futura como primaria, Arial como secundaria */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gris-oscuro);
    background-color: var(--blanco);
}

/* Estilos generales */
h1, h2, h3, h4 {
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    color: var(--azul-oscuro);
}

h2 {
    font-size: 2rem;
    color: var(--azul-oscuro);
    border-left: 4px solid var(--rojo);
    padding-left: 15px;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    color: var(--rojo);
}

p {
    margin-bottom: 1.2rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

.btn {
    display: inline-block;
    background-color: var(--rojo);
    color: var(--blanco);
    padding: 12px 25px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--azul-oscuro);
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: var(--azul-oscuro);
}

.btn-secondary:hover {
    background-color: var(--rojo);
}

/* Header y navegación */
header {
    background-color: var(--blanco);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text h1 {
    font-size: 1.8rem;
    margin: 0;
    line-height: 1.2;
    color: var(--azul-oscuro);
}

.logo-text span {
    font-size: 0.9rem;
    color: var(--rojo);
    font-weight: 600;
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    margin-left: 25px;
}

nav a {
    text-decoration: none;
    color: var(--azul-oscuro);
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
    position: relative;
}

nav a:hover {
    color: var(--rojo);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--rojo);
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--azul-oscuro);
    cursor: pointer;
}

/* Hero section */
.hero {
    background: linear-gradient(rgba(37, 61, 107, 0.85), rgba(37, 61, 107, 0.9)), var(--hero-bg, none);
    background-size: cover;
    background-position: center;
    color: var(--blanco);
    padding: 100px 0;
    text-align: center;
}

.hero h1 {
    color: var(--blanco);
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 30px;
}

/* Franja de colores según manual de marca */
.color-stripe {
    height: 8px;
    background: linear-gradient(to right, var(--rojo) 33.33%, var(--azul-claro) 33.33%, var(--azul-claro) 66.66%, var(--amarillo) 66.66%);
    margin: 20px 0 40px;
}

/* Sobre Nelson */
.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-img {
    flex: 0 0 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-img img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text {
    flex: 1;
}

/* Pilares */
.pillars {
    background-color: var(--gris-claro);
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.pillar-card {
    background-color: var(--blanco);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.pillar-card:hover {
    transform: translateY(-10px);
}

.pillar-icon {
    font-size: 2.5rem;
    color: var(--rojo);
    margin-bottom: 20px;
}

/* Noticias */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.news-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-img {
    height: 200px;
    overflow: hidden;
}

.news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.news-card:hover .news-img img {
    transform: scale(1.05);
}

.news-content {
    padding: 20px;
    background-color: var(--blanco);
}

.news-date {
    color: var(--rojo);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Contacto */
.contact {
    background-color: var(--azul-oscuro);
    color: var(--blanco);
}

.contact h2 {
    color: var(--blanco);
    border-left-color: var(--amarillo);
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.contact-info h3 {
    color: var(--amarillo);
}

.contact-detail {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.contact-detail i {
    font-size: 1.2rem;
    color: var(--amarillo);
    margin-right: 15px;
    width: 30px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--blanco);
    font-family: 'Inter', Arial, sans-serif;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Footer */
footer {
    background-color: var(--gris-oscuro);
    color: var(--blanco);
    padding: 50px 0 20px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    height: 60px;
    width: auto;
    margin-bottom: 15px;
}

.footer-links h3 {
    color: var(--amarillo);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--blanco);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--amarillo);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--blanco);
    font-size: 1.2rem;
    transition: all 0.3s;
}

.social-links a:hover {
    background-color: var(--rojo);
    transform: translateY(-5px);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
    }
    
    .about-img {
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    /* Encabezado móvil: logo centrado, menú a la derecha */
    .header-container {
        justify-content: center;
        position: relative;
        padding: 10px 0;
        min-height: 70px;
    }

    .mobile-menu-btn {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        border-radius: 8px;
        display: grid;
        place-items: center;
    }

    .mobile-menu-btn:active { background: var(--gris-claro); }

    /* Menú lateral (drawer) */
    #mainNav {
        position: fixed;
        top: 0;
        right: 0;
        width: 290px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        background: var(--blanco);
        z-index: 1100;
        transform: translateX(100%);
        transition: transform .3s ease;
        box-shadow: -4px 0 30px rgba(0, 0, 0, .2);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        visibility: hidden;
    }

    #mainNav.open {
        transform: translateX(0);
        visibility: visible;
    }

    .drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 18px;
        border-bottom: 4px solid var(--rojo);
    }

    .drawer-head img { height: 50px; width: auto; }

    .drawer-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--azul-oscuro);
        cursor: pointer;
        width: 40px;
        height: 40px;
    }

    nav ul {
        display: flex;
        position: static;
        flex-direction: column;
        padding: 10px 0;
        box-shadow: none;
    }

    nav li {
        margin: 0;
    }

    nav ul a {
        display: block;
        padding: 15px 24px;
        font-size: 1.05rem;
        border-right: 4px solid transparent;
    }

    nav ul a:hover, nav ul a:active {
        background: var(--gris-claro);
        border-right-color: var(--rojo);
    }

    nav a::after { display: none; }

    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(20, 30, 55, .55);
        z-index: 1050;
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s;
    }

    .nav-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    body.menu-open { overflow: hidden; }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .logo-img {
        height: 60px;
    }
    
    .logo-text h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .logo-container {
        gap: 10px;
    }
    
    .logo-img {
        height: 50px;
    }
    
    .logo-text h1 {
        font-size: 1.3rem;
    }
    
    .logo-text span {
        font-size: 0.8rem;
    }
}

/* ===== Ajustes y nuevas secciones ===== */
a.logo-container { text-decoration: none; }
.hero .btn { margin: 5px; }
.hero .color-stripe { max-width: 300px; margin: 20px auto 30px; }
.about-text .btn { margin-top: 10px; }
.news-card { display: flex; flex-direction: column; background: var(--blanco); }
.news-content { flex: 1; display: flex; flex-direction: column; }
.news-content .btn { margin-top: auto; align-self: flex-start; }
.news-content h3 a { color: inherit; text-decoration: none; }
.empty-note { color: #777; font-style: italic; }

/* Formulario */
.contact-form .check {
    display: flex; gap: 10px; align-items: flex-start;
    font-size: .9rem; margin-bottom: 20px; line-height: 1.4;
}
.contact-form .check input { width: auto; margin: 3px 0 0; flex: 0 0 auto; }
.contact-form .check a { color: var(--amarillo); }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-detail p { margin-bottom: .2rem; }
.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 20px; font-weight: 500; }
.alert-ok { background: #1e7e34; color: #fff; }
.alert-error { background: var(--rojo); color: #fff; }

/* Páginas internas (legal, noticia) */
.page-hero {
    background: var(--azul-oscuro); color: var(--blanco);
    padding: 60px 0 40px; text-align: center;
}
.page-hero h1 { color: var(--blanco); font-size: 2.4rem; margin-bottom: 10px; }
.page-hero p { opacity: .85; margin: 0; }
.page-hero .color-stripe { max-width: 240px; margin: 20px auto 0; }
.page-body { max-width: 860px; margin: 0 auto; padding: 50px 20px 70px; }
.page-body h2 { font-size: 1.45rem; margin-top: 2.2rem; }
.page-body ul, .page-body ol { margin: 0 0 1.2rem 1.4rem; }
.page-body li { margin-bottom: .5rem; }
.page-body a { color: var(--rojo); }
.page-body .updated { color: #777; font-size: .9rem; border-top: 1px solid #eee; padding-top: 20px; margin-top: 40px; }
.article-img { width: 100%; max-height: 480px; object-fit: cover; border-radius: 10px; margin-bottom: 30px; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--azul-oscuro); font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--rojo); }

.copyright a { color: rgba(255,255,255,.85); text-decoration: none; }
.copyright a:hover { color: var(--amarillo); }
.copyright p { margin-bottom: .4rem; }

@media (max-width: 768px) {
    .page-hero h1 { font-size: 1.8rem; }
    header { position: sticky; }
    .header-container { position: relative; }
}
.contact-form h3 { color: var(--amarillo); }
.footer-logo { background: transparent; padding: 0; border-radius: 0; height: 70px; }
.copyright a.dev-link { color: var(--amarillo); font-weight: 600; }
.copyright a.dev-link:hover { text-decoration: underline; }

/* Elementos del menú lateral: solo en móvil */
@media (min-width: 769px) {
    .drawer-head, .nav-overlay { display: none; }
}

/* El menú lateral vive dentro del header: al abrirlo, el header sube por encima del fondo oscuro */
body.menu-open header { z-index: 1200; }
