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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f3f4f6;
  color: #1a1a2e;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ── Header ── */
header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
  letter-spacing: -0.5px;
}
.logo span { color: #2563eb; }
nav a {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background 0.2s;
}
nav a:hover { background: #f3f4f6; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 40px 24px 24px;
}
.hero h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.hero p {
  color: #6b7280;
  font-size: 15px;
  margin-top: 4px;
}

/* ── Card Grid ── */
.card-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* ── Card ── */
.card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
}
.card-img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cat-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #e5e7eb;
  color: #4b5563;
}
.cat-news { background: #dbeafe; color: #1d4ed8; }
.cat-money { background: #d1fae5; color: #047857; }
.cat-sports { background: #fef3c7; color: #b45309; }
.cat-entertainment { background: #fce7f3; color: #be185d; }
.cat-tech { background: #e0e7ff; color: #4338ca; }
.cat-lifestyle { background: #f3e8ff; color: #7c3aed; }
.provider {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a2e;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
  padding-top: 12px;
}

/* ── Article Detail ── */
.article-detail {
  max-width: 820px;
  margin: 32px auto;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.article-hero {
  width: 100%;
  height: 400px;
  background-size: cover;
  background-position: center;
}
.article-content {
  padding: 32px 36px 40px;
}
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.article-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin-bottom: 18px;
  color: #111827;
}
.article-desc {
  font-size: 16px;
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 32px;
}
.btn-redirect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 10px;
  transition: background 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}
.btn-redirect:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.btn-redirect::after {
  content: "→";
  font-size: 18px;
  line-height: 1;
}
.btn-back {
  display: inline-block;
  margin-top: 24px;
  font-size: 15px;
  font-weight: 600;
  color: #2563eb;
  padding: 10px 20px;
  border-radius: 8px;
  transition: background 0.2s;
}
.btn-back:hover { background: #eff6ff; }

/* ── Ad Slots ── */
.ad-leaderboard {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 24px;
  text-align: center;
  min-height: 90px;
}
.ad-card-slot {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ad-bottom {
  max-width: 1280px;
  margin: 0 auto 24px;
  padding: 0 24px;
  text-align: center;
  min-height: 90px;
}
.ad-in-article {
  margin: 28px 0;
  text-align: center;
  min-height: 90px;
}

/* ── Provider Logo ── */
.provider-logo {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
}

/* ── Article Actions ── */
.article-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ── Card Link ── */
.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ── Error ── */
.error-msg {
  text-align: center;
  padding: 64px 24px;
  font-size: 16px;
  color: #6b7280;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 28px 24px;
  font-size: 13px;
  color: #9ca3af;
  border-top: 1px solid #e5e7eb;
  margin-top: 16px;
}
footer a { color: #2563eb; font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; padding: 0 16px 32px; gap: 16px; }
  .hero h1 { font-size: 24px; }
  .card-img { height: 180px; }
  .article-hero { height: 220px; }
  .article-content { padding: 20px; }
  .article-title { font-size: 22px; }
  .header-inner { padding: 12px 16px; }
}
