/* Article layout, post content and Ghost editor (Koenig) cards. */

.article { padding-top: clamp(3.5rem, 12vh, 7rem); }

.article-head,
.gh-content > *,
.article-foot,
.subscribe {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.article-title {
  margin-top: 1rem;
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.article-subtitle {
  margin-top: 1.1rem;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.45;
  color: var(--muted);
}

.article-image { margin: clamp(2rem, 6vh, 3.5rem) auto 0; }

.article-image img {
  display: block;
  width: 100%;
  border-radius: 6px;
}

/* Some posts repeat their title as a leading h1 in the body; the template
   already renders it. */
.gh-content > h1:first-child { display: none; }

/* Body copy. */
.gh-content {
  margin-top: clamp(2.5rem, 7vh, 4rem);
  font-size: 1.15rem;
  line-height: 1.72;
}

.gh-content > * + * { margin-top: 1.5em; }

.gh-content > h2,
.gh-content > h3,
.gh-content > h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.gh-content > h2 { margin-top: 2.6em; font-size: 1.75rem; }
.gh-content > h3 { margin-top: 2.2em; font-size: 1.35rem; }
.gh-content > h4 { margin-top: 2em; font-size: 1.1rem; }
.gh-content > h2 + *, .gh-content > h3 + *, .gh-content > h4 + * { margin-top: 0.75em; }

.gh-content a {
  color: var(--signal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.gh-content a:hover { text-decoration-thickness: 2px; }
.gh-content strong { font-weight: 650; }

.gh-content ul,
.gh-content ol { padding-left: 1.3em; }
.gh-content li + li { margin-top: 0.5em; }
.gh-content li::marker { color: var(--signal); }

.gh-content blockquote:not([class]) {
  padding-left: 1.25rem;
  border-left: 3px solid var(--signal);
  font-size: 1.25rem;
  line-height: 1.5;
}

.gh-content blockquote.kg-blockquote-alt {
  text-align: center;
  font-size: 1.6rem;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.015em;
  padding: 0 1rem;
}

.gh-content hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 3em auto;
}

.gh-content code {
  font-family: var(--display);
  font-size: 0.85em;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--rule);
}

.gh-content pre {
  overflow-x: auto;
  padding: 1.2rem 1.4rem;
  border-radius: 6px;
  background: #0d0f14;
  color: #e4e6f3;
  font-family: var(--display);
  font-size: 0.88rem;
  line-height: 1.6;
}

.gh-content pre code { padding: 0; border: 0; background: none; font-size: inherit; }

.gh-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.gh-content th, .gh-content td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.gh-content th { font-family: var(--display); font-size: 0.8rem; font-weight: 500; color: var(--muted); }

.gh-content figcaption,
.article-image figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.gh-content img { max-width: 100%; height: auto; border-radius: 6px; }

/* Koenig card widths. */
.gh-content > .kg-width-wide,
.article-image.kg-width-wide { max-width: var(--wide); }

.gh-content > .kg-width-full {
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.kg-width-full img { border-radius: 0; width: 100%; }

.kg-image-card img { display: block; margin: 0 auto; }

.kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; }
.kg-gallery-row { display: flex; gap: 0.75rem; }
.kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

.kg-bookmark-card a.kg-bookmark-container {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

.kg-bookmark-card a.kg-bookmark-container:hover { border-color: var(--signal); }
.kg-bookmark-content { flex: 1; padding: 1.1rem 1.25rem; min-width: 0; }
.kg-bookmark-title { font-weight: 600; line-height: 1.3; }

.kg-bookmark-description {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-family: var(--display);
  font-size: 0.75rem;
  color: var(--muted);
}

.kg-bookmark-icon { width: 18px; height: 18px; border-radius: 3px; }
.kg-bookmark-thumbnail { position: relative; flex: 0 0 32%; min-height: 100%; }

.kg-bookmark-thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.kg-callout-card {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--rule);
  font-size: 1.05rem;
}

.kg-callout-card-accent { background: var(--signal); color: #fff; border-color: var(--signal); }

.kg-button-card { display: flex; justify-content: center; }

.kg-button-card a.kg-btn,
.kg-btn {
  display: inline-block;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  background: var(--signal);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.kg-embed-card { display: flex; justify-content: center; }
.kg-video-card video, .kg-embed-card iframe { max-width: 100%; border-radius: 6px; }

.kg-toggle-card {
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
}

.kg-toggle-heading-text { font-weight: 600; }

/* Footer of a post and the newsletter box. */
.article-foot {
  margin-top: clamp(3rem, 8vh, 5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.article-foot .lead-cta { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; }

.chips a {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
}

.chips a:hover { border-color: var(--signal); color: var(--signal); }

.subscribe {
  margin-top: clamp(3rem, 8vh, 5rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.subscribe-title { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.015em; }
.subscribe-copy { margin-top: 0.4rem; color: var(--muted); }

.subscribe-form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }

.subscribe-form input {
  flex: 1 1 14rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font: inherit;
  background: var(--ink);
  color: var(--text);
}

.subscribe-form button {
  padding: 0.75rem 1.3rem;
  border: 0;
  border-radius: 999px;
  background: var(--signal);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.subscribe-ok, .subscribe-err { display: none; flex-basis: 100%; font-size: 0.9rem; }
.subscribe-form.success .subscribe-ok { display: block; color: var(--signal); }
.subscribe-form.error .subscribe-err { display: block; color: #c02a2a; }
.subscribe-form.loading button { opacity: 0.6; }
