:root {
    --primary: #FF8C00;
    --primary-dark: #cc7000;
    --accent: #d32f2f;
    --blue: #004aad;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --bg-body: #f9f9f9;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f0f0f0;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #eeeeee;
    --dark-section: #333333;
    --dark-text-inverse: #ffffff;
    --shadow: rgba(0,0,0,0.04);
}
body.dark-mode {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-input: #2d2d2d;
    --bg-hover: #2c2c2c;
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    --border-color: #333333;
    --dark-section: #000000;
    --dark-text-inverse: #e0e0e0;
    --shadow: rgba(0,0,0,0.5);
    --primary: #ff9d23;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }
body { 
    background-color: var(--bg-body); color: var(--text-main);
    display: flex; flex-direction: column; min-height: 100vh; 
    transition: background-color 0.3s, color 0.3s;
}
header { background: var(--bg-card); border-bottom: 3px solid var(--primary); }
.top-bar { 
    background: var(--dark-section); color: white; padding: 8px 20px; font-size: 0.85rem; 
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.user-badge {
    background: var(--primary); color: white; padding: 4px 10px; 
    border-radius: 15px; font-size: 0.75rem; margin-left: 8px; display: inline-block;
}
.btn-login, .btn-secondary {
    background: var(--primary); color: white; border: none; padding: 6px 14px; 
    border-radius: 4px; cursor: pointer; font-size: 0.8rem; margin-left: 5px; transition: 0.3s;
}
.btn-login:hover { background: var(--bg-card); color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary { background: #555; }
.btn-secondary:hover { background: #777; }
.logo-area { padding: 20px; text-align: center; cursor: pointer; }
.logo-title { font-size: 2.5rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 3px; margin: 0; line-height: 1; }
.logo-subtitle { font-size: 1rem; color: var(--text-muted); letter-spacing: 5px; text-transform: uppercase; }
nav { background: var(--primary); display: flex; justify-content: center; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.1); flex-wrap: wrap; }
nav button { 
    background: none; border: none; color: white; padding: 15px 25px; 
    font-weight: 600; font-size: 1rem; cursor: pointer; transition: 0.3s; 
}
nav button:hover, nav button.active { background: rgba(0,0,0,0.15); }
.ticker { background: var(--dark-section); color: white; padding: 10px; display: flex; align-items: center; overflow: hidden; }
.ticker.has-urgente { background: #1a0000; border-bottom: 2px solid var(--accent); }
.ticker-label { background: var(--accent); color: white; padding: 2px 10px; font-weight: bold; font-size: 0.8rem; margin-right: 15px; white-space: nowrap; flex-shrink: 0; }
.ticker.has-urgente .ticker-label { animation: tickerPulse 1.5s infinite; }
.ticker-track { overflow: hidden; flex: 1; position: relative; }
.ticker-content {
    display: inline-block; white-space: nowrap;
    animation: tickerScroll 30s linear infinite;
    padding-left: 100%;
}
@keyframes tickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
@keyframes tickerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.ticker-track:hover .ticker-content { animation-play-state: paused; }
.search-bar { max-width: 1200px; margin: 20px auto; padding: 0 15px; }
.search-bar input {
    width: 100%; padding: 12px; background-color: var(--bg-input); color: var(--text-main);
    border: 2px solid var(--border-color); border-radius: 25px; font-size: 1rem; transition: 0.3s;
}
.search-bar input:focus { outline: none; border-color: var(--primary); }
.container { max-width: 1200px; margin: 20px auto; display: grid; grid-template-columns: 70% 28%; gap: 2%; padding: 0 15px; flex: 1; }
.main-content { display: flex; flex-direction: column; gap: 25px; }
.news-card { 
    background: var(--bg-card); border: 1px solid var(--border-color); 
    display: flex; flex-direction: column; box-shadow: 0 4px 6px var(--shadow); 
    transition: transform 0.2s; border-radius: 8px; overflow: hidden; cursor: pointer; 
}
.news-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px rgba(0,0,0,0.1); }
.card-image { height: 240px; background-color: #ddd; background-size: cover; background-position: center; position: relative; }
.category-tag { 
    position: absolute; top: 15px; left: 15px; background: var(--primary); color: white; 
    padding: 5px 12px; font-size: 0.75rem; font-weight: bold; border-radius: 4px; text-transform: uppercase;
}
.card-body { padding: 20px; }
.card-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.card-title { font-size: 1.5rem; margin-bottom: 10px; color: var(--text-main); line-height: 1.2; }
.card-excerpt { color: var(--text-muted); font-size: 1rem; line-height: 1.6; }
#articleView { background: var(--bg-card); padding: 30px; border-radius: 8px; border: 1px solid var(--border-color); }
.article-header { margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.article-title { font-size: 2.2rem; color: var(--text-main); margin-bottom: 10px; line-height: 1.1; }
.article-img-full { width: 100%; height: auto; max-height: 400px; object-fit: cover; border-radius: 8px; margin-bottom: 20px; }
.article-body { font-size: 1.1rem; line-height: 1.8; color: var(--text-main); margin-bottom: 20px; }
.article-body p { margin-top: 0; margin-bottom: 0.7em; }
/* Párrafos vacíos (Enter extra en Quill) → espacio mínimo */
.article-body p:has(> br:only-child) { margin-bottom: 0; line-height: 0.4em; }
.article-body h2, .article-body h3 { margin: 1.2em 0 0.5em; }
.article-body ul, .article-body ol { margin: 0.5em 0; padding-left: 2em; }
.article-body a { color: var(--blue); text-decoration: underline; }
/* Imágenes dentro del cuerpo de la noticia */
.article-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 1em 0; display: block; }
.btn-back { background: var(--bg-hover); border: 1px solid var(--border-color); padding: 8px 15px; cursor: pointer; border-radius: 4px; font-weight: bold; color: var(--text-muted); margin-bottom: 20px; }
.btn-back:hover { background: var(--border-color); }
.share-buttons {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    padding: 15px 0; margin-bottom: 10px; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
}
.share-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 14px; border-radius: 6px; font-size: 0.85rem; font-weight: 600;
    text-decoration: none; color: white; border: none; cursor: pointer; transition: 0.2s;
}
.share-btn.whatsapp { background: #25D366; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.copy { background: #555; color: white; }
.share-btn:hover { opacity: 0.85; transform: scale(1.03); }
.comments-section { 
    background: var(--bg-body); padding: 20px; border-radius: 8px; margin-top: 20px; 
    border: 1px solid var(--border-color);
}
.comment-box { border-bottom: 1px solid var(--border-color); padding: 15px 0; }
.comment-user { font-weight: bold; color: var(--blue); margin-bottom: 5px; }
.comment-text { color: var(--text-main); font-size: 0.95rem; }
.comment-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; }
.sidebar { display: flex; flex-direction: column; gap: 25px; }
.widget { background: var(--bg-card); padding: 20px; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 2px 5px var(--shadow); }
.widget h3 { border-bottom: 3px solid var(--primary); padding-bottom: 8px; margin-bottom: 15px; font-size: 1.1rem; color: var(--text-main); }
.ad-space { 
    height: 250px; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; text-align: center; 
    border: 1px dashed #ccc; cursor: pointer; transition: 0.3s; overflow: hidden;
    background-size: cover; background-position: center; color: white; text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    border-radius: 4px;
}
.ad-space:hover { opacity: 0.9; transform: scale(1.01); }
.sub-input {
    width: 100%; padding: 8px; margin-bottom: 10px; 
    border: 1px solid var(--border-color); border-radius: 4px; 
    background: var(--bg-input); color: var(--text-main); font-size: 0.95rem;
}
.sub-input:focus { outline: none; border-color: var(--primary); }
.admin-panel {
    background: var(--bg-card); border-left: 5px solid var(--accent);
    padding: 30px; margin: 30px auto; max-width: 1000px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1); border-radius: 4px; display: none; 
}
.admin-panel.visible { display: block; animation: fadeIn 0.5s; }
.admin-panel h2 { color: var(--text-main); }
.tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid var(--border-color); }
.tab {
    padding: 10px 20px; background: none; border: none; cursor: pointer;
    font-weight: 600; color: var(--text-muted); transition: 0.3s;
}
.tab.active { color: var(--primary); border-bottom: 3px solid var(--primary); margin-bottom: -2px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content h3 { color: var(--text-main); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; color: var(--text-main); }
.form-group input, .form-group textarea, .form-group select { 
    width: 100%; padding: 10px; background-color: var(--bg-input); color: var(--text-main);
    border: 1px solid var(--border-color); border-radius: 4px; font-size: 1rem; 
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary);
}
.form-group small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 0.85rem; }
.password-strength { height: 5px; border-radius: 3px; margin-top: 5px; transition: 0.3s; }
.btn-submit { 
    background: var(--dark-section); color: white; border: none; padding: 12px 25px; 
    cursor: pointer; font-size: 1rem; border-radius: 4px; width: 100%; transition: 0.2s;
}
.btn-submit:hover { background: var(--primary); }
.btn-submit:disabled { background: #ccc; cursor: not-allowed; }
.moderation-item, .user-item { 
    background: var(--bg-card); color: var(--text-main);
    padding: 15px; border-left: 4px solid #ffc107; border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px; display: flex; justify-content: space-between; 
    align-items: center; border-radius: 4px; box-shadow: 0 2px 4px var(--shadow);
    gap: 10px;
}
.user-item { border-left-color: var(--blue); }
.btn-approve, .btn-delete, .btn-activate { 
    background: var(--success); color: white; border: none; padding: 6px 12px; 
    border-radius: 4px; cursor: pointer; font-size: 0.85rem; transition: 0.2s;
}
.btn-approve:hover { background: #218838; }
.btn-delete { background: var(--danger); }
.btn-delete:hover { background: #c82333; }
.btn-activate { background: var(--warning); color: #333; }
.log-entry {
    padding: 10px; border-left: 3px solid var(--border-color); margin-bottom: 8px;
    background: var(--bg-body); color: var(--text-main); font-size: 0.9rem; border-radius: 4px;
}
.log-entry .log-time { color: var(--text-muted); font-size: 0.8rem; }
.log-entry .log-action { font-weight: 600; color: var(--blue); }
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.6);
    align-items: center; justify-content: center;
}
.modal-content {
    background: var(--bg-card); color: var(--text-main);
    padding: 30px; border-radius: 8px; width: 90%; max-width: 450px; 
    text-align: center; position: relative; box-shadow: 0 10px 25px rgba(0,0,0,0.3); 
    max-height: 90vh; overflow-y: auto;
}
.close-modal { position: absolute; top: 10px; right: 15px; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.close-modal:hover { color: var(--text-main); }
.modal-content h2 { color: var(--text-main); margin-bottom: 20px; }
.modal-link { font-size: 0.9rem; margin-top: 15px; cursor: pointer; text-decoration: underline; display: block; }
.link-primary { color: var(--blue); }
.alert { padding: 12px; border-radius: 4px; margin-bottom: 15px; display: none; }
.alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert.warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.loading-spinner {
    text-align: center; padding: 40px; color: var(--text-muted);
    font-size: 1.1rem;
}
.ql-toolbar.ql-snow { background: var(--bg-card); border-color: var(--border-color); }
.ql-container.ql-snow { border-color: var(--border-color); }
body.dark-mode .ql-toolbar.ql-snow { background: var(--bg-input); }
body.dark-mode .ql-editor { color: var(--text-main); }
body.dark-mode .ql-snow .ql-stroke { stroke: var(--text-muted); }
body.dark-mode .ql-snow .ql-fill { fill: var(--text-muted); }
body.dark-mode .ql-snow .ql-picker-label { color: var(--text-muted); }
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
footer { background: var(--dark-section); color: white; text-align: center; padding: 30px; margin-top: auto; }
@media (max-width: 768px) {
    .container { grid-template-columns: 1fr; }
    nav { overflow-x: auto; justify-content: flex-start; }
    nav button { white-space: nowrap; padding: 12px 18px; font-size: 0.9rem; }
    .logo-title { font-size: 1.8rem; letter-spacing: 1px; }
    .tabs { overflow-x: auto; }
    .tab { white-space: nowrap; padding: 10px 15px; font-size: 0.85rem; }
    .moderation-item, .user-item { flex-direction: column; align-items: flex-start; }
    .share-buttons { justify-content: center; }
    .article-title { font-size: 1.6rem; }
}

/* ============================================================
   MEJORAS — Concordia Checked
   ============================================================ */

/* ── Barra de progreso de lectura ── */
#reading-progress {
    position: fixed; top: 0; left: 0; z-index: 9999;
    height: 3px; width: 0%; background: var(--primary);
    transition: width 0.1s linear;
    box-shadow: 0 0 6px rgba(255,140,0,0.5);
}

/* ── Skeleton loaders ── */
.skeleton-wrap { display: flex; flex-direction: column; gap: 25px; width: 100%; }
.skeleton-card { background: var(--bg-card); border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); }
.skeleton-img { height: 240px; background: var(--bg-hover); position: relative; overflow: hidden; }
.skeleton-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.skeleton-line { height: 14px; background: var(--bg-hover); border-radius: 6px; position: relative; overflow: hidden; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.title { height: 22px; width: 90%; }

.skeleton-img::after,
.skeleton-line::after {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: skelShimmer 1.4s infinite;
}
body.dark-mode .skeleton-img::after,
body.dark-mode .skeleton-line::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
@keyframes skelShimmer { 0% { left: -100%; } 100% { left: 200%; } }

/* Skeleton hero */
.skeleton-hero { background: var(--bg-card); border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); margin-bottom: 25px; }
.skeleton-hero-img { height: 420px; background: var(--bg-hover); position: relative; overflow: hidden; }
.skeleton-hero-img::after { content: ''; position: absolute; top:0; left:-100%; width:60%; height:100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent); animation: skelShimmer 1.4s infinite; }
body.dark-mode .skeleton-hero-img::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent); }
.skeleton-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; }
.skeleton-grid-card { background: var(--bg-card); border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); }
.skeleton-grid-img { height: 180px; background: var(--bg-hover); position: relative; overflow: hidden; }
.skeleton-grid-img::after { content: ''; position: absolute; top:0; left:-100%; width:60%; height:100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent); animation: skelShimmer 1.4s infinite 0.2s; }
body.dark-mode .skeleton-grid-img::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent); }

