/* ==========================================================================
   R365 GLOBAL MEDIA - Premium Stylesheet
   Design System: Crimson Red, Dark Deep Navy/Slate, Gold Accents
   Typography: Playfair Display (Serif) & Inter (Sans-serif)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,700&display=swap');

:root {
    /* Light Theme Variables */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F2F2F2;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --border-color: #CFCFCF;
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    
    --primary: #1A1A2E; /* Dark Navy like El País */
    --primary-hover: #2D2D4E;
    --accent: #C8102E; /* Crimson as accent only */
    --accent-light: #FFF5F5;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.08);
    --shadow-glow: none;
    
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --border-radius-sm: 2px;
    --border-radius-md: 4px;
    --border-radius-lg: 6px;
    
    --header-height: 80px;
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-primary: #0A0F1D; /* Extremely Deep Slate */
    --bg-secondary: #121829; /* Card background */
    --bg-tertiary: #1E2640;
    --bg-glass: rgba(18, 24, 41, 0.85);
    --border-color: #232D45;
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --primary: #4A4A6E;
    --primary-hover: #6A6A8E;
    --accent: #E63946;
    --accent-light: #1E2522;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: none;
}

/* ==========================================================================
   Base Reset
   ========================================================================== */

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

button, input, textarea, select {
    font-family: inherit;
    outline: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 24px;
}



/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   Header and Branding
   ========================================================================== */

.top-bar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 8px 0;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticker-financial {
    display: flex;
    gap: 16px;
    overflow: hidden;
}

.financial-item {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.financial-up { color: #10B981; }
.financial-down { color: #EF4444; }

.main-header {
    background-color: var(--bg-secondary);
    border-bottom: 2px solid #1A1A2E;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

/* El País-style: Logo centered, nav separated */
.header-logo-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
}

.logo-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-logo-section {
    position: relative;
}

.header-actions-left,
.header-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
}

.nav-bar-wrapper {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    background-color: var(--bg-secondary);
}

.nav-bar-wrapper .nav-menu {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
}

.nav-separator {
    color: var(--border-color);
    font-size: 0.9rem;
    padding: 0 14px;
    user-select: none;
}

.nav-bar-wrapper .nav-link {
    text-transform: uppercase;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 4px 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform var(--transition-fast);
}

.logo-badge {
    background-color: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    letter-spacing: 1px;
    align-self: flex-start;
    margin-top: 8px;
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-secondary);
    position: relative;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link.active {
    border-bottom: 2px solid var(--accent);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    background-color: var(--primary);
    transition: width var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 0;
}

/* Actions Header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 20px;
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* Theme Switcher Toggle */
.theme-toggle {
    width: 48px;
    height: 24px;
    border-radius: 12px;
    background-color: var(--bg-tertiary);
    position: relative;
    padding: 2px;
    transition: background-color var(--transition-normal);
}

.theme-toggle-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary);
    position: absolute;
    left: 2px;
    top: 2px;
    transition: transform var(--transition-normal), background-color var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
}

[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(24px);
    background-color: var(--accent);
}

/* ==========================================================================
   Breaking News Ticker
   ========================================================================== */

.breaking-news-bar {
    background-color: #1A1A2E;
    color: white;
    padding: 6px 0;
    font-size: 0.9rem;
    overflow: hidden;
    position: relative;
}

.breaking-news-container {
    display: flex;
    align-items: center;
}

.breaking-title {
    font-weight: 700;
    text-transform: uppercase;
    background-color: var(--accent);
    color: var(--bg-secondary);
    padding: 4px 12px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border-radius: var(--border-radius-sm);
    margin-right: 20px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.ticker-wrap {
    overflow: hidden;
    width: 100%;
}

.ticker-move {
    display: flex;
    gap: 40px;
    white-space: nowrap;
    animation: tickerAnimation 30s linear infinite;
}

.ticker-move:hover {
    animation-play-state: paused;
}

.ticker-item {
    font-weight: 500;
    cursor: pointer;
}

.ticker-item::after {
    content: "•";
    margin-left: 40px;
    color: var(--accent);
}

@keyframes tickerAnimation {
    0% { transform: translate3d(100%, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* ==========================================================================
   Main Grid Layout
   ========================================================================== */

.main-layout {
    display: grid;
    grid-template-columns: 220px 2.2fr 1fr;
    gap: 32px;
    margin-top: 32px;
    margin-bottom: 60px;
}

/* Articles and Feeds */
.articles-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title span {
    position: relative;
}

/* Hero Article Card */
.hero-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

@media (min-width: 900px) {
    .hero-card {
        flex-direction: row;
        align-items: stretch;
    }
}

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

.hero-img-container {
    height: 250px;
    overflow: hidden;
    position: relative;
    flex: 1;
}

@media (min-width: 900px) {
    .hero-img-container {
        height: auto;
        min-height: 100%;
        width: 50%;
    }
}

.hero-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform var(--transition-normal);
}

.hero-card:hover .hero-img-container img {
    transform: scale(1.03);
}

.hero-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--primary);
    color: white;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.hero-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 900px) {
    .hero-content {
        padding: 40px;
        width: 50%;
    }
}

.hero-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    transition: color var(--transition-fast);
}

