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

/* Base styles */
:root {
  color-scheme: light dark;

  /* Light Mode Variables */
  --bg-primary-light: #ffffff;
  --bg-secondary-light: #f0f0f0;
  --bg-tertiary-light: #e9ecef;
  --text-primary-light: #24292f;
  --text-secondary-light: #0d1117;
  --text-tertiary-light: #3d444d;
  --link-color-light: #0078d3;
  --link-hover-color-light: #0056b3;
  --border-color-light: #e0e0e0;
  --code-bg-light: #f8f9fa;
  --blockquote-bg-light: #f6f8fa;
  --blockquote-border-light: #dfe2e5;
  --table-border-light: #dfe2e5;
  --table-header-bg-light: #f6f8fa;
  --table-alternate-bg-light: #f8f9fa;
  --search-dropdown-bg-light: #ffffff;
  --search-input-bg-light: #f6f8fa;
  --search-input-border-light: #dfe2e5;
  --search-result-hover-light: #f6f8fa;
  --category-label-bg-light: #f6f8fa;
  --category-label-color-light: #57606a;
  --footer-bg-light: #f6f8fa;
  --footer-text-light: #57606a;
  --footer-link-light: #0078d3;
  --footer-link-hover-light: #0056b3;
  --footer-border-light: #dfe2e5;
  --sidebar-bg-light: #ffffff;
  --sidebar-border-light: #dfe2e5;
  --sidebar-title-color-light: #24292f;
  --sidebar-text-light: #57606a;
  --accent-color-light: #0078d3;
  --accent-hover-light: #0056b3;

  /* Dark Mode Variables */
  --bg-primary-dark: #0d1117;
  --bg-secondary-dark: #1f242c;
  --bg-tertiary-dark: #212830;
  --text-primary-dark: #c9d1d9;
  --text-secondary-dark: #c9d1d9;
  --text-tertiary-dark: #c9d1d9;
  --link-color-dark: #58a6ff;
  --link-hover-color-dark: #1f6feb;
  --border-color-dark: #30363d;
  --code-bg-dark: #1e1e1e;
  --blockquote-bg-dark: #24292f;
  --blockquote-border-dark: #30363d;
  --table-border-dark: #30363d;
  --table-header-bg-dark: #24292f;
  --table-alternate-bg-dark: #1f242c;
  --search-dropdown-bg-dark: #1f242c;
  --search-input-bg-dark: #24292f;
  --search-input-border-dark: #30363d;
  --search-result-hover-dark: #24292f;
  --category-label-bg-dark: #24292f;
  --category-label-color-dark: #8b949e;
  --footer-bg-dark: #0d1117;
  --footer-text-dark: #8b949e;
  --footer-link-dark: #58a6ff;
  --footer-link-hover-dark: #1f6feb;
  --footer-border-dark: #30363d;
  --sidebar-bg-dark: #0d1117;
  --sidebar-border-dark: #30363d;
  --sidebar-title-color-dark: #c9d1d9;
  --sidebar-text-dark: #8b949e;
  --accent-color-dark: #58a6ff;
  --accent-hover-dark: #1f6feb;

  /* Header Variables (Always Dark) */
  --header-bg: #0d1117;
  --header-border: #30363d;
  --header-text-logo-color: #c9d1d9;
  --header-nav-link-color: #c9d1d9;
  --header-nav-link-hover-active-color: #58a6ff;
  --header-mobile-toggle-icon-color: #c9d1d9;
  --header-mobile-menu-bg: #161b22;
  --header-mobile-menu-link-color: #c9d1d9;
  --header-mobile-menu-border-color: #30363d;
  --header-mobile-menu-hover-bg: #1f242c;
  --header-mobile-menu-active-bg: #212830;
  --header-mobile-menu-active-text-color: #58a6ff;
  --header-mobile-menu-active-border-color: #58a6ff;
  --header-mobile-nav-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  --header-logo-light-display: none;
  --header-logo-dark-display: block;
  --header-height: 60px;

  /* Initial Default Values (Light Mode) */
  --bg-primary: var(--bg-primary-light);
  --bg-secondary: var(--bg-secondary-light);
  --bg-tertiary: var(--bg-tertiary-light);
  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --text-tertiary: var(--text-tertiary-light);
  --link-color: var(--link-color-light);
  --link-hover-color: var(--link-hover-color-light);
  --border-color: var(--border-color-light);
  --code-bg: var(--code-bg-light);
  --blockquote-bg: var(--blockquote-bg-light);
  --blockquote-border: var(--blockquote-border-light);
  --table-border: var(--table-border-light);
  --table-header-bg: var(--table-header-bg-light);
  --table-alternate-bg: var(--table-alternate-bg-light);
  --search-dropdown-bg: var(--search-dropdown-bg-light);
  --search-input-bg: var(--search-input-bg-light);
  --search-input-border: var(--search-input-border-light);
  --search-result-hover: var(--search-result-hover-light);
  --category-label-bg: var(--category-label-bg-light);
  --category-label-color: var(--category-label-color-light);
  --footer-bg: var(--footer-bg-light);
  --footer-text: var(--footer-text-light);
  --footer-link: var(--footer-link-light);
  --footer-link-hover: var(--footer-link-hover-light);
  --footer-border: var(--footer-border-light);
  --sidebar-bg: var(--sidebar-bg-light);
  --sidebar-border: var(--sidebar-border-light);
  --sidebar-title-color: var(--sidebar-title-color-light);
  --sidebar-text: var(--sidebar-text-light);
  --accent-color: var(--accent-color-light);
  --accent-hover: var(--accent-hover-light);

  /* Light mode code colors */
  --code-bg-light: #f8f9fa;
  --code-border-light: #e9ecef;
  --code-header-bg-light: #f1f3f5;
  --code-text-light: #24292e;
  --code-comment-light: #6a737d;
  --code-keyword-light: #d73a49;
  --code-string-light: #032f62;
  --code-number-light: #005cc5;
  --code-function-light: #6f42c1;
  --code-operator-light: #d73a49;

  /* Dark mode code colors */
  --code-bg-dark: #1e1e1e;
  --code-border-dark: #2d2d2d;
  --code-header-bg-dark: #252526;
  --code-text-dark: #e6edf3;
  --code-comment-dark: #6a9955;
  --code-keyword-dark: #569cd6;
  --code-string-dark: #ce9178;
  --code-number-dark: #b5cea8;
  --code-function-dark: #dcdcaa;
  --code-operator-dark: #d4d4d4;
}

