/* Casual Physics Enjoyer — static blog
   Typography & layout inspired by John Baez's Azimuth blog: a calm, readable,
   text-first WordPress feel. Cream background, serif body, dark links. */

:root {
  --bg: #fbf7ef;
  --ink: #1f1d1a;
  --muted: #6a6356;
  --rule: #d8cfbf;
  --link: #6b3a14;
  --link-hover: #a35a1f;
  --accent: #7a1f1f;
  --max: 760px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(107, 58, 20, 0.25);
}
a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

.site {
  max-width: 1050px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: 210px minmax(0, var(--max));
  grid-template-areas:
    "header  header"
    "sidebar content"
    "footer  footer";
  column-gap: 3rem;
  justify-content: center;
}
.site-header { grid-area: header; }
.sidebar     { grid-area: sidebar; }
.content     { grid-area: content; }
.site-footer { grid-area: footer; }

/* ---------- year sidebar ---------- */

.sidebar { align-self: start; }
@media (min-width: 981px) {
  .sidebar {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
  }
}
.sidebar-title {
  font-size: 1rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  margin: 0 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--ink);
}
.year-nav details.year {
  border-bottom: 1px solid var(--rule);
}
.year-nav summary {
  cursor: pointer;
  padding: 0.4rem 0;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: var(--ink);
}
.year-nav summary:hover { color: var(--accent); }
.year-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant: normal;
}
.year-nav ul {
  list-style: none;
  padding: 0 0 0.6rem 0.2rem;
  margin: 0;
}
.year-nav li {
  margin: 0.28rem 0;
  font-size: 0.85rem;
  line-height: 1.35;
}
.year-nav li a { border-bottom: none; }
.year-nav li a:hover { border-bottom: 1px solid var(--link-hover); }
.year-nav li.active a {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 980px) {
  .site {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "content"
      "sidebar"
      "footer";
  }
  .sidebar {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
  }
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
}

.site-title {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.site-title a {
  color: var(--ink);
  border: none;
}
.site-tagline {
  margin: 0.4rem 0 0.9rem;
  color: var(--muted);
  font-style: italic;
  font-size: 1rem;
}
.site-nav a {
  margin-right: 1.2rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  border-bottom: none;
}
.site-nav a:hover {
  border-bottom: 1px solid var(--link-hover);
}

/* ---------- post listings ---------- */

.post-preview {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.4rem;
  margin-bottom: 1.6rem;
}
.post-preview:last-child {
  border-bottom: none;
}
.post-preview .post-title { font-size: 1.4rem; }
.post-preview .post-header { margin-bottom: 0.5rem; }
.post-excerpt {
  margin: 0.5rem 0 0.6rem;
  color: #2f2b24;
  font-size: 1rem;
  line-height: 1.55;
}
.read-more {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  border-bottom: none;
}
.read-more:hover { border-bottom: 1px solid var(--link-hover); }

.post-preview.featured {
  background: #f5efde;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 2.2rem;
}
.pinned-label {
  margin: 0 0 0.3rem;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--accent);
}

.post-header {
  margin-bottom: 1.2rem;
}
.post-title {
  font-size: 1.7rem;
  line-height: 1.25;
  margin: 0 0 0.3rem;
  font-weight: 700;
}
.post-title a {
  color: var(--ink);
  border-bottom: none;
}
.post-title a:hover {
  color: var(--accent);
}
.post-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
}
.post-date {
  font-style: normal;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.post-subtitle {
  color: var(--muted);
}

.post-body {
  font-size: 1.04rem;
}
.post-body p {
  margin: 1rem 0;
}
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-weight: 700;
  margin-top: 2rem;
}
.post-body h1 { font-size: 1.5rem; }
.post-body h2 { font-size: 1.35rem; }
.post-body h3 { font-size: 1.15rem; }
.post-body h4 { font-size: 1.05rem; }

.post-body img, .post-body figure {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
}
.post-body figure img { margin: 0 auto; }
.post-body figcaption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.4rem;
}

.post-body blockquote {
  border-left: 3px solid var(--rule);
  margin: 1.4rem 0;
  padding: 0.1rem 1.1rem;
  color: #3b362d;
  font-style: italic;
}

.post-body code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #f1ead9;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
.post-body pre {
  background: #f1ead9;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.post-body pre code { background: none; padding: 0; }

.post-body ul, .post-body ol { padding-left: 1.4rem; }
.post-body li { margin: 0.3rem 0; }

.post-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

.post-body a.image-link, .post-body .image-link {
  border: none;
}

/* substack-specific cleanup: hide subscribe widgets and CTAs */
.post-body .subscription-widget,
.post-body .subscription-widget-wrap,
.post-body .button-wrapper,
.post-body .pencraft,
.post-body .embedded-publication { display: none !important; }

/* captions and footnotes */
.post-body sup a { border: none; color: var(--accent); }
.post-body .footnote { font-size: 0.9rem; color: var(--muted); }

.post-tags {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1.6rem;
  font-style: italic;
}
.post-perma {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ---------- archive ---------- */

.page-title {
  font-size: 1.8rem;
  margin: 0 0 0.3rem;
}
.page-blurb {
  color: var(--muted);
  font-style: italic;
  margin-top: 0;
}
.archive-year {
  margin-top: 2rem;
}
.archive-year-title {
  font-size: 1.3rem;
  margin: 0 0 0.6rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.2rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}
.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.archive-list li {
  margin: 0.35rem 0;
  font-size: 0.98rem;
  line-height: 1.45;
}
.archive-date {
  display: inline-block;
  width: 4.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}
.archive-subtitle {
  color: var(--muted);
  font-style: italic;
  font-size: 0.92rem;
}

/* ---------- pager / footer ---------- */

.pager {
  margin: 2.5rem 0 1rem;
  text-align: center;
}
.big-link {
  display: inline-block;
  border: 1px solid var(--rule);
  padding: 0.6rem 1.2rem;
  background: #f5efde;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.site-footer a { color: var(--muted); }
