/* The Metropolis Reader. Black masthead, white page, bordered cards:
   the same plain blog look the site has always had. */

@font-face {
  font-family: "Roboto";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/roboto-700.woff2") format("woff2");
}

:root {
  --ink: #000;
  --soft: rgba(0, 0, 0, 0.8);
  --line: rgba(0, 0, 0, 0.2);
  --accent: #237374;
  --page: 940px;
  --body: Helvetica, "Helvetica Neue", Arial, sans-serif;
  --display: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 16px/1.5 var(--body);
}

img, video { max-width: 100%; }
a { color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- masthead ---------- */

.masthead {
  background: #000;
  text-align: center;
  padding: 5px 16px 8px;
  line-height: 0;
}
.masthead img { width: 600px; height: auto; }

/* ---------- page frame + section nav ---------- */

.wrap {
  max-width: calc(var(--page) + 40px);
  margin: 0 auto;
  padding: 0 20px;
}

.sections {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 34px;
  margin: 56px 0 30px;
}
.sections ul {
  display: flex; flex-wrap: wrap; gap: 6px 30px;
  list-style: none; margin: 0; padding: 0;
  flex: 1;
}
.sections a { text-decoration: none; font-size: 16px; }
.sections a:hover, .sections a[aria-current="page"] { color: var(--accent); }

.search-toggle {
  border: 0; background: none; padding: 6px; margin: -6px; cursor: pointer; color: inherit; line-height: 0;
}
.search-toggle:hover { color: var(--accent); }
.search input {
  font: 15px var(--body); width: 220px; max-width: 46vw;
  padding: 6px 2px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: none; outline: none;
}
.search input:focus { border-bottom-color: var(--accent); }

/* ---------- cards ---------- */

.card {
  display: flex;
  border: 1px solid var(--line);
  margin-bottom: 32px;
  min-height: 352px;
}
.card-media {
  position: relative;
  flex: 0 0 50%;
  background: #0a0a0f;
  line-height: 0;
}
.card-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.play {
  position: absolute; left: 50%; top: 50%; width: 54px; height: 38px; margin: -19px 0 0 -27px;
  background: rgba(20, 20, 20, 0.82); border-radius: 9px;
}
.play::after {
  content: ""; position: absolute; left: 21px; top: 11px;
  border-style: solid; border-width: 8px 0 8px 14px; border-color: transparent transparent transparent #fff;
}
.card-body {
  flex: 1; min-width: 0;
  padding: 42px 48px 36px;
}
.card-text { min-height: 0; }
.card-text .card-body { padding-bottom: 40px; }

.byline { display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 1.35; }
.byline .author, .byline .meta { display: block; }
.dot { margin: 0 6px; }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-initial {
  display: inline-flex; align-items: center; justify-content: center;
  background: #000; color: #fff59a;
  font: 700 15px/1 var(--display);
}

.card h2 {
  font: 700 22px/1.41 var(--display);
  margin: 20px 0 10px;
  overflow-wrap: anywhere;
}
.card h2 a { text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.excerpt {
  margin: 0;
  font-size: 15px; line-height: 1.5;
  color: var(--soft);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.card-text .excerpt { -webkit-line-clamp: 4; }
.empty { color: var(--soft); padding: 40px 0 80px; }

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

.post {
  border: 1px solid var(--line);
  padding: 56px 100px 60px;
}
.byline-inline { gap: 0; font-size: 13px; }
.byline-inline .avatar { margin-right: 12px; }
.byline-inline .author { display: inline; }

.post h1 {
  font: 700 40px/1.3 var(--display);
  margin: 18px 0 24px;
  overflow-wrap: anywhere;
}
.content { font-size: 18px; line-height: 1.5; overflow-wrap: break-word; }
.content p { margin: 0 0 27px; }
.content h2, .content h3 { font-family: var(--display); font-weight: 700; line-height: 1.3; margin: 40px 0 14px; }
.content h2 { font-size: 28px; }
.content h3 { font-size: 22px; }
.content a { color: var(--accent); }
.content ul, .content ol { margin: 0 0 27px; padding-left: 1.4em; }
.content li { margin-bottom: 6px; }
.content blockquote { margin: 0 0 27px; padding-left: 20px; border-left: 3px solid var(--ink); }
.content code { font: 0.86em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f3f3f3; padding: 1px 5px; }
.content pre { margin: 0 0 27px; padding: 16px 18px; background: #f3f3f3; overflow-x: auto; }
.content pre code { background: none; padding: 0; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.content figure { margin: 0 0 27px; line-height: 0; }
.content figure img, .content figure video { display: block; width: 100%; height: auto; }
.content figure img + img, .content figure a + a, .content figure br + * { margin-top: 12px; }
.content figure br { display: none; }
.content figure a { display: block; }
.content video { background: #000; }
.embed { position: relative; aspect-ratio: 16 / 9; margin: 0 0 27px; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.content > :last-child { margin-bottom: 0; }

.share {
  display: flex; align-items: center; gap: 26px;
  margin-top: 30px; padding: 18px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.share a, .share button {
  color: inherit; line-height: 0; border: 0; background: none; padding: 4px; margin: -4px; cursor: pointer; position: relative;
}
.share a:hover, .share button:hover { color: var(--accent); }
.copy-link.copied::after {
  content: "Link copied"; position: absolute; left: 30px; top: 50%; transform: translateY(-50%);
  font: 12px/1 var(--body); white-space: nowrap; color: var(--soft);
}

/* ---------- pager, search results, footer ---------- */

.pager {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  margin: 28px 0 0; font-size: 15px;
}
.pager a { text-decoration: none; max-width: 46%; }
.pager a:hover { color: var(--accent); }
.pager a[rel="prev"], .pager a:last-child { text-align: right; }
.pager .count { color: var(--soft); font-size: 13px; }

#search-results .hit { display: block; text-decoration: none; padding: 18px 0; border-bottom: 1px solid var(--line); }
#search-results .hit:first-child { border-top: 1px solid var(--line); }
#search-results .hit strong { font: 700 18px/1.4 var(--display); display: block; }
#search-results .hit:hover strong { color: var(--accent); }
#search-results .hit span { font-size: 12px; display: block; margin-bottom: 2px; }
#search-results .hit p { margin: 4px 0 0; font-size: 15px; color: var(--soft); }
#search-results .none { color: var(--soft); padding: 18px 0; }

.notfound { padding: 30px 0 60px; }
.notfound h1 { font: 700 40px/1.3 var(--display); margin: 0 0 10px; }
.notfound a { color: var(--accent); }

.site-footer {
  display: flex; justify-content: center; align-items: center; gap: 22px;
  padding: 64px 20px 72px;
}
.site-footer a { line-height: 0; }
.site-footer a:hover { color: var(--accent); }

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

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .post { padding: 40px 48px 44px; }
}

@media (max-width: 700px) {
  .masthead img { width: min(600px, 100%); }
  .sections { margin: 28px 0 22px; }
  .sections ul { gap: 6px 22px; }
  .card { display: block; min-height: 0; margin-bottom: 24px; }
  .card-media { display: block; aspect-ratio: 4 / 3; }
  .card-body { padding: 24px 22px 28px; }
  .card h2 { margin-top: 16px; }
  .wrap { padding: 0 14px; }
  .post { padding: 26px 20px 30px; }
  .post h1 { font-size: 30px; margin: 14px 0 18px; }
  .content { font-size: 17px; }
  .content p, .content ul, .content ol, .content figure, .embed { margin-bottom: 22px; }
  .pager { font-size: 14px; }
  .site-footer { padding: 44px 20px 52px; }
}

@media (prefers-reduced-motion: no-preference) {
  .card h2 a, .sections a, .pager a { transition: color 0.15s; }
}
