/* Malaysia News Hub — Metronic-inspired theme layer
   Keeps the existing DOM/JS intact while applying Metronic-style surfaces,
   spacing, cards, shadows and blue primary accents. */
:root {
  --background: 220 20% 97%;
  --foreground: 222 47% 11%;
  --muted: 215 16% 47%;
  --muted-foreground: 215 16% 47%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --primary: 221 83% 53%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222 47% 11%;
  --accent: 221 83% 96%;
  --accent-foreground: 221 83% 43%;
  --destructive: 0 84% 60%;
  --ring: 221 83% 53%;
  --radius: 0.875rem;
  --mnh-page: #f5f8ff;
  --mnh-panel: rgba(255,255,255,.92);
  --mnh-panel-solid: #fff;
  --mnh-shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --mnh-shadow: 0 8px 24px rgba(15,23,42,.06);
  --mnh-shadow-lg: 0 18px 48px rgba(15,23,42,.10);
}
.dark {
  --background: 222 47% 7%;
  --foreground: 210 40% 98%;
  --muted: 215 20% 65%;
  --muted-foreground: 215 20% 65%;
  --card: 222 47% 10%;
  --card-foreground: 210 40% 98%;
  --border: 217 33% 18%;
  --input: 217 33% 18%;
  --primary: 217 91% 60%;
  --primary-foreground: 222 47% 8%;
  --secondary: 217 33% 15%;
  --secondary-foreground: 210 40% 98%;
  --accent: 217 33% 16%;
  --accent-foreground: 217 91% 70%;
  --ring: 217 91% 60%;
  --mnh-page: #070b16;
  --mnh-panel: rgba(17,24,39,.88);
  --mnh-panel-solid: #111827;
  --mnh-shadow-sm: 0 1px 2px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.25);
  --mnh-shadow: 0 8px 24px rgba(0,0,0,.30);
  --mnh-shadow-lg: 0 18px 48px rgba(0,0,0,.38);
}
html { background: var(--mnh-page); }
body {
  background:
    radial-gradient(circle at top left, hsl(var(--primary) / .12), transparent 32rem),
    linear-gradient(180deg, var(--mnh-page), hsl(var(--background)) 34rem);
}
.site-header,
.header {
  background: color-mix(in srgb, var(--mnh-panel) 92%, transparent) !important;
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid hsl(var(--border) / .75) !important;
  box-shadow: var(--mnh-shadow-sm);
}
.logo {
  color: hsl(var(--foreground));
  letter-spacing: -.02em;
}
.logo::after {
  content: "";
  width: .45rem;
  height: .45rem;
  margin-left: .45rem;
  display: inline-block;
  border-radius: 999px;
  background: hsl(var(--primary));
  box-shadow: 0 0 0 4px hsl(var(--primary) / .12);
  vertical-align: middle;
}
.btn,
.icon-btn,
.lang-button,
.tab,
.cat-tab,
.dropdown-item,
.mobile-lang-btn {
  border-radius: .75rem !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:hover,
.icon-btn:hover,
.lang-button:hover,
.dropdown-item:hover,
.mobile-lang-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--mnh-shadow-sm);
}
.btn.primary,
.tab.active,
.cat-tab.active,
.mobile-lang-btn.active {
  background: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  border-color: hsl(var(--primary)) !important;
  box-shadow: 0 8px 18px hsl(var(--primary) / .22);
}
.hero,
.filters-panel,
.news-section,
.source-category,
.footer-card,
.card,
.cta-box,
.source-banner,
.related-card,
.article-shell,
.dropdown-menu,
.topbar,
.site-footer {
  border-color: hsl(var(--border) / .8) !important;
  box-shadow: var(--mnh-shadow-sm);
}
.hero,
.filters-panel,
.news-section,
.source-category,
.card,
.cta-box,
.source-banner,
.article-shell,
.site-footer {
  background: var(--mnh-panel) !important;
  backdrop-filter: blur(10px);
}
.story-featured,
.story-mini,
.news-card,
.related-card,
.source-item {
  border-color: hsl(var(--border) / .8) !important;
  background: var(--mnh-panel-solid) !important;
  box-shadow: var(--mnh-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.story-featured:hover,
.story-mini:hover,
.news-card:hover,
.related-card:hover,
.source-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--mnh-shadow);
  border-color: hsl(var(--primary) / .28) !important;
}
.story-img,
.news-img,
.hero-img img,
.hero-img .img-fallback,
.related-card img,
.related-card .img-fallback,
.img-fallback {
  border-radius: calc(var(--radius) + .25rem) !important;
}
.cat-pill,
.badge,
.source-chip,
.src-chip,
.filter-note,
.news-meta,
.byline {
  border-radius: 999px !important;
}
.cat-pill,
.badge,
.source-chip,
.src-chip {
  background: hsl(var(--primary) / .10) !important;
  color: hsl(var(--primary)) !important;
  border: 1px solid hsl(var(--primary) / .18) !important;
}
.tabs-section,
.tabs,
.filter-row,
.mobile-footer-lang {
  background: color-mix(in srgb, var(--mnh-panel) 92%, transparent) !important;
  border-color: hsl(var(--border) / .75) !important;
  backdrop-filter: blur(14px);
}
.ad-slot,
.infeed-ad {
  background: repeating-linear-gradient(45deg, hsl(var(--secondary)), hsl(var(--secondary)) 10px, hsl(var(--background)) 10px, hsl(var(--background)) 20px) !important;
  border-color: hsl(var(--border) / .8) !important;
  border-radius: var(--radius) !important;
}
.section-title,
h1,
h2,
h3 {
  letter-spacing: -.03em;
}
.wrap,
.container {
  position: relative;
}
.site-footer {
  border-radius: 1.25rem 1.25rem 0 0;
}
.dark .story-featured,
.dark .story-mini,
.dark .news-card,
.dark .related-card,
.dark .source-item {
  background: rgba(15,23,42,.86) !important;
}

