/* ============================================================
   InfoDominicana - Estilos
   Paleta: azul oscuro (#1a237e), blanco, acentos dorados (#ffc107)
   ============================================================ */
:root {
  --primary: #1a237e;
  --primary-light: #283593;
  --primary-dark: #0d1642;
  --accent: #ffc107;
  --accent-dark: #ff8f00;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #212121;
  --text-secondary: #616161;
  --text-muted: #757575;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 25px rgba(0,0,0,0.12);
  --radius: 12px;
  --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- HEADER ---------- */
.header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.header-top {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.header-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(255,193,7,0.3);
}

.header-logo-text h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.header-logo-text span {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
  display: block;
}

.header-date {
  font-size: 0.85rem;
  opacity: 0.9;
  text-align: right;
}

.header-nav {
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.header-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 20px;
  overflow-x: auto;
}

.header-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.header-nav a:hover, .header-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- MAIN CONTENT ---------- */
.main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px;
}

/* ---------- LOADING ---------- */
.loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- NEWS GRID ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.news-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #e8eaf6, #c5cae9);
}

.news-card-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.news-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--primary-dark);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-card-badge {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- FEATURED SECTION ---------- */
.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}

.featured-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  cursor: pointer;
  transition: box-shadow 0.25s;
}

.featured-card:hover {
  box-shadow: var(--shadow-hover);
}

.featured-card-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 280px;
}

.featured-card-image {
  background: linear-gradient(135deg, #1a237e, #3949ab);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.featured-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-card-body h2 {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.featured-card-body p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.featured-card-body .badge {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 14px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* ---------- DETAIL PAGE ---------- */
.detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.detail-back:hover { color: var(--primary-light); }

.detail-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.detail-image-placeholder {
  width: 100%;
  height: 250px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  border-radius: var(--radius);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: rgba(255,255,255,0.3);
}

.detail-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.detail-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.detail-content {
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text);
}

.detail-content p {
  margin-bottom: 1rem;
}

.detail-sources {
  margin-top: 32px;
  padding: 20px;
  background: #f0f4ff;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-sources strong {
  color: var(--primary);
}

.detail-share {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.share-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.share-btn:hover { opacity: 0.85; }

.share-fb { background: #1877f2; color: white; }
.share-tw { background: #000; color: white; }
.share-wa { background: #25d366; color: white; }

/* ---------- PAGINATION ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination button {
  padding: 10px 18px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 24px 20px;
  font-size: 0.85rem;
  margin-top: auto;
}

.footer span {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .featured-card-inner {
    grid-template-columns: 1fr;
  }

  .featured-card-image {
    min-height: 200px;
  }

  .detail-title {
    font-size: 1.5rem;
  }

  .header-logo-text h1 {
    font-size: 1.2rem;
  }

  .header-date {
    display: none;
  }

  .header-nav a {
    padding: 10px 14px;
    font-size: 0.8rem;
  }
}

/* ---------- LIGHTBOX ---------- */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.25s ease;
}
.lightbox-overlay.active { display: flex; }
.lightbox-overlay.closing { animation: fadeOut 0.2s ease; }

.lightbox-img {
  max-width: 95vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

.js-lightbox-trigger { cursor: pointer; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }