@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;0,700;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --white-editorial: #FFFFF5;
    --white-soft: #F5F7F6;
    --gray-fog-light: #E6E8E7;
    --gray-fog: #D8DAD9;
    --black-editorial: #0F1110;
    --gray-deep: #3A3D3C;
    --gray-soft-text: #6B6F6D;
    --green-bg-soft: #E8F3EF;
    --nox-green: #074025;
    --green-accent: #2E6F57;
    --green-medium: #6FAF8F;
    --green-light-bg: #CFE5DB;

    --font-display: 'Crimson Pro', serif;
    --font-body: 'Source Serif 4', serif;
    --font-ui: 'DM Sans', sans-serif;
}

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(7, 64, 37, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(7, 64, 37, 0.6);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--white-editorial) 0%, var(--green-bg-soft) 100%);
    color: var(--black-editorial);
    line-height: 1.6;
    overflow-x: hidden;
}

/* HEADER DINÁMICO */
.header {
    background: linear-gradient(135deg, rgba(255, 255, 245, 0.95) 0%, rgba(232, 243, 239, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--nox-green), var(--green-accent), var(--green-medium)) 1;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(7, 64, 37, 0.1);
}

.header-top {
    padding: 14px 0;
    background: linear-gradient(90deg, var(--nox-green), var(--green-accent));
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.4s ease;
    max-height: 100px;
    /* arbitrary max height to allow smooth collapse */
}

.header-top.header-top-hidden {
    max-height: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.header-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.header-date {
    font-family: var(--font-ui);
    font-size: 0.9em;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-custom {
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    font-family: var(--font-ui);
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
}

.btn-custom::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-custom:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary-custom {
    background: linear-gradient(135deg, white, var(--green-light-bg));
    color: var(--nox-green);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.4);
}

.btn-primary-custom:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.6);
    color: var(--nox-green);
}

.btn-ghost-custom {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-ghost-custom:hover {
    background: white;
    color: var(--nox-green);
    transform: translateY(-3px) scale(1.05);
}

/* LOGO ANIMADO */
.logo-section {
    text-align: center;
    padding: 30px 0;
    position: relative;
    background: radial-gradient(circle at center, var(--green-bg-soft) 0%, transparent 70%);
    transition: padding 0.4s ease;
}

.logo-section.shrunk {
    padding: 10px 0;
}

.logo {
    font-family: var(--font-display);
    font-size: 4em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--nox-green) 0%, var(--green-accent) 50%, var(--green-medium) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: inline-block;
    animation: gradient-shift 4s ease infinite;
    position: relative;
    filter: drop-shadow(0 4px 10px rgba(7, 64, 37, 0.3));
    transition: font-size 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.logo.shrunk {
    font-size: 2.2em;
}

.logo:hover {
    animation: gradient-shift 1s ease infinite, float 2s ease-in-out infinite;
}

.logo-tagline {
    font-family: var(--font-ui);
    font-size: 0.85em;
    color: var(--gray-soft-text);
    margin-top: 8px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.4s ease;
}

.logo-tagline.shrunk {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

/* TICKER ENERGÉTICO */
.news-ticker {
    background: linear-gradient(90deg, var(--nox-green) 0%, var(--green-accent) 50%, var(--nox-green) 100%);
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
    overflow: hidden;
    position: relative;
    height: 50px;
    display: flex;
    align-items: center;
    box-shadow: inset 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.ticker-label {
    position: absolute;
    left: 0;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 0.8em;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    z-index: 10;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
    animation: pulse-glow 2s ease-in-out infinite;
}

.ticker-content {
    display: flex;
    animation: scroll-ticker 40s linear infinite;
    padding-left: 140px;
}

.ticker-item {
    padding: 0 40px;
    font-family: var(--font-ui);
    font-size: 0.95em;
    font-weight: 600;
    white-space: nowrap;
    color: white;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticker-dot {
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes scroll-ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* NAVEGACIÓN DINÁMICA */
.nav-frontend {
    background: transparent;
    padding-bottom: 20px;
    transition: padding-bottom 0.4s ease;
}

.nav-frontend.shrunk {
    padding-bottom: 10px;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link-frontend {
    padding: 16px 24px;
    font-family: var(--font-ui);
    font-size: 0.9em;
    font-weight: 700;
    color: var(--black-editorial);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 8px;
}

.nav-link-frontend::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-accent), var(--green-medium));
    transform: translateX(-50%);
    transition: width 0.3s;
    border-radius: 3px;
}

.nav-link-frontend:hover,
.nav-link-frontend.active {
    color: var(--nox-green);
    background: var(--green-light-bg);
    transform: translateY(-2px);
}

.nav-link-frontend:hover::before,
.nav-link-frontend.active::before {
    width: 80%;
}

/* CONTENEDOR */
.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* HERO SECTION IMPACTANTE */
.hero-section {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
    animation: scale-in 0.8s ease-out;
}

@media (max-width: 991px) {
    .hero-section {
        grid-template-columns: 1fr;
    }
}

.hero-main {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(7, 64, 37, 0.2);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: block;
    text-decoration: none;
}

.hero-main:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 80px rgba(7, 64, 37, 0.3);
}

.hero-main-image {
    width: 100%;
    height: 600px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.hero-main:hover .hero-main-image {
    transform: scale(1.1);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 17, 16, 0.95) 0%, transparent 100%);
    padding: 40px;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.hero-main:hover .hero-overlay {
    transform: translateY(0);
}

.category-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--nox-green), var(--green-accent));
    color: white;
    font-family: var(--font-ui);
    font-size: 0.75em;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 50px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(7, 64, 37, 0.4);
    animation: float 3s ease-in-out infinite;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1.2;
    color: white;
    margin-bottom: 16px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-excerpt {
    font-size: 1.1em;
    line-height: 1.6;
    color: var(--green-light-bg);
}

