/*
 * blog.css — Shirt Pocket Watch (self-hosted blog).  Loaded after site.css on
 * blog pages only.  Contains the blog-specific layout from the approved
 * ee-theme; the nav/footer/page chrome and fonts come from site.css.  The
 * color tokens below are the blog's own (site.css defines only the font vars).
 */
:root {
  --sp-page: #eef1f6;
  --sp-paper: #ffffff;
  --sp-ink: #1d232e;
  --sp-copy: #4a5568;
  --sp-muted: #8b93a4;
  --sp-line: rgba(30, 40, 60, 0.09);
  --sp-blue: #2c6fa8;
  --sp-blue-dark: #1e5285;
  --sp-blue-wash: rgba(44, 111, 168, 0.10);
}

img, video, iframe { max-width: 100%; }
.sp-post-body img { height: auto; border-radius: 10px; }

/* Masthead + tools */
.sp-blog-header { max-width: 860px; margin: 0 auto; padding: 56px 44px 20px; }
.sp-eyebrow {
  margin-bottom: 12px; color: var(--sp-blue);
  font-family: var(--sp-font-mono); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.sp-blog-title {
  margin: 0 0 12px; font-family: var(--sp-font-display);
  font-size: clamp(40px, 6vw, 58px); font-weight: 800;
  letter-spacing: -0.04em; line-height: 0.98;
}
.sp-blog-intro { max-width: 680px; margin: 0; color: var(--sp-copy); font-size: 17px; line-height: 1.55; }

.sp-blog-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  max-width: 860px; margin: 0 auto; padding: 8px 44px 28px; flex-wrap: wrap;
}
.sp-tool-links { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-tool-link {
  display: inline-block; padding: 8px 12px; border: 1px solid var(--sp-line);
  border-radius: 9px; background: rgba(255, 255, 255, 0.72);
  color: #3a4356; font-size: 13px; font-weight: 600;
}
.sp-tool-link:hover { border-color: rgba(44, 111, 168, 0.3); color: var(--sp-blue-dark); }
.sp-tool-link.is-active { background: var(--sp-blue); color: #fff; border-color: var(--sp-blue); }

.sp-search-form { display: flex; gap: 7px; }
.sp-search-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.sp-search-input {
  width: 200px; min-height: 36px; padding: 7px 10px;
  border: 1px solid rgba(30, 40, 60, 0.14); border-radius: 9px;
  background: #fff; color: var(--sp-ink); font: 13px var(--sp-font-body);
}
.sp-search-submit {
  min-height: 36px; padding: 7px 13px; border: 0; border-radius: 9px;
  background: var(--sp-ink); color: #fff; cursor: pointer; font: 600 13px var(--sp-font-body);
}

/* Main stream */
.sp-content { max-width: 860px; margin: 0 auto; padding: 4px 44px 64px; }
.sp-post-list { display: flex; flex-direction: column; gap: 18px; }
.sp-post {
  overflow: hidden; padding: 30px; border: 1px solid var(--sp-line);
  border-radius: 16px; background: var(--sp-paper);
  box-shadow: 0 1px 2px rgba(30, 40, 60, 0.04), 0 8px 24px rgba(30, 40, 60, 0.05);
}
.sp-post--single { padding: 34px 36px; }
.sp-post.sp-excerpt { display: block; color: inherit; transition: border-color .15s, box-shadow .15s; }
.sp-post.sp-excerpt:hover { border-color: rgba(44, 111, 168, 0.35); box-shadow: 0 1px 2px rgba(30,40,60,0.05), 0 12px 30px rgba(30,40,60,0.07); }
.sp-post.sp-excerpt .sp-post-title { margin: 4px 0 8px; }
.sp-excerpt-copy { margin: 0; color: var(--sp-copy); font-size: 15px; line-height: 1.55; }
.sp-post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px;
  color: var(--sp-muted); font-family: var(--sp-font-mono); font-size: 12px; line-height: 1.4;
}
.sp-category {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--sp-blue-wash); color: var(--sp-blue-dark);
  font-family: var(--sp-font-body); font-size: 11px; font-weight: 650;
}
.sp-category:hover { color: var(--sp-blue-dark); background: rgba(44,111,168,0.16); }
.sp-draft-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: rgba(224,178,74,0.22); color: #8a6a1c;
  font-family: var(--sp-font-body); font-size: 11px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.sp-post-title {
  margin: 0 0 20px; font-family: var(--sp-font-display);
  font-size: clamp(26px, 4vw, 36px); font-weight: 750;
  letter-spacing: -0.025em; line-height: 1.12;
}
.sp-post-title a { color: var(--sp-ink); }
.sp-post-title a:hover { color: var(--sp-blue-dark); }