.hero-card:hover .hero-title {
    color: var(--primary);
}

.hero-excerpt {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 24px;
}

.author-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.author-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.author-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Section Blocks for Homepage */
.section-block-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: 700;
}

/* Secondary Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* MSN-Style Magazine Layout Grid overrides */
@media (min-width: 768px) {
    .articles-grid-magazine {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-auto-flow: dense;
        gap: 20px;
    }
    .grid-col-span-2 {
        grid-column: span 2;
    }
    .grid-row-span-2 {
        grid-row: span 2;
    }
}

/* Clases para pantalla completa en Portada (todos) sin barra lateral */
.main-layout.full-width-magazine {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
}

/* Play Button Overlay (MSN style video news indicator) */
.play-btn-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.25);
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}
.article-card:hover .play-btn-overlay, 
.article-card.card-overlay:hover .play-btn-overlay {
    background-color: rgba(255, 255, 255, 0.45);
    transform: translate(-50%, -50%) scale(1.1);
}
.play-btn-overlay i {
    color: #ffffff;
    font-size: 1.2rem;
    margin-left: 3px; /* Centrado óptico del triángulo */
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Social Interaction Bar at card bottom */
.card-interaction-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.card-interaction-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.card-interaction-item:hover {
    color: var(--primary);
}

/* Source Header inside card body */
.card-source-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-source-name {
    color: var(--text-secondary);
}
.card-source-time {
    color: var(--text-muted);
    font-weight: normal;
}

/* Sports Scores Widget (MSN Style) */
.sports-scores-widget {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow-sm);
}
.sports-widget-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sports-games-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}
.sports-game-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.sports-game-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sports-game-status {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 600;
}
.status-live {
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 4px;
}
.status-live-dot {
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
.status-final {
    color: var(--text-muted);
}
.status-upcoming {
    color: var(--text-secondary);
}
.sports-game-teams {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sports-team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}
.team-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.team-flag {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.team-score {
    font-weight: 700;
}
.sports-widget-footer {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
    transition: color var(--transition-fast);
}
.sports-widget-footer:hover {
    color: var(--primary-hover);
}

/* Willyrex-style Card Author Overlay */
.card-overlay .card-author-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 8px;
}
.card-overlay .card-author-badge img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.6);
}
.card-overlay .card-author-badge span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

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

.article-card.card-overlay {
    position: relative;
    min-height: 350px;
    color: white;
}
.article-card.card-overlay .article-img-container {
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1;
}
.article-card.card-overlay .article-img-container img {
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Evita cortar cabezas en las portadas/overlays */
}
.article-card.card-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 30%, rgba(0,0,0,0.85) 90%);
    z-index: 2;
}
.article-card.card-overlay .article-content {
    position: relative;
    z-index: 3;
    justify-content: flex-end;
    height: 100%;
    padding: 24px;
    box-sizing: border-box;
    pointer-events: none;
}
.article-card.card-overlay .article-title {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.article-card.card-overlay .article-excerpt {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.article-card.card-overlay .article-footer {
    color: rgba(255,255,255,0.7);
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 10px;
    margin-top: 8px;
}

/* Headline List Card (MSN "Historias principales" widget style) */
.headline-list-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow-sm);
}
.headline-list-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.headline-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}
.headline-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}
.headline-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.headline-item:hover {
    transform: translateX(4px);
}
.headline-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.headline-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}
.headline-item:hover .headline-item-title {
    color: var(--primary);
}

.article-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.article-img-container {
    height: 130px;
    overflow: hidden;
    position: relative;
    background-color: #1A1A2E;
}

.article-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center 15% !important;
    background-color: #1A1A2E !important;
    transition: transform var(--transition-normal);
}

.article-card:hover .article-img-container img {
    transform: scale(1.05);
}

