/* Article, News and 404 pages (generated by build_pages.py). Loaded after
   style.css, which provides the variables, cards, links and footer. */

/* ---------------------------------------------------------------- header
   Small lockup (leaf + FRAGMINT, linking home) and the section nav. */

.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem 6vw;
  border-bottom: 1px solid var(--line);
}

.site-head__home {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.site-head__home img {
  display: block;
  width: auto;
  height: 2.1rem;
}

.site-head__wordmark {
  display: block;
  width: 7.5rem;
  aspect-ratio: 482 / 72;
  background: var(--ink);
  -webkit-mask: url("/wordmark.svg") center / contain no-repeat;
  mask: url("/wordmark.svg") center / contain no-repeat;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sub);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current] {
  color: var(--mint);
  border-bottom-color: var(--mint);
}

/* ---------------------------------------------------------------- article */

.page__main {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) 6vw 0;
}

.post__head,
.post__body,
.post__nav,
.post__back {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.post__section,
.post__meta,
.post__tags li {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.post__section {
  margin: 0 0 1rem;
}

.post__section a {
  color: var(--mint);
  text-decoration: none;
}

.post__section a:hover {
  text-decoration: underline;
}

.post__title {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0 0 0.9rem;
  color: var(--muted);
}

.post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post__tags li {
  padding: 0.3em 0.7em;
  border: 1px solid var(--line);
  font-size: 0.68rem;
  color: var(--sub);
}

.post__feature {
  max-width: 56rem;
  margin: 2.5rem auto 0;
  background: #1a1a1d;
}

.post__feature img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 34rem;
  object-fit: cover;
}

/* Transparent logos: whole logo, on the panel. */
.post__feature--logo img {
  max-height: 22rem;
  padding: 2.5rem;
  object-fit: contain;
}

/* ---------------------------------------------------------------- body */

/* No body content may widen the page on a phone: long unbroken strings (the
   BOLT pool ID, URLs) wrap anywhere, media never exceeds the column, and
   tables / code scroll inside their own box. */
.post__body {
  margin-top: 2.75rem;
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--sub);
  overflow-wrap: anywhere;
}

.post__body img,
.post__body video,
.post__body iframe,
.post__body svg,
.post__body figure {
  max-width: 100%;
}

.post__body video {
  height: auto;
}

.post__head,
.post__nav a {
  overflow-wrap: anywhere;
}

.post__body table,
.post__body pre {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.post__body pre {
  overflow-wrap: normal;
}

.post__body > :first-child {
  margin-top: 0;
}

.post__body p,
.post__body ul,
.post__body ol {
  margin: 0 0 1.2em;
}

.post__body ul,
.post__body ol {
  padding-left: 1.3em;
}

.post__body li {
  margin-bottom: 0.4em;
}

.post__body li::marker {
  color: var(--mint);
}

.post__body h2,
.post__body h3,
.post__body h4 {
  margin: 2em 0 0.6em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.post__body h2 {
  font-size: 1.75rem;
}

.post__body h3 {
  font-size: 1.35rem;
}

.post__body h4 {
  font-size: 1.15rem;
}

.post__body strong,
.post__body b {
  font-weight: 600;
  color: var(--ink);
}

.post__body a[href] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--mint);
  text-underline-offset: 0.25em;
}

.post__body a[href]:hover {
  color: var(--mint);
}

.post__body hr {
  margin: 2.25em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.post__body blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.25em;
  border-left: 2px solid var(--mint);
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--ink);
}

.post__body figure {
  margin: 2.25em 0;
}

.post__body img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  background: #1a1a1d;
}

/* Transparent logos in a body (build_pages.py marks them): whole, on the panel. */
.post__body img.post__logo {
  max-height: 22rem;
  padding: 2.5rem;
}

/* Keeps the live "Photo by ... / Unsplash" credits (the links have no href). */
.post__body figcaption {
  margin-top: 0.7em;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------------------------------------------------------------- prev / next */

.post__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 3.5rem;
  background: var(--line);
  border: 1px solid var(--line);
}

.post__nav a {
  display: block;
  padding: 1.1rem 1.25rem 1.25rem;
  background: var(--bg);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
}

.post__nav a:hover,
.post__nav a:focus-visible {
  color: var(--mint);
}

.post__nav span {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mint);
}

.post__next {
  grid-column: 2;
  text-align: right;
}

@media (max-width: 600px) {
  .post__nav {
    grid-template-columns: 1fr;
  }

  .post__next {
    grid-column: 1;
  }
}

.post__back {
  margin-top: 2rem;
}

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

.listing {
  max-width: 56rem;
  margin: 0 auto;
}

.listing__cards {
  margin-top: 2rem;
}

.listing__cards .post__meta {
  margin-bottom: 0.6rem;
}

.listing__cards .card__name a {
  color: var(--ink);
  text-decoration: none;
}

.listing__cards .card__name a:hover {
  color: var(--mint);
}

.listing__lead {
  margin: 0 0 1.5rem;
  font-size: 1.2rem;
  color: var(--sub);
}

@media (prefers-reduced-motion: reduce) {
  .site-nav a {
    transition: none;
  }
}