body {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 2;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--text-primary);
}

h1 {
  font-size: 27px;
}
h2 {
  font-size: 21px;
  margin-top: 32px;
}
h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 24px;
}

p {
  margin-bottom: 16px;
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

/* Layout */
.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

p,
li,
td,
.article-subtitle,
.sidebar-item-meta {
  line-height: 1.6;
}

pre,
code {
  line-height: 1.5;
}

/* Header */
.top-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  justify-content: center;
  padding: 0;
  z-index: 1000;
}

.header-content-container {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.logo {
  height: 32px;
  flex-shrink: 0;
}

.logo-light {
  display: var(--header-logo-light-display);
}

.logo-dark {
  display: var(--header-logo-dark-display);
}

.text-logo {
  font-size: 20px;
  font-weight: 600;
  color: var(--header-text-logo-color);
  margin-left: 10px;
}

/* Navigation */
.nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.main-nav {
  display: flex;
  gap: 20px;
}

.main-nav a {
  text-decoration: none;
  color: var(--header-nav-link-color);
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.main-nav a:hover {
  text-decoration: none;
  border-bottom: 2px solid #333;
  color: var(--header-nav-link-hover-active-color);
}

.main-nav a.active {
  border-bottom: 2px solid var(--header-nav-link-hover-active-color);
  color: var(--header-nav-link-hover-active-color);
}

/* Search Button */
.search-button {
  display: flex;
  background: transparent;
  border: none;
  color: var(--header-text-logo-color);
  font-size: 24px;
  cursor: pointer;
  padding: 0 15px;
  margin-left: 10px;
  align-items: center;
  transition: color 0.3s ease;
}

.search-button:hover {
  color: var(--header-nav-link-hover-active-color);
}

.search-button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Mobile Navigation */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}

.mobile-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--header-mobile-toggle-icon-color);
  margin: 4px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-nav-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background-color: var(--header-mobile-menu-bg);
  z-index: 1010;
  border-top: 1px solid var(--header-mobile-menu-border-color);
  box-shadow: var(--header-mobile-nav-shadow);
}

.mobile-nav-menu.active {
  display: block;
}

.mobile-nav-menu a {
  display: block;
  color: var(--header-mobile-menu-link-color);
  text-decoration: none;
  padding: 12px 20px;
  font-weight: 500;
  text-align: left;
  border-bottom: 1px solid var(--header-mobile-menu-border-color);
}

.mobile-nav-menu a:last-child {
  border-bottom: none;
}

.mobile-nav-menu a:hover {
  background-color: var(--header-mobile-menu-hover-bg);
  color: var(--header-nav-link-hover-active-color);
}

.mobile-nav-menu a.active {
  background-color: var(--header-mobile-menu-active-bg);
  border-left: 4px solid var(--header-mobile-menu-active-border-color);
  color: var(--header-mobile-menu-active-text-color);
  padding-left: 16px;
}