.sp-post-body { color: #303949; font-size: 16px; line-height: 1.6; }
.sp-post-body > :first-child { margin-top: 0; }
.sp-post-body > :last-child { margin-bottom: 0; }
.sp-post-body p { margin: 0 0 1.1em; }
.sp-post-body h1, .sp-post-body h2, .sp-post-body h3, .sp-post-body h4 {
  margin: 1.6em 0 0.55em; color: var(--sp-ink); font-family: var(--sp-font-display);
  font-weight: 750; letter-spacing: -0.015em; line-height: 1.2;
}
.sp-post-body h1 { font-size: 28px; }
.sp-post-body h2 { font-size: 25px; }
.sp-post-body h3 { font-size: 21px; }
.sp-post-body h4 { font-size: 18px; }
.sp-post-body ul, .sp-post-body ol { margin: 0 0 1.2em; padding-left: 1.5em; }
.sp-post-body li { margin: 0.35em 0; }
/* Multi-paragraph ("loose") list items: Markdown wraps their text in <p>, which
   would otherwise add an inconsistent trailing margin vs. single-line ("tight")
   items. Give items that contain paragraphs a uniform separation and a modest
   internal paragraph gap, so mixed lists read consistently (margins collapse, so
   a tight item beside loose ones picks up the same spacing). */
.sp-post-body li:has(> p) { margin: 0.9em 0; }
.sp-post-body li > p { margin: 0 0 0.55em; }
.sp-post-body li > p:last-child { margin-bottom: 0; }
.sp-post-body blockquote {
  margin: 1.35em 0; padding: 2px 0 2px 20px;
  border-left: 3px solid #9fb8d4; color: #526074;
}
.sp-post-body code {
  padding: 1px 5px; border-radius: 5px; background: var(--sp-blue-wash);
  color: var(--sp-blue-dark); font: 0.88em var(--sp-font-mono);
}
.sp-post-body pre {
  overflow-x: auto; padding: 16px 18px; border-radius: 12px;
  background: #232b38; color: #e7edf4;
}
.sp-post-body pre code { padding: 0; background: transparent; color: inherit; }
.sp-post-body a { text-decoration: underline; text-decoration-color: rgba(44, 111, 168, 0.35); }
.sp-post-body hr { border: 0; border-top: 1px solid var(--sp-line); margin: 1.6em 0; }

/* Footnotes (Markdown Extra) */
.sp-post-body .footnotes { margin-top: 2em; padding-top: 0.5em; font-size: 14px; color: var(--sp-copy); }
.sp-post-body .footnotes hr { margin: 0 0 1em; }
.sp-post-body sup[id^="fnref"] { font-size: 0.75em; }

.sp-post-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px;
  margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--sp-line);
  color: var(--sp-muted); font-size: 12.5px;
}
.sp-post-footer a { font-weight: 600; }

