/* ==========================================================================
   BALIGOVIRAL — ELITE INTERNATIONAL NEWS PORTAL STYLESHEET
   Design Language: Modern Editorial High-End (The Verge + Bloomberg + Kumparan)
   Precision Centered Layout + Responsive Mobile Dropdown Navigation
   ========================================================================== */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-red: #e11d48;
  --accent-red-hover: #be123c;
  --accent-blue: #0284c7;
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.06);
  --font-serif: 'Playfair Display', 'Merriweather', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --container-max: 1240px;
}

[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: #111827;
  --border-color: #1e293b;
  --border-light: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 20px -3px rgb(0 0 0 / 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Precision Centered Container */
.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* --- TOP HEADER & TICKER --- */
.top-bar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.825rem;
  color: var(--text-secondary);
  padding: 0.45rem 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

.live-badge {
  background-color: var(--accent-red);
  color: #ffffff;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.live-dot {
  width: 6px;
  height: 6px;
  background-color: #ffffff;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  min-width: 0;
  flex: 1;
}

.ticker-item {
  display: inline-block;
  color: var(--text-primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ticker-item:hover {
  color: var(--accent-red);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.lang-btn, .theme-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.775rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.lang-btn:hover, .theme-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* --- MAIN BRANDING HEADER --- */
.main-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
  background-color: var(--bg-primary);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-symbol {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #e11d48, #0284c7);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

.brand-text h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
}

.brand-text span {
  color: var(--accent-red);
}

.brand-tagline {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-bar-inline {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 0.45rem 1rem;
  width: 280px;
}

.search-bar-inline input {
  background: none;
  border: none;
  outline: none;
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 100%;
}

.search-bar-inline button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

/* Mobile Category Dropdown Selector */
.mobile-nav-select-wrap {
  display: none;
  padding: 0.6rem 0;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-select {
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

/* --- DESKTOP NAV BAR --- */
.nav-bar {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0.75rem 0;
  scrollbar-width: none;
  justify-content: flex-start;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-item a {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-bottom: 0.25rem;
  position: relative;
}

.nav-item a:hover, .nav-item.active a {
  color: var(--accent-red);
}

.nav-item.active a::after {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--accent-red);
  border-radius: 3px 3px 0 0;
}

/* --- HERO SECTION LAYOUT (PRECISION CENTERED) --- */
.hero-section {
  padding: 2rem 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

/* Lead Story Card (Col 1) */
.lead-story-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.lead-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #0f172a;
}

.lead-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.lead-story-card:hover .lead-image-wrap img {
  transform: scale(1.03);
}

.category-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--accent-red);
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

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

.lead-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.lead-title:hover {
  color: var(--accent-red);
}

.lead-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-author {
  color: var(--text-primary);
  font-weight: 700;
}

/* Sub-Featured Cards (Col 2) */
.sub-featured-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.sub-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

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

.sub-card:hover .sub-image-wrap img {
  transform: scale(1.04);
}

.sub-content {
  padding: 1rem;
}

.sub-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.sub-title:hover {
  color: var(--accent-red);
}

/* Trending Sidebar (Col 3) */
.trending-sidebar {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.trending-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  position: relative;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.trending-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trend-number {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-muted);
  width: 26px;
  text-align: center;
  font-family: var(--font-serif);
}

.trending-item:nth-child(1) .trend-number { color: #e11d48; }
.trending-item:nth-child(2) .trend-number { color: #ea580c; }
.trending-item:nth-child(3) .trend-number { color: #d97706; }

.trend-details h4 {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.trend-details h4:hover {
  color: var(--accent-red);
}

.trend-meta {
  font-size: 0.725rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
}

/* --- SECTION BLOCKS --- */
.section-block {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-color);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-all-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-red);
}

.view-all-link:hover {
  text-decoration: underline;
}

.news-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

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

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

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

.news-card:hover .card-thumb img {
  transform: scale(1.05);
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-category {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-blue);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  flex-grow: 1;
}

.card-title:hover {
  color: var(--accent-red);
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
}

/* --- NEWSLETTER CALLOUT --- */
.newsletter-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border-radius: 16px;
  padding: 3rem 2rem;
  color: #ffffff;
  text-align: center;
  margin: 2rem 0;
  box-shadow: var(--shadow-lg);
}

.newsletter-banner h3 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.newsletter-banner p {
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto 1.5rem auto;
}

.newsletter-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  gap: 0.5rem;
}

.newsletter-form input {
  flex-grow: 1;
  padding: 0.75rem 1.25rem;
  border-radius: 30px;
  border: 1px solid #334155;
  background-color: #1e293b;
  color: #ffffff;
  font-size: 0.9rem;
  outline: none;
}

.newsletter-form button {
  background-color: var(--accent-red);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.newsletter-form button:hover {
  background-color: var(--accent-red-hover);
}

/* --- SINGLE ARTICLE PAGE --- */
.article-header {
  padding: 2.5rem 0 1.5rem 0;
}

.article-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.article-breadcrumb a:hover {
  color: var(--accent-red);
}

.article-title-main {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-excerpt-lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

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

.author-info-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--accent-blue);
}

.author-name-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.article-date-str {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.share-buttons-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.share-btn:hover {
  background-color: var(--accent-red);
  color: #ffffff;
  border-color: var(--accent-red);
}

.article-main-grid {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 3rem;
  padding-bottom: 4rem;
}

.article-hero-media {
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
}

.article-hero-media img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.article-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  font-style: italic;
  border-bottom: 1px solid var(--border-color);
}

.article-body-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body-text p {
  margin-bottom: 1.5rem;
}

.article-body-text h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 2rem 0 1rem 0;
}

.article-body-text blockquote {
  border-left: 4px solid var(--accent-red);
  background-color: var(--bg-secondary);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  border-radius: 0 8px 8px 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-primary);
}

/* Reactions Bar */
.reaction-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2.5rem 0;
  text-align: center;
}

.reaction-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.reaction-buttons-wrap {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.reaction-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
}

.reaction-btn:hover, .reaction-btn.active {
  background-color: var(--accent-red);
  color: #ffffff;
  border-color: var(--accent-red);
}

/* --- FOOTER (CLEANED) --- */
.site-footer {
  background-color: #090d16;
  color: #f8fafc;
  padding: 3.5rem 0 2rem 0;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.8fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand h2 {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  color: #ffffff;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #64748b;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
  .trending-sidebar {
    grid-column: span 2;
  }
  .news-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .article-main-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-nav-select-wrap {
    display: block;
  }
  .nav-bar {
    display: none;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .trending-sidebar {
    grid-column: span 1;
  }
  .news-grid-4 {
    grid-template-columns: 1fr;
  }
  .brand-text h1 {
    font-size: 1.5rem;
  }
  .article-title-main {
    font-size: 1.65rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .search-bar-inline {
    width: 180px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}