/* SIDEBAR HERO */
.hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(7, 64, 37, 0.15);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    position: relative;
    animation: slide-in-right 0.6s ease-out backwards;
    display: block;
    text-decoration: none;
}

.sidebar-card:nth-child(1) {
    animation-delay: 0.2s;
}

.sidebar-card:nth-child(2) {
    animation-delay: 0.3s;
}

.sidebar-card:nth-child(3) {
    animation-delay: 0.4s;
}

.sidebar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--green-accent), var(--green-medium));
    transition: height 0.4s ease;
}

.sidebar-card:hover {
    transform: translateX(10px) scale(1.03);
    box-shadow: 0 15px 50px rgba(7, 64, 37, 0.25);
}

.sidebar-card:hover::before {
    height: 100%;
}

.sidebar-card-content {
    padding: 24px;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 1.3em;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--black-editorial);
}

.sidebar-meta {
    font-family: var(--font-ui);
    font-size: 0.85em;
    color: var(--gray-soft-text);
    font-weight: 600;
}

/* GRID DINÁMICO */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

@media (max-width: 991px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.news-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(7, 64, 37, 0.12);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    position: relative;
    animation: scale-in 0.6s ease-out backwards;
    text-decoration: none;
    display: block;
}

.news-card:nth-child(1) {
    animation-delay: 0.1s;
}

.news-card:nth-child(2) {
    animation-delay: 0.2s;
}

.news-card:nth-child(3) {
    animation-delay: 0.3s;
}

.news-card:nth-child(4) {
    animation-delay: 0.4s;
}

.news-card:nth-child(5) {
    animation-delay: 0.5s;
}

.news-card:nth-child(6) {
    animation-delay: 0.6s;
}

.news-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(111, 175, 143, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
}

.news-card:hover {
    transform: translateY(-15px) rotate(-1deg);
    box-shadow: 0 25px 60px rgba(7, 64, 37, 0.25);
}

.news-card:hover::after {
    right: 100%;
}

.news-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.news-card:hover .news-card-image {
    transform: scale(1.15);
}

.news-card-content {
    padding: 24px;
}

.news-card-title {
    font-family: var(--font-display);
    font-size: 1.4em;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--black-editorial), var(--gray-deep));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-card-excerpt {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--gray-soft-text);
}

/* SECTION HEADERS */
.section-header {
    margin-top: 60px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--green-light-bg);
    padding-bottom: 10px;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 2.2em;
    font-weight: 700;
    color: var(--nox-green);
    margin: 0;
}

/* FOOTER */
.footer-editorial {
    background: var(--black-editorial);
    color: white;
    padding: 80px 0 30px;
    position: relative;
    overflow: hidden;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, white, var(--green-medium));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.footer-desc {
    color: var(--gray-fog);
    font-size: 0.95em;
    max-width: 300px;
}

.footer-title {
    font-family: var(--font-ui);
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
    color: var(--green-light-bg);
}

/* SINGLE POST VIEWS */
.single-post-title {
    font-family: var(--font-display);
    font-size: 3.5em;
    font-weight: 700;
    line-height: 1.1;
    color: var(--black-editorial);
    margin-bottom: 20px;
}

.single-post-content {
    font-family: var(--font-body);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--gray-deep);
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
}

.single-post-content h2,
.single-post-content h3 {
    font-family: var(--font-display);
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--black-editorial);
}