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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface2: #1e1e1e;
  --accent: #e63946;
  --accent2: #ff6b6b;
  --text: #ebebeb;
  --muted: #888;
  --border: #272727;
  --max: 1200px;
  --radius: 10px;
}

body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; font-size: 16px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── PROGRESS BAR ── */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 9999; width: 0; transition: width .1s;
}

/* ── HEADER ── */
header {
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center; gap: 16px;
}
.logo { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.5px; white-space: nowrap; }
.logo span { color: var(--accent); }

.header-search {
  flex: 1; max-width: 320px; position: relative;
}
.header-search input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 7px 36px 7px 16px; color: var(--text);
  font-size: 0.875rem; outline: none; transition: border-color .2s;
}
.header-search input:focus { border-color: var(--accent); }
.search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; pointer-events: none; }

nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
nav a { color: var(--muted); font-size: 0.875rem; padding: 6px 12px; border-radius: 6px; transition: all .2s; white-space: nowrap; }
nav a:hover { color: var(--text); background: var(--surface2); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; padding: 4px; }

/* ── AD BANNER ── */
.ad-banner { background: var(--surface); border-bottom: 1px solid var(--border); text-align: center; padding: 8px; min-height: 60px; }
.ad-slot { background: var(--surface2); border: 1px dashed var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; min-height: 90px; overflow: hidden; }

/* ── LAYOUT ── */
.container { max-width: var(--max); margin: 0 auto; padding: 32px 20px; }
.grid { display: grid; grid-template-columns: 1fr 300px; gap: 32px; }

/* ── HERO ── */
.hero {
  border-radius: 14px; padding: 48px 40px; margin-bottom: 32px;
  position: relative; overflow: hidden; min-height: 280px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--surface);
}
.hero-tag { display: inline-block; background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 3px 10px; border-radius: 4px; margin-bottom: 12px; width: fit-content; }
.hero h1 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.hero p { color: #ccc; font-size: 1rem; max-width: 560px; margin-bottom: 20px; }
.btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.9rem; padding: 10px 24px; border-radius: 6px; transition: all .2s; }
.btn:hover { background: var(--accent2); transform: translateY(-1px); }

/* ── SECTION HEADER ── */
.section-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.section-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.category-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); font-size: 0.75rem; padding: 4px 12px; border-radius: 20px; cursor: pointer; transition: all .2s; }
.cat-btn:hover, .cat-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── SEARCH BANNER ── */
.search-banner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; font-size: 0.875rem; color: var(--muted); }
.search-banner button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.8rem; }
.search-banner button:hover { color: var(--text); }

/* ── CARDS ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color .2s, transform .2s; display: flex; flex-direction: column; }
.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card-img { width: 100%; height: 175px; object-fit: cover; background: var(--surface2); display: block; }
.card-img-fallback { width: 100%; height: 175px; background: linear-gradient(135deg, var(--surface2), #1a0808); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.card-body { padding: 16px; flex: 1; }
.card-tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); margin-bottom: 6px; }
.card h3 { font-size: 0.95rem; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.card p { font-size: 0.82rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); }

/* ── LOAD MORE ── */
.load-more-wrap { text-align: center; margin-bottom: 32px; }
.load-more { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 12px 32px; border-radius: 6px; cursor: pointer; font-size: 0.9rem; transition: all .2s; }
.load-more:hover { border-color: var(--accent); color: var(--accent); }

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.widget-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 16px; }
.trending-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.trending-num { font-size: 1.4rem; font-weight: 900; color: var(--border); line-height: 1; min-width: 26px; }
.trending-item h4 { font-size: 0.82rem; font-weight: 600; line-height: 1.3; margin-bottom: 2px; }
.trending-item span { font-size: 0.7rem; color: var(--muted); }
.cat-list-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.875rem; transition: color .2s; }
.cat-list-item:last-child { border-bottom: none; }
.cat-list-item:hover { color: var(--accent); }
.cat-count { background: var(--surface2); font-size: 0.72rem; padding: 2px 8px; border-radius: 10px; color: var(--muted); }

/* ── ARTICLE PAGE ── */
.article-hero-img { width: 100%; height: 400px; border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
.article-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.article-header { margin-bottom: 32px; }
.article-header h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.2; margin: 12px 0; }
.article-meta { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; }

/* Botones de compartir */
.share-buttons { display: flex; gap: 8px; margin-left: auto; }
.share-btn { font-size: 0.75rem; font-weight: 700; padding: 5px 12px; border-radius: 5px; transition: opacity .2s; }
.share-btn:hover { opacity: .8; }
.share-x { background: #000; color: #fff; }
.share-wa { background: #25d366; color: #fff; }
.share-end { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 32px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-end p { color: var(--muted); font-size: 0.875rem; margin-right: auto; }

/* Artículos relacionados */
.related-section { margin-top: 48px; }
.related-section .section-title { margin-bottom: 16px; }

/* Contenido del artículo */
.article-content { font-size: 1.05rem; line-height: 1.85; color: #d0d0d0; }
.article-content h2 { font-size: 1.45rem; font-weight: 700; margin: 36px 0 12px; color: var(--text); border-left: 3px solid var(--accent); padding-left: 14px; }
.article-content h3 { font-size: 1.15rem; font-weight: 700; margin: 24px 0 10px; color: var(--text); }
.article-content p { margin-bottom: 18px; }
.article-content ul, .article-content ol { margin: 0 0 18px 24px; }
.article-content li { margin-bottom: 6px; }
.article-content blockquote { border-left: 4px solid var(--accent); padding: 14px 20px; background: var(--surface); border-radius: 0 8px 8px 0; margin: 24px 0; color: var(--muted); font-style: italic; }
.article-content a { color: var(--accent2); text-decoration: underline; text-underline-offset: 3px; }
.article-content a:hover { color: #fff; }
.article-content strong { color: var(--text); }
.article-content h2:last-of-type { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); border-left: none; padding-left: 0; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.ad-inline { margin: 32px 0; }

/* ── FOOTER ── */
footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 64px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 40px 20px; text-align: center; }
.footer-logo { font-size: 1.5rem; font-weight: 900; margin-bottom: 8px; }
.footer-logo span { color: var(--accent); }
.footer-inner > p { color: var(--muted); font-size: 0.875rem; margin-bottom: 16px; }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.footer-links a { color: var(--muted); font-size: 0.875rem; transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--border); font-size: 0.75rem; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 600px) {
  nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 12px; }
  nav.open { display: flex; }
  .nav-toggle { display: block; }
  .header-search { max-width: 160px; }
  .hero { padding: 28px 20px; }
  .article-hero-img { height: 220px; }
  .share-buttons { margin-left: 0; width: 100%; }
  .category-filters { display: none; }
}