/* ── Hero card (primera noticia) ── */
.news-hero {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 8px; overflow: hidden; cursor: pointer;
    box-shadow: 0 4px 6px var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 25px;
    display: flex; flex-direction: column;
}
.news-hero:hover { transform: translateY(-3px); box-shadow: 0 12px 20px rgba(0,0,0,0.12); }
.hero-image {
    height: 420px; background-size: cover; background-position: center;
    position: relative; flex-shrink: 0;
}
.hero-image::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
    pointer-events: none;
}
.hero-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 25px;
    color: white; z-index: 1;
}
.hero-overlay .category-tag { position: static; margin-bottom: 10px; display: inline-block; }
.hero-title {
    font-size: 1.9rem; font-weight: 800; line-height: 1.15;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5); margin-bottom: 8px;
}
.hero-meta { font-size: 0.85rem; opacity: 0.85; }

/* ── Grilla 2x2 ── */
.news-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 15px; margin-bottom: 25px;
}
.news-grid-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 8px; overflow: hidden; cursor: pointer;
    box-shadow: 0 4px 6px var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column;
}
.news-grid-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px rgba(0,0,0,0.1); }
.grid-card-image {
    height: 180px; background-size: cover; background-position: center; position: relative;
}
.grid-card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.grid-card-body .card-title { font-size: 1.05rem; margin-bottom: 6px; line-height: 1.3; }
.grid-card-body .card-excerpt { font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Tags / etiquetas ── */
.tags-container { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-pill {
    background: var(--bg-hover); color: var(--text-muted); border: 1px solid var(--border-color);
    padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; cursor: pointer;
    transition: 0.2s; white-space: nowrap; text-decoration: none; display: inline-block;
}
.tag-pill:hover { background: var(--primary); color: white; border-color: var(--primary); }
.tag-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Tags en admin (input con chips) */
#tagsPreview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 28px; }
.tag-chip {
    background: var(--primary); color: white;
    padding: 3px 8px; border-radius: 20px; font-size: 0.8rem;
    display: inline-flex; align-items: center; gap: 5px;
}
.tag-chip button {
    background: none; border: none; color: white; cursor: pointer;
    font-size: 0.9rem; padding: 0; line-height: 1;
}

/* ── Noticias relacionadas ── */
.related-section { margin-top: 30px; padding-top: 20px; border-top: 2px solid var(--border-color); }
.related-section h3 { font-size: 1.1rem; margin-bottom: 15px; color: var(--text-main); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.related-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform 0.2s;
}
.related-card:hover { transform: translateY(-2px); }
.related-img { height: 110px; background-size: cover; background-position: center; }
.related-body { padding: 10px; }
.related-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; color: var(--text-main); }
.related-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ── Contador de vistas ── */
.view-count { color: var(--text-muted); font-size: 0.85rem; }

/* ── Widget "Más leídas" ── */
.popular-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 10px 0; border-bottom: 1px solid var(--border-color); cursor: pointer;
    transition: 0.2s;
}
.popular-item:last-child { border-bottom: none; }
.popular-item:hover .popular-title { color: var(--primary); }
.popular-rank {
    font-size: 1.5rem; font-weight: 800; color: var(--border-color);
    min-width: 28px; line-height: 1; flex-shrink: 0;
}
.popular-thumb {
    width: 55px; height: 55px; border-radius: 6px;
    background-size: cover; background-position: center; flex-shrink: 0;
}
.popular-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; color: var(--text-main); }
.popular-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }

