/* Well, Shit. — yellow background, black ink, white highlights. Bold and clean. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond.woff2") format("woff2-variations");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-italic.woff2") format("woff2-variations");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f5c518;
  --ink: #000000;
  --white: #ffffff;
  --muted: rgba(0, 0, 0, 0.62);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --rule: 3px;       /* dividers between sections and posts */
  --rule-thin: 2px;  /* rows inside lists and tables */
  --frame: 4px;      /* borders around photos and boxes */

  /* The white marker-pen highlight: padded sideways so it hugs the words. */
  --highlight: 0.15em 0 0 var(--white), -0.15em 0 0 var(--white);
}

* { box-sizing: border-box; }

::selection {
  background: var(--white);
  color: var(--ink);
}

html { font-size: 17px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2.5px;
  text-underline-offset: 4px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap-narrow {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Labels — dates, nav, buttons, table heads. One sans-serif style everywhere. */

.site-nav a,
.hero-byline,
.badge,
.feed-date,
.read-more,
.post-list-date,
.post-meta,
.post-nav-link,
.post-content th,
.footer-links {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Standalone links get room around them so they're easy to tap. */
.site-nav a,
.footer-links a,
.read-more,
.post-nav-link {
  display: inline-block;
  padding: 0.35rem 0;
}

/* The highlight: hovered links and the white box behind "Shit." */

a:hover,
.site-title em,
.hero-title em,
.error-page h1 em,
.footer-title em,
.feed-title a:hover,
.post-list-link:hover .post-list-title {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--highlight);
  text-decoration: none;
}

.site-title em,
.hero-title em,
.error-page h1 em,
.footer-title em { font-style: italic; }

/* Header */

.site-header {
  border-bottom: var(--rule) solid var(--ink);
  background: var(--bg);
}

.header-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-nav { margin-left: auto; }

.site-nav a {
  text-decoration: none;
  margin-left: 1.75rem;
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2.5px;
  text-underline-offset: 4px;
}

/* Homepage: single scrolling feed */

.home { padding-top: 4.5rem; }

.hero-title {
  font-size: 4.25rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem 0;
}

.hero-tagline {
  font-size: 1.4rem;
  font-style: italic;
  line-height: 1.45;
  margin: 0 0 1rem 0;
  max-width: 34rem;
}

.hero-byline {
  color: var(--muted);
  margin: 0;
}

.hero-hint {
  margin: 2.5rem 0 0 0;
  font-style: italic;
}

.badge {
  display: inline-block;
  background: var(--white);
  color: var(--ink);
  padding: 0.2rem 0.65rem;
  margin-right: 0.5rem;
  transform: translateY(-0.1em);
}

/* Feed */

.feed { margin-top: 4rem; }

.feed-item {
  border-top: var(--rule) solid var(--ink);
  padding: 2.75rem 0 3rem 0;
}

.feed-date {
  color: var(--muted);
  margin: 0 0 0.4rem 0;
}

.feed-title {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem 0;
}

.feed-title a {
  text-decoration: none;
  font-weight: 700;
}

.feed-sub {
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.45;
  margin: 0 0 1.5rem 0;
}

.feed-img-link {
  display: block;
  text-decoration: none;
}

.feed-img-link:hover { background: none; box-shadow: none; }

.feed-img {
  width: 100%;
  height: auto;
  max-height: 30rem;
  object-fit: cover;
  display: block;
  border: var(--frame) solid var(--ink);
  margin: 0 0 1.5rem 0;
  transition: transform 0.2s ease;
}

.feed-img-link:hover .feed-img {
  transform: scale(1.01);
}

.series-parts {
  margin: 0 0 1.25rem 0;
  padding-left: 1.5rem;
}

.series-parts li { margin-bottom: 0.25rem; }

.feed-end {
  border-top: var(--rule) solid var(--ink);
  padding-top: 2.5rem;
  text-align: center;
}

.feed-end p { margin: 0; }

/* Post list */

.list-header { padding-top: 4rem; }

.list-header h1 {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem 0;
}

.list-intro { font-style: italic; color: var(--muted); margin: 0 0 2.25rem 0; }

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list-item {
  padding: 1.5rem 0;
  border-bottom: var(--rule-thin) solid var(--ink);
}

.post-list-item:last-child { border-bottom: 0; }

.post-list-link {
  text-decoration: none;
  display: block;
}

.post-list-link:hover {
  background: none;
  box-shadow: none;
}

.post-list-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.post-list-desc {
  display: block;
  font-style: italic;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 400;
}

.post-list-date { color: var(--muted); }

/* Single post */

.post { padding-top: 4rem; padding-bottom: 2.5rem; }

.post-header {
  border-bottom: var(--rule) solid var(--ink);
  padding-bottom: 1.5rem;
  margin: 0 0 2.75rem 0;
}

.post-header > :last-child { margin-bottom: 0; }

.post-title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem 0;
}

.post-subtitle {
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 1.25rem 0;
}

.post-meta {
  color: var(--muted);
  margin: 0;
}

.post-content h2 {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 2.75rem 0 1rem 0;
}

.post-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.25rem 0 0.75rem 0;
}

