/* Blog Header */
.blog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-muted);
}

.blog-header-left {
  display: flex;
  align-items: center;
}

.header-divider {
  color: var(--text-muted);
  margin: 0 0.5rem;
}

.blog-header a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.blog-header a:hover {
  color: var(--primary);
}

.blog-header .logo {
  font-family: 'Pacifico', cursive;
}

.blog-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.social-icon-link:hover {
  color: var(--primary);
}

.social-icon-link svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--card-bg);
  border: 1px solid var(--border-muted);
  border-radius: 0.5rem;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 0;
}

.theme-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

body.light .theme-toggle .icon-sun {
  display: block;
}

body.light .theme-toggle .icon-moon {
  display: none;
}

/* Blog List */
.blog-list {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.blog-list h1 {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

/* Post Card */
.post-card {
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-muted);
  border-radius: 0;
  padding: 2.5rem 0;
  margin-bottom: 0;
  transition: none;
}

.post-card:first-of-type {
  padding-top: 0;
}

.post-card:last-child {
  border-bottom: none;
}

.post-card:hover {
  border-color: var(--border-muted);
}

.post-card a {
  text-decoration: none;
  color: var(--text);
}

.post-card a:hover h2 {
  color: var(--primary);
}

.post-card h2 {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1.625rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color 0.15s;
}

.post-card time {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.post-card p {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
}

.post-card .tag {
  display: inline-block;
  background: var(--bg-light);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  margin-right: 0.4rem;
}

.post-tags {
  margin: 0.5rem 0;
}

.read-more {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: color 0.15s;
}

.read-more:hover {
  text-decoration: underline;
}

/* Breadcrumbs */
.breadcrumbs {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: "›";
  color: var(--text-muted);
  margin: 0 0.5rem;
  opacity: 0.5;
}

.breadcrumb-item a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.breadcrumb-current span {
  color: var(--text);
  font-weight: 500;
}

/* Blog Post (Single) */
.blog-post {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.blog-post header {
  margin-bottom: 2rem;
}

.blog-post header h1 {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.blog-post header .post-dates {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.blog-post header .post-dates time {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.blog-post header .date-sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

.blog-post header .date-updated {
  font-size: 0.875rem;
}

.blog-post header .post-tags {
  margin: 0.75rem 0;
}

.blog-post header .tag {
  display: inline-block;
  background: var(--bg-light);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  margin-right: 0.4rem;
}

/* Table of Contents */
.toc {
  margin: 1.5rem 0 2.5rem;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--border-muted);
}

.toc details summary {
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  margin-bottom: 0.75rem;
}

.toc details summary::-webkit-details-marker {
  display: none;
}

.toc details[open] summary::after {
  content: "";
}

.toc nav,
.toc ul,
.toc #TableOfContents ul {
  list-style: none !important;
  padding: 0;
  margin: 0;
}

.toc #TableOfContents > ul > li {
  margin: 0.3rem 0;
}

.toc #TableOfContents > ul > li > ul {
  padding-left: 1rem;
  margin-top: 0.15rem;
}

.toc #TableOfContents > ul > li > ul > li {
  margin: 0.1rem 0;
}

.toc #TableOfContents a {
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.6;
}

.toc #TableOfContents a:hover {
  color: var(--primary);
}

.toc #TableOfContents > ul > li > ul a {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Wide table support */
.prose .table-wide {
  margin: 2rem -2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .prose .table-wide {
    margin: 1.5rem -1.25rem;
  }
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  margin: 2rem 0;
}

.prose th {
  font-weight: 600;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid var(--border-muted);
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.prose td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border-muted);
  white-space: nowrap;
}

.prose th:first-child,
.prose td:first-child {
  font-weight: 600;
  white-space: normal;
}

.prose tr:hover td {
  background: var(--bg-light);
}

.prose .score-table tr:hover td {
  background: unset;
}

/* Prose (Article Content) */
.prose {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1.25rem;
  line-height: 1.8;
  letter-spacing: -0.003em;
}

.prose p {
  margin: 1.5rem 0;
}

.prose h2 {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.prose h3 {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose ul,
.prose ol {
  padding-left: 1.75rem;
  margin: 1.5rem 0;
}

.prose li {
  margin: 0.5rem 0;
}

.prose li::marker {
  color: var(--text-muted);
}

.prose blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 2rem 0;
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.7;
}

.prose blockquote p {
  margin: 0.5rem 0;
}

.prose code {
  background: var(--bg-light);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.85em;
}

.prose pre {
  background: var(--bg-dark);
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.prose img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 0.5rem;
  margin: 3rem auto 1.5rem;
  /* More space above, centered */
  display: block;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  /* nice shadow */
}

.post-card img {
  max-height: 30vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
  display: block;
  margin: 0.75rem 0;
}

.post-card figure {
  margin: 1.5rem 0;
}

.post-card figcaption {
  text-align: center;
  margin-top: 0.75rem;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.post-card figcaption .caption-text {
  display: block;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 400;
  font-style: normal;
  opacity: 0.85;
}

.post-card figcaption .caption-attr {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: 0.3rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.post-card figcaption .caption-attr a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border-muted);
  transition: all 0.2s;
}

.post-card figcaption .caption-attr a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.prose figure {
  margin: 3rem 0;
}

.prose figure img {
  margin: 0 auto;
}

.prose figcaption {
  text-align: center;
  margin-top: 1rem;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.prose figcaption .caption-text {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 400;
  font-style: normal;
  /* Clean, non-italic */
  opacity: 0.85;
}

.prose figcaption .caption-attr {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.35rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.prose figcaption .caption-attr a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border-muted);
  transition: all 0.2s;
}

.prose figcaption .caption-attr a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.prose hr {
  border: none;
  text-align: center;
  margin: 3rem 0;
}

.prose hr::before {
  content: "...";
  font-size: 1.5rem;
  letter-spacing: 0.6em;
  color: var(--text-muted);
}

/* Blog Footer */
.blog-footer {
  max-width: 680px;
  margin: 2rem auto 0;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border-muted);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.blog-footer a {
  color: var(--primary);
  text-decoration: none;
}

.blog-footer a:hover {
  text-decoration: underline;
}

/* Back Link */
.back-link {
  display: inline-block;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-muted);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  width: 100%;
}

