/* Ribbonfarm static site — style.css */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #fafaf8;
  --text: #1f1f1f;
  --accent: #7a5533;
  --accent-light: #a0713f;
  --muted: #6b6b6b;
  --border: #ddd8d0;
  --max-width: 740px;
  --font-body: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

html { font-size: 19px; background: var(--bg); color: var(--text); }
body { margin: 0; font-family: var(--font-body); line-height: 1.8; }

/* ── Header ── */
.site-header { background: var(--bg); }

.site-topbar {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}
.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.45rem 1.75rem;
  display: flex;
  justify-content: flex-end;
}
.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.site-nav a:hover { color: var(--text); }

.site-masthead {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0 0.9rem;
}
.masthead-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.75rem;
  overflow: hidden;
}
.site-logo-link { display: inline-block; line-height: 0; }
.site-logo {
  display: block;
  height: 64px;
  width: auto;
}

/* ── Layout ── */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.75rem 5rem;
}

/* ── Post / Page ── */
.post-header, .page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.post-title, .page-title {
  font-family: var(--font-body);
  font-size: 2.3rem;
  font-weight: bold;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.post-meta {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.post-meta a { color: var(--accent); text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }

.series-badge {
  display: inline-block;
  background: #efe8de;
  color: var(--accent);
  border-radius: 2px;
  padding: 0.05em 0.4em;
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
}

/* ── Series nav ── */
.series-nav {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  margin: 2rem 0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
}
.series-label { color: var(--muted); margin-bottom: 0.35rem; }
.series-label a { color: var(--accent); text-decoration: none; font-weight: 600; }
.series-links { display: flex; justify-content: space-between; gap: 1rem; }
.series-prev, .series-next { color: var(--accent); text-decoration: none; }
.series-prev:hover, .series-next:hover { text-decoration: underline; }

/* ── Post body ── */
.post-body p, .page-body p { margin: 0 0 1.2em; }
.post-body img, .page-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
}
.post-body figure, .page-body figure {
  margin: 2rem 0;
  text-align: center;
}
.post-body figcaption, .page-body figcaption {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-sans);
  margin-top: 0.4rem;
}
.post-body h2, .page-body h2 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2.5rem 0 0.6rem;
  color: var(--text);
  letter-spacing: 0.01em;
}
.post-body h3, .page-body h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 0.4rem;
  color: var(--text);
}
.post-body h4, .page-body h4 {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.5rem 0 0.3rem;
  color: var(--muted);
}
.post-body blockquote, .page-body blockquote {
  border-left: 2px solid var(--accent);
  margin: 1.8rem 0;
  padding: 0.15rem 1.4rem;
  font-style: italic;
  color: #444;
}
.post-body blockquote p, .page-body blockquote p { margin-bottom: 0.5em; }
.post-body a, .page-body a {
  color: var(--accent-light);
  text-decoration: underline;
  text-decoration-color: rgba(160, 113, 63, 0.4);
  text-underline-offset: 2px;
}
.post-body a:hover, .page-body a:hover {
  text-decoration-color: var(--accent-light);
}
.post-body pre, .page-body pre {
  background: #f0ede7;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.82rem;
  border-radius: 3px;
  line-height: 1.6;
}
.post-body code, .page-body code {
  font-size: 0.85em;
  background: #f0ede7;
  padding: 0.1em 0.3em;
  border-radius: 2px;
}
.post-body pre code, .page-body pre code { background: none; padding: 0; }
.post-body ul, .post-body ol,
.page-body ul, .page-body ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.post-body li, .page-body li { margin-bottom: 0.3em; }
.post-body hr, .page-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Comments ── */
.comments-section {
  margin-top: 4rem;
  border-top: 2px solid var(--border);
  padding-top: 2.5rem;
}
.comments-heading {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2rem;
}
.comment {
  margin-bottom: 1.75rem;
}
.comment-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.74rem;
}
.comment-author-name {
  font-weight: 600;
  color: var(--text);
}
.comment-header a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.comment-header a:hover { text-decoration: underline; }
.comment-date { color: var(--muted); }
.comment-body {
  font-size: 0.92rem;
  line-height: 1.7;
}
.comment-body p { margin: 0 0 0.75em; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-body a { color: var(--accent-light); }
.comment-body i, .comment-body em { font-style: italic; }
.comment-body blockquote {
  border-left: 2px solid var(--border);
  margin: 0.75rem 0;
  padding: 0.1rem 1rem;
  color: #555;
  font-style: italic;
}
.comment-children {
  margin-top: 1.25rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
}
/* ── Pingbacks ── */
.pingbacks {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.pingbacks-heading {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85rem;
}
.pingbacks-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  columns: 2;
  column-gap: 2rem;
}
.pingbacks-list li { margin-bottom: 0.35rem; break-inside: avoid; }
.pingbacks-list a { color: var(--muted); text-decoration: none; }
.pingbacks-list a:hover { color: var(--accent); text-decoration: underline; }

/* ── Archive ── */
.archive-year {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  margin: 2.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.archive-count, .archive-total { font-weight: normal; color: var(--muted); font-size: 1rem; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 0.2rem 0; font-size: 0.92rem; }
.post-date {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: var(--muted);
  display: inline-block;
  min-width: 6.5rem;
}
.post-author { font-size: 0.76rem; color: var(--muted); }

/* ── Archive filters ── */
.archive-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
}
.archive-filters select {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.3em 0.6em;
  cursor: pointer;
}
.archive-filters select:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.archive-no-results {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--muted);
  padding: 1.5rem 0;
  display: none;
}

