:root {
  --primary: #0056b3;      /* blue */
  --primary-dark: #003b80;
  --accent: #ffc107;       /* yellow */
  --bg: #f4f7fb;
  --text: #111827;
  --muted: #6b7280;
  --card-bg: #ffffff;
  --border: rgba(148, 163, 184, 0.5);
  --radius-lg: 18px;
  --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.08);
}

/* DARK MODE */
body.dark {
  --bg: #020617;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --card-bg: #020617;
  --border: rgba(55, 65, 81, 0.9);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.9);
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

/* Top bar */
.top-bar {
  background: var(--primary);
  color: #fff;
  padding: 6px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.top-bar span strong {
  font-weight: 600;
}

.top-bar-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-outline-light {
  border-radius: 999px;
  padding: 4px 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
  background: transparent;
  color: white;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Nav */
.nav {
  padding: 10px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}
body.dark .nav {
  background: #020617;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid var(--border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}

.nav-title-main {
  font-weight: 700;
  font-size: 17px;
  color: var(--primary-dark);
}
body.dark .nav-title-main {
  color: #e5e7eb;
}

.nav-title-sub {
  font-size: 11px;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  flex-wrap: wrap;
}

.nav-links a {
  padding-bottom: 2px;
  position: relative;
  color: #374151;
}
body.dark .nav-links a {
  color: #e5e7eb;
}

.nav-links a.active {
  color: var(--primary-dark);
  font-weight: 600;
}
body.dark .nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost-small {
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  font-size: 11px;
  cursor: pointer;
  background: #ffffff;
}
body.dark .btn-ghost-small {
  background: #020617;
  color: #e5e7eb;
  border-color: var(--border);
}

/* Page */
.page {
  max-width: 1100px;
  margin: 16px auto 40px;
  padding: 0 6%;
}

.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--primary-dark);
}

/* Layout */
.layout {
  display: grid;
  /* Gap increse */
  grid-template-columns: minmax(0, 5fr) minmax(0, 2.1fr);
  gap: 20px;
}

/* Article */
.article-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 16px;
}

.article-tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e7f1ff;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
body.dark .article-tag {
  background: #082f49;
  color: #fbbf24;
}

.article-title {
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
body.dark .article-title {
  color: #e5e7eb;
}

.article-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}

.article-hero-img {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  max-height: 260px;
  background: #e5e7eb;
}

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

/* TOC */
.toc-box {
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #f9fafb;
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 14px;
}
body.dark .toc-box {
  background: #020617;
}

.toc-title {
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
body.dark .toc-title {
  color: #e5e7eb;
}

.toc-list {
  list-style: none;
  padding-left: 0;
}

.toc-list li {
  margin-bottom: 4px;
  cursor: pointer;
}

.toc-list a {
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 12px;
}
.toc-list a:hover {
  text-decoration: underline;
}

/* Article content */
.article-content h2 {
  font-size: 18px;
  margin-top: 16px;
  margin-bottom: 6px;
  color: var(--primary-dark);
}
body.dark .article-content h2 {
  color: #e5e7eb;
}

.article-content h3 {
  font-size: 15px;
  margin-top: 12px;
  margin-bottom: 4px;
  color: #1f2937;
}
body.dark .article-content h3 {
  color: #e5e7eb;
}

.article-content p {
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
}
body.dark .article-content p {
  color: #d1d5db;
}

.article-content ul {
  font-size: 13px;
  color: #374151;
  margin-left: 18px;
  margin-bottom: 8px;
}
body.dark .article-content ul {
  color: #d1d5db;
}

.highlight-box {
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e1;
  border: 1px solid rgba(234, 179, 8, 0.6);
  font-size: 12px;
  color: #7c5e03;
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}
.info-row span strong {
  color: var(--primary-dark);
}
body.dark .info-row span strong {
  color: #fbbf24;
}

/* Footer CTA */
.article-footer-cta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.btn-cta {
  border-radius: 999px;
  padding: 6px 12px;
  border: none;
  background: var(--accent);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #111827;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 88px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-card {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px 12px 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  font-size: 12px;
  color: #374151;
}
body.dark .ad-card {
  color: #d1d5db;
}

.ad-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.ad-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
body.dark .ad-title {
  color: #e5e7eb;
}

.ad-tagline {
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 8px;
}
body.dark .ad-tagline {
  color: #d1d5db;
}

.ad-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 8px;
}

.ad-badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e7f1ff;
  color: var(--primary-dark);
}
body.dark .ad-badge {
  background: #082f49;
  color: #fbbf24;
}

.ad-button {
  border-radius: 999px;
  padding: 6px 10px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ad-button-yellow {
  background: var(--accent);
  color: #111827;
}

.ad-footer {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.ad-highlight {
  margin-bottom: 6px;
  padding: 6px 8px;
  font-size: 11px;
  border-radius: 10px;
  background: #fff8e1;
  border: 1px solid rgba(234, 179, 8, 0.6);
  color: #7c5e03;
}

/* Mini footer */
.mini-footer {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-footer a {
  color: var(--primary-dark);
}
body.dark .mini-footer a {
  color: #93c5fd;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  background: #111827;
  color: #f9fafb;
  border: none;
  cursor: pointer;
  display: none;
}

.back-to-top.visible {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Hide google translate element */
#google_translate_element {
  position: fixed;
  bottom: -200px;
  right: 0;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .article-card {
    padding: 14px 12px;
  }
}