/* Media Queries */
@media (max-width: 992px) {
  .header-content-container .nav {
    display: none;
  }

  .mobile-nav-toggle {
    display: block;
    margin-left: auto;
  }

  .header-content-container {
    padding: 0 16px;
    display: flex;
    align-items: center;
  }

  .text-logo {
    display: none;
  }

  .search-button {
    margin-left: 10px;
    padding: 0 10px;
  }
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.content-wrapper {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
  padding-bottom: 100px;
}

.article-container {
  flex: 1;
  max-width: 1280px;
}

/* Article elements */
.category-label {
  display: inline-block;
  padding: 4px 8px;
  background-color: var(--category-label-bg);
  color: var(--category-label-color);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.article-title {
  margin-bottom: 16px;
}

.article-subtitle {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #404040;
  margin-bottom: 24px;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: #404040;
}

.author-name {
  font-weight: 600;
}
.article-timestamp {
  margin-left: 8px;
}

.publish-date {
  font-size: 0.85em;
  color: #6c757d;
  display: block;
  margin-top: -5px;
  margin-bottom: 10px;
}

.latest-posts-heading {
  font-size: 22px;
  font-weight: 700;
  margin-top: 80px;
  color: #cc0000;
}

.section-divider {
  border: none;
  border-top: 2px solid #e0e0e0;
  margin: 16px 0 32px;
  width: 100%;
}

/* Featured image */
.featured-image {
  width: 100%;
  height: 400px;
  background-color: #f0f0f0;
  margin-bottom: 16px;
  position: relative;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-caption {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: #404040;
  margin-top: 8px;
  margin-bottom: 32px;
}

/* Responsive inline images for post content */
.post-image img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  display: block;
  margin: 16px auto;
}

.post-image p {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-top: 4px;
}

/* Pull quotes */
blockquote {
  border-left: 4px solid #58a6ff;
  padding: 16px 24px;
  margin: 40px 0;
  background-color: #f2f2f2;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

blockquote cite {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 300;
  font-style: normal;
}

/* Info boxes */
.info-box {
  background-color: #f2f2f2;
  border: 1px solid #cccccc;
  padding: 20px;
  margin: 32px 0;
}

.info-box-title {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 16px;
}

/* Standardized Callout System */
.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.6;
}

.callout-title {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  opacity: 0.8;
}

.callout-content {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* Callout Type Colors - Light Mode */
.callout.type-tip {
  background-color: #e8f4fd;
  color: #1e3a8a;
}

.callout.type-tip .callout-title {
  color: #1e3a8a;
}

.callout.type-note {
  background-color: #fef3c7;
  color: #92400e;
}

.callout.type-note .callout-title {
  color: #92400e;
}

.callout.type-scenario {
  background-color: #f0f9ff;
  color: #075985;
}

.callout.type-scenario .callout-title {
  color: #075985;
}

.callout.type-your-turn {
  background-color: #ecfdf5;
  color: #065f46;
}

.callout.type-your-turn .callout-title {
  color: #065f46;
}

.callout.type-pro-tip {
  background-color: #fdf4ff;
  color: #7c2d12;
}

.callout.type-pro-tip .callout-title {
  color: #7c2d12;
}

.callout.type-remember {
  background-color: #fef2f2;
  color: #991b1b;
}

.callout.type-remember .callout-title {
  color: #991b1b;
}

.callout.type-challenge {
  background-color: #f1f5f9;
  color: #334155;
}

.callout.type-challenge .callout-title {
  color: #334155;
}

.callout.type-info {
  background-color: #f0f9ff;
  color: #0c4a6e;
}

.callout.type-info .callout-title {
  color: #0c4a6e;
}

/* Dark Mode Callout Colors */
@media (prefers-color-scheme: dark) {
  .callout.type-tip {
    background-color: #1e3a8a;
    color: #dbeafe;
  }

  .callout.type-tip .callout-title {
    color: #dbeafe;
  }

  .callout.type-note {
    background-color: #92400e;
    color: #fef3c7;
  }

  .callout.type-note .callout-title {
    color: #fef3c7;
  }

  .callout.type-scenario {
    background-color: #075985;
    color: #e0f2fe;
  }

  .callout.type-scenario .callout-title {
    color: #e0f2fe;
  }

  .callout.type-your-turn {
    background-color: #065f46;
    color: #dcfce7;
  }

  .callout.type-your-turn .callout-title {
    color: #dcfce7;
  }

  .callout.type-pro-tip {
    background-color: #7c2d12;
    color: #fdf4ff;
  }

  .callout.type-pro-tip .callout-title {
    color: #fdf4ff;
  }

  .callout.type-remember {
    background-color: #991b1b;
    color: #fee2e2;
  }

  .callout.type-remember .callout-title {
    color: #fee2e2;
  }

  .callout.type-challenge {
    background-color: #334155;
    color: #f1f5f9;
  }

  .callout.type-challenge .callout-title {
    color: #f1f5f9;
  }

  .callout.type-info {
    background-color: #0c4a6e;
    color: #e0f2fe;
  }

  .callout.type-info .callout-title {
    color: #e0f2fe;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .callout {
    margin: 20px 0;
    padding: 16px 18px;
    font-size: 14px;
  }

  .callout-title {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .callout-content {
    font-size: 14px;
  }
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 100px;
  margin-left: 10px;
  flex: 0 0 300px;
  padding-left: 20px;
  padding-top: 40px;
  width: 300px;
}

.sidebar-section {
  background-color: #f2f2f2;
  margin-bottom: 24px;
  padding: 16px;
}

.sidebar-title {
  font-family: "Inter", sans-serif;
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #cccccc;
}

.sidebar-item {
  margin-bottom: 16px;
}

.sidebar-item-title {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.sidebar-item-meta {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: #404040;
}

.no-sidebar {
  display: none;
}

/* Footer */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 1.2rem 0;
  margin-top: 3rem;
  text-align: center;
  border-top: 1px solid var(--footer-border);
  bottom: 0;
  width: 100%;
  position: fixed;
  z-index: 1000;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-container .copyright p {
  margin: 0;
  font-size: 0.6rem;
  color: var(--footer-text);
}

.footer-container .copyright a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-container .copyright a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
  footer {
    background-color: var(--footer-bg);
    border-color: var(--footer-border);
  }

  .footer-container .copyright p {
    color: var(--footer-text);
  }

  .footer-container .copyright a {
    color: var(--link-color);
  }

  .footer-container .copyright a:hover {
    color: var(--link-hover-color);
  }
}

.table-container {
  overflow-x: auto;
  margin: 32px 0;
}

/* Code block styles */
.code-block-container {
  position: relative;
  margin: 1.5em 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--code-bg-light);
  border: 1px solid var(--code-border-light);
}

.code-block-container pre {
  margin: 0;
  padding: 16px 16px 16px 24px;
  background: none !important;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, Monaco, "Andale Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #24292e;
  tab-size: 2;
  white-space: pre;
  word-wrap: normal;
  max-width: 100%;
}

/* Add specific handling for JSON code blocks */
pre code.language-json {
  white-space: pre-wrap;
  word-break: break-word;
}

pre code.language-json .token.punctuation,
pre code.language-json .token.property {
  word-break: keep-all;
}

.article-container pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  word-wrap: normal;
}

.article-container pre code {
  display: inline-block;
  min-width: 100%;
}

/* Ensure code blocks don't overflow on desktop */
@media (min-width: 768px) {
  .article-container {
    max-width: 100%;
    overflow-x: hidden;
  }

  .article-container pre {
    max-width: 100%;
    overflow-x: auto;
  }
}

/* Header */
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background-color: var(--code-header-bg-light);
  border-bottom: 1px solid var(--code-border-light);
  height: 36px;
}

.code-block-header .language-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-block-header .copy-button {
  background: none;
  border: none;
  color: var(--code-text-light);
  opacity: 0.6;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.code-block-header .copy-button:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.05);
}