/* ── Series list page ── */
.series-list-page { max-width: 700px; }
.series-list-page .page-title { margin-bottom: 1.5rem; }

/* ── Series list / index ── */
.series-index ol, .series-index-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.series-item { padding: 0.25rem 0; }
.series-part { font-family: var(--font-sans); font-size: 0.76rem; color: var(--muted); min-width: 4rem; display: inline-block; }
.series-description { color: var(--muted); font-style: italic; }
.series-index-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.series-count { color: var(--muted); font-size: 0.83rem; }

/* ── Series grid (homepage) ── */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}
.series-card {
  display: block;
  background: #f3ede5;
  border-radius: 3px;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.series-card:hover { border-color: var(--accent); }
.series-card-name { display: block; font-family: var(--font-sans); font-weight: 600; font-size: 0.88rem; margin-bottom: 0.2rem; }
.series-card-count { font-size: 0.73rem; color: var(--muted); font-family: var(--font-sans); }
.series-card-desc { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }

/* ── Homepage ── */
.home-hero {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.home-title {
  font-family: var(--font-body);
  font-size: 2.8rem;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}
.home-tagline { font-style: italic; color: var(--muted); margin: 0 0 1rem; font-size: 1.05rem; }
.home-retired-note { font-family: var(--font-sans); font-size: 0.82rem; color: var(--muted); }
.home-links { margin-top: 1.2rem; }
.cta-link {
  display: inline-block;
  margin-right: 1rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
.cta-link:hover { background: var(--accent-light); }

.home-series, .home-recent { margin-top: 2.5rem; }
.home-series h2, .home-recent h2 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ── Homepage intro blurb ── */
.home-blurb {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 600px;
  margin: 0.5rem 0 1.5rem;
  color: var(--text);
}

/* ── Canon / Essential Posts two-column layout ── */
.home-canon { margin-bottom: 3rem; }
.canon-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3rem;
}
.canon-col-heading {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.canon-card {
  display: block;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.canon-card-title {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--accent-light);
  line-height: 1.3;
}
.canon-card:hover .canon-card-title { text-decoration: underline; text-decoration-color: var(--accent-light); text-underline-offset: 2px; }
.canon-card-meta {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* ── Wayback Machine slideshow ── */
.wayback-slideshow {
  margin: 1.5rem 0 2rem;
  max-width: 100%;
}
.wayback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
}
.wayback-prev, .wayback-next {
  background: none;
  border: none;
  color: var(--bg);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
  opacity: 0.8;
}
.wayback-prev:hover, .wayback-next:hover { opacity: 1; }
.wayback-frames {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  overflow: hidden;
}
.wayback-frames img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.wayback-frames img.active { opacity: 1; }

/* ── Series stack (used on /series/ page) ── */
.home-series-section { margin-bottom: 2rem; }
.series-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.series-row {
  background: #f3ede5;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.8rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: border-color 0.15s;
}
.series-row:hover { border-color: var(--accent); }
.series-row-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}
.series-row-title {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}
.series-row-count {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}
.series-row-desc {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Book callout ── */
.book-callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: #faf6f0;
  padding: 0.55rem 1rem;
  margin: 0 0 2rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 0.5em;
  align-items: baseline;
}
.book-callout-label { color: var(--muted); }
.book-callout-title {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.book-callout-title:hover { text-decoration: underline; }

/* ── Author ── */
.author-post-count { font-family: var(--font-sans); font-size: 0.83rem; color: var(--muted); }

/* ── Footer ── */
.site-footer {
  background: var(--text);
  color: #a09080;
  margin-top: 5rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.76rem;
}
.footer-inner a { color: #c8b8a0; }
.footer-inner p { margin: 0; }

/* ── Responsive ── */
@media (max-width: 640px) {
  html { font-size: 17px; }
  .post-title, .page-title { font-size: 1.8rem; }
  .page-wrap { padding: 2rem 1.25rem 4rem; }
  .topbar-inner { padding: 0.4rem 1.25rem; }
  .masthead-inner { padding: 0 1.25rem; }
  .site-logo { height: 48px; }
  .canon-columns { grid-template-columns: 1fr; }
  .archive-filters { gap: 0.5rem; }
}
