/* =============================================================
   Jean Jacques Blog — Complete Dark Theme
   GitHub Dark Palette + Two-column layout + Manga Styling
   ============================================================= */

/* ---- Variables ------------------------------------------- */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface2:     #21262d;
  --border:       #30363d;
  --text:         #c9d1d9;
  --text-muted:   #8b949e;
  --primary:      #2ea043;
  --primary-hov:  #3fb950;
  --accent:       #56d364;
  --link:         #58a6ff;
  --link-hov:     #79c0ff;
  --code-bg:      #1E1F22;
  --nav-h:        56px;
  --nav-breakpoint: 820px;
}

/* ---- Reset & Base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.blog-body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hov); }
img { max-width: 100%; height: auto; display: block; }

/* ---- Navbar ---------------------------------------------- */
.blog-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.blog-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
}

.blog-nav__brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text) !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-short { display: none; }
.blog-nav__brand:hover { color: var(--accent) !important; }

.blog-nav__menu {
  display: flex;
  gap: 2px;
  flex: 1;
}

.blog-nav__item {
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--text-muted) !important;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.blog-nav__item:hover,
.blog-nav__item.active {
  color: var(--text) !important;
  background: var(--surface2);
}

.blog-nav__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 0.85rem;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.blog-nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 36px;
  padding: 0;
}

.nav-toggle__icon {
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
  border-radius: 2px;
}
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.nav-toggle__icon::before { top: -6px; }
.nav-toggle__icon::after { top: 6px; }

/* ---- Page Layout ----------------------------------------- */
.blog-wrapper {
  min-height: calc(100vh - var(--nav-h) - 80px);
}

.blog-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 28px) clamp(12px, 4vw, 24px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: clamp(18px, 3vw, 28px);
  align-items: start;
}

.blog-main { min-width: 0; }

.blog-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
}

/* Custom scrollbar for sidebar */
.blog-sidebar::-webkit-scrollbar { width: 4px; }
.blog-sidebar::-webkit-scrollbar-track { background: transparent; }
.blog-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ---- Section Title --------------------------------------- */
.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

/* ---- Post List Wrapper ----------------------------------- */
.post-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

/* ---- Post Card ------------------------------------------- */
.post-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  text-decoration: none;
}
.post-card:last-child { border-bottom: none; }
.post-card:hover { background: var(--surface2); }

.post-card__thumb {
  flex-shrink: 0;
  width: 160px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface2);
  display: block;
}
.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.post-card:hover .post-card__thumb img { transform: scale(1.04); }

.post-card__content { flex: 1; min-width: 0; }

.post-card__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  line-height: 1.35;
}
.post-card__title a { color: var(--text) !important; }
.post-card__title a:hover { color: var(--link) !important; }

.post-card__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.meta-sep { opacity: 0.4; }

.post-card__desc {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ---- Tag Badges ------------------------------------------ */
.tag-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 500;
  background: var(--surface2);
  color: var(--text-muted) !important;
  border: 1px solid var(--border);
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.tag-badge:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}

