/* ============================================
   CNN-INSPIRED NEWS PORTAL
   Colores: Rojo CNN (#CC0000), Negro, Blanco, Grises
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700;900&family=Source+Serif+4:wght@400;600;700&display=swap');

:root {
    --red-primary: #CC0000;
    --red-dark: #990000;
    --red-light: #E60000;
    --black: #0a0a0a;
    --dark-gray: #1a1a1a;
    --medium-gray: #333333;
    --gray: #666666;
    --light-gray: #e8e8e8;
    --lighter-gray: #f4f4f4;
    --white: #ffffff;
    --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --max-width: 1200px;
    --header-height: 56px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    color: var(--black);
    background: var(--white);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================
   BREAKING NEWS TICKER
   ============================================ */
.ticker-bar {
    background: var(--red-primary);
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    white-space: nowrap;
    padding: 6px 0;
}

.ticker-bar .ticker-content {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

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

/* ============================================
   HEADER (CNN-style)
   ============================================ */
.site-header {
    background: var(--dark-gray);
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-inner {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 28px;
    color: var(--white);
    letter-spacing: -1px;
    text-transform: uppercase;
}

.site-logo span {
    color: var(--red-primary);
}

/* Hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    margin: 5px 0;
    transition: 0.3s;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 0;
}

.main-nav a {
    display: block;
    padding: 16px 14px;
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: background 0.2s;
    border-bottom: 3px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(255,255,255,0.08);
    border-bottom-color: var(--red-primary);
}

/* ============================================
   LIVE BADGE
   ============================================ */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--red-primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 2px;
}

.live-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.section-divider {
    border: none;
    border-top: 3px solid var(--red-primary);
    margin: 24px 0 16px;
}

.section-title {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--red-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 16px;
}

/* ============================================
   HERO / FEATURED ARTICLE (CNN Top Story style)
   ============================================ */
.hero-section {
    margin: 16px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2px;
    background: var(--light-gray);
}

.hero-main {
    position: relative;
    overflow: hidden;
    background: var(--black);
    min-height: 400px;
}

.hero-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.hero-main .hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}

.hero-main .category-tag {
    display: inline-block;
    background: var(--red-primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    margin-bottom: 10px;
}

.hero-main h2 {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    margin-bottom: 8px;
}

.hero-main h2 a:hover {
    text-decoration: underline;
}

.hero-main .hero-excerpt {
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    line-height: 1.5;
}

.hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-sidebar-item {
    position: relative;
    overflow: hidden;
    background: var(--black);
    flex: 1;
    min-height: 130px;
}

.hero-sidebar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.65;
}

.hero-sidebar-item .hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.hero-sidebar-item h3 {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.hero-sidebar-item h3 a:hover {
    text-decoration: underline;
}

/* ============================================
   ARTICLE CARDS GRID
   ============================================ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.article-card {
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 16px;
}

.article-card .card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    margin-bottom: 10px;
}

.article-card .card-category {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--red-primary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.article-card h3 {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
}

.article-card h3 a:hover {
    color: var(--red-primary);
}

.article-card .card-meta {
    font-size: 12px;
    color: var(--gray);
}

/* ============================================
   ARTICLE LIST (sidebar style)
   ============================================ */
.article-list-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--light-gray);
}

.article-list-item .list-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    flex-shrink: 0;
}

.article-list-item h4 {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.article-list-item h4 a:hover {
    color: var(--red-primary);
}

.article-list-item .list-meta {
    font-size: 11px;
    color: var(--gray);
    margin-top: 4px;
}

/* ============================================
   SINGLE ARTICLE PAGE
   ============================================ */
.article-page {
    max-width: 780px;
    margin: 24px auto;
    padding: 0 16px;
}

.article-page .article-category {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--red-primary);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.article-page h1 {
    font-family: var(--font-serif);
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 12px;
}

.article-page .article-meta {
    font-size: 14px;
    color: var(--gray);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 20px;
}

.article-page .article-meta strong {
    color: var(--black);
}

.article-page .featured-image {
    width: 100%;
    margin-bottom: 20px;
}

.article-page .article-body {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.75;
    color: var(--medium-gray);
}

.article-page .article-body p {
    margin-bottom: 18px;
}

.article-page .article-body h2 {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--black);
}

.article-page .article-body h3 {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 10px;
    color: var(--black);
}

.article-page .article-body ul {
    margin: 10px 0 18px 24px;
}

.article-page .article-body li {
    margin-bottom: 6px;
}

.article-page .article-body strong {
    color: var(--black);
}

/* CTA BUTTON */
.cta-box {
    background: linear-gradient(135deg, #f8f8f8, #eee);
    border-left: 4px solid var(--red-primary);
    padding: 24px;
    margin: 32px 0;
    text-align: center;
}

.cta-box p {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--medium-gray);
}

.cta-button {
    display: inline-block;
    background: var(--red-primary);
    color: white;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 40px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.cta-button:hover {
    background: var(--red-dark);
}

/* ============================================
   FOOTER (CNN-style)
   ============================================ */
.site-footer {
    background: var(--dark-gray);
    color: var(--white);
    margin-top: 40px;
}

.footer-top {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.footer-col h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--red-primary);
    margin-bottom: 12px;
}

.footer-col a {
    display: block;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    padding: 4px 0;
    transition: color 0.2s;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .hero-main { min-height: 280px; }
    .hero-sidebar { flex-direction: row; }
    .hero-sidebar-item { min-height: 120px; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .site-logo { font-size: 22px; }
    .menu-toggle { display: block; }
    .main-nav { 
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--dark-gray);
        z-index: 999;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; }
    .main-nav a { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .hero-main h2 { font-size: 24px; }
    .hero-sidebar { flex-direction: column; }
    .articles-grid { grid-template-columns: 1fr; }
    .article-page h1 { font-size: 28px; }
    .article-page .article-body { font-size: 16px; }
    .footer-top { grid-template-columns: 1fr; }
}

/* ============================================
   ADMIN STYLES (inline - solo para /admin)
   ============================================ */
.admin-body {
    font-family: var(--font-sans);
    background: #f0f2f5;
}

.admin-header {
    background: var(--dark-gray);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    color: white;
    font-size: 18px;
}

.admin-header a {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.admin-container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

.admin-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 20px;
}

.admin-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--red-primary);
}

.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--light-gray);
}

.admin-tabs a {
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--gray);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.admin-tabs a:hover,
.admin-tabs a.active {
    color: var(--red-primary);
    border-bottom-color: var(--red-primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--medium-gray);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-sans);
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 2px rgba(204,0,0,0.15);
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--red-primary);
    color: white;
}
.btn-primary:hover { background: var(--red-dark); }

.btn-secondary {
    background: var(--medium-gray);
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    border-bottom: 2px solid var(--light-gray);
}

.admin-table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--lighter-gray);
}

.admin-table tr:hover td {
    background: var(--lighter-gray);
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-published { background: #d4edda; color: #155724; }
.status-draft { background: #fff3cd; color: #856404; }

.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 36px;
    font-weight: 900;
    color: var(--red-primary);
}

.stat-card .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-top: 4px;
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-table { font-size: 12px; }
    .admin-tabs a { padding: 8px 12px; font-size: 12px; }
}
