/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;1,400&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --primary: #004e64;      /* Deep Ocean Blue */
    --primary-dark: #003544;
    --secondary: #00a5cf;    /* Bright Cyan Blue */
    --accent: #9fffcb;       /* Mint Accent */
    --warm: #25a18e;         /* Teal */
    --gold: #f4d35e;         /* Sun Gold */
    
    /* Neutral Colors */
    --dark: #1a1a1a;
    --gray-dark: #333333;
    --gray-medium: #777777;
    --gray-light: #f4f4f4;
    --white: #ffffff;
    
    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --radius: 8px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Merriweather', serif; /* Classic news body font */
    background-color: #f9f9f9;
    color: var(--dark);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, nav, .btn, .date, .category-tag {
    font-family: 'Outfit', sans-serif; /* Modern headings */
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Wrapper */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Header (solo el header principal del sitio) */
body > header {
    background: var(--white);
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 2000; /* Highest priority */
    box-shadow: var(--shadow-sm);
    border-bottom: 4px solid var(--primary);
}

/* Reading Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 2000;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--secondary), var(--accent));
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px var(--secondary);
}

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

.logo img {
    height: 45px;
}

.logo span {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

nav ul { display: flex; gap: 2rem; }
nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

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

nav a:hover::after { width: 100%; }
nav a:hover { color: var(--primary); }

.btn-admin {
    padding: 0.5rem 1.2rem;
    background: var(--dark);
    color: var(--white);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-admin:hover { background: var(--primary); color: var(--white); }

/* Hero Section */
.hero-section {
    position: relative;
    height: 500px; /* Alto fijo para impacto */
    margin-bottom: 3rem;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
    transition: transform 5s ease;
}

.hero-section:hover .hero-bg {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 4rem 2rem 2rem;
    color: var(--white);
}

.hero-content {
    max-width: var(--container-width);
    margin: 0 auto;
}

.hero-category {
    background: var(--secondary);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-meta {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Main Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3 Content, 1/3 Sidebar */
    gap: 3rem;
    margin-bottom: 4rem;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    border-left: 5px solid var(--primary);
    padding-left: 1rem;
    margin-bottom: 2rem;
    color: var(--dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Card Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.news-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

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

.card-img-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

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

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-medium);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
}

.card-meta .cat { color: var(--secondary); }

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.3;
    color: var(--dark);
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--gray-medium);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.card-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.read-more {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    border: 1px solid #eee;
}

.widget-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.compact-news-list { display: flex; flex-direction: column; gap: 1rem; }
.compact-news-item { display: flex; gap: 1rem; align-items: start; }
.compact-news-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.compact-news-info h4 {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0.3rem;
}
.compact-news-info h4 a:hover { color: var(--secondary); }
.compact-news-date { font-size: 0.75rem; color: #999; }

/* Article Page */
.article-main {
    padding-bottom: 5rem;
    padding-top: calc(var(--header-height) + 3.5rem);
    position: relative;
    z-index: 10;
}

.article-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    padding: 3rem; /* Reduced padding to create space safely */
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border-radius: var(--radius);
    position: relative;
    border: 1px solid rgba(0,0,0,0.03);
    overflow: hidden; /* Contains all children */
}

.article-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 3.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Subtle divider */
    padding-bottom: 3rem;
}

.article-category-wrapper {
    margin-bottom: 1.5rem;
}

.article-category {
    font-family: 'Outfit', sans-serif;
    color: var(--secondary);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 0.85rem;
    position: relative;
    padding-bottom: 5px;
}

.article-category::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--primary);
}

.article-title {
    font-family: 'Merriweather', serif; /* Editorial Serif */
    font-size: clamp(2.2rem, 5vw, 4.5rem); /* Massive, cinematic title */
    line-height: 1.1;
    margin: 0 0 1.5rem 0;
    color: var(--dark);
    font-weight: 900;
    letter-spacing: -1px;
    max-width: 100%;
    overflow-wrap: anywhere;
    hyphens: auto;
}