/* Tag cloud color variety by position */
.tag-cloud .tag-badge:nth-child(7n+1) { background:#1a2f2a; border-color:#2ea043; color:#56d364 !important; }
.tag-cloud .tag-badge:nth-child(7n+2) { background:#1a1f2e; border-color:#1f6feb; color:#58a6ff !important; }
.tag-cloud .tag-badge:nth-child(7n+3) { background:#2d1b1e; border-color:#f85149; color:#ff7b72 !important; }
.tag-cloud .tag-badge:nth-child(7n+4) { background:#27211b; border-color:#e3b341; color:#f0c040 !important; }
.tag-cloud .tag-badge:nth-child(7n+5) { background:#221e2e; border-color:#7c3aed; color:#a78bfa !important; }
.tag-cloud .tag-badge:nth-child(7n+6) { background:#1e2a2d; border-color:#0e9888; color:#2dd4bf !important; }
.tag-cloud .tag-badge:nth-child(7n+0) { background:#2a1f2e; border-color:#ec4899; color:#f472b6 !important; }

/* ---- Paginator ------------------------------------------- */
.blog-paginator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 20px 0 4px;
}

.paginator-btn {
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text-muted) !important;
  border: 1px solid var(--border);
  font-size: 0.83rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  cursor: pointer;
}
.paginator-btn:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
  background: var(--surface);
}
.paginator-btn.current {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}
.paginator-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ---- Sidebar Cards --------------------------------------- */
.sidebar-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.sidebar-card__title {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
}

/* About Me */
.about-me {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.about-me__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.about-me__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.about-me__name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
}
.about-me__subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.about-me__bio {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Follow Me */
.follow-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text) !important;
  background: var(--surface2);
  transition: border-color 0.15s, color 0.15s;
}
.follow-btn:hover { border-color: var(--accent); color: var(--accent) !important; }
.follow-btn svg { flex-shrink: 0; }

/* Recent Posts */
.recent-posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recent-post { display: flex; flex-direction: column; gap: 2px; }
.recent-post__title {
  font-size: 0.83rem;
  color: var(--text) !important;
  line-height: 1.3;
  font-weight: 500;
}
.recent-post__title:hover { color: var(--link) !important; }
.recent-post__date {
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}
.show-more {
  font-size: 0.76rem;
  color: var(--text-muted) !important;
  display: block;
  margin-top: 6px;
}
.show-more:hover { color: var(--link) !important; }

/* Categories */
.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.category-link {
  font-size: 0.83rem;
  color: var(--text-muted) !important;
}
.category-link:hover { color: var(--link) !important; }
.category-count {
  font-size: 0.72rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Archive */
.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.archive-link {
  font-size: 0.83rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted) !important;
}
.archive-link:hover { color: var(--link) !important; }
.archive-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ---- Footer ---------------------------------------------- */
.blog-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px;
  margin-top: 0;
}
.blog-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-link {
  font-size: 0.8rem;
  color: var(--text-muted) !important;
}
.footer-link:hover { color: var(--link) !important; }
.footer-social {
  display: flex;
  gap: 12px;
  align-items: center;
}
.social-icon {
  color: var(--text-muted) !important;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.social-icon:hover { color: var(--text) !important; }
.blog-footer__credits {
  text-align: center;
  padding-top: 10px;
  font-size: 0.73rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.blog-footer__credits a { color: var(--text-muted) !important; }
.blog-footer__credits a:hover { color: var(--link) !important; }

/* ---- Search Page ----------------------------------------- */
.search-page { max-width: 800px; }

.search-header { margin-bottom: 20px; }
.search-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.search-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.search-box-wrapper {
  position: relative;
  margin-bottom: 12px;
}
.search-input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46,160,67,0.15);
}
.search-input::-webkit-search-cancel-button { cursor: pointer; }

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-status {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  min-height: 1.2em;
}

.search-results { background: none; border: none; }
.search-results .post-card:first-child { border-radius: 8px 8px 0 0; }
.search-results .post-card:last-child  { border-radius: 0 0 8px 8px; }
.search-results .post-card:only-child  { border-radius: 8px; }

/* ---- Sidebar Search -------------------------------------- */
.sidebar-search__wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}
.sidebar-search__input {
  flex: 1;
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.83rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.sidebar-search__input::placeholder { color: var(--text-muted); }
.sidebar-search__input:focus { border-color: var(--primary); }

.sidebar-search__btn {
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  transition: border-color 0.15s, color 0.15s;
}
.sidebar-search__btn:hover { border-color: var(--accent); color: var(--accent); }

/* Article TOC (single post sidebar) */
.article-toc {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.article-toc #TableOfContents ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-toc #TableOfContents li {
  margin: 0;
}

.article-toc #TableOfContents li + li {
  margin-top: 6px;
}

.article-toc #TableOfContents li ul {
  margin-top: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.article-toc #TableOfContents a {
  display: block;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-muted) !important;
}

.article-toc #TableOfContents a:hover {
  color: var(--link) !important;
}

/* Article summary (posts page sidebar) */
.article-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.article-summary-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.article-summary-link {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text) !important;
}

.article-summary-link:hover {
  color: var(--link) !important;
}

.article-summary-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ---- Single Post Page ------------------------------------ */
.post-single {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
}
.post-header { margin-bottom: 24px; }
.post-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.3;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.post-cover {
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
  max-height: 400px;
}
.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- About Page ----------------------------------------- */
.about-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.about-profile {
  flex-shrink: 0;
}

.about-profile img {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--border);
}

.about-header__content {
  min-width: 0;
}