/* Pagination */
.sp-pagination {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
  margin-top: 22px; padding: 15px 18px; border: 1px solid var(--sp-line);
  border-radius: 12px; background: #fff; color: var(--sp-copy); font-size: 13px;
}
.sp-pagination a, .sp-pagination strong {
  display: inline-block; min-width: 30px; padding: 5px 10px; border-radius: 8px; text-align: center;
}
.sp-pagination strong { background: var(--sp-blue); color: #fff; }
.sp-pagination a { color: #3a4356; border: 1px solid var(--sp-line); }
.sp-pagination a:hover { border-color: rgba(44,111,168,0.35); color: var(--sp-blue-dark); }
.sp-pagination .sp-page-count { border: 0; color: var(--sp-muted); font-family: var(--sp-font-mono); }

/* Archives + categories + search */
.sp-section-title {
  margin: 0 0 20px; font-family: var(--sp-font-display); font-size: 32px;
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.1;
}
.sp-archive-card, .sp-comments-card, .sp-empty {
  padding: 28px 30px; border: 1px solid var(--sp-line); border-radius: 16px;
  background: #fff; box-shadow: 0 1px 2px rgba(30, 40, 60, 0.04);
}
.sp-archive-year { margin: 28px 0 4px; color: #9fb8d4; font: 700 28px var(--sp-font-mono); }
.sp-archive-year:first-child { margin-top: 0; }
.sp-archive-month { margin: 18px 0 5px; font: 750 18px var(--sp-font-display); }
.sp-archive-entry { padding: 7px 0; border-bottom: 1px solid rgba(30, 40, 60, 0.06); }
.sp-archive-entry:last-child { border-bottom: 0; }
.sp-archive-date { color: var(--sp-muted); font: 11px var(--sp-font-mono); }
.sp-archive-entry a { font-weight: 600; }

.sp-category-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  margin: 0; padding: 0; list-style: none;
}
.sp-category-card {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  min-height: 100%; padding: 18px 20px; border: 1px solid var(--sp-line);
  border-radius: 12px; background: #fff; color: var(--sp-ink); font: 700 17px var(--sp-font-display);
}
.sp-category-card:hover { border-color: rgba(44, 111, 168, 0.35); color: var(--sp-blue-dark); }
.sp-category-count { font: 500 12px var(--sp-font-mono); color: var(--sp-muted); }

/* Comments (read-only archive) */
.sp-comments-card { margin-top: 18px; }
.sp-comments-title { margin: 0 0 4px; font: 750 20px var(--sp-font-display); }
.sp-comments-note { margin: 0 0 8px; color: var(--sp-muted); font-size: 13px; }
.sp-comment { padding: 20px 0; border-top: 1px solid var(--sp-line); }
.sp-comment:first-of-type { padding-top: 14px; }
.sp-comment-author { color: var(--sp-ink); font-weight: 700; }
.sp-comment-author a { color: var(--sp-ink); }
.sp-comment-author a:hover { color: var(--sp-blue-dark); }
.sp-comment-meta { margin-bottom: 9px; color: var(--sp-muted); font: 11px var(--sp-font-mono); }
.sp-comment-body { color: #303949; font-size: 15px; line-height: 1.6; }
.sp-comment-body > :first-child { margin-top: 0; }
.sp-comment-body > :last-child { margin-bottom: 0; }
.sp-comment-body p { margin: 0 0 0.8em; }

.sp-empty { color: var(--sp-copy); }

@media (max-width: 760px) {
  .sp-blog-header { padding: 42px 24px 18px; }
  .sp-blog-tools { align-items: stretch; flex-direction: column; padding: 6px 24px 24px; }
  .sp-search-input { width: 100%; }
  .sp-content { padding: 4px 24px 50px; }
  .sp-post, .sp-post--single, .sp-archive-card, .sp-comments-card, .sp-empty { padding: 24px; }
  .sp-category-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .sp-content { padding-right: 16px; padding-left: 16px; }
  .sp-post, .sp-post--single, .sp-archive-card, .sp-comments-card, .sp-empty { padding: 21px 19px; border-radius: 14px; }
  .sp-post-title { font-size: 27px; }
}
@media print {
  .sp-blog-tools, .sp-pagination { display: none; }
  .sp-post { border: 0; box-shadow: none; }
}
