/* Scoped blog article styles to avoid global overrides */
.article-content {
  color: #d1d5db;
  line-height: 1.7;
  font-size: 1.05rem;
  padding: 1rem 0.5rem;
  transition: color 0.3s ease;
}

body.light-mode .article-content {
  color: #333333;
}

.article-content .article-title {
  color: #e5e7eb;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 0.25rem 0;
  text-align: left;
  position: static;
  top: auto;
  letter-spacing: normal;
  text-shadow: none;
  transition: color 0.3s ease;
}

body.light-mode .article-content .article-title {
  color: #111111;
}

.article-content .article-meta {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: color 0.3s ease;
}

body.light-mode .article-content .article-meta {
  color: #636363;
}

.article-content .article-meta a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.3s ease;
}

body.light-mode .article-content .article-meta a {
  color: #636363;
}

.article-content .article-meta a:hover {
  color: #e5e7eb;
  text-decoration: underline;
}

body.light-mode .article-content .article-meta a:hover {
  color: #333333;
}

/* Typography inside article body */
.article-content .article-body h1,
.article-content .article-body h2,
.article-content .article-body h3,
.article-content .article-body h4,
.article-content .article-body h5,
.article-content .article-body h6 {
  color: #e5e7eb;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
  position: static;
  top: auto;
  letter-spacing: normal;
  text-shadow: none;
  transition: color 0.3s ease;
}

body.light-mode .article-content .article-body h1,
body.light-mode .article-content .article-body h2,
body.light-mode .article-content .article-body h3,
body.light-mode .article-content .article-body h4,
body.light-mode .article-content .article-body h5,
body.light-mode .article-content .article-body h6 {
  color: #222222;
}

.article-content .article-body h1 { font-size: 1.9rem; text-align: left; }
.article-content .article-body h2 { font-size: 1.6rem; }
.article-content .article-body h3 { font-size: 1.4rem; margin-left: 0; padding-left: 0; }
.article-content .article-body h4 { font-size: 1.25rem; }
.article-content .article-body h5 { font-size: 1.1rem; }
.article-content .article-body h6 { font-size: 1rem; }

.article-content .article-body p {
  margin: 1.4rem 0;
  color: #d1d5db;
  transition: color 0.3s ease;
}

body.light-mode .article-content .article-body p {
  color: #333333;
}

