/* ========================================
   Carousel + Sidebar Layout
   ======================================== */

:root {
    --primary-color: #dc2626;
    --secondary-color: #ef4444;
    --accent-color: #fbbf24;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    
    --font-primary: 'Playfair Display', serif;
    --font-secondary: 'Noto Sans', sans-serif;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.12);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-secondary); background: var(--background-color); color: var(--text-color); line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-color); text-decoration: none; transition: all 0.3s ease; }
a:hover { color: var(--secondary-color); }
.container { max-width: 1400px; margin: 0 auto; padding: 0 var(--space-lg); }

#preloader { position: fixed; inset: 0; background: white; display: flex; align-items: center; justify-content: center; z-index: 9999; }
#preloader.hidden { opacity: 0; pointer-events: none; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--border-color); border-top-color: var(--accent-color); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== HEADER ===== */
.header { background: var(--card-bg); border-bottom: 3px solid var(--primary-color); position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow-md); }
.header-container { display: flex; align-items: center; gap: var(--space-lg); padding: var(--space-md) var(--space-lg); }
.logo-section { display: flex; align-items: center; gap: var(--space-md); }
.site-logo { height: 50px; width: auto; object-fit: contain; }
.site-title { font-family: var(--font-primary); font-size: 1.8rem; font-weight: 800; color: var(--primary-color); }
.tagline { font-size: 0.85rem; color: var(--text-muted); }
.main-nav { display: flex; gap: var(--space-sm); flex: 1; justify-content: center; }
.nav-link { padding: var(--space-sm) var(--space-md); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; }
.nav-link:hover, .nav-link.active { background: var(--primary-color); color: white; }
.search-toggle { background: transparent; border: none; color: var(--text-color); font-size: 1.2rem; cursor: pointer; }

/* ===== BREAKING NEWS ===== */
.breaking-news { background: var(--primary-color); display: flex; align-items: center; padding: var(--space-sm) 0; margin-top: var(--space-md); }
.breaking-label { background: var(--accent-color); color: var(--primary-color); padding: var(--space-xs) var(--space-md); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; margin-right: var(--space-lg); }
.breaking-ticker { flex: 1; overflow: hidden; color: white; }
.ticker-item { display: inline-block; padding: 0 var(--space-md); }

/* ===== CAROUSEL + SIDEBAR LAYOUT ===== */
.featured-section { padding: var(--space-2xl) 0; }

.carousel-sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: var(--space-lg);
    align-items: start;
}

/* Main Carousel */
.carousel-main {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.carousel-slide {
    position: relative;
    height: 500px;
    display: none;
}

.carousel-slide.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-2xl);
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    color: white;
}

.carousel-overlay .category-badge {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.carousel-overlay h2 {
    font-family: var(--font-primary);
    font-size: 2.2rem;
    font-weight: 800;
    margin: var(--space-sm) 0;
    line-height: 1.2;
}

.carousel-overlay p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: var(--space-md);
}

.carousel-meta {
    display: flex;
    gap: var(--space-lg);
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Carousel Controls */
.carousel-controls {
    position: absolute;
    bottom: var(--space-lg);
    right: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    z-index: 10;
}

.carousel-btn {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Carousel Indicators */
.carousel-indicators {
    position: absolute;
    bottom: var(--space-md);
    left: var(--space-lg);
    display: flex;
    gap: var(--space-xs);
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--accent-color);
    width: 30px;
    border-radius: 6px;
}

/* Sidebar */
.carousel-sidebar {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    max-height: 500px;
    overflow-y: auto;
}

.sidebar-title {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--accent-color);
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sidebar-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-item:hover {
    background: var(--background-color);
}

.sidebar-item.active {
    background: var(--background-color);
    border-left: 3px solid var(--accent-color);
}

.sidebar-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.sidebar-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-item .category-badge {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.sidebar-item h4 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-item .timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* News Grid Section */
.news-section {
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-xl);
    position: relative;
    padding-bottom: var(--space-md);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.news-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.news-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

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

.card-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-content {
    padding: var(--space-lg);
}

.card-title {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.category-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    color: white;
}

.cat-nacional { background: #dc3545; }
.cat-politica { background: #007bff; }
.cat-economia { background: #28a745; }
.cat-deportes { background: #fd7e14; }
.cat-cultura { background: #6f42c1; }
.cat-destacado { background: #e74c3c; }

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: var(--space-2xl);
}

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

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

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

.footer-logo h3 {
    font-family: var(--font-primary);
    font-size: 1.3rem;
}

.footer-about {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

.social-links {
    display: flex;
    gap: var(--space-sm);
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
}

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

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Spacing Variables */
:root {
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .carousel-sidebar-layout {
        grid-template-columns: 1fr;
    }
    .carousel-sidebar {
        max-height: none;
    }
    .news-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .carousel-slide {
        height: 350px;
    }
    .carousel-overlay h2 {
        font-size: 1.5rem;
    }
    .news-grid-3 {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .carousel-slide {
        height: 280px;
    }
    .carousel-overlay h2 {
        font-size: 1.2rem;
    }
    .carousel-overlay p {
        font-size: 0.9rem;
    }
}
