:root {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-card: #111827;
  --bg-subtle: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;
  --border-color: #1f2937;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.6);
}

/* Distinct Typography & Surface Personalities per Portal */
body.layout-01 { --font-heading: Georgia, "Times New Roman", Times, serif; --radius: 4px; }
body.layout-02 { --bg-body: #f0fdf4; --radius: 16px; }
[data-theme="dark"] body.layout-02 { --bg-body: #051611; }
body.layout-03 { --radius: 2px; }
body.layout-04 { --bg-body: #fdfaf3; --font-heading: Georgia, Cambria, serif; --radius: 4px; }
[data-theme="dark"] body.layout-04 { --bg-body: #0d1117; }
body.layout-05 { --bg-body: #f5f3ff; --radius: 14px; }
[data-theme="dark"] body.layout-05 { --bg-body: #090818; }
body.layout-06 { --radius: 6px; }
body.layout-07 { --bg-body: #fffbeb; --radius: 10px; }
[data-theme="dark"] body.layout-07 { --bg-body: #120f0b; }
body.layout-08 { --font-heading: "Palatino Linotype", Georgia, serif; --radius: 6px; }
body.layout-09 { --radius: 4px; }
body.layout-10 { --bg-body: #f4fbf7; --radius: 12px; }
[data-theme="dark"] body.layout-10 { --bg-body: #07140d; }

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  padding-bottom: 72px; /* Space for mobile bottom nav */
  overflow-x: hidden;
}

@media (min-width: 769px) {
  body { padding-bottom: 0; }
}

h1, h2, h3, h4, .hero-title, .news-title, .article-h1 {
  font-family: var(--font-heading);
}

a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--brand-primary); }
img, svg { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Desktop Top Utility Bar (Hidden on small mobile to keep mobile sleek) */
.topbar {
  background-color: var(--brand-dark);
  color: #f8fafc;
  font-size: 12.5px;
  padding: 7px 0;
  border-bottom: 2px solid var(--brand-primary);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-live {
  background-color: var(--brand-primary);
  color: #fff;
  font-weight: 800;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.topbar-link { color: #cbd5e1; font-weight: 500; }
.topbar-link:hover { color: #fff; }

.theme-btn {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
}

/* Header Variations */
.site-header {
  background-color: var(--bg-card);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 60;
}

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

/* Centered Newspaper Header for Layout 01, 04, 08 */
body.layout-01 .header-inner,
body.layout-04 .header-inner,
body.layout-08 .header-inner {
  flex-direction: column;
  text-align: center;
  padding: 6px 0;
}

body.layout-01 .site-header,
body.layout-04 .site-header {
  border-bottom: 4px double var(--text-main);
}

/* Dark Contrast Header for Layout 03, 09 */
body.layout-03 .site-header,
body.layout-09 .site-header {
  background-color: var(--brand-dark);
  color: #ffffff;
  border-bottom: 3px solid var(--brand-primary);
}
body.layout-03 .brand-tagline,
body.layout-09 .brand-tagline {
  color: #cbd5e1;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-svg {
  height: 50px;
  width: auto;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  width: 280px;
}

.search-input {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--text-main);
  width: 100%;
  outline: none;
}

.search-btn {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  padding: 8px 15px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* Mobile Action Buttons (Hamburger & Search Toggle) */
.mobile-triggers {
  display: none;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

/* Category Navigation Bar */
.main-nav {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 55;
  box-shadow: var(--shadow-sm);
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  gap: 6px;
  padding: 8px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-list::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-block;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 6px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

body.layout-02 .nav-link,
body.layout-05 .nav-link,
body.layout-10 .nav-link {
  border-radius: 999px;
}

.nav-link:hover, .nav-link.active {
  background-color: var(--brand-primary);
  color: #ffffff;
}

/* Breaking Ticker */
.ticker-bar {
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
  font-size: 13px;
}
.ticker-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.ticker-label {
  background-color: var(--brand-primary);
  color: #fff;
  font-weight: 800;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.ticker-text {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Special Highlight Ribbon (Data / Regional / Market Strip) */
.special-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.strip-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.strip-label { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--brand-primary); }
.strip-val { font-size: 13.5px; font-weight: 700; margin-top: 2px; line-height: 1.3; }

/* Main Content & Distinct Hero Layouts */
.main-content { padding: 22px 0 48px; }

.cat-badge {
  display: inline-block;
  background-color: var(--brand-primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  width: fit-content;
}

.meta-info {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* HERO TYPE A: Classic 3-Column Investigative (Portals 01, 04) */
.hero-3col {
  display: grid;
  grid-template-columns: 1fr 1.8fr 1fr;
  gap: 18px;
  margin-bottom: 30px;
}

/* HERO TYPE B: Modern Bento Grid (Portals 02, 07, 10) */
.hero-bento {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  margin-bottom: 30px;
}
.hero-bento-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* HERO TYPE C: Dark Contrast Split Banner (Portals 03, 05, 08) */
.hero-split-dark {
  background: linear-gradient(125deg, var(--brand-dark) 0%, #1e293b 70%, var(--brand-primary) 100%);
  color: #ffffff;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}
.hero-split-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-split-body .hero-title a:hover { color: #fde047; }
.hero-split-body .hero-excerpt { color: #e2e8f0; }
.hero-split-body .meta-info { color: #cbd5e1; }

/* HERO TYPE D: High-Speed Breaking Trio (Portals 06, 09) */
.hero-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-subtle);
}
.hero-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 10px;
}
.hero-excerpt {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 14px;
}

/* Content + Sidebar Grid */
.content-grid {
  display: grid;
  grid-template-columns: 2.15fr 1fr;
  gap: 28px;
  align-items: start;
}

/* Left Sidebar Variant for Portals 03, 06, 08 */
body.layout-03 .content-grid,
body.layout-06 .content-grid,
body.layout-08 .content-grid {
  grid-template-columns: 1fr 2.15fr;
}
body.layout-03 .content-grid > section,
body.layout-06 .content-grid > section,
body.layout-08 .content-grid > section {
  order: 2;
}
body.layout-03 .content-grid > aside,
body.layout-06 .content-grid > aside,
body.layout-08 .content-grid > aside {
  order: 1;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 18px;
}
.section-title {
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: relative;
  padding-left: 12px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  background-color: var(--brand-primary);
  border-radius: 2px;
}

/* News Feed Variations */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 2-Column Magazine Feed for Portals 02, 05, 07, 10 */
body.layout-02 .news-list.feed-grid,
body.layout-05 .news-list.feed-grid,
body.layout-07 .news-list.feed-grid,
body.layout-10 .news-list.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
body.layout-02 .news-list.feed-grid .news-card,
body.layout-05 .news-list.feed-grid .news-card,
body.layout-07 .news-list.feed-grid .news-card,
body.layout-10 .news-list.feed-grid .news-card {
  grid-template-columns: 1fr;
}

/* Timeline Accent for Portal 06 */
body.layout-06 .news-card {
  border-left: 4px solid var(--brand-primary);
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 15px;
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.news-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-subtle);
}
.news-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.news-title {
  font-size: 17.5px;
  font-weight: 750;
  line-height: 1.35;
  margin-bottom: 6px;
}
.news-excerpt {
  font-size: 13.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar Widgets */
.sidebar { display: flex; flex-direction: column; gap: 22px; }
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.trending-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.trending-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.trending-item:last-child { border-bottom: none; padding-bottom: 0; }
.trending-num {
  font-size: 20px;
  font-weight: 900;
  color: var(--brand-primary);
  line-height: 1;
  min-width: 24px;
}
.trending-title { font-size: 14px; font-weight: 700; line-height: 1.35; margin-bottom: 4px; }

/* Single Article Reader */
.article-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.breadcrumb { font-size: 12.5px; color: var(--text-light); margin-bottom: 12px; }
.article-h1 { font-size: 28px; font-weight: 850; line-height: 1.28; margin-bottom: 14px; }
.article-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
}
.article-featured-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}
.img-caption { font-size: 12px; color: var(--text-light); font-style: italic; margin-bottom: 20px; }
.article-content { font-size: 16.5px; line-height: 1.8; }
.article-content p { margin-bottom: 16px; }
.article-content h2, .article-content h3 { margin: 24px 0 10px; line-height: 1.35; }
.article-content blockquote {
  border-left: 4px solid var(--brand-primary);
  background: var(--bg-subtle);
  padding: 14px 18px;
  margin: 18px 0;
  font-style: italic;
  border-radius: 0 6px 6px 0;
}
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.share-btn {
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  cursor: pointer;
}
.share-btn:hover { background: var(--brand-primary); color: #fff; }

/* Mobile Slide-Out Drawer & Bottom App Bar */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 90;
  display: none;
}
.mobile-drawer-backdrop.open { display: block; }

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -310px;
  width: 290px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-card);
  z-index: 100;
  padding: 20px;
  box-shadow: -8px 0 24px rgba(0,0,0,0.25);
  transition: right 0.25s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mobile-drawer.open { right: 0; }

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: none;
  grid-template-columns: repeat(5, 1fr);
  z-index: 80;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.mnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  gap: 2px;
}
.mnav-item.active, .mnav-item:hover { color: var(--brand-primary); }
.mnav-icon { font-size: 17px; line-height: 1; }

/* Footer */
.site-footer {
  background-color: var(--brand-dark);
  color: #e2e8f0;
  padding: 36px 0 24px;
  margin-top: 40px;
  border-top: 4px solid var(--brand-primary);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.footer-title { font-size: 14px; font-weight: 800; color: #fff; text-transform: uppercase; margin-bottom: 10px; }
.footer-text { font-size: 13px; color: #94a3b8; line-height: 1.6; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: #cbd5e1; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
}

/* =========================================================
   MOBILE-FIRST RESPONSIVE BREAKPOINTS (< 960px and < 680px)
   ========================================================= */
@media (max-width: 960px) {
  .hero-3col, .hero-bento, .hero-split-dark, .hero-trio, .content-grid, .footer-grid {
    grid-template-columns: 1fr !important;
  }
  body.layout-03 .content-grid > section,
  body.layout-06 .content-grid > section,
  body.layout-08 .content-grid > section { order: 1; }
  body.layout-03 .content-grid > aside,
  body.layout-06 .content-grid > aside,
  body.layout-08 .content-grid > aside { order: 2; }
  .special-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .topbar { display: none; } /* Clean mobile top - utilities moved to Mobile Drawer */
  .site-header { padding: 10px 0; position: sticky; top: 0; z-index: 70; box-shadow: var(--shadow-sm); }
  body.layout-01 .header-inner,
  body.layout-04 .header-inner,
  body.layout-08 .header-inner {
    flex-direction: row;
    text-align: left;
    padding: 0;
  }
  .brand-logo-svg { height: 38px; }
  .header-actions { display: none; }
  .mobile-triggers { display: flex; }
  .main-nav { position: static; }
  .nav-link { padding: 6px 11px; font-size: 12px; }
  .mobile-bottom-nav { display: grid; }
  .special-strip { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .strip-card { padding: 8px 10px; }
  .strip-val { font-size: 12px; }

  .hero-split-body { padding: 18px; }
  .hero-body { padding: 14px; }
  .hero-title { font-size: 18.5px; }
  .hero-excerpt { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-bento-right { grid-template-columns: 1fr; }

  /* Compact Native-App Style Mobile News Cards! */
  body.layout-02 .news-list.feed-grid,
  body.layout-05 .news-list.feed-grid,
  body.layout-07 .news-list.feed-grid,
  body.layout-10 .news-list.feed-grid {
    grid-template-columns: 1fr !important;
  }
  .news-card,
  body.layout-02 .news-list.feed-grid .news-card,
  body.layout-05 .news-list.feed-grid .news-card,
  body.layout-07 .news-list.feed-grid .news-card,
  body.layout-10 .news-list.feed-grid .news-card {
    grid-template-columns: 104px 1fr !important;
    gap: 12px;
    padding: 11px;
    align-items: center;
  }
  .news-thumb {
    width: 104px;
    height: 78px;
    aspect-ratio: auto;
    border-radius: 6px;
  }
  .news-title { font-size: 14.5px; line-height: 1.32; margin-bottom: 4px; }
  .news-excerpt { display: none; } /* Hide long excerpt on small mobile list to keep it super clean */
  .cat-badge { font-size: 9.5px; padding: 2px 6px; margin-bottom: 4px; }
  .meta-info { font-size: 11px; gap: 6px; }

  .article-box { padding: 16px; }
  .article-h1 { font-size: 21px; }
  .article-content { font-size: 15.5px; }
}
