/* ==========================================================================
   SISTEMA DE DISEÑO BASE - EMPIEZA DE CERO (Premium Vanilla CSS)
   ========================================================================== */

/* 1. TOKENS Y VARIABLES (Aesthetics & HSL)
   ========================================================================== */
:root {
    /* Paleta Corporativa (Moderna, alta conversión) */
    --clr-primary-base: 220, 85%, 55%;
    /* Azul Eléctrico Vibrante */
    --clr-primary: hsl(var(--clr-primary-base));
    --clr-primary-hover: hsl(220, 85%, 45%);
    --clr-primary-light: hsl(220, 85%, 95%);

    --clr-secondary: hsl(150, 70%, 40%);
    /* Verde Éxito / Esperanza */

    --clr-bg-body: hsl(210, 20%, 98%);
    /* Gris ultra claro, no blanco puro */
    --clr-bg-card: hsl(0, 0%, 100%);

    /* Textos (Alto contraste) */
    --clr-text-main: hsl(220, 30%, 15%);
    /* Casi negro, azulado */
    --clr-text-muted: hsl(220, 15%, 40%);

    /* Estructura Glassmorphism */
    --glass-bg: hsla(0, 0%, 100%, 0.85);
    --glass-border: hsla(220, 50%, 90%, 0.5);
    --glass-shadow: 0 8px 32px 0 hsla(220, 30%, 15%, 0.05);

    /* Tipografía Premium */
    --font-sans: 'Onest', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);

    /* Transiciones */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. RESET MODERNO
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--clr-text-main);
    background-color: var(--clr-bg-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--clr-text-main);
    margin-bottom: 0.5em;
    letter-spacing: -0.02em;
}

a {
    color: var(--clr-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

/* 3. LAYOUT & CONTENEDORES
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container_nav {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-content {
    min-height: 70vh;
    padding-top: 110px;
    /* Evita solapamiento con navbar flotante mas alta */
}

/* 4. COMPONENTES GLOBAL: Header (Glassmorphism)
   ========================================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 110px;
    z-index: 1000;
    display: flex;
    align-items: center;
    background: transparent;
    transition: var(--transition-smooth);
}

.main-header.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    height: 90px;
}

/*.logo {
    display: flex;
    align-items: center;
    /* Centra verticalmente el contenido 
*/
/* Asegura centro horizontal si fuera necesario 
    height: 100%;
    text-decoration: none;
    gap: 0.5rem;
    transition: all var(--transition-smooth);
}*/

/* El span intermedio debe permitir que la imagen se comporte correctamente */


/*.logo img {

    Elimina el espacio fantasma debajo de las imágenes 
    max-height: 110px;
    width: auto;
    transition: max-height var(--transition-smooth);
    /* Opcional: si quieres que la transición sea más fluida, añade transform-origin 
    transform-origin: center;*/
}

.logo span {
    display: flex;
    align-items: center;
    height: 100%;
    /*width: 171px;*/
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /*font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    justify-content: center;
    color: var(--clr-text-main);
    letter-spacing: -0.03em;*/
    height: 100%;
    text-align: center;
    justify-content: center;
    margin: auto;
    /*margin: 0 0 0 30px;*/

    /* Toma la altura del header */
}

.logo img {
    max-height: 110px;
    width: auto;
    transition: max-height var(--transition-smooth);
    text-align: center;
    justify-content: center;

}

.main-header.scrolled .logo img {
    max-height: 70px;
    display: flex;
    align-items: center;
    transform-origin: center;

}

.logo-mark {
    background: linear-gradient(135deg, var(--clr-primary), hsl(250, 85%, 65%));
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px hsla(var(--clr-primary-base), 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--clr-text-muted);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
}

.nav-links a:hover {
    color: var(--clr-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--clr-primary);
    transition: var(--transition-fast);
    border-radius: 2px;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Dropdown Menu Styles */
.nav-links .dropdown {
    position: relative;
    padding-bottom: 20px;
    /* Expands hover area preventing loss of focus */
    margin-bottom: -20px;
}

.nav-links .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: hsla(0, 0%, 100%, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid hsla(0, 0%, 100%, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 1rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    z-index: 1000;
}

.nav-links .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-links .dropdown-menu li {
    padding: 0;
}

.nav-links .dropdown-menu a {
    display: block;
    padding: 0.6rem 1.5rem;
    color: var(--clr-text-main);
    /* Darker text for readability */
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links .dropdown-menu a::after {
    display: none;
    /* remove moving underline for dropdown elements */
}

.nav-links .dropdown-menu a:hover {
    background-color: hsla(var(--clr-primary-base), 0.05);
    color: var(--clr-primary);
}

.btn-nav {
    display: none;
}

@media (min-width: 768px) {
    .btn-nav {
        display: inline-flex;
    }
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

@media (max-width: 900px) {

    .nav-links,
    .btn-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background-color: var(--clr-text-main);
    }
}

/* 5. COMPONENTES: Botones & Inputs
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
    cursor: pointer;
    border: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn-primary {
    background: var(--clr-primary);
    color: white;
    box-shadow: 0 4px 15px hsla(var(--clr-primary-base), 0.3);
}

.btn-primary:hover {
    background: var(--clr-primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px hsla(var(--clr-primary-base), 0.4);
}

/* 6. COMPONENTES: Cards (Blog / Noticias)
   ========================================================================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0 4rem;
}

.news-card {
    background: var(--clr-bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px hsla(220, 20%, 15%, 0.04);
    border: 1px solid hsla(220, 20%, 90%, 0.5);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px hsla(220, 20%, 15%, 0.08);
}

.news-card-img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    background-color: var(--clr-primary-light);
    border-bottom: 1px solid hsla(220, 20%, 90%, 0.5);
}

.news-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-meta {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-badge {
    background: var(--clr-primary-light);
    color: var(--clr-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.news-card-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-title a {
    color: var(--clr-text-main);
}

.news-card-title a:hover {
    color: var(--clr-primary);
}

.news-card-excerpt {
    font-size: 0.95rem;
    color: var(--clr-text-muted);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.news-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
}

.news-read-more {
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.news-read-more::after {
    content: '→';
    transition: transform var(--transition-fast);
}

.news-card:hover .news-read-more::after {
    transform: translateX(4px);
}

/* 7. VISTA INDIVIDUAL (Artículo / Hero)
   ========================================================================== */
.hero-article {
    background: var(--clr-primary-light);
    padding: 4rem 1.5rem 3rem;
    border-radius: 24px;
    margin: 2rem auto;
    max-width: 1000px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-article::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, hsla(0, 0%, 100%, 0.8) 0%, transparent 60%);
    pointer-events: none;
}

.hero-meta {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.04em;
    color: var(--clr-text-main);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.article-content {
    max-width: 800px;
    margin: 0 auto 4rem;
    background: var(--clr-bg-card);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px hsla(220, 20%, 15%, 0.04);
}

.article-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--clr-text-muted);
}

.article-content h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.8rem;
}

/* 8. FOOTER
   ========================================================================== */
.site-footer {
    background: var(--clr-bg-card);
    border-top: 1px solid hsla(220, 20%, 90%, 0.8);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 500px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-brand .brand-bio {
    margin-top: 1rem;
    color: var(--clr-text-muted);
    font-size: 0.95rem;
}

.footer-links h4,
.footer-contacto h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--clr-text-main);
}

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

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
}

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

.footer-contacto p {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid hsla(220, 20%, 90%, 0.5);
    text-align: center;
    color: var(--clr-text-muted);
    font-size: 0.85rem;
}