/* ==========================================================================
   Design System Variables (Fuerte por Naturaleza)
   ========================================================================== */
   :root {
    /* Colors - Updated to new logo */
    --color-primary: #00bdf2; /* Bright Cyan */
    --color-primary-dark: #009dbf;
    --color-secondary: #f47920; /* Vibrant Orange */
    --color-tertiary: #fdb813; /* Sun Yellow */
    --color-neutral: #006579; /* Dark Teal for text/headings */
    --color-neutral-light: #4492a5;
    --color-surface: #ffffff;
    --color-surface-dim: #f2fafd; /* Very light cyan for backgrounds */
    
    /* Typography */
    --font-headline: 'Epilogue', sans-serif;
    --font-body: 'Public Sans', sans-serif;
    
    /* Spacing & Layout */
    --container-max: 1280px;
    --gutter: 24px;
    --section-gap: 120px;
    
    /* Shapes & Shadows */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0, 101, 121, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 101, 121, 0.12);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-neutral);
    background-color: var(--color-surface);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headline);
    color: var(--color-neutral);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* ==========================================================================
   Layout Helpers
   ========================================================================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section {
    padding: var(--section-gap) 0;
}

.text-center {
    text-align: center;
}

.bg-surface-dim {
    background-color: var(--color-surface-dim);
}

/* ==========================================================================
   Components
   ========================================================================== */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 189, 242, 0.3);
}

.btn-primary:hover {
    background-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 121, 32, 0.4);
}

/* ==========================================================================
   Header & Navbar
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 24px 0;
    transition: all var(--transition-base);
}

.header.scrolled {
    padding: 16px 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

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

.logo img {
    height: 48px;
    width: auto;
    transition: transform var(--transition-fast);
}

.logo:hover img {
    transform: scale(1.05);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 32px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 32px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.header-socials {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-left: 16px;
}

.header-socials a {
    color: var(--color-secondary); /* Naranja para mayor visibilidad */
    transition: color var(--transition-fast), transform var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-socials a:hover {
    color: var(--color-primary); /* Cyan al pasar el cursor */
    transform: scale(1.1);
}

.nav-link {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-neutral);
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-primary);
}

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-neutral);
    cursor: pointer;
}

/* ==========================================================================
   Hero Section with Canvas Animation
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    background-color: transparent;
    overflow: hidden;
}

.fluid-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
}

.position-relative {
    position: relative;
    overflow: hidden;
}

.relative-z {
    position: relative;
    z-index: 2;
    pointer-events: none;
}
.relative-z > * {
    pointer-events: auto;
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 1; /* Imagen en su máximo esplendor */
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 101, 121, 0.5) 0%, rgba(0, 189, 242, 0.6) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    pointer-events: none;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-content > * {
    pointer-events: auto; /* Re-enable for buttons/text */
}

.hero-subtitle {
    display: inline-block;
    color: var(--color-neutral); /* Mejor contraste que el cyan */
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 24px;
    font-size: 14px;
    background: rgba(255,255,255,0.9);
    padding: 8px 16px;
    border-radius: 50px;
}

.hero-title {
    font-size: clamp(3.5rem, 6vw, 6rem);
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    line-height: 1.1;
    color: #ffffff;
}

.hero-title span {
    color: var(--color-secondary);
    background: linear-gradient(90deg, var(--color-secondary) 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    max-width: 700px;
}

/* ==========================================================================
   Recurso Visual 13
   ========================================================================== */
.recurso-visual {
    padding: 40px 0; /* Padding para que respiren en el fondo blanco */
    margin-top: 0; /* Quitamos el solapamiento con el hero */
    position: relative;
    z-index: 3;
    background-color: var(--color-surface); /* Aseguramos fondo blanco */
}

.recurso-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.recurso-img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.1));
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   PSTD Section
   ========================================================================== */
.pstd {
    padding-top: var(--section-gap);
}

.pstd-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.pstd-text h2 {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-bottom: 24px;
}

.pstd-text p {
    font-size: 1.125rem;
    margin-bottom: 24px;
    color: var(--color-neutral);
}

.pstd-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.badge {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
}

