/* ============================================
   DÍMELO TV MEDIA GROUP — ESTILOS PRINCIPALES
   ============================================ */

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

:root {
  --primary: #e5001e;
  --primary-dark: #b5001a;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --border: #e0e0e0;
  --text: #111111;
  --text-muted: #666666;
  --text-light: #999999;
  --cat-tv: #0077cc;
  --cat-ent: #7b2fbf;
  --cat-music: #d4500a;
  --cat-cel: #c2185b;
  --cat-cine: #1a7a4a;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.14);
  --max-width: 1200px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

ul { list-style: none; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon { font-size: 1.5rem; }

.logo-sub {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  line-height: 1;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.main-nav a {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.main-nav a:hover {
  background: #f0f0f0;
  color: var(--primary);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
  margin-left: auto;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 0;
}

.mobile-nav a {
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
  display: block;
}

.mobile-nav a:hover { background: #f8f8f8; color: var(--primary); }

.mobile-nav.open { display: flex; }

/* ============================================
   BREAKING NEWS TICKER
   ============================================ */
.breaking-bar {
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 36px;
}

.breaking-label {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.breaking-track {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0, black 40px, black calc(100% - 40px), transparent 100%);
}

.breaking-items {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
  padding-left: 100%;
}

.breaking-item a {
  color: #ddd;
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.2s;
}

.breaking-item a:hover { color: #fff; }

.breaking-sep {
  color: var(--primary);
  font-size: 1rem;
}

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

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  border-left: 4px solid var(--primary);
  padding-left: 10px;
  margin-bottom: 16px;
}

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

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
}

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

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 20px;
  background: #f0f0f0;
  color: var(--text-muted);
}

.cat-tv    { background: #e8f4ff; color: var(--cat-tv); }
.cat-ent   { background: #f3eaff; color: var(--cat-ent); }
.cat-music { background: #fff0e6; color: var(--cat-music); }
.cat-cel   { background: #fce4ec; color: var(--cat-cel); }
.cat-cine  { background: #e8f5ee; color: var(--cat-cine); }

.sponsored-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
}

.article-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

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

.article-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.article-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.read-time, .pub-time {
  font-size: 0.73rem;
  color: var(--text-light);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 80px;
}

/* MOST READ */
.most-read-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.most-read-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.most-read-item:last-child { border-bottom: none; }

.most-read-item a {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  flex: 1;
}

.most-read-item a:hover { color: var(--primary); }

.rank {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
  min-width: 20px;
  line-height: 1;
  padding-top: 2px;
}

.arrow {
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.4;
}

/* TOPIC EXPLORER */
.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}

.topic-tag:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* NEWSLETTER */
.newsletter-box {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
}

.newsletter-box h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.newsletter-box p {
  font-size: 0.82rem;
  color: #aaa;
  margin-bottom: 14px;
  line-height: 1.5;
}

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

.newsletter-form input {
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #0f0f1a;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

.newsletter-form input:focus { border-color: var(--primary); }

.newsletter-form button {
  padding: 9px;
  border-radius: 6px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.newsletter-form button:hover { background: var(--primary-dark); }

/* ============================================
   ARTICLE IMAGES
   ============================================ */
.article-img {
  display: block;
  width: calc(100% + 32px);
  margin: -16px -16px 12px -16px;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

.article-img-sm {
  display: block;
  width: calc(100% + 28px);
  margin: -14px -14px 10px -14px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

/* Estado: imagen no disponible en Wikipedia */
.article-img.wiki-no-image,
.article-img-sm.wiki-no-image {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  position: relative;
}

.article-img.wiki-no-image::after,
.article-img-sm.wiki-no-image::after {
  content: '📺';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  opacity: 0.4;
}

/* Shimmer de carga */
.article-img:not(.wiki-loaded):not(.wiki-no-image),
.article-img-sm:not(.wiki-loaded):not(.wiki-no-image) {
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   MORE NEWS SECTION
   ============================================ */
.more-news {
  margin-top: 32px;
}

.more-news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.article-card-small {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
}

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

.article-card-small h4 {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  flex: 1;
}

.article-card-small h4 a:hover { color: var(--primary); }

.article-card-small .pub-time {
  font-size: 0.72rem;
  color: var(--text-light);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: #111;
  color: #ccc;
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: block;
  margin-bottom: 10px;
}

.footer-brand p {
  font-size: 0.85rem;
  color: #888;
  line-height: 1.6;
  max-width: 280px;
}

.footer-links h4,
.footer-legal h4 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.footer-links ul,
.footer-legal ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a,
.footer-legal a {
  font-size: 0.83rem;
  color: #888;
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-legal a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid #222;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: #666;
}

.disclaimer a { color: #888; text-decoration: underline; }
.disclaimer a:hover { color: #ccc; }

/* ============================================
   CATEGORY PAGE HEADER
   ============================================ */
.cat-page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  margin-bottom: 24px;
}

.cat-page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.cat-page-header h1 {
  font-size: 2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-page-header p {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 0.95rem;
}

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

.article-header {
  margin-bottom: 24px;
}

.article-header h1 {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.3;
  margin: 12px 0;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  margin-top: 12px;
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #222;
}

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

.article-body h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 28px 0 12px;
  color: var(--text);
}

/* ============================================
   CONTACT & ABOUT PAGES
   ============================================ */
.static-page {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

.static-page h1 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 20px;
  border-bottom: 3px solid var(--primary);
  padding-bottom: 12px;
}

.static-page h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 24px 0 10px;
}

.static-page p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.contact-form input,
.contact-form textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
}

.contact-form textarea { min-height: 120px; resize: vertical; }

.btn-primary {
  padding: 11px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}

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

/* ============================================
   MOST-READ SIDEBAR WRAPPER
   ============================================ */
.most-read,
.topic-explorer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .most-read,
  .topic-explorer {
    flex: 1 1 260px;
  }

  .newsletter-box {
    flex: 1 1 100%;
  }

  .more-news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .menu-toggle { display: block; }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .more-news-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .article-header h1 { font-size: 1.4rem; }
}

/* ============================================
   TOAST / NOTIFICATION
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #222;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}