/* Meta Data */
.meta-item { 
    display: flex; 
    align-items: center; 
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--gray-medium);
    margin-top: 0.5rem;
}

.article-featured-wrapper {
    margin: 0 0 3rem 0; /* SAFE: No negative margins */
    position: relative;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.article-featured-img {
    width: 100%;
    height: auto; /* Let natural height dictate layout */
    max-height: 600px;
    object-fit: cover;
    display: block; /* Removes inline gap */
}

.article-content {
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    line-height: 1.9;
    color: #2c2c2c;
    max-width: 740px;
    margin: 0 auto;
    font-family: 'Merriweather', serif;
}

.article-lead {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--primary-dark);
    margin-bottom: 3rem;
}

.article-body-text p {
    margin-bottom: 2rem;
}

/* Elite Drop Cap */
.article-body-text > p:first-of-type::first-letter {
    font-family: 'Merriweather', serif;
    font-size: 5.5rem;
    font-weight: 900;
    float: left;
    line-height: 0.8;
    margin-right: 1rem;
    margin-top: 0.5rem;
    color: var(--primary);
}

.article-share {
    margin-top: 5rem;
    padding: 3rem;
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.share-title {
    font-size: 1.2rem;
    color: var(--gray-dark);
    font-family: 'Outfit', sans-serif;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-share {
    font-size: 0.95rem;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-share:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.btn-fb { background: #1877F2; }
.btn-tw { background: #1DA1F2; }
.btn-wa { background: #25D366; }

/* Sticky Share Sidebar (Desktop Only) */
.sticky-share-sidebar {
    position: fixed;
    left: calc(50% - 500px);
    top: 250px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 100;
}

@media (max-width: 1100px) {
    .sticky-share-sidebar { display: none; }
}

.sticky-share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.sticky-share-btn:hover { transform: scale(1.1); filter: brightness(1.1); }

/* Newsletter Box */
.newsletter-box {
    margin-top: 5rem;
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 4rem;
    border-radius: 20px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.newsletter-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.newsletter-box h3 { font-size: 2.2rem; margin-bottom: 1rem; color: white; }
.newsletter-box p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2.5rem; }

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-input {
    flex-grow: 1;
    padding: 1.2rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    outline: none;
}

.newsletter-submit {
    background: var(--accent);
    color: var(--primary-dark);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
}

.newsletter-submit:hover { background: var(--secondary); color: white; transform: translateY(-3px); }

/* Related News */
.related-news-section {
    margin-top: 8rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .related-grid { grid-template-columns: 1fr; }
    .newsletter-box { padding: 2rem 1.5rem; }
    .newsletter-form { flex-direction: column; }
}

.related-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.related-card:hover { transform: translateY(-5px); }
.related-img { width: 100%; height: 180px; object-fit: cover; }
.related-info { padding: 1.5rem; }
.related-info h4 { font-size: 1.1rem; line-height: 1.3; margin-bottom: 0.5rem; }
.related-info .date { font-size: 0.8rem; color: var(--gray-medium); }

/* Footer */
footer {
    background: var(--dark);
    color: var(--white);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 { color: var(--white); margin-bottom: 1.5rem; }
.footer-col p { color: #aaa; font-size: 0.9rem; }
.footer-links li { margin-bottom: 0.8rem; }
.footer-links a { color: #ccc; }
.footer-links a:hover { color: var(--secondary); }

.copy {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 2rem;
    font-size: 0.85rem;
    color: #777;
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1100;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mobile Nav Styles */
.nav-mobile {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: var(--white);
    z-index: 1200;
    padding: 2rem;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.nav-mobile.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--gray-light);
    padding-bottom: 1rem;
}

.mobile-nav-close,
.mobile-menu-close {
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
}

.nav-mobile ul {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-mobile a {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1150;
    display: none;
}

.mobile-nav-overlay.active {
    display: block;
}

/* Responsive Breakpoints */

/* Desktop & Large Tablets (up to 1200px) */
@media (max-width: 1240px) {
    .container { width: 95%; }
    .hero-title { font-size: 2.5rem; }
}

/* Small Laptops & Tablets (up to 992px) */
@media (max-width: 1024px) {
    .main-layout { gap: 2rem; }
    .hero-section { height: 400px; }
    .hero-title { font-size: 2.2rem; }
}

/* Tablets & Mobile (up to 768px) */
@media (max-width: 768px) {
    :root { --header-height: 70px; }

    /* Layout Overrides */
    .article-main { padding-top: calc(var(--header-height) + 1.5rem); }
    
    /* Header */
    body > header { height: var(--header-height); }
    .nav-desktop, .btn-admin { display: none; }
    .mobile-menu-toggle { display: flex; }
    .logo span { font-size: 1.2rem; }
    
    /* Search Form */
    .search-form { display: none; }

    /* Layout */
    .main-layout { grid-template-columns: 1fr; gap: 2rem; }
    .sidebar { position: static; margin-top: 3rem; }

    /* Hero */
    .hero-section { height: auto; min-height: 400px; }
    .hero-title { font-size: 2rem; }
    .hero-overlay { padding: 2rem 1.5rem; }

    /* Grid */
    .news-grid { grid-template-columns: 1fr; }
    
    /* Article Page Specifics */
    .article-wrapper { 
        padding: 0;
        margin: 0; 
        border: none;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
        background: transparent;
        overflow: visible;
    }
    
    .article-header { 
        margin-bottom: 2rem; 
        align-items: flex-start; 
        text-align: left;
        padding: 0 1rem 2rem;
        width: 100%;
    }

    .article-category { font-size: 0.75rem; }
    .article-category::after { left: 0; transform: none; }
    
    .article-title { 
        font-size: 2.2rem; 
        margin-bottom: 1rem;
        line-height: 1.2; 
    }
    
    .meta-item {
        width: 100%;
        font-size: 0.85rem;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    /* Featured Image */
    .article-featured-wrapper { 
        margin: 0 1rem 2rem;
        width: auto;
        border-radius: 6px;
    }
    .article-featured-img { height: auto; aspect-ratio: 16/9; }
    
    /* Content */
    .article-content { font-size: clamp(1.05rem, 3.8vw, 1.15rem); line-height: 1.7; padding: 0 1rem; }
    .article-lead { font-size: 1.25rem; margin-bottom: 2rem; }
    
    /* Share & Footer */
    .article-share { padding: 1.5rem; margin-top: 3rem; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
}

.nav-mobile a.btn {
    color: var(--white);
    background: var(--primary);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    display: block;
    margin-top: 1rem;
}

.nav-mobile a.btn:hover {
    background: var(--secondary);
}

/* Very Small Devices (up to 480px) */
@media (max-width: 480px) {
    .logo span { font-size: 1rem; }
    .hero-title { font-size: 1.5rem; }
    .section-title { font-size: 1.2rem; }
    .card-title { font-size: 1.1rem; }
    .article-title { font-size: 1.8rem; }
    .article-lead { font-size: 1.1rem; }
    .btn { width: 100%; text-align: center; }
}

/* Utilities */
.btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--secondary); }

/* Admin Forms Override */
.admin-form-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 2rem auto;
}

@media (max-width: 768px) {
    .admin-form-container {
        padding: 1.5rem;
        margin: 1rem auto;
        width: calc(100% - 2rem);
        max-width: 100%;
    }

    .admin-form-group { margin-bottom: 1.5rem; }
    .admin-btn-save { width: 100%; }
}

.admin-form-group { margin-bottom: 2rem; }
.admin-form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--dark);
    font-family: 'Outfit', sans-serif;
}

.admin-form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s;
}

.admin-form-control:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 95, 115, 0.1);
}

.admin-btn-save {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.animate-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

.article-content blockquote {
    border-left: 4px solid var(--secondary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--gray-dark);
    font-size: 1.4rem;
}