.article-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-category {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.article-title {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: color var(--transition-fast);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.6em; /* Forzar 3 líneas exactas para alineación vertical perfecta */
}

.article-card:hover .article-title {
    color: var(--primary);
}

.article-excerpt {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

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

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */

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

.widget {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    padding: 24px;
    box-shadow: none;
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.widget-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
}

/* Weather Widget */
.weather-widget {
    background: linear-gradient(135deg, #1E3A8A, #3B82F6);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.weather-city {
    font-weight: 700;
    font-size: 1.1rem;
}

.weather-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weather-temp-container {
    display: flex;
    align-items: baseline;
}

.weather-temp {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.weather-unit {
    font-size: 1.2rem;
    font-weight: 500;
    margin-left: 2px;
}

.weather-info {
    text-align: right;
}

.weather-cond {
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: capitalize;
}

.weather-details {
    font-size: 0.75rem;
    opacity: 0.8;
}

.weather-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Trending Widget */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trending-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    cursor: pointer;
}

.trending-num {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.4;
    line-height: 1;
    width: 32px;
    transition: opacity var(--transition-fast);
}

.trending-item:hover .trending-num {
    opacity: 1;
}

.trending-text {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.trending-item:hover .trending-text {
    color: var(--primary);
}

/* Audio Podcast/News Widget */
.podcast-widget {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.podcast-player {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.podcast-info {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.podcast-cover {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
}

.podcast-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.podcast-author {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.player-btn {
    font-size: 1.1rem;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.player-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: scale(1.05);
}

.player-btn-play {
    font-size: 1.3rem;
    width: 42px;
    height: 42px;
    background-color: var(--primary);
    color: white;
    border: none;
}

.player-progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    margin-top: 12px;
    cursor: pointer;
    position: relative;
}

.player-progress-fill {
    width: 0%;
    height: 100%;
    background-color: var(--primary);
    border-radius: 2px;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.1s linear;
}

/* Audio Visualizer Animation */
.visualizer-container {
    display: flex;
    gap: 3px;
    height: 24px;
    align-items: flex-end;
}

.vis-bar {
    width: 3px;
    background-color: var(--primary);
    height: 3px;
    border-radius: 2px;
    transition: height 0.15s ease-in-out;
}

.vis-bar.playing {
    animation: jump 1.2s ease-in-out infinite alternate;
}

.vis-bar:nth-child(2) { animation-delay: 0.1s; }
.vis-bar:nth-child(3) { animation-delay: 0.2s; }
.vis-bar:nth-child(4) { animation-delay: 0.3s; }
.vis-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes jump {
    0% { height: 4px; }
    100% { height: 24px; }
}

/* Newsletter Widget */
.newsletter-widget {
    background-color: var(--accent-light);
    border-color: rgba(184, 134, 11, 0.2);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.newsletter-status {
    font-size: 0.8rem;
    color: #10B981;
    display: none;
    margin-top: 4px;
    font-weight: 500;
}

/* ==========================================================================
   Article Reader View (Inmersive Modal)
   ========================================================================== */

.reader-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 15, 29, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.reader-modal.active {
    display: flex;
    opacity: 1;
}

.reader-container {
    background-color: var(--bg-secondary);
    width: 90%;
    max-width: 900px;
    height: 90vh;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.reader-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.font-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.font-btn {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.font-btn.active {
    background-color: var(--primary);
    color: white;
}

.reader-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px 60px;
}

.reader-article-category {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.reader-article-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.reader-article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.reader-tts-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-primary);
    padding: 8px 16px;
    border-radius: 2px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

.reader-tts-container:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.reader-tts-icon {
    font-size: 1rem;
    color: var(--primary);
}

.reader-article-img {
    width: 100%;
    max-height: 520px;
    object-fit: contain; /* Muestra la foto periodística original completa sin recortar rostros */
    background-color: var(--bg-secondary); /* Fondo elegante para rellenar áreas vacías */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.reader-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-primary);
}

/* Font Size Modifiers */
.font-size-sm .reader-content { font-size: 1rem; }
.font-size-md .reader-content { font-size: 1.15rem; }
.font-size-lg .reader-content { font-size: 1.35rem; }

.reader-content p {
    margin-bottom: 24px;
}

/* Comments Section */
.comments-section {
    margin-top: 48px;
    border-top: 1px solid var(--border-color);
    padding-top: 32px;
}

.comments-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.comment-input-row {
    display: flex;
    gap: 12px;
}

.comment-textarea {
    resize: none;
    height: 100px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-card {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.comment-author {
    font-weight: 700;
}

.comment-date {
    color: var(--text-muted);
}

.comment-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Admin Panel / Dashboard (Modal View)
   ========================================================================== */

.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 15, 29, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1001;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.admin-modal.active {
    display: flex;
    opacity: 1;
}

.admin-container {
    background-color: var(--bg-secondary);
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 280px 1fr;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-sidebar {
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.admin-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.admin-menu-item:hover, .admin-menu-item.active {
    background-color: var(--primary);
    color: white;
}

.admin-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
}

.admin-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
}

.admin-view {
    display: none;
    padding: 32px;
    flex-direction: column;
    gap: 24px;
}

.admin-view.active {
    display: flex;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Admin Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* Table styles for editing posts */
.admin-table-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

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

.admin-table th, .admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: var(--bg-primary);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.admin-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.post-status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-published {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-draft {
    background-color: #FEF3C7;
    color: #92400E;
}

/* ==========================================================================
   Footer Section
   ========================================================================== */

.main-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px 0;
    color: var(--text-secondary);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

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

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-desc {
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

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

.social-links {
    display: flex;
    gap: 16px;
}

.social-icon {
    font-size: 1.2rem;
    transition: color var(--transition-fast);
}

.social-icon:hover {
    color: var(--primary);
}

/* ==========================================================================
   Responsive Grid Settings
   ========================================================================== */

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .sidebar-left {
        display: none;
    }
    .hero-img-container {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 16px 0;
        gap: 16px;
    }
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 16px;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .reader-body {
        padding: 24px;
    }
    .reader-article-title {
        font-size: 2rem;
    }
    .admin-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .admin-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }
    .admin-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    .admin-menu-item {
        white-space: nowrap;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ========================================
   AI AGENTS DASHBOARD
   ======================================== */

/* Agent Button in Header */
.btn-agents {
    background: linear-gradient(135deg, #4F46E5, #7C3AED) !important;
    position: relative;
    overflow: hidden;
}
.btn-agents::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: agentShimmer 3s ease-in-out infinite;
}
@keyframes agentShimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* Modal Overlay */
.agents-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}
.agents-modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Main Container */
.agents-container {
    background-color: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Header */
.agents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
}
.agents-header-left { display: flex; align-items: center; gap: 12px; }
.agents-header-right { display: flex; align-items: center; gap: 16px; }
.agents-logo { display: flex; align-items: center; gap: 14px; }
.agents-logo i { font-size: 2rem; opacity: 0.9; }
.agents-logo h2 { font-family: var(--font-serif); font-size: 1.4rem; margin: 0; font-weight: 700; }
.agents-subtitle { font-size: 0.8rem; opacity: 0.8; }

/* Live Indicator */
.agents-live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background-color: rgba(255,255,255,0.15);
    font-size: 0.8rem;
    font-weight: 600;
}
.agents-live-indicator.active { background-color: rgba(16, 185, 129, 0.3); }
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6B7280;
}
.agents-live-indicator.active .live-dot {
    background-color: #10B981;
    animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.agents-header .btn-icon { color: white; }
.agents-header .btn-icon:hover { background-color: rgba(255,255,255,0.15); }

/* Controls Bar */
.agents-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 28px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.btn-run-cycle {
    background: linear-gradient(135deg, #059669, #10B981) !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.btn-run-cycle:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4); }
.btn-run-cycle:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-run-cycle.running {
    background: linear-gradient(135deg, #D97706, #F59E0B) !important;
}

/* Toggle Switch */
.auto-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #CBD5E1;
    border-radius: 24px;
    transition: all 0.3s ease;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
    background-color: #4F46E5;
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Countdown */
.agents-countdown {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Dashboard Grid */
.agents-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 500px;
}

/* Pipeline Column */
.agents-pipeline {
    padding: 24px;
    overflow-y: auto;
    max-height: 600px;
    border-right: 1px solid var(--border-color);
}
.pipeline-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Agent Cards */
.agent-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
}
.agent-card[data-status="running"] {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15), 0 4px 12px rgba(79, 70, 229, 0.1);
}
.agent-card[data-status="complete"] {
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}
.agent-card[data-status="error"] {
    border-color: #EF4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.agent-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.agent-info h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.agent-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.agent-status-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    background-color: var(--bg-primary);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.agent-card[data-status="running"] .agent-status-badge {
    background-color: rgba(79, 70, 229, 0.15);
    color: #4F46E5;
    animation: badgePulse 1.5s ease-in-out infinite;
}
.agent-card[data-status="complete"] .agent-status-badge {
    background-color: rgba(16, 185, 129, 0.15);
    color: #059669;
}
.agent-card[data-status="error"] .agent-status-badge {
    background-color: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}
@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Agent Stats Row */
.agent-card-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
.agent-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.agent-stat .stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}
.agent-stat .stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Agent Progress Bar */
.agent-progress {
    height: 3px;
    background-color: var(--border-color);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}
.agent-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, #4F46E5, #7C3AED);
}
.agent-card[data-status="running"] .agent-progress-fill {
    animation: progressIndeterminate 1.5s ease-in-out infinite;
}
@keyframes progressIndeterminate {
    0% { width: 0%; margin-left: 0; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}
.agent-card[data-status="complete"] .agent-progress-fill {
    width: 100%;
    background: linear-gradient(90deg, #059669, #10B981);
}

/* Pipeline Connector */
.pipeline-connector {
    display: flex;
    justify-content: center;
    padding: 6px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.5;
}

/* Activity Feed Column */
.agents-activity {
    display: flex;
    flex-direction: column;
    padding: 24px;
}
.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.activity-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--text-primary);
}
.btn-clear-log {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Activity Feed */
.activity-feed {
    flex: 1;
    overflow-y: auto;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 8px;
}
.activity-feed::-webkit-scrollbar { width: 4px; }
.activity-feed::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 4px; }

.activity-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}
.activity-empty i { font-size: 2.5rem; opacity: 0.3; }
.activity-empty p { font-size: 0.85rem; margin: 0; }

/* Activity Log Entry */
.activity-entry {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    font-size: 0.8rem;
    animation: logSlideIn 0.3s ease;
    border-left: 3px solid var(--border-color);
}
.activity-entry.agent-curator { border-left-color: #4F46E5; }
.activity-entry.agent-verifier { border-left-color: #059669; }
.activity-entry.agent-writer { border-left-color: #D97706; }
.activity-entry.agent-editor { border-left-color: #DC2626; }
.activity-entry.agent-publisher { border-left-color: #7C3AED; }
.activity-entry.agent-engine { border-left-color: #0EA5E9; }

@keyframes logSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 45px;
}
.activity-text {
    color: var(--text-secondary);
    line-height: 1.4;
}
.activity-text strong {
    color: var(--text-primary);
}

/* Cycle Summary */
.cycle-summary {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08));
    border-radius: 12px;
    border: 1px solid rgba(79, 70, 229, 0.15);
}
.cycle-summary h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #4F46E5;
}
.summary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Trusted Sources Footer */
.agents-sources {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.sources-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.sources-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.source-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .agents-modal.active { padding: 0; }
    .agents-container { border-radius: 0; max-width: 100%; }
    .agents-header { padding: 16px; flex-wrap: wrap; gap: 12px; }
    .agents-controls { padding: 12px 16px; }
    .agents-dashboard { grid-template-columns: 1fr; }
    .agents-pipeline { border-right: none; border-bottom: 1px solid var(--border-color); max-height: 400px; padding: 16px; }
    .agents-activity { padding: 16px; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .agents-sources { padding: 12px 16px; }
}

/* ========================================
   VERACITY BADGES & BANNERS (AI AGENTS INTEGRATION)
   ======================================== */

/* Veracity Badge (on cards) */
.veracity-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    opacity: 0.85;
}
.veracity-badge:hover {
    opacity: 1;
}

/* R365 Image Watermark */
.card-img-container::after, 
.hero-img-container::after, 
.reader-image-container::after {
    content: "R365 MEDIA";
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-family: var(--font-serif);
    font-size: 0.6rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
    background-color: rgba(0, 0, 0, 0.4);
    padding: 2px 5px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 5;
    letter-spacing: 1px;
}
.veracity-badge.badge-alta {
    background-color: rgba(16, 185, 129, 0.95); /* Emerald */
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.veracity-badge.badge-media {
    background-color: rgba(217, 119, 6, 0.95); /* Amber */
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.veracity-badge.badge-baja {
    background-color: rgba(239, 68, 68, 0.95); /* Red */
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Veracity Banner (in Reader Modal) */
.veracity-banner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.veracity-banner.banner-alta {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.08));
    border-color: rgba(16, 185, 129, 0.25);
}
.veracity-banner.banner-alta i, .veracity-banner.banner-alta .veracity-banner-header span {
    color: #059669;
}
.veracity-banner.banner-media {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.08), rgba(245, 158, 11, 0.08));
    border-color: rgba(217, 119, 6, 0.25);
}
.veracity-banner.banner-media i, .veracity-banner.banner-media .veracity-banner-header span {
    color: #D97706;
}
.veracity-banner.banner-baja {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(220, 38, 38, 0.08));
    border-color: rgba(239, 68, 68, 0.25);
}
.veracity-banner.banner-baja i, .veracity-banner.banner-baja .veracity-banner-header span {
    color: #DC2626;
}

.veracity-banner-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.veracity-score-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary) !important;
}
.veracity-banner-body {
    color: var(--text-secondary);
}
.veracity-banner-body .source-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4F46E5;
    font-weight: 600;
    text-decoration: none;
    margin-left: 8px;
    transition: color 0.2s ease;
}
.veracity-banner-body .source-link:hover {
    color: #7C3AED;
    text-decoration: underline;
}

/* Ticker "EN VIVO" badge next to Logo */
.live-news-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: #EF4444;
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    margin-left: 8px;
}
.live-news-dot {
    width: 6px;
    height: 6px;
    background-color: #EF4444;
    border-radius: 50%;
    animation: redLivePulse 1.5s ease-in-out infinite;
}
@keyframes redLivePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ========================================
   ADVERTISEMENT SYSTEM (PUBLICIDAD)
   ======================================== */

.ad-banner-container {
    width: 100%;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-banner-top {
    max-width: 1100px;
    margin: 16px auto;
    padding: 0 24px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.ad-banner-top img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.ad-banner-top img:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.ad-banner-sidebar {
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.ad-banner-sidebar img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: all 0.4s ease;
}

.ad-banner-sidebar img:hover {
    transform: scale(1.03);
}

.ad-banner-reader img {
    width: 100%;
    height: auto;
    max-height: 90px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.ad-banner-reader img:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.ad-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    display: block;
    text-align: center;
}

.ad-widget {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    padding: 16px !important;
}

.ad-link {
    display: block;
    width: 100%;
}

/* News Slider Carousel (Portada Premium) */
.news-slider-wrapper {
    position: relative;
    width: 100%;
    height: 480px;
    margin-bottom: 30px;
    border-radius: var(--border-radius-lg, 16px);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    background-color: #0d0d0d;
}

@media (max-width: 768px) {
    .news-slider-wrapper {
        height: 380px;
    }
}

@media (max-width: 480px) {
    .news-slider-wrapper {
        height: 300px;
        margin-bottom: 20px;
    }
}

.news-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.8s;
    z-index: 1;
    cursor: pointer;
}

.slider-slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}

.slider-slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 60px 50px 40px 50px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    color: #ffffff;
    pointer-events: none; /* Asegura que hacer click en el contenido también active el evento click del slide */
}

@media (max-width: 768px) {
    .slider-slide-content {
        padding: 30px 24px 30px 24px;
        gap: 8px;
    }
}

.slider-category-badge {
    background-color: var(--primary, #4F46E5);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 4px;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: inline-block;
    transition: transform 0.3s ease;
}

.slider-title {
    font-family: var(--font-serif, "Playfair Display", Georgia, serif);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 4px 0 8px 0;
    max-width: 85%;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 992px) {
    .slider-title {
        font-size: 1.8rem;
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .slider-title {
        font-size: 1.4rem;
        max-width: 100%;
    }
}

.slider-excerpt {
    font-size: 1.05rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    max-width: 75%;
    margin: 0;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .slider-excerpt {
        font-size: 0.9rem;
        max-width: 100%;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .slider-excerpt {
        display: none; /* Ocultar en móviles muy pequeños para ahorrar espacio vertical */
    }
}

.slider-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.slider-meta i {
    margin-right: 4px;
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 480px) {
    .slider-meta {
        font-size: 0.75rem;
        margin-top: 4px;
    }
}

/* Navigation Buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-btn:hover {
    background-color: var(--primary, #4F46E5);
    border-color: var(--primary, #4F46E5);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
    transform: translateY(-50%) scale(1.08);
}

.slider-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.slider-btn-prev {
    left: 20px;
}

.slider-btn-next {
    right: 20px;
}

@media (max-width: 768px) {
    .slider-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
    .slider-btn-prev {
        left: 10px;
    }
    .slider-btn-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .slider-btn {
        display: none; /* Ocultar flechas en móviles para no obstruir el contenido */
    }
}

/* Dots Indicators */
.slider-dots {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.slider-dot.active {
    width: 24px;
    border-radius: 4px;
    background-color: var(--primary, #4F46E5);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

@media (max-width: 768px) {
    .slider-dots {
        bottom: 15px;
    }
}

/* ==========================================================================
   Portada Social Media Template (R365 Instagram Story Card)
   ========================================================================== */
.portada-social-card {
    width: 100%;
    max-width: 460px;
    margin: 20px auto;
    background-color: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    /* Red frame border with definition shadow */
    border: 14px solid #9B2226 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15), 0 0 0 1px #E2E8F0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.portada-social-header {
    background-color: #ffffff !important; /* White header background */
    border-bottom: 1px solid #E2E8F0 !important;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.portada-social-menu {
    color: #9B2226 !important; /* Red menu icon */
    font-size: 1.2rem;
    cursor: default;
}

.portada-social-logo {
    background-color: transparent !important; /* Transparent background */
    padding: 0 !important;
    border-radius: 0 !important;
    display: inline-flex;
    align-items: center;
    box-shadow: none !important;
}

.portada-logo-text {
    font-family: var(--font-serif, 'Playfair Display', serif);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.portada-social-img-wrapper {
    width: 100%;
    height: 340px;
    overflow: hidden;
    background-color: #1A1A2E !important; /* Brand dark blue */
}

.portada-social-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 15% !important;
    background-color: #1A1A2E !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.portada-social-title-block {
    background-color: #1A1A2E; /* Blue strip */
    padding: 24px;
    color: #ffffff;
    box-sizing: border-box;
    flex-grow: 1;
}

.portada-social-badge {
    display: inline-block;
    background-color: #9B2226;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.portada-social-title {
    font-family: var(--font-serif, 'Playfair Display', serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff !important;
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.portada-social-footer {
    background-color: #ffffff !important; /* White footer background */
    border-top: 1px solid #E2E8F0 !important;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.portada-social-icons {
    display: flex;
    gap: 15px;
    color: #9B2226 !important; /* Red social icons */
    font-size: 1.05rem;
}

.portada-social-handles {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.portada-social-handle {
    font-size: 0.70rem;
    color: #4B5563 !important; /* Dark grey handle text */
    font-weight: 500;
}

.portada-social-url {
    font-size: 0.65rem;
    font-weight: 700;
    color: #1A1A2E !important; /* Dark blue URL text */
    letter-spacing: 0px;
}

/* Homepage Card Portada Style */
.article-card {
    /* Red frame border with definition shadow */
    border: 7px solid #9B2226 !important; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1), 0 0 0 1px #E2E8F0 !important;
    background-color: #ffffff !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-radius: 4px !important;
    overflow: hidden;
}

.card-portada-header {
    background-color: #ffffff !important; /* White header background */
    border-bottom: 1px solid #E2E8F0 !important;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    box-sizing: border-box;
}

.card-portada-menu {
    color: #9B2226 !important; /* Red menu icon */
    font-size: 0.85rem;
}

.card-portada-logo {
    background-color: transparent !important; /* Transparent background */
    padding: 0 !important;
    border-radius: 0 !important;
    display: inline-flex;
    align-items: center;
    box-shadow: none !important;
    font-family: var(--font-serif, 'Playfair Display', serif);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.card-portada-content {
    background-color: #1A1A2E !important; /* Blue background block matching R365 colors */
    padding: 16px 14px !important;
    color: #ffffff !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 180px !important; /* Fixed unified text block height */
    justify-content: flex-start;
    overflow: hidden;
}

.card-portada-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card-portada-badge {
    background-color: #9B2226;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.card-portada-time {
    font-size: 0.68rem;
    color: #CBD5E1;
}

.article-card .article-title {
    color: #ffffff !important; /* White title text */
    font-family: var(--font-serif, 'Playfair Display', serif) !important;
    font-size: 0.82rem !important; /* Sized down to prevent overlap */
    font-weight: 700 !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    line-height: 1.25 !important;
    max-height: 2.5em !important; /* Cap to max 2 lines to save space */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.article-card .article-excerpt {
    color: #E2E8F0 !important; /* Light text description */
    font-size: 0.68rem !important; /* Sized down */
    line-height: 1.35 !important;
    margin-bottom: 0 !important;
    max-height: 2.8em !important; /* Cap to max 2 lines */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    flex-grow: 0 !important;
}

.card-portada-footer {
    background-color: #ffffff !important; /* White footer background */
    border-top: 1px solid #E2E8F0 !important;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.card-portada-socials {
    display: flex;
    gap: 6px;
    color: #9B2226 !important; /* Red social icons */
    font-size: 0.75rem;
}

.card-portada-url {
    font-size: 0.58rem;
    font-weight: 700;
    color: #1A1A2E !important; /* Dark blue URL text */
    letter-spacing: 0px;
    max-width: 170px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}



/* ============================================================
   R365 GLOBAL MEDIA - 13 AGENTES EDITORIALES - SALA IA
   ============================================================ */
.pipeline-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.pipeline-mission-badge { background: linear-gradient(135deg, #C8102E, #002D72); color: white; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; }
.agent-num-badge { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); background: rgba(200,16,46,0.1); padding: 2px 6px; border-radius: 4px; display: inline-block; margin-bottom: 4px; }
.agent-writers-group { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: 14px; margin-bottom: 12px; transition: border-color 0.3s; }
.agent-writers-group:hover { border-color: var(--primary); }
.agent-group-label { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.agent-writers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.agent-card-mini { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; transition: all 0.25s ease; cursor: default; position: relative; overflow: hidden; }
.agent-card-mini[data-status="running"] { border-color: var(--primary); box-shadow: 0 0 12px rgba(200,16,46,0.2); }
.agent-card-mini[data-status="complete"] { border-color: #059669; }
.agent-icon-mini { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.agent-info-mini { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.agent-info-mini span { font-size: 0.72rem; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.agent-num-badge-mini { font-size: 0.6rem; font-weight: 800; color: var(--text-muted); background: var(--bg-secondary); padding: 1px 5px; border-radius: 3px; }
.agent-status-badge-mini { font-size: 0.6rem; font-weight: 700; color: var(--text-muted); padding: 1px 6px; border-radius: 3px; background: var(--bg-secondary); text-transform: uppercase; }
.agent-card-mini[data-status="running"] .agent-status-badge-mini { background: rgba(200,16,46,0.15); color: var(--primary); }
.agent-card-mini[data-status="complete"] .agent-status-badge-mini { background: rgba(5,150,105,0.15); color: #059669; }
.writers-combined-stats { background: var(--bg-primary); border-radius: var(--border-radius-sm); padding: 8px; margin-bottom: 8px; }
.verification-legend { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: 12px 14px; margin-bottom: 16px; }
.legend-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.legend-items { display: flex; flex-wrap: wrap; gap: 6px; }
.verification-status-badge { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.status-verified { background: rgba(5,150,105,0.15); color: #059669; border: 1px solid rgba(5,150,105,0.3); }
.status-partial { background: rgba(217,119,6,0.15); color: #D97706; border: 1px solid rgba(217,119,6,0.3); }
.status-unconfirmed { background: rgba(100,116,139,0.15); color: #64748B; border: 1px solid rgba(100,116,139,0.3); }
.status-false { background: rgba(220,38,38,0.15); color: #DC2626; border: 1px solid rgba(220,38,38,0.3); }
.editorial-principles { background: linear-gradient(135deg, rgba(0,45,114,0.08), rgba(200,16,46,0.05)); border: 1px solid rgba(0,45,114,0.2); border-radius: var(--border-radius-md); padding: 14px 16px; margin-bottom: 16px; }
[data-theme="dark"] .editorial-principles { background: linear-gradient(135deg, rgba(200,16,46,0.1), rgba(0,45,114,0.1)); border-color: rgba(200,16,46,0.2); }
.principles-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #C8102E; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.principles-list { list-style: none; padding: 0; margin: 0; counter-reset: principles; display: flex; flex-direction: column; gap: 4px; }
.principles-list li { counter-increment: principles; font-size: 0.75rem; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; line-height: 1.3; }
.principles-list li::before { content: counter(principles) "."; font-weight: 800; color: #C8102E; min-width: 18px; font-size: 0.7rem; }
.activity-entry.agent-director { border-left-color: #C8102E; }
.activity-entry.agent-breaking { border-left-color: #DC2626; }
.activity-entry.agent-fact-checker { border-left-color: #059669; }
.activity-entry.agent-redactores { border-left-color: #D97706; }
.activity-entry.agent-seo { border-left-color: #EA580C; }
.activity-entry.agent-corrector-estilo { border-left-color: #64748B; }
.activity-entry.agent-disenador { border-left-color: #DB2777; }
.diaspora-impact-block { background: linear-gradient(135deg, rgba(0,45,114,0.06), rgba(200,16,46,0.04)); border-left: 4px solid #002D72; border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0; padding: 14px 16px; margin: 20px 0; }
[data-theme="dark"] .diaspora-impact-block { background: linear-gradient(135deg, rgba(200,16,46,0.08), rgba(0,45,114,0.08)); border-left-color: #C8102E; }
.diaspora-impact-title { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: #002D72; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
[data-theme="dark"] .diaspora-impact-title { color: #C8102E; }
.diaspora-impact-text { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.category-badge-diaspora { background: linear-gradient(135deg, #7C3AED, #5b21b6); color: white; font-size: 0.65rem; font-weight: 800; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; }
@media (max-width: 768px) { .agent-writers-grid { grid-template-columns: repeat(2, 1fr); } .legend-items { flex-direction: column; } .pipeline-header-row { flex-direction: column; align-items: flex-start; } }