.about-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---- Post Content / Markdown ----------------------------- */
.post-content,
.post-content.markdown-body {
  background: transparent !important;
  color: var(--text) !important;
  font-size: 0.95rem;
  line-height: 1.8;
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text) !important;
  border-bottom-color: var(--border) !important;
}
.post-content a { color: var(--link); }
.post-content a:hover { color: var(--link-hov); }
.post-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--surface2);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
}
.post-content code {
  background: var(--code-bg) !important;
  color: #BCBEC4 !important;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 0.87em;
  border: 1px solid var(--border) !important;
}
.post-content pre {
  background: var(--code-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  padding: 16px !important;
  overflow-x: auto;
}
.post-content pre code {
  background: none !important;
  border: none !important;
  padding: 0;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}
.post-content th {
  background: var(--surface2) !important;
  color: var(--text) !important;
  padding: 8px 12px;
  text-align: left;
  border: 1px solid var(--border) !important;
}
.post-content td {
  padding: 8px 12px;
  border: 1px solid var(--border) !important;
  color: var(--text-muted);
}
.post-content tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.post-content img {
  border-radius: 8px;
  max-width: 100%;
  margin: 16px auto;
}

.post-content img,
.post-cover img {
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out;
  z-index: 200;
}
.image-lightbox__content {
  position: relative;
  max-width: min(1024px, 96vw);
  max-height: 90vh;
}
.image-lightbox__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.image-lightbox__close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #ffffffcc;
  color: #fff;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.image-lightbox__close:hover { background: rgba(0, 0, 0, 0.8); transform: scale(1.05); }
.image-lightbox__close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
.image-lightbox.is-open { opacity: 1; pointer-events: auto; }

body.nav-open,
body.image-lightbox-open {
  overflow: hidden;
}
.post-content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 32px 0;
  position: relative;
}
.post-content hr::after {
  content: "✦";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  padding: 0 8px;
  color: var(--accent);
  font-size: 1em;
}

/* ---- Post Navigation ------------------------------------- */
.post-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.post-nav__prev,
.post-nav__next {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 45%;
  color: var(--text-muted) !important;
}
.post-nav__next { text-align: right; margin-left: auto; }
.post-nav__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.post-nav__title {
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text) !important;
}
.post-nav__prev:hover .post-nav__title,
.post-nav__next:hover .post-nav__title { color: var(--link) !important; }

