/* Modern News Portal CSS - Responsive, Clean Typography, High Contrast */
:root {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-red: #ef4444;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --transition: all 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Header & Navigation */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.brand-badge {
  background: var(--accent-blue);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-form {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  max-width: 400px;
}

.search-input {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  background: var(--bg-subtle);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
  background: var(--text-main);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--accent-blue);
}

/* Category Navigation Tabs */
.category-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  white-space: nowrap;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 1.5rem;
}

.nav-item {
  padding: 0.85rem 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text-main);
}

.nav-item.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Breaking News Banner */
.breaking-banner {
  background: #fef2f2;
  border-bottom: 1px solid #fee2e2;
  padding: 0.75rem 1.5rem;
}

.breaking-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.breaking-tag {
  background: var(--accent-red);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.breaking-title {
  font-weight: 600;
  color: #991b1b;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breaking-title:hover {
  text-decoration: underline;
}

/* Main Layout Container */
.main-container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Featured Hero Section */
.hero-section {
  margin-bottom: 3rem;
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

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

.hero-img-wrap {
  position: relative;
  min-height: 320px;
  background: #1e293b;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cat-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: #eff6ff;
  color: var(--accent-blue);
  width: fit-content;
  margin-bottom: 1rem;
}

.cat-badge.Business { background: #ecfdf5; color: #059669; }
.cat-badge.World { background: #f5f3ff; color: #7c3aed; }
.cat-badge.Sports { background: #fef2f2; color: #dc2626; }
.cat-badge.Entertainment { background: #fff7ed; color: #ea580c; }

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.hero-excerpt {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.meta-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Article Grid */
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.article-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: #cbd5e1;
}

.card-img-wrap {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: #1e293b;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .card-img {
  transform: scale(1.03);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.75rem 0;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 3rem 0;
}

.page-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.page-btn:hover:not(.disabled) {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.page-btn.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.page-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Article Detail Layout */
.article-detail-grid {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 3rem;
}

.article-main {
  background: var(--bg-surface);
  padding: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.detail-title {
  font-size: 2.5rem;
  font-weight: 850;
  line-height: 1.2;
  margin: 1rem 0 1.5rem;
  letter-spacing: -0.5px;
}

.detail-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.author-info {
  font-weight: 600;
  color: var(--text-main);
}

.detail-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2.5rem;
}

.detail-body {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #334155;
  white-space: pre-line;
}

.detail-body h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 2rem 0 1rem;
}

/* Comments Section */
.comments-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--border-color);
}

.comment-form-card {
  background: var(--bg-subtle);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-surface);
}

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

.submit-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.submit-btn:hover {
  background: var(--accent-blue-hover);
}

.comment-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-color);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: 700;
  font-size: 0.95rem;
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-widget {
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.related-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: var(--transition);
}

.related-item:hover {
  transform: translateX(3px);
}

.related-img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.related-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #f1f5f9;
  padding: 4rem 1.5rem 2rem;
  margin-top: 5rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  border-bottom: 1px solid #334155;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.footer-copy {
  font-size: 0.85rem;
  color: #94a3b8;
  text-align: center;
  width: 100%;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .hero-card, .article-detail-grid {
    grid-template-columns: 1fr;
  }
  .hero-img-wrap {
    min-height: 240px;
  }
  .hero-content, .article-main {
    padding: 1.5rem;
  }
  .detail-title {
    font-size: 1.8rem;
  }
}
