/* Public blog stylesheet — ported from the old Jekyll site
   (jons-blog-zk/assets/css/main.css). Retro / neo-brutalist system:
   #333 on #f5f5f5, white 800px container with 2px border + 8px 8px 0 shadow,
   Helvetica, bold underlined links that invert on hover, hard 4px shadows on
   post-list items, mini-posts as light-green 75%-width cards, single 768px
   breakpoint that drops the container chrome. Jekyll-only bits (the stats-page
   CSS) were stripped; everything the ported pages use is kept verbatim. */

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

body {
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  padding: 20px;
}

/* Main container with retro box shadow */
.main-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: #fff;
  padding: 40px;
  box-shadow: 8px 8px 0px #333;
  border: 2px solid #333;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

h1 {
  font-size: 1.8em;
}

/* Site header title styling */
.site-header h1 {
  font-size: 2.2em;
}

h2 {
  font-size: 1.4em;
  margin-top: 30px;
}

h3 {
  font-size: 1.2em;
  margin-top: 25px;
}

p {
  margin-bottom: 20px;
}

/* Links */
a {
  color: #333;
  text-decoration: underline;
  font-weight: bold;
  padding: 2px 4px;
  margin-left: -4px;
  background-color: transparent;
}

a:hover {
  background-color: #333;
  color: #fff;
}

/* Remove underlines from titles */
h1 a, .post-title a {
  text-decoration: none;
}

h1 a:hover, .post-title a:hover {
  background-color: #333;
  color: #fff;
}

/* Navigation */
.site-nav {
  margin-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.site-nav a {
  text-decoration: none;
  padding: 5px 10px;
  border: 2px solid transparent;
}

.site-nav a:hover {
  border: 2px solid #333;
  background-color: transparent;
  color: #333;
}

.site-nav a.active {
  border: 2px solid #333;
  background-color: transparent;
  color: #333;
  box-shadow: 2px 2px 0px #333;
}

/* Post list */
.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 45px;
  padding: 20px;
  border: 2px solid #333;
  box-shadow: 4px 4px 0px #333;
}

.post-title {
  font-size: 1.3em;
  margin-top: 10px;
  margin-bottom: 10px;
  text-transform: none;
}

.post-date {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 10px;
}

.post-excerpt {
  margin-bottom: 15px;
}

/* Footer */
.site-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 2px solid #333;
  text-align: center;
  font-size: 0.9em;
}

/* Code blocks */
pre, code {
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  background-color: #f0f0f0;
  border: 1px solid #333;
}

pre {
  padding: 15px;
  overflow-x: auto;
  box-shadow: 2px 2px 0px #333;
}

code {
  padding: 2px 4px;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid #333;
  padding-left: 20px;
  margin: 20px 0;
  font-style: italic;
}

/* Tags */
.post-tags {
  margin-top: 15px;
}

.tag {
  display: inline-block;
  background-color: #d0d0d0;
  color: #333;
  padding: 3px 8px;
  margin-right: 5px;
  font-size: 0.8em;
  font-weight: bold;
  text-decoration: none;
  border: 1px solid #bbb;
}

.tag:hover {
  background-color: #c0c0c0;
  color: #333;
}

/* Post content styling */
.post {
  margin-bottom: 40px;
}

.post-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #333;
}

.post-title {
  font-size: 1.8em;
  margin-bottom: 8px;
  color: #333;
  text-transform: none;
}