/* ---- Manga / Anime Shortcodes ---------------------------- */
.sensei-note,
.battle-pattern,
.technique {
  margin: 24px 0;
  border-radius: 8px;
  padding: 16px 20px;
}
.sensei-note__header,
.battle-pattern__header,
.technique__header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
}
.sensei-note { background: #0d1f38; border: 1px solid #1f6feb; border-left: 4px solid #58a6ff; }
.sensei-note__title { color: #58a6ff; }
.sensei-note__body { color: var(--text); }

.battle-pattern { background: #2d1216; border: 1px solid #f85149; border-left: 4px solid #ff7b72; }
.battle-pattern__title { color: #ff7b72; }
.battle-pattern__body { color: var(--text); }

.technique { background: #0f2d1f; border: 1px solid #2ea043; border-left: 4px solid #56d364; }
.technique__title { color: #56d364; }
.technique__body { color: var(--text); }

.sensei-note__body p:last-child,
.battle-pattern__body p:last-child,
.technique__body p:last-child { margin-bottom: 0; }

/* ---- Override residual primer light classes -------------- */
/* These ensure any primer classes used don't reintroduce white */
.bg-white  { background: var(--bg) !important; }
.bg-gray   { background: var(--bg) !important; }
.text-gray { color: var(--text-muted) !important; }
.Box, .Box--blue { background: var(--surface) !important; border-color: var(--border) !important; }
.markdown-body { background: transparent !important; color: var(--text) !important; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: var(--text) !important;
  border-bottom-color: var(--border) !important;
}
.markdown-body code, .markdown-body pre {
  background: var(--code-bg) !important;
  color: #BCBEC4 !important;
  border-color: var(--border) !important;
}

body.light-mode .markdown-body code {
  background: #f6f8fa !important;
  color: #000000 !important;
  border-color: #d0d7de !important;
}

body.light-mode .markdown-body pre {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #d0d7de !important;
}
.markdown-body blockquote {
  border-left-color: var(--primary) !important;
  color: var(--text-muted) !important;
}
.markdown-body table th { background: var(--surface2) !important; color: var(--text) !important; }
.markdown-body table td { border-color: var(--border) !important; }
.markdown-body a { color: var(--link) !important; }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .blog-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

/* Keep in sync with --nav-breakpoint */
@media (max-width: 820px) {
  .blog-nav__inner { gap: 12px; }
  .blog-nav__menu {
    position: absolute;
    top: calc(var(--nav-h) - 1px);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 10px 16px 14px;
    z-index: 150;
  }
  .blog-nav__menu.is-open { display: flex; }
  .blog-nav__item { width: 100%; padding: 10px 12px; }
  .blog-nav__actions { margin-left: auto; }
  .blog-nav__toggle { display: inline-flex; }
  .blog-nav__brand { font-size: 1rem; }
  .brand-full { display: none; }
  .brand-short { display: inline; }
  body.no-js .blog-nav__menu {
    position: static;
    display: flex;
    padding: 0;
    box-shadow: none;
    border-bottom: none;
  }
  body.no-js .blog-nav__toggle { display: none; }
}

@media (max-width: 640px) {
  .blog-layout { padding: 12px; }
  .post-card { flex-direction: column; }
  .post-card__thumb { width: 100%; height: 180px; }
  .blog-nav__menu { padding: 10px 12px 14px; }
  .blog-nav__item { font-size: 0.9rem; }
  .blog-nav__actions { gap: 6px; }
  .post-title { font-size: 1.35rem; }
  .post-single { padding: 20px; }
}

/* ---- Light Mode Override --------------------------------- */
body.light-mode {
  --bg:         #ffffff;
  --surface:    #f6f8fa;
  --surface2:   #eaeef2;
  --border:     #d0d7de;
  --text:       #1f2328;
  --text-muted: #57606a;
  --link:       #0969da;
  --link-hov:   #0550ae;
  --code-bg:    #ffffff;
  --primary:    #2da44e;
  --accent:     #1a7f37;
}
body.light-mode .blog-nav       { background: var(--surface); }
body.light-mode .post-list      { background: var(--surface); }
body.light-mode .post-card:hover { background: var(--surface2); }
body.light-mode .sidebar-card   { background: var(--surface); }
body.light-mode .post-single    { background: var(--surface); }
body.light-mode .post-content   { color: var(--text) !important; }
body.light-mode .blog-footer    { background: var(--surface); }
body.light-mode .post-content code { background: #f6f8fa !important; color: #000000 !important; border-color: #d0d7de !important; }
body.light-mode .post-content pre  { background: #ffffff !important; border-color: #d0d7de !important; }
body.light-mode .post-content hr::after { background: var(--surface); }

/* ============================================================
   IntelliJ IDEA Islands Dark Theme - Syntax Highlighting (Dark Mode)
   ============================================================ */

/* Dark Mode Chroma Overrides */
.chroma { 
  background-color: #1E1F22 !important;
  color: #BCBEC4 !important;
}

.chroma .hl { background-color: #2B2D30 !important; }
.chroma .lnt { color: #5E6167 !important; }
.chroma .ln { color: #5E6167 !important; }

/* Error */
.chroma .err { color: #E8596B !important; background-color: #3d2426 !important; }

/* Keywords */
.chroma .k { color: #CF8E6D !important; font-weight: normal !important; }
.chroma .kc { color: #CF8E6D !important; font-weight: normal !important; }
.chroma .kd { color: #CF8E6D !important; font-weight: normal !important; }
.chroma .kn { color: #CF8E6D !important; font-weight: normal !important; }
.chroma .kp { color: #CF8E6D !important; font-weight: normal !important; }
.chroma .kr { color: #CF8E6D !important; font-weight: normal !important; }
.chroma .kt { color: #CF8E6D !important; font-weight: normal !important; }

/* Names */
.chroma .na { color: #C77DBB !important; }
.chroma .nb { color: #56A8F5 !important; }
.chroma .nc { color: #4EC9B0 !important; font-weight: normal !important; }
.chroma .no { color: #C77DBB !important; font-weight: normal !important; }
.chroma .nd { color: #C77DBB !important; }
.chroma .ni { color: #C77DBB !important; }
.chroma .ne { color: #BCBEC4 !important; }
.chroma .nf { color: #56A8F5 !important; font-weight: normal !important; }
.chroma .nl { color: #C77DBB !important; }
.chroma .nn { color: #BCBEC4 !important; }
.chroma .nt { color: #CF8E6D !important; }
.chroma .nv { color: #C77DBB !important; }
.chroma .nx { color: #BCBEC4 !important; }

/* Literals - Strings */
.chroma .s { color: #6AAB73 !important; }
.chroma .sa { color: #6AAB73 !important; }
.chroma .sb { color: #6AAB73 !important; }
.chroma .sc { color: #6AAB73 !important; }
.chroma .dl { color: #6AAB73 !important; }
.chroma .sd { color: #6C707E !important; font-style: italic !important; }
.chroma .s2 { color: #6AAB73 !important; }
.chroma .se { color: #CF8E6D !important; font-weight: normal !important; }
.chroma .sh { color: #6AAB73 !important; }
.chroma .si { color: #CF8E6D !important; }
.chroma .sx { color: #6AAB73 !important; }
.chroma .sr { color: #6AAB73 !important; font-weight: normal !important; }
.chroma .s1 { color: #6AAB73 !important; }
.chroma .ss { color: #C77DBB !important; }

/* Literals - Numbers */
.chroma .m { color: #2AACB8 !important; }
.chroma .mb { color: #2AACB8 !important; }
.chroma .mf { color: #2AACB8 !important; }
.chroma .mh { color: #2AACB8 !important; }
.chroma .mi { color: #2AACB8 !important; }
.chroma .il { color: #2AACB8 !important; }
.chroma .mo { color: #2AACB8 !important; }

/* Operators */
.chroma .o { color: #BCBEC4 !important; }
.chroma .ow { color: #CF8E6D !important; font-weight: normal !important; }

/* Comments */
.chroma .c { color: #6C707E !important; font-style: italic !important; }
.chroma .ch { color: #6C707E !important; font-style: italic !important; }
.chroma .cm { color: #6C707E !important; font-style: italic !important; }
.chroma .c1 { color: #6C707E !important; font-style: italic !important; }
.chroma .cs { color: #6C707E !important; font-style: italic !important; }
.chroma .cp { color: #C77DBB !important; font-weight: normal !important; }
.chroma .cpf { color: #C77DBB !important; font-weight: normal !important; }

/* Generic */
.chroma .gd { color: #E8596B !important; }
.chroma .ge { font-style: italic !important; }
.chroma .gr { color: #E8596B !important; }
.chroma .gh { color: #CF8E6D !important; font-weight: normal !important; }
.chroma .gi { color: #6AAB73 !important; }
.chroma .go { color: #6C707E !important; }
.chroma .gp { color: #BCBEC4 !important; }
.chroma .gs { font-weight: bold !important; }
.chroma .gu { color: #CF8E6D !important; font-weight: normal !important; }
.chroma .gt { color: #E8596B !important; }

/* Other */
.chroma .w { color: #5E6167 !important; }
.chroma .p { color: #BCBEC4 !important; }
.chroma .fm { color: #56A8F5 !important; font-weight: normal !important; }
.chroma .vm { color: #C77DBB !important; }

/* Light Mode Chroma Overrides - Reset to light theme */
body.light-mode .chroma {
  background-color: #ffffff !important;
  color: #000000 !important;
}

body.light-mode .chroma .hl { background-color: #e8f2ff !important; }
body.light-mode .chroma .lnt { color: #787878 !important; }
body.light-mode .chroma .ln { color: #787878 !important; }
body.light-mode .chroma .err { color: #ff0000 !important; background-color: #ffdddd !important; }

body.light-mode .chroma .k { color: #000080 !important; font-weight: bold !important; }
body.light-mode .chroma .kc { color: #000080 !important; font-weight: bold !important; }
body.light-mode .chroma .kd { color: #000080 !important; font-weight: bold !important; }
body.light-mode .chroma .kn { color: #000080 !important; font-weight: bold !important; }
body.light-mode .chroma .kp { color: #000080 !important; font-weight: bold !important; }
body.light-mode .chroma .kr { color: #000080 !important; font-weight: bold !important; }
body.light-mode .chroma .kt { color: #000080 !important; font-weight: bold !important; }

body.light-mode .chroma .na { color: #0000ff !important; }
body.light-mode .chroma .nb { color: #000080 !important; }
body.light-mode .chroma .nc { color: #000000 !important; font-weight: bold !important; }
body.light-mode .chroma .no { color: #871094 !important; font-weight: bold !important; }
body.light-mode .chroma .nd { color: #808000 !important; }
body.light-mode .chroma .ni { color: #871094 !important; }
body.light-mode .chroma .ne { color: #000000 !important; font-weight: bold !important; }
body.light-mode .chroma .nf { color: #00627a !important; font-weight: bold !important; }
body.light-mode .chroma .nl { color: #871094 !important; }
body.light-mode .chroma .nn { color: #000000 !important; }
body.light-mode .chroma .nt { color: #000080 !important; }
body.light-mode .chroma .nv { color: #871094 !important; }
body.light-mode .chroma .nx { color: #000000 !important; }

body.light-mode .chroma .s { color: #067d17 !important; }
body.light-mode .chroma .sa { color: #067d17 !important; }
body.light-mode .chroma .sb { color: #067d17 !important; }
body.light-mode .chroma .sc { color: #067d17 !important; }
body.light-mode .chroma .dl { color: #067d17 !important; }
body.light-mode .chroma .sd { color: #8c8c8c !important; font-style: italic !important; }
body.light-mode .chroma .s2 { color: #067d17 !important; }
body.light-mode .chroma .se { color: #000080 !important; font-weight: bold !important; }
body.light-mode .chroma .sh { color: #067d17 !important; }
body.light-mode .chroma .si { color: #067d17 !important; }
body.light-mode .chroma .sx { color: #067d17 !important; }
body.light-mode .chroma .sr { color: #008000 !important; font-weight: bold !important; }
body.light-mode .chroma .s1 { color: #067d17 !important; }
body.light-mode .chroma .ss { color: #871094 !important; }

body.light-mode .chroma .m { color: #1750eb !important; }
body.light-mode .chroma .mb { color: #1750eb !important; }
body.light-mode .chroma .mf { color: #1750eb !important; }
body.light-mode .chroma .mh { color: #1750eb !important; }
body.light-mode .chroma .mi { color: #1750eb !important; }
body.light-mode .chroma .il { color: #1750eb !important; }
body.light-mode .chroma .mo { color: #1750eb !important; }

body.light-mode .chroma .o { color: #000000 !important; }
body.light-mode .chroma .ow { color: #000080 !important; font-weight: bold !important; }

body.light-mode .chroma .c { color: #8c8c8c !important; font-style: italic !important; }
body.light-mode .chroma .ch { color: #8c8c8c !important; font-style: italic !important; }
body.light-mode .chroma .cm { color: #8c8c8c !important; font-style: italic !important; }
body.light-mode .chroma .c1 { color: #8c8c8c !important; font-style: italic !important; }
body.light-mode .chroma .cs { color: #8c8c8c !important; font-style: italic !important; }
body.light-mode .chroma .cp { color: #808000 !important; font-weight: bold !important; }
body.light-mode .chroma .cpf { color: #808000 !important; font-weight: bold !important; }

body.light-mode .chroma .gd { color: #ff0000 !important; }
body.light-mode .chroma .ge { font-style: italic !important; }
body.light-mode .chroma .gr { color: #ff0000 !important; }
body.light-mode .chroma .gh { color: #000080 !important; font-weight: bold !important; }
body.light-mode .chroma .gi { color: #067d17 !important; }
body.light-mode .chroma .go { color: #8c8c8c !important; }
body.light-mode .chroma .gp { color: #000000 !important; font-weight: bold !important; }
body.light-mode .chroma .gs { font-weight: bold !important; }
body.light-mode .chroma .gu { color: #000080 !important; font-weight: bold !important; }
body.light-mode .chroma .gt { color: #ff0000 !important; }

body.light-mode .chroma .w { color: #bbbbbb !important; }
body.light-mode .chroma .p { color: #000000 !important; }
body.light-mode .chroma .fm { color: #00627a !important; font-weight: bold !important; }
body.light-mode .chroma .vm { color: #871094 !important; }

/* ============================================================
   Code Block Copy Button
   ============================================================ */

/* Code block wrapper with copy button */
.highlight {
  position: relative;
  margin: 16px 0;
}

.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  background: rgba(188, 190, 196, 0.1);
  color: #BCBEC4;
  border: none;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
  line-height: 1;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.highlight:hover .code-copy-btn {
  opacity: 0.6;
}

.code-copy-btn:hover {
  opacity: 1 !important;
  background: rgba(188, 190, 196, 0.15);
}

.code-copy-btn:active {
  transform: scale(0.96);
  background: rgba(188, 190, 196, 0.2);
}

.code-copy-btn.copied {
  opacity: 1 !important;
  color: #6AAB73;
  background: rgba(106, 171, 115, 0.15);
}

/* Light mode adjustments */
body.light-mode .code-copy-btn {
  background: rgba(0, 0, 0, 0.04);
  color: #57606a;
}

body.light-mode .highlight:hover .code-copy-btn {
  opacity: 0.5;
}

body.light-mode .code-copy-btn:hover {
  opacity: 1 !important;
  background: rgba(0, 0, 0, 0.08);
}

body.light-mode .code-copy-btn:active {
  background: rgba(0, 0, 0, 0.12);
}

body.light-mode .code-copy-btn.copied {
  color: #067d17;
  background: rgba(6, 125, 23, 0.1);
}