/* Dashboard shell for homepage */
.dashboard-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: 1.25rem;
  align-items: start;
  padding-top: 1.5rem;
}
.dashboard-sidebar,
.dashboard-aside {
  position: sticky;
  top: 5.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dashboard-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.dashboard-main .hero,
.dashboard-main .filters-section,
.dashboard-main .sources-section,
.dashboard-main .tabs-section {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
.dashboard-main > .container,
.dashboard-main .hero > .container,
.dashboard-main .filters-section > .container,
.dashboard-main .tabs-section > .container,
.dashboard-main .sources-section > .container {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.dashboard-main .hero {
  border-radius: 1.25rem;
}
.sidebar-card,
.aside-card {
  background: var(--mnh-panel);
  border: 1px solid hsl(var(--border) / .8);
  border-radius: 1.125rem;
  padding: 1rem;
  box-shadow: var(--mnh-shadow-sm);
  backdrop-filter: blur(12px);
}
.sidebar-brand-card {
  background:
    radial-gradient(circle at top right, hsl(var(--primary) / .18), transparent 12rem),
    var(--mnh-panel);
}
.sidebar-kicker,
.sidebar-title,
.aside-title {
  display: block;
  margin-bottom: .625rem;
  color: hsl(var(--muted-foreground));
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.sidebar-card h2 {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  letter-spacing: -.035em;
}
.sidebar-card p,
.aside-card p {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: .86rem;
  line-height: 1.55;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.sidebar-nav-item,
.sidebar-card.compact a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .65rem .75rem;
  border: 1px solid transparent;
  border-radius: .8rem;
  background: transparent;
  color: hsl(var(--foreground));
  text-decoration: none;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.sidebar-nav-item::before,
.sidebar-card.compact a::before {
  content: "";
  width: .45rem;
  height: .45rem;
  margin-right: .6rem;
  border-radius: 999px;
  background: hsl(var(--muted-foreground) / .35);
}
.sidebar-nav-item span { flex: 1; text-align: left; }
.sidebar-nav-item:hover,
.sidebar-card.compact a:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  transform: translateX(2px);
}
.sidebar-nav-item.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  box-shadow: 0 10px 22px hsl(var(--primary) / .22);
}
.sidebar-nav-item.active::before { background: currentColor; }
.sidebar-card.compact {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.status-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .5rem;
}
.status-dot {
  width: .65rem;
  height: .65rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34,197,94,.14);
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}
.stat-grid div {
  padding: .75rem;
  border-radius: .85rem;
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border) / .65);
}
.stat-grid strong {
  display: block;
  color: hsl(var(--foreground));
  font-size: 1.15rem;
  letter-spacing: -.03em;
}
.stat-grid span {
  display: block;
  color: hsl(var(--muted-foreground));
  font-size: .72rem;
  margin-top: .15rem;
}
.aside-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.aside-pills span {
  padding: .45rem .6rem;
  border-radius: 999px;
  background: hsl(var(--primary) / .10);
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / .16);
  font-size: .78rem;
  font-weight: 600;
}
.dashboard-main .news-section,
.dashboard-main .sources-section .section-head,
.dashboard-main #sourcesContainer > * {
  border-radius: 1.125rem;
}
@media (max-width: 1180px) {
  .dashboard-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .dashboard-aside { display: none; }
}
@media (max-width: 860px) {
  .dashboard-shell { display: block; padding-top: 1rem; }
  .dashboard-sidebar { position: static; margin-bottom: 1rem; }
  .dashboard-sidebar .sidebar-brand-card,
  .dashboard-sidebar .compact { display: none; }
  .sidebar-card { padding: .75rem; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; padding-bottom: .15rem; }
  .sidebar-nav-item { width: auto; white-space: nowrap; flex: 0 0 auto; }
  .sidebar-nav-item::before { display: none; }
  .dashboard-main { gap: 1rem; }
}