.post-meta {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.post-content {
  line-height: 1.7;
}

.post-content h1 {
  font-size: 1.5em;
  margin-top: 40px;
  margin-bottom: 20px;
}

.post-content h2 {
  font-size: 1.3em;
  margin-top: 35px;
  margin-bottom: 15px;
}

.post-content h3 {
  font-size: 1.1em;
  margin-top: 30px;
  margin-bottom: 15px;
}

.post-content p {
  margin-bottom: 20px;
}

.post-content ul, .post-content ol {
  margin-bottom: 20px;
  padding-left: 30px;
}

.post-content li {
  margin-bottom: 5px;
  padding: 0;
  border: none;
  box-shadow: none;
  background-color: transparent;
}

/* Mini post styling */
.mini-post {
  background-color: #f0f8f0;
  border: 2px solid #333;
  box-shadow: 4px 4px 0px #333;
  padding: 20px;
  margin-bottom: 45px;
  width: 75%;
}

.mini-post-content {
  margin-bottom: 10px;
  font-size: 1em;
  line-height: 1.5;
}

.mini-post-meta {
  font-size: 0.9em;
  color: #666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mini-post-meta .post-tags {
  margin-top: 0;
}

/* Single mini post page styling */
.mini-post-single {
  background-color: #f0f8f0;
  border: 2px solid #333;
  box-shadow: 4px 4px 0px #333;
  padding: 20px;
  margin-bottom: 30px;
  width: 75%;
}

/* Archive page styling */
.archive {
  margin-top: 20px;
}

.archive-month {
  margin-bottom: 40px;
}

.archive-month-title {
  font-size: 1.3em;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ccc;
  color: #333;
}

.archive-list {
  list-style: none;
  padding: 0;
}

.archive-item {
  display: flex;
  align-items: baseline;
  margin-bottom: 8px;
  padding: 5px 0;
}

.archive-date {
  font-size: 0.9em;
  color: #666;
  flex-shrink: 0;
  margin-right: 15px;
}

.archive-link {
  text-decoration: none;
  color: #333;
  font-weight: normal;
}

.archive-link:hover {
  background-color: #f0f0f0;
  padding: 2px 4px;
  color: #333;
}

/* Tag page title styling */
.tag-page-title {
  display: inline-block;
  background-color: #d0d0d0;
  color: #333;
  padding: 8px 16px;
  font-size: 1.8em;
  font-weight: bold;
  text-decoration: none;
  border: 1px solid #bbb;
  margin-bottom: 30px;
}

/* Date link styling - preserve date appearance */
.post-date a, .mini-post-meta a {
  color: #666;
  text-decoration: none;
  font-weight: normal;
  padding: 2px 4px;
  margin-left: -4px;
  background-color: transparent;
}

.post-date a:hover, .mini-post-meta a:hover {
  background-color: #333;
  color: #fff;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  body {
    padding: 0;
    background-color: #fff;
  }

  .main-container {
    box-shadow: none;
    border: none;
    padding: 20px;
    max-width: none;
    margin: 0;
  }


  /* Make mini posts full width on mobile */
  .mini-post, .mini-post-single {
    width: 100%;
  }

  /* Fix code block overflow on mobile */
  pre, code {
    overflow-x: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
  }

  /* For inline code, allow breaking */
  code {
    word-break: break-all;
    white-space: normal;
  }

  /* For code blocks, maintain formatting but enable scroll */
  pre {
    white-space: pre;
    overflow-x: scroll;
  }

  /* Ensure all content respects container bounds */
  .post-content, .mini-post-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
  }
}

/* Star rating styling */
.star-rating {
  font-size: 2em;
  color: #333;
  margin-bottom: 20px;
  line-height: 1;
}

.book-review-rating {
  margin-bottom: 20px;
}

/* Book rating in archive lists */
.book-rating {
  font-size: 0.7em;
  color: #333;
  margin-left: 10px;
  margin-right: 10px;
  flex-shrink: 0;
  line-height: 1;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding: 15px 0;
  border-top: 2px solid #333;
}

.pagination a {
  text-decoration: none;
  padding: 8px 15px;
  border: 2px solid #333;
  font-weight: bold;
  box-shadow: 2px 2px 0px #333;
}

.pagination a:hover {
  background-color: #333;
  color: #fff;
}

.pagination-info {
  font-size: 0.9em;
  color: #666;
}

.pagination-disabled {
  color: #ccc;
  padding: 8px 15px;
}

/* Content type indicator */
.content-type-indicator {
  font-size: 0.95em;
  font-weight: bold;
  color: #666;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  filter: grayscale(100%);
}

/* Retro 404 */
.error-404 {
  text-align: center;
  padding: 40px 0;
}

.error-404 .error-code {
  font-size: 4em;
  font-weight: bold;
  margin-bottom: 10px;
}

/* Public canvas (/map) chrome — a header bar linking back, full-viewport body.
   The canvas island itself is styled by /assets/css/canvas.css. */
body.map-body {
  padding: 0;
  background-color: #f5f5f5;
  overflow: hidden;
}

.map-header {
  border-bottom: 2px solid #333;
  background-color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 100;
}

.map-header h1 {
  font-size: 1.3em;
  margin: 0;
}

.map-viewport {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
}

#canvas-root {
  width: 100%;
  height: 100%;
}

/* Stats (/stats) — server-rendered SVG charts. The charts keep their intrinsic
   pixel size and scroll horizontally on narrow screens rather than scaling
   down until the cells are unreadable; the page body never scrolls sideways. */
.stats-container h1 {
  margin-bottom: 6px;
}

.stats-total {
  color: #666;
  margin-bottom: 30px;
}

.stat-chart {
  margin-bottom: 40px;
}

.stat-chart h2 {
  font-size: 1.2em;
  border-bottom: 2px solid #333;
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.stats-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.stats-scroll svg {
  display: block;
}

/* Tag rows are links, but the site's <a> styling (underline + bold) must not
   leak into SVG text — chart labels wear text tokens, not link decoration. */
/* The decoration must be cleared on the <a> itself: text-decoration propagates
   to descendants and a child rule cannot undo it. */
.stats-tag-row {
  cursor: pointer;
  text-decoration: none;
  font-weight: normal;
}

.stats-tag-row:hover path {
  fill: #333;
}

.stats-tag-row:hover text {
  fill: #000;
}

.stats-empty {
  color: #666;
}

.stats-table {
  margin-top: 10px;
  border-top: 1px solid #d0d0d0;
  padding-top: 14px;
}

.stats-table summary {
  cursor: pointer;
  color: #666;
  font-size: 0.9em;
}

.stats-table table {
  border-collapse: collapse;
  margin-top: 12px;
}

.stats-table th,
.stats-table td {
  text-align: left;
  padding: 4px 24px 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9em;
}