/* ── Dashboard de estadísticas (admin) ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-card {
    background: var(--bg-body); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 20px 15px; text-align: center;
}
.stat-card .stat-number { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .stat-icon { font-size: 1.5rem; margin-bottom: 8px; }

/* ── Indicador de publicación programada ── */
.scheduled-badge {
    background: #fff3cd; color: #856404; border: 1px solid #ffc107;
    padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600;
}
body.dark-mode .scheduled-badge { background: #2d2600; color: #ffd55a; border-color: #7a5700; }

/* ── Responsive para las mejoras ── */
@media (max-width: 768px) {
    .hero-image { height: 260px; }
    .hero-title { font-size: 1.3rem; }
    .news-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .skeleton-grid { grid-template-columns: 1fr; }
    .skeleton-hero-img { height: 260px; }
}

/* ── Fix mobile nav — no wrapping ── */
@media (max-width: 768px) {
    nav {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
    }
    nav button {
        white-space: nowrap !important;
        flex-shrink: 0;
    }

    /* Hero más chico en mobile */
    .news-hero { margin-bottom: 15px; }
    .hero-image { height: 240px !important; }
    .hero-title { font-size: 1.2rem !important; }
    .hero-overlay { padding: 15px !important; }

    /* Grid colapsa a columna única */
    .news-grid { grid-template-columns: 1fr !important; gap: 12px !important; }

    /* Cards normales sin overflow */
    .news-card, .news-grid-card { width: 100%; }
}

/* ── Fix footer mobile — no flota en medio del sidebar ── */
@media (max-width: 768px) {
    body {
        display: block !important;
    }
    footer {
        margin-top: 0 !important;
    }
    .container {
        flex: none !important;
    }
}

/* ── Fix definitivo footer/sidebar mobile ── */
@media (max-width: 768px) {
    body {
        display: block !important;
        min-height: 100vh;
    }
    footer {
        margin-top: 0 !important;
    }
    .container {
        display: block !important;
        flex: none !important;
    }
    .container > div,
    .sidebar {
        width: 100% !important;
        display: block !important;
    }
}

/* ── Botón editar en lista admin ── */
.btn-edit {
    background: var(--blue, #1565c0); color: white; border: none;
    padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 0.9rem;
    transition: opacity 0.2s;
}
.btn-edit:hover { opacity: 0.8; }

/* ── Comunicado editorial — widget sidebar ── */
.comunicado-widget { border-left: 3px solid var(--primary) !important; }
.comunicado-preview {
    font-size: 0.82rem; color: var(--text-muted); line-height: 1.5;
    margin-bottom: 10px; display: -webkit-box;
    -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.comunicado-btn {
    background: none; border: 1px solid var(--primary); color: var(--primary);
    padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8rem;
    width: 100%; text-align: center; transition: 0.2s;
}
.comunicado-btn:hover { background: var(--primary); color: white; }

/* ── Modal comunicado ── */
.comunicado-modal-content {
    background: var(--bg-card); border-radius: 10px; padding: 28px;
    max-width: 560px; width: 92%; position: relative; max-height: 85vh;
    overflow-y: auto;
}
.comunicado-full-text p {
    font-size: 0.95rem; line-height: 1.7; color: var(--text-main);
    margin-bottom: 14px;
}
.comunicado-full-text p:last-child { margin-bottom: 0; }

/* ── Audio embebido — card ── */
/* audio-marker: invisible hasta que JS lo convierte en player */
a.audio-marker { display: none !important; }

.audio-embed-card, .article-body .audio-embed-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary); border-radius: 8px;
    padding: 14px 16px; margin: 18px 0;
}
.audio-embed-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.audio-embed-icon { font-size: 1.3rem; flex-shrink: 0; }
.audio-embed-name {
    font-size: 0.88rem; font-weight: 600; color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.article-body audio, .audio-embed-card audio {
    width: 100%; margin: 4px 0 8px; border-radius: 4px; display: block;
}
.btn-transcribir {
    background: none; border: 1px solid var(--primary); color: var(--primary);
    padding: 4px 12px; border-radius: 4px; cursor: pointer;
    font-size: 0.78rem; transition: 0.2s;
}
.btn-transcribir:hover { background: var(--primary); color: white; }
.btn-transcribir:disabled { opacity: 0.5; cursor: default; }
.transcripcion-box { margin-top: 10px; }
.transcripcion-box textarea { font-family: inherit; width: 100%; }

/* ── PDF embebido — visor con iframe ── */
.pdf-embed-wrap {
    border: 1px solid var(--border-color); border-left: 4px solid #e53935;
    border-radius: 8px; overflow: hidden; margin: 18px 0;
}
.pdf-embed-header {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-card); padding: 10px 14px;
    font-size: 0.88rem; font-weight: 600; color: var(--text-main);
}
.pdf-embed-fname {
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pdf-open-btn {
    background: #e53935; color: white !important; text-decoration: none !important;
    padding: 4px 10px; border-radius: 4px; font-size: 0.78rem;
    white-space: nowrap; flex-shrink: 0;
}
.pdf-open-btn:hover { opacity: 0.85; }
.pdf-embed-iframe {
    width: 100%; height: 500px; display: block; border: none;
    background: #f5f5f5;
}

/* ── Imágenes en el cuerpo ── */
.article-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 1em 0; display: block; }

/* ── Mobile ── */
@media (max-width: 480px) {
    .comunicado-modal-content { padding: 18px; }
    .comunicado-full-text p { font-size: 0.9rem; }
    .audio-embed-card { padding: 10px 12px; }
    .btn-transcribir { width: 100%; padding: 7px; }
    .pdf-embed-iframe { height: 320px; }
}