/* MSN / Google News style homepage layout */
.news-portal {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 1.5rem;
}
.news-portal > .container,
.news-portal .hero > .container,
.news-portal .filters-section > .container,
.news-portal .tabs-section > .container,
.news-portal .sources-section > .container {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.news-portal .hero,
.news-portal .filters-section,
.news-portal .tabs-section,
.news-portal .sources-section {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.portal-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: end;
  padding: 1.25rem;
  border: 1px solid hsl(var(--border) / .8);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at top right, hsl(var(--primary) / .16), transparent 18rem),
    var(--mnh-panel);
  box-shadow: var(--mnh-shadow-sm);
  backdrop-filter: blur(12px);
}
.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .6rem;
  color: hsl(var(--primary));
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.portal-kicker::before {
  content: "";
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34,197,94,.14);
}
.portal-intro h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.25rem);
  line-height: .98;
  letter-spacing: -.06em;
}
.portal-intro p {
  max-width: 760px;
  margin: .8rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  line-height: 1.65;
}
.portal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: .65rem;
  min-width: 300px;
}
.portal-stats div {
  padding: .85rem;
  border: 1px solid hsl(var(--border) / .75);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--mnh-panel-solid) 88%, transparent);
  text-align: center;
  box-shadow: var(--mnh-shadow-sm);
}
.portal-stats strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -.04em;
}
.portal-stats span {
  display: block;
  margin-top: .15rem;
  color: hsl(var(--muted-foreground));
  font-size: .74rem;
  font-weight: 600;
}
.news-portal .hero-grid {
  gap: 1rem !important;
}
.news-portal .story-featured {
  min-height: 420px;
}
.news-portal .story-side {
  gap: 1rem !important;
}
.news-portal .filters-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  padding: .85rem !important;
}
.news-portal .tabs-section {
  position: sticky;
  top: 4.25rem;
  z-index: 30;
}
.news-portal .tabs {
  padding: .55rem;
  border: 1px solid hsl(var(--border) / .75);
  border-radius: 1rem;
  box-shadow: var(--mnh-shadow-sm);
}
.news-portal .news-section {
  padding: 1rem !important;
  border-radius: 1.25rem;
}
.news-portal .news-section-head {
  padding-bottom: .85rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid hsl(var(--border) / .7);
}
.news-portal .news-grid {
  gap: .95rem !important;
}
.news-portal .news-card .body {
  padding: .85rem !important;
}
.news-portal .sources-section .section-head {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid hsl(var(--border) / .75);
  border-radius: 1.25rem;
  background: var(--mnh-panel);
  box-shadow: var(--mnh-shadow-sm);
}
.news-portal .infeed-ad-wrap,
.news-portal > .container {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
@media (max-width: 900px) {
  .portal-intro { grid-template-columns: 1fr; align-items: start; }
  .portal-stats { min-width: 0; width: 100%; }
  .news-portal .filters-panel { grid-template-columns: 1fr; }
  .news-portal .story-featured { min-height: 0; }
}
@media (max-width: 640px) {
  .news-portal { padding-top: .9rem; gap: 1rem; }
  .portal-intro { padding: 1rem; border-radius: 1rem; }
  .portal-stats { grid-template-columns: repeat(3, 1fr); gap: .45rem; }
  .portal-stats div { padding: .65rem .45rem; }
  .portal-stats strong { font-size: 1.05rem; }
  .portal-stats span { font-size: .65rem; }
  .news-portal .tabs-section { top: 3.75rem; }
}

/* Compact tuning after MSN/Google News redesign */
.news-portal {
  gap: 1rem;
  padding-top: 1.1rem;
}
.portal-intro {
  padding: 1rem 1.1rem;
  gap: 1rem;
}
.portal-kicker {
  margin-bottom: .45rem;
  font-size: .7rem;
}
.portal-intro h1 {
  font-size: clamp(1.55rem, 3.1vw, 2.45rem);
  line-height: 1.04;
  max-width: 720px;
}
.portal-intro p {
  margin-top: .55rem;
  font-size: .92rem;
  line-height: 1.55;
  max-width: 700px;
}
.portal-stats {
  min-width: 260px;
  gap: .5rem;
}
.portal-stats div {
  padding: .65rem .7rem;
  border-radius: .85rem;
}
.portal-stats strong {
  font-size: 1.12rem;
}
.portal-stats span {
  font-size: .68rem;
}
.news-portal .hero-eyebrow-row {
  margin-bottom: .75rem;
}
.news-portal .story-featured {
  min-height: 360px;
}
.news-portal .filters-panel {
  padding: .7rem !important;
  gap: .65rem;
}
.news-portal .tabs {
  padding: .45rem;
}
.news-portal .news-section {
  padding: .85rem !important;
}
.news-portal .news-section-head {
  padding-bottom: .65rem;
  margin-bottom: .75rem;
}
.news-portal .sources-section .section-head {
  padding: .85rem;
  margin-bottom: .8rem;
}
@media (max-width: 900px) {
  .portal-intro { gap: .75rem; }
  .portal-stats { min-width: 0; }
}
@media (max-width: 640px) {
  .news-portal { padding-top: .7rem; gap: .85rem; }
  .portal-intro { padding: .85rem; }
  .portal-intro h1 { font-size: 1.45rem; }
  .portal-intro p { font-size: .86rem; }
  .news-portal .story-featured { min-height: 0; }
}