/* Token colors - Light mode */
.token.comment {
  color: #6a737d;
}
.token.keyword {
  color: #d73a49;
}
.token.string {
  color: #032f62;
}
.token.number {
  color: #005cc5;
}
.token.function {
  color: #6f42c1;
}
.token.operator,
.token.builtin,
.token.variable,
.token.constant,
.token.punctuation {
  color: #24292e;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  .code-block-container {
    background-color: #1e1e1e;
    border: 1px solid #2d2d2d;
  }

  .code-block-container pre {
    background-color: #1e1e1e !important;
    color: #e6edf3;
  }

  .code-block-header {
    background-color: #252526;
    border-bottom: 1px solid #2d2d2d;
  }

  pre[class*="language-"] {
    background-color: #1e1e1e !important;
    color: #e6edf3;
    text-shadow: none !important;
  }

  code[class*="language-"] {
    background-color: #1e1e1e !important;
    color: #e6edf3;
    text-shadow: none !important;
  }

  /* Token colors - Dark mode */
  .token.comment {
    color: #8b949e;
  }
  .token.keyword {
    color: #ff7b72;
  }
  .token.string {
    color: #a5d6ff;
  }
  .token.number {
    color: #79c0ff;
  }
  .token.function {
    color: #d2a8ff;
  }
  .token.operator,
  .token.builtin,
  .token.variable,
  .token.constant,
  .token.punctuation {
    color: #e6edf3;
  }

  .token {
    background: transparent !important;
  }

  .code-block-header .language-label {
    color: var(--text-primary-dark);
    opacity: 0.8;
  }
}

/* Scrollbars */
.code-block-container pre::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.code-block-container pre::-webkit-scrollbar-track {
  background: transparent;
}

.code-block-container pre::-webkit-scrollbar-thumb {
  background: var(--code-border-light);
  border: 3px solid var(--code-bg-light);
  border-radius: 6px;
}

@media (prefers-color-scheme: dark) {
  .code-block-container pre::-webkit-scrollbar-thumb {
    background: var(--code-border-dark);
    border-color: var(--code-bg-dark);
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  margin-bottom: 2rem;
  font-family: "Inter", sans-serif;
  font-size: 14px;
}

thead {
  background-color: #f2f2f2;
}

th {
  font-weight: 700;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid #cccccc;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #cccccc;
}

tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

td.numeric {
  text-align: right;
  font-family: "Inter", sans-serif;
}

td.positive {
  color: #007236;
  font-weight: 600;
}

td.negative {
  color: #cc0000;
  font-weight: 600;
}

.table-footnote {
  font-size: 12px;
  font-style: italic;
  color: #404040;
  margin-top: 8px;
}

/* Add space between table and following paragraph */
table + p {
  margin-top: 2rem;
}

/* Apple-style Dropdown Search */
.search-container {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
}

.search-button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.search-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.search-button svg {
  width: 16px;
  height: 16px;
  fill: #333333;
}

/* Search dropdown and overlay */
.search-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.search-overlay.active {
  display: block;
}

.search-dropdown {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--search-dropdown-bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 999;
  display: none;
  overflow-y: hidden;
}

.search-dropdown.active {
  display: block;
}

.search-dropdown-inner {
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.search-form {
  flex-shrink: 0;
  position: relative;
  margin-bottom: 1rem;
}

.search-form input {
  width: 100%;
  padding: 12px;
  padding-left: 36px;
  border: 1px solid var(--search-input-border);
  border-radius: 6px;
  background-color: var(--search-input-bg);
  color: var(--text-primary);
}

.search-form input:focus {
  outline: none;
  border-color: var(--header-nav-link-hover-active-color);
}

.search-form svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: #666;
}

.search-form .clear-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  width: 18px;
  height: 18px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-form .clear-button.active {
  opacity: 1;
}

.search-form .clear-button svg {
  position: static;
  transform: none;
  width: 12px;
  height: 12px;
  fill: #666;
}

.quick-links-wrapper {
  flex-grow: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2rem;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .search-dropdown-inner {
    padding: 1rem;
  }

  .quick-links {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Quick Links Section */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-bottom: 0.5rem;
}

.quick-link-category {
  margin-bottom: 0.5rem;
}

.quick-link-category-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.quick-link-item {
  display: block;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 0.1rem 0;
  font-size: 0.7rem;
  transition: color 0.2s ease;
}

.quick-link-item:hover {
  color: var(--link-color);
}

.quick-link-subcategory {
  margin-left: 1rem;
  margin-top: 0.5rem;
}

.quick-link-subcategory-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

/* Live Search Results */
.live-search-results {
  margin-top: 30px;
  display: none;
}

.live-search-results.active {
  display: block;
}

.result-category {
  margin-bottom: 24px;
}

.result-category-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #666;
}

.result-item {
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-bottom: 5px;
}

.result-item:hover {
  background-color: var(--search-result-hover);
}

.result-item-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
}

