/* =========================================
   1. VARIABLES Y FUENTES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Merriweather:ital,wght@0,400;0,700;0,900;1,400&display=swap');

:root {
    /* Colores Base (Sobrescritos por PHP) */
    --primary: #0f2545;
    --accent: #d62828;
    --text-dark: #1a1a1a;
    --bg-light: #f8fafc;
    --border: #e2e8f0;
    
    /* Admin Variables */
    --sidebar-w: 260px;
    --sidebar-bg: #1e293b;
}

body { font-family: 'Inter', sans-serif; background-color: var(--bg-light); color: var(--text-dark); overflow-x: hidden; }
a { text-decoration: none; transition: 0.2s ease; color: inherit; }
a:hover { color: var(--accent); }
.font-serif { font-family: 'Merriweather', serif; letter-spacing: -0.5px; }

/* =========================================
   2. HEADER & NAV
   ========================================= */
.top-bar { background: #f1f5f9; font-size: 0.8rem; padding: 8px 0; border-bottom: 1px solid var(--border); font-weight: 600; }
.navbar { box-shadow: 0 4px 20px -5px rgba(0,0,0,0.05); padding: 1rem 0; }
.nav-link { font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* Ticker */
.news-ticker { background: #0f172a; color: white; height: 42px; display: flex; align-items: center; overflow: hidden; border-bottom: 3px solid var(--accent); font-size: 0.85rem; }
.ticker-label { background: var(--accent); height: 100%; padding: 0 25px; display: flex; align-items: center; font-weight: 800; font-size: 0.7rem; text-transform: uppercase; z-index: 10; clip-path: polygon(0 0, 100% 0, 90% 100%, 0% 100%); }
.ticker-move { display: inline-block; white-space: nowrap; padding-left: 100%; animation: ticker 45s linear infinite; }
.ticker-move:hover { animation-play-state: paused; }
.ticker-item { color: #e2e8f0; margin-right: 50px; font-weight: 600; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* =========================================
   3. PORTADA (Hero & Cards)
   ========================================= */
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; min-height: 500px; margin-bottom: 50px; }
@media (max-width: 992px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-item { position: relative; border-radius: 10px; overflow: hidden; height: 100%; background: #000; }
.hero-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; opacity: 0.9; }
.hero-item:hover .hero-img { transform: scale(1.05); opacity: 0.7; }
.hero-content { position: absolute; bottom: 0; left: 0; width: 100%; padding: 30px; background: linear-gradient(to top, rgba(0,0,0,0.95) 10%, transparent); color: white; z-index: 2; }
.cat-badge { background: var(--accent); color: white; font-size: 0.6rem; font-weight: 800; text-transform: uppercase; padding: 5px 10px; border-radius: 4px; margin-bottom: 10px; display: inline-block; }

/* Card Horizontal (Imagen Izq - Texto Der) */
.card-horizontal { background: white; border-bottom: 1px solid var(--border); display: flex; margin-bottom: 25px; padding-bottom: 25px; align-items: flex-start; }
.card-h-img { width: 260px; height: 160px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.card-h-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card-horizontal:hover img { transform: scale(1.05); }
.card-h-body { padding-left: 25px; flex-grow: 1; display: flex; flex-direction: column; }
@media (max-width: 768px) { .card-horizontal { flex-direction: column; } .card-h-img { width: 100%; height: 200px; margin-bottom: 15px; } .card-h-body { padding-left: 0; } }

/* Sidebar Widgets */
.sidebar-sticky { position: sticky; top: 110px; }
.widget { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 25px; margin-bottom: 30px; }
.widget-title { font-weight: 800; text-transform: uppercase; font-size: 0.85rem; margin-bottom: 20px; border-left: 4px solid var(--accent); padding-left: 12px; color: var(--primary); }
.popular-item { display: flex; gap: 15px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #f1f5f9; }
.popular-img { width: 80px; height: 80px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.popular-img img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================
   4. VISTA NOTICIA (Lectura)
   ========================================= */
.article-wrapper { max-width: 1200px; margin: 0 auto; }
.pro-content-grid { display: grid; grid-template-columns: 60px 1fr 300px; gap: 40px; }
@media (max-width: 992px) { .pro-content-grid { grid-template-columns: 1fr; } .sticky-tools-left { display: none; } }
.sticky-tools-left { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 10px; }
.tool-icon { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #ddd; background: white; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.tool-icon:hover { background: var(--primary); color: white; }
.article-body { font-family: 'Merriweather', serif; font-size: 1.2rem; line-height: 1.9; color: #222; }
.article-body p:first-of-type::first-letter { float: left; font-size: 4rem; line-height: 0.8; font-weight: 900; margin-right: 10px; color: var(--primary); }
.author-box { background: #f8f9fa; border-left: 4px solid var(--primary); padding: 20px; border-radius: 0 8px 8px 0; }

/* =========================================
   5. ADMIN (Fix Estructura)
   ========================================= */
.d-flex-wrapper { display: flex; width: 100%; align-items: stretch; }
#sidebar { min-width: var(--sidebar-w); max-width: var(--sidebar-w); min-height: 100vh; background: var(--sidebar-bg); color: #fff; position: fixed; top:0; left:0; z-index: 1000; }
#sidebar .nav-link { color: #cbd5e1; padding: 12px 20px; display: block; text-decoration: none; }
#sidebar .nav-link:hover, #sidebar .nav-link.active { background: rgba(255,255,255,0.1); color: white; border-left: 4px solid var(--accent); }
#content { width: calc(100% - var(--sidebar-w)); margin-left: var(--sidebar-w); padding: 30px; min-height: 100vh; }
@media (max-width: 768px) { #sidebar { margin-left: -260px; } #content { width: 100%; margin-left: 0; } }

/* =========================================
   6. FOOTER
   ========================================= */
footer { background: #0f172a; color: #94a3b8; padding-top: 60px; margin-top: 80px; border-top: 5px solid var(--primary); }
footer h4 { color: white; font-family: 'Merriweather', serif; font-weight: 900; }