.article-content .article-body a { color: #cbd5e1; text-decoration: underline; transition: color 0.3s ease; }
.article-content .article-body a:hover { color: #e5e7eb; }
body.light-mode .article-content .article-body a { color: #333333; }
body.light-mode .article-content .article-body a:hover { color: #111111; }

.article-content .article-body ul,
.article-content .article-body ol {
  padding-left: 1.3rem;
  margin: 0.8rem 0;
}

.article-content .article-body li { margin: 0.25rem 0; }

.article-content .article-body blockquote {
  border-left: 3px solid #4b5563;
  padding-left: 0.9rem;
  color: #cbd5e1;
  margin: 1rem 0;
  transition: color 0.3s ease, border-color 0.3s ease;
}

body.light-mode .article-content .article-body blockquote {
  border-left-color: #9ca3af;
  color: #333333;
}

/* Space for tags group */
.article-tags { margin-top: 0.5rem; margin-bottom: 0.5rem; }

.article-content .article-body code {
  background: #111111 !important;
  border: 1px solid #222222 !important;
  color: #e5e7eb !important;
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.article-content .article-body pre {
  background: #0f0f0f !important;
  border: 1px solid #222222 !important;
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
  overflow-x: auto;
  color: #e5e7eb;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body.light-mode .article-content .article-body pre {
  background: #0f0f0f !important;
  border-color: #222222 !important;
  color: #e5e7eb !important;
}
.article-content .article-body pre code {
  display: block;
  background: transparent !important;
  padding: 0;
  border-radius: 0;
  border: 0 !important;
}

/* Ensure no stray borders inside code blocks from nested elements */
.article-content .article-body pre * { border: 0 !important; box-shadow: none !important; }

.article-content .article-body img,
.article-content .article-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.article-content .article-body figure { margin: 1rem 0; }
.article-content .article-body figcaption { color: #9ca3af; font-size: 0.9rem; margin-top: 0.5rem; transition: color 0.3s ease; }

body.light-mode .article-content .article-body figcaption {
  color: #636363;
}

.article-content .article-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
  font-size: 0.95rem;
  border: 1px solid #222222;
  background: #111111;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: background 0.3s ease, border-color 0.3s ease;
}

body.light-mode .article-content .article-body table {
  border-color: #d1d5db;
  background: #f9f9f9;
}

.article-content .article-body table th,
.article-content .article-body table td {
  border: 1px solid #222222;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

body.light-mode .article-content .article-body table th,
body.light-mode .article-content .article-body table td {
  border-color: #d1d5db;
  color: #111111;
}

.article-content .article-body table th {
  background: #151515;
  transition: background 0.3s ease;
}

body.light-mode .article-content .article-body table th {
  background: #e8e8e8;
}

/* Alerts (shortcodes) – grayscale look */
.article-content .article-body .alert-box {
  background: #101010;
  border: 1px solid #222222;
  color: #e5e7eb;
  border-left: 3px solid #2a2a2a;
  padding: 0.6rem 0.8rem;
  border-radius: 0.4rem;
  margin: 1rem 0;
  line-height: 1.4;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body.light-mode .article-content .article-body .alert-box {
  background: #f9f9f9;
  border-color: #d1d5db;
  color: #111111;
  border-left-color: #9ca3af;
}

.article-content .article-body .alert-box .alert-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.2rem 0;
  padding-top: 0;
}
.article-content .article-body .alert-box .alert-icon { width: 0.95rem; height: 0.95rem; }
.article-content .article-body .alert-box p { margin: 0; display: flex; align-items: center; column-gap: 0.35rem; }
.article-content .article-body .alert-box.warning,
.article-content .article-body .alert-box.info,
.article-content .article-body .alert-box.success,
.article-content .article-body .alert-box.error {
  background: #111111;
  border-color: #222222;
  border-left-color: #2a2a2a;
  transition: background 0.3s ease, border-color 0.3s ease;
}

body.light-mode .article-content .article-body .alert-box.warning,
body.light-mode .article-content .article-body .alert-box.info,
body.light-mode .article-content .article-body .alert-box.success,
body.light-mode .article-content .article-body .alert-box.error {
  background: #f9f9f9;
  border-color: #d1d5db;
  border-left-color: #9ca3af;
}

.article-content .article-body hr {
  border: 0;
  border-top: 1px solid #222222;
  margin: 1.5rem 0;
  transition: border-color 0.3s ease;
}

body.light-mode .article-content .article-body hr {
  border-top-color: #d1d5db;
}

/* Alerts/shortcodes basic spacing */
.article-content .article-body .alert { margin: 1rem 0; }

/* Tag styling to match list tile chips */
.article-tags a,
.article-content .taxonomy-list a,
.article-content .article-body .tags a {
  background: #222222;
  color: #d1d5db;
  padding: 0.2em 0.7em;
  border-radius: 0.75em;
  font-size: 0.8rem;
  margin-right: 0.25rem;
  transition: background 0.3s ease, color 0.3s ease;
}

body.light-mode .article-tags a,
body.light-mode .article-content .taxonomy-list a,
body.light-mode .article-content .article-body .tags a {
  background: #e8e8e8;
  color: #333333;
}

.article-tags a:hover,
.article-content .taxonomy-list a:hover,
.article-content .article-body .tags a:hover {
  background: #333333;
  color: #e5e7eb;
  text-decoration: none !important;
}

body.light-mode .article-tags a:hover,
body.light-mode .article-content .taxonomy-list a:hover,
body.light-mode .article-content .article-body .tags a:hover {
  background: #d1d5db;
  color: #111111;
}

/* Avoid section overlap: ensure blocks have spacing */
.article-content .article-body > * + * { margin-top: 0.9rem; }
/* Ensure a bit more space before large headings */
.article-content .article-body h1 { margin-top: 1.8rem; }
.article-content .article-body h2 { margin-top: 1.6rem; }

/* Constrain content width to match list layout and provide space under blog nav */
.blog-main-content { width: 80%; max-width: 44rem; margin-left: auto; margin-right: auto; padding-top: 1.5rem; }

/* Cover image styling */
.article-cover-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

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



/* Spoiler effect (Goodreads-like) */
.article-content .article-body spoiler, /* plain HTML */
.article-content .article-body .spoiler { /* shortcode fallback */
  display: inline;
  filter: blur(6px);
  transition: filter 0.2s ease;
  background: transparent;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
}
.article-content .article-body spoiler:hover,
.article-content .article-body .spoiler:hover {
  filter: blur(3px);
  outline: none;
}
.article-content .article-body spoiler.revealed,
.article-content .article-body .spoiler.revealed {
  filter: none;
}

@media screen and (min-width: 1024px) {
  .article-content p, .article-content li, .article-content code { font-size: 18px; }
}