.badge-eu {
    background-color: rgba(0, 189, 242, 0.1); /* Nuevo Cyan */
    color: var(--color-primary);
    border: 1px solid rgba(0, 189, 242, 0.2);
}

.badge-cabildo {
    background-color: rgba(244, 121, 32, 0.1); /* Nuevo Naranja */
    color: var(--color-secondary);
    border: 1px solid rgba(244, 121, 32, 0.2);
}

.pstd-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform var(--transition-slow);
}

.pstd-image:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.pstd-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   Ejes Section
   ========================================================================== */
.ejes-header {
    margin-bottom: 64px;
}

.ejes-header h2 {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-bottom: 16px;
}

.ejes-header p {
    font-size: 1.125rem;
    color: var(--color-neutral-light);
}

.ejes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.eje-card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.eje-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: transparent;
    transition: background-color var(--transition-base);
    z-index: 2;
}

.eje-card:nth-child(1)::before { background-color: var(--color-tertiary); }
.eje-card:nth-child(2)::before { background-color: var(--color-secondary); }
.eje-card:nth-child(3)::before { background-color: var(--color-primary); }
.eje-card:nth-child(4)::before { background-color: var(--color-neutral); }

.eje-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

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

.eje-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.eje-content {
    padding: 32px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.eje-tag {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.eje-content h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    line-height: 1.4;
}

.eje-content p {
    color: var(--color-neutral-light);
    font-size: 0.95rem;
}

/* ==========================================================================
   Blog / Noticias Section
   ========================================================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.blog-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.blog-img {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.blog-tag {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255,255,255,0.9);
    color: var(--color-primary);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
}

.blog-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-date {
    font-size: 0.875rem;
    color: var(--color-neutral-light);
    margin-bottom: 12px;
    display: block;
}

.blog-title {
    font-size: 1.25rem;
    margin-bottom: 16px;
    line-height: 1.4;
}

.blog-excerpt {
    color: var(--color-neutral-light);
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.blog-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: gap var(--transition-fast);
}

.blog-link:hover {
    gap: 12px;
    color: var(--color-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: var(--color-surface-dim); /* Tono alineado con la nueva paleta (cyan muy claro) */
    color: var(--color-neutral);
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 2fr;
    gap: 40px;
    margin-bottom: 64px;
}

.footer-brand .footer-logo {
    max-width: 280px;
    /* Sin filtro invert para mantener sus colores originales en fondo claro */
}

.footer-menu ul {
    list-style: none;
    padding: 0;
}

.footer-menu li {
    margin-bottom: 16px;
}

.footer-menu a {
    color: var(--color-neutral);
    transition: color var(--transition-fast);
    font-size: 0.95rem;
    opacity: 0.8;
}

.footer-menu a:hover {
    color: var(--color-primary);
    opacity: 1;
}

.footer-contact p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    opacity: 0.8;
}

.mt-3 {
    margin-top: 16px;
}

.footer-socials {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-socials a {
    color: var(--color-neutral);
    opacity: 0.8;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-socials a:hover {
    color: var(--color-primary);
    opacity: 1;
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 24px;
}

.official-logos-img {
    max-width: 100%;
    height: auto;
    max-height: 50px; /* Asegura que no sea excesivamente grande */
    display: block;
    opacity: 0.9;
}

.footer-copyright {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* ==========================================================================
   Filtros Blog
   ========================================================================== */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--color-surface-dim);
    color: var(--color-neutral);
    padding: 8px 20px;
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-btn.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.blog-card {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.blog-card.hidden {
    display: none;
}

.footer-transparency-text {
    width: 100%;
    font-size: 0.8rem;
    color: var(--color-neutral);
    opacity: 0.8;
    text-align: center;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 24px;
}

/* ==========================================================================
   Animations & Responsive
   ========================================================================== */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 992px) {
    .pstd-container {
        grid-template-columns: 1fr;
    }
    
    .pstd-image {
        transform: none;
    }
    
    .pstd-image:hover {
        transform: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        padding: 24px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path var(--transition-base);
    }
    
    .nav.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-logos {
        display: flex;
        justify-content: center;
        margin-bottom: 24px;
    }
}