.result-item-excerpt {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.result-item-path {
  font-size: 12px;
  color: #666;
}

/* List Styling */
ul,
ol {
  margin-top: 0;
  margin-bottom: 24px;
  padding-left: 20px;
  line-height: 1.8;
}

ul li,
ol li {
  margin-bottom: 8px;
}

/* Remove list indentation for post images */
ul .post-image,
ol .post-image {
  margin-left: -2rem;
  text-align: center;
  /* Optional: Adjust width if container constrains it */
  /* width: calc(100% + 2rem); */
  /* max-width: none; /* Override any max-width constraints if needed */
}

ul strong,
ol strong {
  display: inline;
  margin: 0;
  padding: 0;
  font-weight: 700;
}

.info-box ul,
.info-box ol {
  margin: 0.75rem 0;
}

.subscribe-prompt {
  text-align: center;
  margin-top: 20px;
  font-family: "Inter", sans-serif;
}

.subscribe-button {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  background-color: #9a9a9a;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.subscribe-button:hover {
  background-color: #4a4a4a;
  transform: translateY(-1px);
}

.hidden {
  display: none;
}

.subscribe-form {
  margin-top: 16px;
  text-align: center;
}

.subscribe-form input[type="email"] {
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  border: none;
  border-bottom: 1px solid #cccccc;
  outline: none;
  width: 80%;
  max-width: 280px;
  background-color: transparent;
  transition: border-color 0.2s ease;
}

.subscribe-form input[type="email"]:focus {
  border-color: #9a9a9a;
}

.subscribe-form button[type="submit"] {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  background-color: #9a9a9a;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.subscribe-form button[type="submit"]:hover {
  background-color: #4a4a4a;
  transform: translateY(-1px);
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  font-size: 14px;
}

.post-navigation a {
  color: #007aff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-navigation a:hover {
  color: #0056b3;
}

.prev-post {
  max-width: 45%;
  text-align: left;
}

.next-post {
  max-width: 45%;
  text-align: right;
}

/* Responsive styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .content-wrapper {
    flex-direction: column;
  }
  .sidebar {
    display: none;
    position: fixed;
    top: 80px; /* below your sticky header */
    right: 0;
    width: 250px;
    background-color: #f2f2f2;
    z-index: 999;
    padding: 20px;
  }

  .sidebar.active {
    display: block;
    width: 100%;
    height: 100%;
    top: 120px;
  }

  .floating-nav-toggle {
    position: fixed;
    top: 0;
    left: 225px;
    font-size: 1.5rem;
    background-color: rgba(255, 255, 255, 0);
    color: #333333;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    z-index: 1000;
  }

  .header-inner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 12px 16px;
  }

  .header-actions {
    /* Search button stays right */
    margin-left: auto;
  }

  .mobile-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
  }

  .mobile-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 6px 12px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
  }

  .mobile-nav a:hover,
  .mobile-nav a.active {
    border-bottom: 2px solid #cc0000;
  }

  /* Hide desktop nav on mobile (already in your code) */
  .main-nav {
    display: none;
  }
}

/* Responsive fallback */
@media (min-width: 1025px) {
  .floating-nav-toggle {
    display: none;
  }

  .mobile-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  h1,
  h2,
  h3 {
    line-height: 1.4;
  }
  h1 {
    font-size: 24px;
  }
  h2 {
    font-size: 20px;
  }
  h3 {
    font-size: 16px;
  }
  body {
    font-size: 14px;
  }
  .article-subtitle {
    font-size: 14px;
  }

  blockquote {
    font-size: 14px;
    padding: 12px;
  }
  .featured-image {
    height: 250px;
  }
  .footer-inner {
    flex-direction: column;
    padding: 16px;
  }
  .footer-section {
    margin-right: 0;
    margin-bottom: 24px;
  }

  pre,
  code {
    font-size: 10px; /* or go down to 11px if you want */
  }

  th,
  td {
    padding: 8px 8px;
    font-size: 10px;
  }

  tr {
    border-bottom: 1px solid #ddd;
  }
  .cxhacks-logo {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .blog-logo {
    width: 32px;
    height: 32px;
    margin-right: 0;
  }

  .search-container {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
  }

  .search-button {
    padding: 10px;
  }

  .search-dropdown,
  .search-form,
  .search-results {
    width: 100%;
  }

  .content-wrapper {
    flex-direction: column;
  }
  .sidebar {
    display: none;
    position: fixed;
    top: 80px; /* below your sticky header */
    right: 0;
    width: 250px;
    background-color: #f2f2f2;
    z-index: 999;
    padding: 20px;
  }

  .floating-nav-toggle {
    position: fixed;
    top: 0;
    left: 225px;
    font-size: 1.5rem;
    background-color: rgba(255, 255, 255, 0);
    color: #333333;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    z-index: 1000;
  }

  .header-inner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 12px 16px;
  }

  .header-actions {
    /* Search button stays right */
    margin-left: auto;
  }

  .mobile-nav {
    display: block;
    padding: 5px 5px 5px 5px;
    font-size: 14px;
    margin-left: -5%;
    width: 110%;
  }

  /* Hide desktop nav on mobile (already in your code) */
  .main-nav {
    display: none;
  }

  /* Responsive inline images for post content */
  .post-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: block;
    margin: 16px auto;
  }

  .post-image p {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 4px;
  }

  .search-dropdown.active {
    height: calc(100vh - var(--header-height));
  }

  .search-dropdown-inner {
    padding: 1rem;
  }

  .quick-links {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
    max-height: calc(100vh - var(--header-height) - 100px);
  }

  .quick-link-category {
    margin-bottom: 1rem;
  }

  .quick-link-category-title {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
  }

  .quick-link-item {
    padding: 0.4rem 0;
    font-size: 0.85rem;
  }

  .quick-link-subcategory {
    margin-left: 0.75rem;
  }

  .quick-link-subcategory-title {
    font-size: 0.85rem;
  }
}