/* Asides: the one-line beats between scenes. */
.post-content h4 {
  font-size: 1.45rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.35;
  margin: 2.5rem 0 1.25rem 0;
}

.post-content p { margin: 0 0 1.4rem 0; }

.post-content blockquote {
  margin: 2rem 0;
  padding: 1.1rem 1.5rem;
  border-left: var(--frame) solid var(--ink);
  background: var(--white);
  font-style: italic;
  font-size: 1.15rem;
}

.post-content blockquote p { margin: 0.25rem 0; }

.post-content hr {
  border: 0;
  height: var(--rule);
  background: var(--ink);
  width: 5rem;
  margin: 3rem 0;
}

.post-content ul, .post-content ol { padding-left: 1.75rem; }

.post-content li { margin-bottom: 0.5rem; }

.post-content strong { font-weight: 700; }

.post-content .callout {
  background: var(--white);
  border: var(--frame) solid var(--ink);
  padding: 1.5rem 1.75rem;
  margin: 0 0 2.75rem 0;
  font-size: 1.3rem;
  line-height: 1.6;
}

.post-content .callout p { margin: 0 0 1rem 0; }

.post-content .callout p:last-child { margin-bottom: 0; }

.post-content img {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  border: var(--frame) solid var(--ink);
  display: block;
  margin: 2.5rem auto;
}

/* Post navigation */

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: var(--rule) solid var(--ink);
}

.post-nav-link { text-decoration: none; }

.post-nav-next { text-align: right; margin-left: auto; }

/* Tables (timeline) */

.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 2rem 0;
  font-size: 1.02rem;
  line-height: 1.5;
}

.post-content th {
  text-align: left;
  border-bottom: var(--rule) solid var(--ink);
  padding: 0.5rem 0.75rem 0.5rem 0;
}

.post-content td {
  border-bottom: var(--rule-thin) solid var(--ink);
  padding: 0.8rem 0.75rem 0.8rem 0;
  vertical-align: top;
}

.post-content td:first-child { white-space: nowrap; }

/* Error page */

.error-page { padding-top: 6rem; padding-bottom: 4rem; }

.error-page h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
}

/* Footer */

.site-footer {
  background: var(--ink);
  color: var(--white);
  padding: 3.25rem 0;
  margin-top: 4rem;
}

.site-footer :focus-visible { outline-color: var(--bg); }

.footer-title { font-size: 1.4rem; font-weight: 700; margin: 0; }

.footer-tag {
  font-style: italic;
  margin: 0.4rem 0 0 0;
}

.footer-links { margin: 1rem 0 0 0; }

.footer-links a {
  color: var(--white);
  text-decoration: none;
}

.footer-links a:hover {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0.15em 0 0 var(--bg), -0.15em 0 0 var(--bg);
}

/* Small screens */

@media (max-width: 640px) {
  html { font-size: 16px; }

  .hero-title { font-size: 3rem; }

  .post-title { font-size: 2.2rem; }

  .feed-title { font-size: 1.75rem; }

  .header-wrap { flex-direction: column; align-items: flex-start; gap: 0.4rem; }

  .site-nav { margin-left: 0; }

  .site-nav a { margin-left: 0; margin-right: 1.25rem; }
}