.back-link:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .breadcrumbs {
    padding: 1rem 1.25rem 0;
  }

  .breadcrumb-list {
    font-size: 0.8125rem;
  }

  .breadcrumb-item:not(:last-child)::after {
    margin: 0 0.35rem;
  }

  .blog-header {
    padding: 1rem;
  }

  .blog-list {
    padding: 2rem 1.25rem;
  }

  .blog-list h1 {
    font-size: 2rem;
  }

  .post-card {
    padding: 1.5rem 0;
  }

  .post-card h2 {
    font-size: 1.375rem;
  }

  .blog-post {
    padding: 1rem 1.25rem 3rem;
  }

  .blog-post header h1 {
    font-size: 2rem;
  }

  .prose {
    font-size: 1.125rem;
  }

  .prose h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
  }

  .prose h3 {
    font-size: 1.25rem;
  }

  .prose blockquote {
    font-size: 1.125rem;
  }

  .blog-footer {
    padding: 1.5rem 1.25rem;
  }
}

/* ===== Score Heatmap Tables ===== */

.prose table.score-table {
  border-collapse: separate;
  border-spacing: 2px;
  margin: 1rem 0 2rem;
}

.prose .score-table th {
  text-align: center;
  padding: 0.5rem 0.3rem;
  font-size: 0.7rem;
  border-bottom: none;
  vertical-align: bottom;
  line-height: 1.2;
}

.prose .score-table th:first-child {
  text-align: left;
  min-width: 6rem;
}

.prose .score-table th.col-fit {
  border-bottom: 2px solid var(--primary);
}

.prose .score-table td {
  text-align: center;
  padding: 0.4rem 0.3rem;
  border-bottom: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 2rem;
}

.prose .score-table td:first-child {
  text-align: left;
  background: transparent !important;
  font-weight: 600;
  padding-right: 0.5rem;
  white-space: nowrap;
  min-width: auto;
}

.prose .score-table tr:hover td {
  filter: brightness(1.2);
}

.prose .score-table tr:hover td:first-child {
  filter: none;
}

/* Score colors — dark mode (default) */
.s1  { background: oklch(0.35 0.11 25); }
.s2  { background: oklch(0.37 0.10 30); }
.s3  { background: oklch(0.39 0.10 48); }
.s4  { background: oklch(0.41 0.09 62); }
.s5  { background: oklch(0.42 0.08 82); }
.s6  { background: oklch(0.42 0.08 105); }
.s7  { background: oklch(0.41 0.09 135); }
.s8  { background: oklch(0.39 0.10 148); }
.s9  { background: oklch(0.37 0.11 155); }
.s10 { background: oklch(0.35 0.12 160); }
.s-na { background: var(--bg-light); color: var(--text-muted); font-style: italic; }

/* Score colors — light mode */
body.light .s1  { background: oklch(0.82 0.09 25); }
body.light .s2  { background: oklch(0.83 0.08 30); }
body.light .s3  { background: oklch(0.84 0.08 48); }
body.light .s4  { background: oklch(0.85 0.07 62); }
body.light .s5  { background: oklch(0.86 0.06 82); }
body.light .s6  { background: oklch(0.86 0.06 105); }
body.light .s7  { background: oklch(0.85 0.07 135); }
body.light .s8  { background: oklch(0.83 0.08 148); }
body.light .s9  { background: oklch(0.82 0.09 155); }
body.light .s10 { background: oklch(0.80 0.10 160); }

/* Score legend */
.score-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 1rem 0 1.5rem;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.75rem;
  flex-wrap: wrap;
}

.score-legend-label {
  color: var(--text-muted);
  margin-right: 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.score-legend-item,
.score-legend-na {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 4px;
  font-weight: 500;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.score-legend-na {
  padding: 0 0.4rem;
}

/* Column tooltips */
.col-tip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-muted);
}

.col-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-dark, #1a1a2e);
  color: var(--text, #e0e0e0);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
}

.col-tip:hover::after {
  opacity: 1;
}

body.light .col-tip::after {
  background: #1a1a2e;
  color: #e8e8e8;
}

/* Keep rightmost tooltips from overflowing */
.prose .score-table th:nth-last-child(-n+3) .col-tip::after {
  left: auto;
  right: 0;
  transform: none;
}

/* Keep leftmost tooltips from overflowing */
.prose .score-table th:nth-child(2) .col-tip::after,
.prose .score-table th:nth-child(3) .col-tip::after {
  left: 0;
  transform: none;
}