/* Ensure strong and em remain inline properly */
strong,
em,
b {
  display: inline;
  font-weight: 700; /* or bold */
  margin: 0; /* remove any unwanted spacing */
  padding: 0;
}

ol li .post-image,
ul li .post-image,
ol li blockquote,
ul li blockquote {
  margin-left: -2rem; /* Adjust based on your list indent size */
}

/* === Pagination Controls === */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  padding-bottom: 6rem; /* Add more padding to push it above footer */
}

.pagination-button {
  background-color: var(--accent-color);
  color: var(--bg-primary);
  border: 1px solid var(--accent-color);
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.pagination-button:disabled {
  background-color: var(--bg-secondary);
  color: var(--text-tertiary);
  border-color: var(--border-color);
  cursor: not-allowed;
}

.page-indicator {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 1rem;
}

/* Dark Mode Pagination */
@media (prefers-color-scheme: dark) {
  .pagination-button {
    background-color: var(--accent-color-dark);
    color: var(--bg-primary-dark);
    border-color: var(--accent-color-dark);
  }

  .pagination-button:hover:not(:disabled) {
    background-color: var(--accent-hover-dark);
    border-color: var(--accent-hover-dark);
  }

  .pagination-button:disabled {
    background-color: var(--bg-secondary-dark);
    color: var(--text-tertiary-dark);
    border-color: var(--border-color-dark);
  }

  .page-indicator {
    color: var(--text-secondary-dark);
  }
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: var(--bg-primary-dark);
    --bg-secondary: var(--bg-secondary-dark);
    --bg-tertiary: var(--bg-tertiary-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --text-tertiary: var(--text-tertiary-dark);
    --link-color: var(--link-color-dark);
    --link-hover-color: var(--link-hover-color-dark);
    --border-color: var(--border-color-dark);
    --code-bg: var(--code-bg-dark);
    --blockquote-bg: var(--blockquote-bg-dark);
    --blockquote-border: var(--blockquote-border-dark);
    --table-border: var(--table-border-dark);
    --table-header-bg: var(--table-header-bg-dark);
    --table-alternate-bg: var(--table-alternate-bg-dark);
    --search-dropdown-bg: var(--search-dropdown-bg-dark);
    --search-input-bg: var(--search-input-bg-dark);
    --search-input-border: var(--search-input-border-dark);
    --search-result-hover: var(--search-result-hover-dark);
    --category-label-bg: var(--category-label-bg-dark);
    --category-label-color: var(--category-label-color-dark);
    --footer-bg: var(--footer-bg-dark);
    --footer-text: var(--footer-text-dark);
    --footer-link: var(--footer-link-dark);
    --footer-link-hover: var(--footer-link-hover-dark);
    --footer-border: var(--footer-border-dark);
    --sidebar-bg: var(--sidebar-bg-dark);
    --sidebar-border: var(--sidebar-border-dark);
    --sidebar-title-color: var(--sidebar-title-color-dark);
    --sidebar-text: var(--sidebar-text-dark);
    --accent-color: var(--accent-color-dark);
    --accent-hover: var(--accent-hover-dark);
  }

  .article-subtitle {
    color: var(--text-primary);
  }

  .article-meta,
  .article-timestamp,
  .publish-date {
    color: var(--footer-text);
  }

  blockquote {
    background-color: var(--blockquote-bg);
    border-left-color: var(--blockquote-border);
  }

  pre,
  code {
    background-color: var(--code-bg);
    color: var(--text-primary);
  }

  table {
    border-color: var(--table-border);
  }

  th {
    background-color: var(--table-header-bg);
    border-color: var(--table-border);
  }

  td {
    border-color: var(--table-border);
  }

  tbody tr:nth-child(even) {
    background-color: var(--table-alternate-bg);
  }

  .search-form input::placeholder {
    color: var(--text-primary);
  }

  .result-item-path {
    color: var(--text-primary);
  }

  .sidebar {
    background-color: var(--sidebar-bg);
    border-color: var(--sidebar-border);
  }

  .sidebar-title {
    color: var(--sidebar-title-color);
  }

  .sidebar-item-title {
    color: var(--link-color);
  }

  .sidebar-item-title:hover {
    color: var(--link-hover-color);
  }

  .sidebar-item-meta {
    color: var(--sidebar-text);
  }

  footer {
    background-color: var(--footer-bg);
    border-color: var(--footer-border);
  }

  .footer-title {
    color: var(--text-primary);
  }

  .footer-links a {
    color: var(--footer-link);
  }

  .footer-links a:hover {
    color: var(--footer-link-hover);
  }

  .copyright {
    color: var(--footer-text);
    border-color: var(--footer-border);
  }

  /* Ensure all text uses the correct color variable */
  p,
  li,
  td,
  th {
    color: var(--text-primary);
  }

  /* Fix any remaining red colors */
  .category-label {
    color: var(--category-label-color);
  }

  .main-nav a.active {
    color: var(--header-nav-link-hover-active-color);
    border-color: var(--header-nav-link-hover-active-color);
  }
}

/* Light Mode Inline Code Styling */
code:not(pre code) {
  background-color: #f6f8fa;
  color: #d73a49;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  font-weight: 500;
  border: 1px solid #e1e4e8;
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #0d1117;
    color: #e0e0e0;
  }

  /* Typography */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: #f5f5f5;
  }

  p {
    color: #cccccc;
  }

  a {
    color: #f48fb1;
  }

  a:hover {
    color: #409eff;
  }

  .article-subtitle {
    color: #b0b0b0;
  }

  .article-meta,
  .sidebar-item-meta,
  .publish-date {
    color: #a0a0a0;
  }

  .category-label {
    color: #f48fb1;
  }

  .latest-posts-heading {
    color: #f48fb1;
  }

  .section-divider {
    border-top-color: #333333;
  }

  /* Images and Captions */
  .featured-image {
    background-color: #272727;
  }

  .image-caption,
  .post-image p {
    color: #a0a0a0;
  }

  .post-image img {
    border-color: #444444;
  }

  /* Blockquotes and Info Boxes */
  blockquote {
    background-color: #1e1e1e;
    border-left-color: #58a6ff;
    color: #cccccc;
  }

  blockquote cite {
    color: #b0b0b0;
  }

  .info-box {
    background-color: #1e1e1e;
    border-color: #333333;
  }

  .info-box-title {
    color: #f5f5f5;
  }

  /* Sidebar */
  .sidebar-section {
    background-color: #1e1e1e;
  }

  .sidebar-title {
    color: #f5f5f5;
    border-bottom-color: #333333;
  }

  .sidebar-item-title {
    color: #e0e0e0;
  }

  /* Code Blocks */
  pre,
  pre:not([class*="language-"]) {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-color: #333333;
  }

  pre[class*="language-"] code {
    color: inherit;
    background-color: transparent;
  }

  code:not(pre code) {
    background-color: rgba(110, 118, 129, 0.1);
    color: #79c0ff;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid rgba(110, 118, 129, 0.2);
  }

  /* Language indicators on code blocks */
  pre.language-http::before,
  pre.language-json::before,
  pre.language-javascript::before,
  pre.language-python::before {
    background-color: #333333;
    color: #f0f0f0;
  }

  /* HTTP request specific */
  .http-request {
    background-color: #222222;
  }

  .param-name {
    color: #80cbc4;
  }

  .param-value {
    color: #d4d4d4;
  }

  /* Code block header for copy button */
  .code-block-header {
    background-color: #333333;
    border-color: #333333;
  }

  .copy-button {
    color: #b0b0b0;
  }

  .copy-button:hover {
    color: #58a6ff;
  }

  /* Tables */
  thead {
    background-color: #2a2a2a;
  }

  th {
    border-bottom-color: #444444;
    color: #f5f5f5;
  }

  td {
    border-bottom-color: #333333;
    color: #cccccc;
  }

  tbody tr:nth-child(even) {
    background-color: #1a1a1a;
  }

  td.positive {
    color: #a5d6a7;
  }

  td.negative {
    color: #ef9a9a;
  }

  .table-footnote {
    color: #a0a0a0;
  }

  /* Search UI */
  .search-button svg {
    fill: #cccccc;
  }

  .search-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }

  .search-dropdown {
    background-color: rgba(20, 20, 20, 0.97);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
  }

  .search-form input {
    background-color: rgba(50, 50, 50, 0.8);
    color: #e0e0e0;
  }

  .search-form input:focus {
    background-color: rgba(60, 60, 60, 1);
  }

  .search-form svg {
    fill: #a0a0a0;
  }

  .search-form .clear-button svg {
    fill: #a0a0a0;
  }

  .quick-link-category-title {
    color: #a0a0a0;
    border-bottom-color: #333333;
  }

  .quick-link-item {
    color: #cccccc;
  }

  .quick-link-item:hover {
    color: #58a6ff;
  }

  .quick-link-subcategory {
    border-left-color: #333333;
  }

  .quick-link-subcategory-title {
    color: #d0d0d0;
  }

  .result-category-title {
    color: #a0a0a0;
  }

  .result-item:hover {
    background-color: rgba(50, 50, 50, 0.7);
  }

  .result-item-title {
    color: #e0e0e0;
  }

  .result-item-path {
    color: #a0a0a0;
  }

  /* Subscribe Form */
  .subscribe-button {
    background-color: #4a4a4a;
    color: #f5f5f5;
  }

  .subscribe-button:hover {
    background-color: #616161;
  }

  .subscribe-form input[type="email"] {
    border-bottom-color: #555555;
    color: #e0e0e0;
  }

  .subscribe-form input[type="email"]:focus {
    border-color: #58a6ff;
  }

  .subscribe-form button[type="submit"] {
    background-color: #4a4a4a;
    color: #f5f5f5;
  }

  .subscribe-form button[type="submit"]:hover {
    background-color: #616161;
  }

  /* Post Navigation */
  .post-navigation {
    border-top-color: #333333;
  }

  .post-navigation a {
    color: #58a6ff;
  }

  .post-navigation a:hover {
    color: #409eff;
  }

  /* Footer */
  footer {
    background-color: #0d1117;
    color: #c9d1d9;
    border-top-color: #30363d;
  }

  .footer-container .copyright a {
    color: #58a6ff;
  }
}

@media (prefers-color-scheme: dark) {
  pre[class*="language-"]::before {
    color: var(--text-tertiary-dark);
  }

  .code-block-container {
    background-color: var(--code-bg-dark);
    border-color: var(--border-color-dark);
  }

  .code-block-container pre {
    color: #e6edf3;
  }

  .code-block-header {
    background-color: var(--bg-tertiary-dark);
    border-color: var(--border-color-dark);
  }

  .code-block-header .copy-button {
    color: var(--text-tertiary-dark);
  }

  .code-block-header .copy-button:hover {
    background-color: var(--bg-secondary-dark);
  }

  pre[class*="language-"] {
    background-color: var(--code-bg-dark);
  }

  code[class*="language-"],
  pre[class*="language-"] {
    color: var(--text-primary-dark);
  }
}

/* Prevent body scroll when dropdown is active */
body.search-active {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

#quiz {
  background-color: #f9f9ff;
  color: #1a1a1a;
  padding: 1.5rem;
  margin-top: 2rem;
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s ease, color 0.3s ease;
}

#quiz h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.quiz-question {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f4f4f4;
  border-left: 5px solid #888;
  border-radius: 0.5rem;
}

.quiz-question p {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.quiz-question label {
  display: block;
  margin-bottom: 0.4rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.4;
}

.quiz-question input[type="radio"] {
  margin-right: 0.5rem;
  accent-color: #6c63ff;
}

button[type="button"] {
  background-color: #3b3b3b;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 0.4rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
  max-width: 220px;
}

button[type="button"]:hover {
  background-color: #4e4e4e;
}

#quizResult {
  margin-top: 1rem;
  font-weight: bold;
  font-size: 1.1rem;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  #quiz {
    padding: 1rem;
  }

  button[type="button"] {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
  }

  .quiz-question {
    padding: 0.75rem;
  }

  .quiz-question label {
    font-size: 0.95rem;
  }
}

/* Dark mode (auto based on system) */
@media (prefers-color-scheme: dark) {
  #quiz {
    background-color: #1c1c28;
    color: #f0f0f0;
  }

  .quiz-question {
    background-color: #2d2d2d;
  }

  button[type="button"] {
    background-color: #4e4e4e;
  }

  button[type="button"]:hover {
    background-color: #3b3b3b;
  }
}

/* Optional: Manual dark mode (body.dark class) */
body.dark #quiz {
  background-color: #1c1c28;
  color: #f0f0f0;
}

body.dark .quiz-question {
  background-color: #2a2a3b;
}

body.dark button[type="button"] {
  background-color: #4e4e4e;
}

body.dark button[type="button"]:hover {
  background-color: #3b3b3b;
}
.mcq-form {
  margin-top: 1rem;
}

.mcq-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mcq-option input[type="radio"] {
  margin-top: 0.4rem;
}

.mcq-option label {
  font-family: monospace;
  background-color: var(--code-bg, #2d2d2d);
  color: var(--code-text, #f8f8f2);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: inline-block;
}

@media (prefers-color-scheme: light) {
  .mcq-option label {
    background-color: #f4f4f4;
    color: #333;
  }
}

.quiz-name-input {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.quiz-name-input label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.quiz-name-input input[type="text"] {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  max-width: 300px;
}

.quiz-name-input input[disabled] {
  background-color: #f5f5f5;
  color: #888;
  cursor: not-allowed;
}

.landmine-quiz {
  background-color: #f4f4f4;
  color: #1a1a1a;
  padding: 1rem 1.25rem;
  margin-top: 2rem;
  border-left: 5px solid #888;
  border-radius: 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light Mode */
@media (prefers-color-scheme: light) {
  .landmine-quiz {
    background-color: #f4f4f4;
    color: #1a1a1a;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .landmine-quiz {
    background-color: #2d2d2d;
    color: #f0f0f0;
    border-left: 5px solid #58a6ff;
  }
}

.landmine-quiz p {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.landmine-quiz label {
  display: block;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.4;
}

.landmine-quiz input[type="radio"] {
  margin-right: 0.5rem;
  accent-color: #6c63ff;
}

.landmine-quiz button {
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 0.4rem;
  background-color: #4e4e4e;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.landmine-quiz button:hover {
  background-color: #3b3b3b;
}

.landmine-feedback {
  font-weight: bold;
  margin-top: 0.75rem;
  font-size: 1rem;
}

/* Blog figure container */
.blog-figure {
  display: block;
  max-width: 100%;
  margin: 2rem auto;
  text-align: center;
}

/* Image styling */
.blog-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

/* Caption styling */
.blog-figure figcaption {
  font-size: 0.95rem;
  color: #555;
  margin-top: 0.5rem;
}

/* Dark mode caption */
@media (prefers-color-scheme: dark) {
  .blog-figure figcaption {
    color: #aaa;
  }

  .blog-figure img {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
  }
}

/* Responsive tweaks for mobile */
@media screen and (max-width: 600px) {
  .blog-figure {
    margin: 1.5rem 1rem;
  }

  .blog-figure figcaption {
    font-size: 0.6rem;
  }
}
