/* ==========================================================================
   IntroVerify blog theme.

   Same design system as the app (introverify/app/app/static/style.css): the
   tokens, the Libre Franklin face, and the theme switch are ported from
   there so the two properties look like one company. Layout classes here are
   blog-specific and named iv-blog-*.

   No CSS framework. Templates use these classes directly.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Libre Franklin, self-hosted. One variable-weight file per script subset,
   fetched only when the page uses a character in its range. Same files the
   app ships.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/libre-franklin-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/libre-franklin-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/libre-franklin-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169,
    U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323,
    U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/libre-franklin-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/libre-franklin-cyrillic-ext.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F,
    U+FE2E-FE2F;
}

/* ==========================================================================
   Tokens

   Three theme states, matching the app: no data-theme attribute follows the
   OS setting, data-theme="light"/"dark" is an explicit choice. Every color
   is defined on bare :root first, so nothing depends on a media query or an
   attribute being present.
   ========================================================================== */

:root {
  --iv-paper: #fffcf5;
  --iv-panel: #f4f0e6;
  --iv-ink: #4a4239;
  --iv-ink-muted: #6f6853;
  --iv-ink-faint: #8a8168;
  --iv-ink-faintest: #a09677;
  --iv-border: #e6dfcc;
  --iv-border-input: #d4c4b0;

  --iv-accent: #ce9615;
  --iv-accent-tint-055: rgba(206, 150, 21, 0.055);
  --iv-accent-tint-09: rgba(206, 150, 21, 0.09);
  --iv-accent-tint-15: rgba(206, 150, 21, 0.15);
  --iv-accent-tint-20: rgba(206, 150, 21, 0.2);
  /* Accent as text: darkened for contrast on paper. Body links use this. */
  --iv-accent-text-strong: #8a6a1f;

  --iv-font-sans: "Libre Franklin", system-ui, -apple-system, sans-serif;
  --iv-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --iv-radius-sm: 3px;
  --iv-radius-md: 4px;
  --iv-radius-lg: 6px;
  --iv-radius-pill: 999px;

  /* Reading column. The design handoff sets this at 680px. */
  --iv-measure: 680px;

  /* Code highlighting, warm-palette Prism overrides. */
  --iv-code-comment: #9a9077;
  --iv-code-punct: #6f6853;
  --iv-code-string: #4f7a3f;
  --iv-code-keyword: #9a5f9c;
  --iv-code-number: #b06a2c;
  --iv-code-func: #3b6fa8;
  --iv-code-var: #b04a4a;
}

:root[data-theme="dark"] {
  --iv-paper: #211a10;
  --iv-panel: #2c2418;
  --iv-ink: #ede4d2;
  --iv-ink-muted: #b8ac95;
  --iv-ink-faint: #a89a7f;
  --iv-ink-faintest: #7d715a;
  --iv-border: #3d3222;
  --iv-border-input: #4a3d2c;

  --iv-accent: #e0ac3d;
  --iv-accent-tint-055: rgba(224, 172, 61, 0.08);
  --iv-accent-tint-09: rgba(224, 172, 61, 0.12);
  --iv-accent-tint-15: rgba(224, 172, 61, 0.18);
  --iv-accent-tint-20: rgba(224, 172, 61, 0.28);
  --iv-accent-text-strong: #f0c877;

  --iv-code-comment: #7d715a;
  --iv-code-punct: #b8ac95;
  --iv-code-string: #9ec97f;
  --iv-code-keyword: #d3a0e0;
  --iv-code-number: #f0a868;
  --iv-code-func: #86b6ea;
  --iv-code-var: #ef8f8f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --iv-paper: #211a10;
    --iv-panel: #2c2418;
    --iv-ink: #ede4d2;
    --iv-ink-muted: #b8ac95;
    --iv-ink-faint: #a89a7f;
    --iv-ink-faintest: #7d715a;
    --iv-border: #3d3222;
    --iv-border-input: #4a3d2c;

    --iv-accent: #e0ac3d;
    --iv-accent-tint-055: rgba(224, 172, 61, 0.08);
    --iv-accent-tint-09: rgba(224, 172, 61, 0.12);
    --iv-accent-tint-15: rgba(224, 172, 61, 0.18);
    --iv-accent-tint-20: rgba(224, 172, 61, 0.28);
    --iv-accent-text-strong: #f0c877;

    --iv-code-comment: #7d715a;
    --iv-code-punct: #b8ac95;
    --iv-code-string: #9ec97f;
    --iv-code-keyword: #d3a0e0;
    --iv-code-number: #f0a868;
    --iv-code-func: #86b6ea;
    --iv-code-var: #ef8f8f;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--iv-paper);
  color: var(--iv-ink);
  font-family: var(--iv-font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--iv-accent-text-strong);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

button {
  font-family: inherit;
}

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

.iv-measure {
  max-width: var(--iv-measure);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.iv-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   Masthead

   Deliberately lighter than the app's nav: the blog ships separately and
   carries one link back to the product.
   ========================================================================== */

.iv-masthead {
  border-bottom: 1px solid var(--iv-border);
}

.iv-masthead-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  padding-bottom: 20px;
}

/* Wordmark and "Blog" read as one lockup, so they get their own tighter gap
   than the masthead's. Baseline, not center: both are 18px text. */
.iv-masthead-brand {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.iv-wordmark {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.5px;
  color: var(--iv-ink);
}
.iv-wordmark:hover {
  text-decoration: none;
}
.iv-wordmark-accent {
  color: var(--iv-accent);
}

/* Same size as the wordmark it sits beside. Weight and color keep it
   secondary. */
.iv-masthead-label {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--iv-ink-faint);
}

.iv-masthead-spacer {
  flex: 1;
}

.iv-masthead-link {
  font-size: 13px;
  color: var(--iv-ink-muted);
}

/* ==========================================================================
   Theme toggle: sliding switch

   Ported from the app. A pill track with a knob that slides between a sun
   (light, knob left) and a moon (dark, knob right), crossfading as it goes.
   theme.js only flips data-theme and keeps aria-checked in sync.
   ========================================================================== */

.iv-theme-switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.iv-theme-switch-track {
  position: absolute;
  inset: 0;
  border-radius: var(--iv-radius-pill);
  background: var(--iv-border-input);
  border: 1px solid var(--iv-border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.iv-theme-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--iv-paper);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.2s ease;
}

.iv-theme-switch-knob svg {
  display: block;
}

.iv-theme-switch-knob .iv-icon-sun,
.iv-theme-switch-knob .iv-icon-moon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--iv-ink);
  transition: opacity 0.15s ease, transform 0.25s ease;
}

.iv-theme-switch-knob .iv-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.iv-theme-switch-knob .iv-icon-moon {
  opacity: 0;
  transform: scale(0.5) rotate(-45deg);
}

/* Three cases, because "no stored preference" is a real state: light
   (default), dark by OS setting, and dark by explicit choice. */
:root[data-theme="dark"] .iv-theme-switch-knob {
  transform: translateX(20px);
}
:root[data-theme="dark"] .iv-theme-switch-knob .iv-icon-sun {
  opacity: 0;
  transform: scale(0.5) rotate(45deg);
}
:root[data-theme="dark"] .iv-theme-switch-knob .iv-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .iv-theme-switch-knob {
    transform: translateX(20px);
  }
  :root:not([data-theme="light"]) .iv-theme-switch-knob .iv-icon-sun {
    opacity: 0;
    transform: scale(0.5) rotate(45deg);
  }
  :root:not([data-theme="light"]) .iv-theme-switch-knob .iv-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .iv-theme-switch-knob,
  .iv-theme-switch-knob .iv-icon-sun,
  .iv-theme-switch-knob .iv-icon-moon,
  .iv-theme-switch-track {
    transition: none;
  }
}

/* ==========================================================================
   Page shell
   ========================================================================== */

.iv-main {
  flex: 1;
  padding-top: 48px;
  padding-bottom: 80px;
}

.iv-lede {
  font-size: 15px;
  line-height: 1.6;
  color: var(--iv-ink-muted);
  margin: 0 0 44px;
}

.iv-page-title {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--iv-ink);
  margin: 0 0 20px;
}

/* ==========================================================================
   Archive list (index, tag pages)

   A stack of rules rather than cards. Each entry owns its top border; the
   list owns the closing one, so a single-entry page still reads as a list.
   ========================================================================== */

.iv-archive {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--iv-border);
}

.iv-archive-item {
  padding: 32px 0;
  border-top: 1px solid var(--iv-border);
}

.iv-archive-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: var(--iv-radius-md);
  margin-bottom: 20px;
  background: var(--iv-panel);
}

.iv-archive-date {
  font-size: 12px;
  color: var(--iv-ink-faintest);
  margin-bottom: 6px;
}

.iv-archive-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px;
}
.iv-archive-title a {
  color: var(--iv-ink);
}

.iv-archive-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--iv-ink-muted);
  margin: 0 0 18px;
}

.iv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.iv-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--iv-accent-text-strong);
  background: var(--iv-accent-tint-09);
  border: 1px solid var(--iv-accent-tint-20);
  border-radius: var(--iv-radius-pill);
  padding: 3px 10px;
}
.iv-tag:hover {
  background: var(--iv-accent-tint-15);
  text-decoration: none;
}

.iv-empty {
  padding: 56px 0 8px;
  border-top: 1px solid var(--iv-border);
  text-align: center;
  color: var(--iv-ink-muted);
  font-size: 14.5px;
  line-height: 1.65;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.iv-button {
  display: inline-block;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--iv-ink-muted);
  background: transparent;
  border: 1px solid var(--iv-border-input);
  border-radius: var(--iv-radius-lg);
}
.iv-button:hover {
  color: var(--iv-ink);
  border-color: var(--iv-ink-faintest);
  text-decoration: none;
}

.iv-button--primary {
  padding: 11px 20px;
  font-size: 14px;
  color: var(--iv-paper);
  background: var(--iv-accent);
  border-color: var(--iv-accent);
}
.iv-button--primary:hover {
  color: var(--iv-paper);
  filter: brightness(1.05);
}

.iv-button--disabled {
  color: var(--iv-ink-faintest);
  border-color: var(--iv-border);
  cursor: default;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.iv-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
}

.iv-pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
}

.iv-pagination-page {
  min-width: 30px;
  padding: 6px 0;
  text-align: center;
  color: var(--iv-ink-muted);
  border-bottom: 2px solid transparent;
}
.iv-pagination-page:hover {
  color: var(--iv-ink);
  text-decoration: none;
}

.iv-pagination-page.is-current {
  font-weight: 600;
  color: var(--iv-ink);
  border-bottom-color: var(--iv-accent);
}

/* ==========================================================================
   Article
   ========================================================================== */

.iv-article-meta {
  font-size: 12.5px;
  color: var(--iv-ink-faintest);
  margin-bottom: 14px;
}

.iv-article-title {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--iv-ink);
  margin: 0 0 18px;
  text-wrap: pretty;
}

.iv-article-feature {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--iv-radius-md);
  margin: 0 0 32px;
  background: var(--iv-panel);
}

/* --------------------------------------------------------------------------
   Rendered markdown. Every element a post can emit is styled here, matching
   the markdown reference in the design handoff.
   -------------------------------------------------------------------------- */

.iv-prose {
  font-size: 16px;
  line-height: 1.75;
  color: var(--iv-ink);
}

.iv-prose > *:first-child {
  margin-top: 0;
}

.iv-prose p {
  margin: 0 0 20px;
}

.iv-prose h1 {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--iv-ink);
  margin: 44px 0 16px;
}

.iv-prose h2 {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--iv-ink);
  margin: 40px 0 14px;
}

.iv-prose h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--iv-ink);
  margin: 32px 0 12px;
}

.iv-prose h4,
.iv-prose h5,
.iv-prose h6 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--iv-ink);
  margin: 28px 0 10px;
}

.iv-prose a {
  color: var(--iv-accent-text-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.iv-prose strong {
  font-weight: 600;
}

.iv-prose ul,
.iv-prose ol {
  margin: 0 0 20px;
  padding-left: 22px;
  line-height: 1.8;
}

.iv-prose li {
  margin-bottom: 4px;
}

.iv-prose li > ul,
.iv-prose li > ol {
  margin: 4px 0 0;
}

/* A blockquote holding only a list renders as the design's callout panel;
   a blockquote of prose renders as a pull quote. */
.iv-prose blockquote {
  margin: 0 0 24px;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--iv-accent);
  font-size: 18px;
  line-height: 1.6;
  color: var(--iv-ink-muted);
}

.iv-prose blockquote p:last-child {
  margin-bottom: 0;
}

.iv-prose blockquote:has(> ul:only-child),
.iv-prose blockquote:has(> ol:only-child) {
  padding: 22px 26px;
  border-left: none;
  border: 1px solid var(--iv-border);
  border-radius: var(--iv-radius-md);
  background: var(--iv-panel);
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--iv-ink);
}

.iv-prose blockquote > ul:only-child,
.iv-prose blockquote > ol:only-child {
  margin: 0;
  padding-left: 20px;
}

.iv-prose code {
  font-family: var(--iv-font-mono);
  font-size: 14px;
  background: var(--iv-panel);
  border: 1px solid var(--iv-border);
  border-radius: var(--iv-radius-sm);
  padding: 1px 5px;
}

.iv-prose pre {
  margin: 0 0 24px;
  padding: 16px 18px;
  font-family: var(--iv-font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--iv-ink);
  background: var(--iv-panel);
  border: 1px solid var(--iv-border);
  border-radius: var(--iv-radius-md);
  overflow-x: auto;
}

.iv-prose pre code {
  font-size: inherit;
  background: transparent;
  border: none;
  padding: 0;
}

.iv-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 0 0 24px;
}

.iv-prose th {
  text-align: left;
  font-weight: 600;
  color: var(--iv-ink);
  padding: 9px 12px 9px 0;
  border-bottom: 1.5px solid var(--iv-border);
}

.iv-prose td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--iv-border);
  color: var(--iv-ink-muted);
}

.iv-prose th:last-child,
.iv-prose td:last-child {
  padding-right: 0;
}

/* A wide table needs somewhere to scroll. Templates can wrap one in
   .iv-scroll; a bare table still wraps its cells rather than overflowing. */
.iv-scroll {
  overflow-x: auto;
  margin: 0 0 24px;
}
.iv-scroll > table {
  margin: 0;
}

.iv-prose hr {
  border: none;
  border-top: 1px solid var(--iv-border);
  margin: 32px 0;
}

.iv-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--iv-radius-md);
  margin: 24px 0;
}

.iv-prose iframe,
.iv-prose video {
  display: block;
  max-width: 100%;
  margin: 28px 0;
  border: none;
  border-radius: var(--iv-radius-md);
}

/* An image on its own line becomes a figure, with its alt text as the
   caption. See _images_to_figures in builder.py. */
.iv-prose figure {
  margin: 24px 0;
}

.iv-prose figure img {
  margin: 0;
}

.iv-prose figcaption {
  font-size: 12.5px;
  color: var(--iv-ink-faintest);
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Product mention at the end of a post. Kept modest on purpose.
   -------------------------------------------------------------------------- */

.iv-cta {
  border-top: 1px solid var(--iv-border);
  margin-top: 44px;
  padding-top: 28px;
}

.iv-cta h2 {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--iv-ink);
  margin: 0 0 12px;
}

.iv-cta p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--iv-ink-muted);
  margin: 0 0 16px;
}

/* ==========================================================================
   Next / previous post

   Full-bleed pair below the article. With a feature image the card gets the
   photo plus a dark scrim; without one it falls back to the panel color and
   ink text, so the two cases never sit side by side looking broken.
   ========================================================================== */

.iv-postnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2px;
  background: var(--iv-border);
  border-top: 1px solid var(--iv-border);
}

.iv-postnav-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 280px;
  overflow: hidden;
  background: var(--iv-panel);
}

.iv-postnav-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.iv-postnav-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(20, 15, 8, 0.78) 0%,
    rgba(20, 15, 8, 0.62) 55%,
    rgba(20, 15, 8, 0.3) 100%
  );
}

.iv-postnav-body {
  position: relative;
  padding: 40px 44px;
  max-width: 460px;
}

.iv-postnav-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--iv-ink-faint);
  margin-bottom: 10px;
}

.iv-postnav-title {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 10px;
  text-wrap: pretty;
}
.iv-postnav-title a {
  color: var(--iv-ink);
}

.iv-postnav-blurb {
  font-size: 14px;
  line-height: 1.6;
  color: var(--iv-ink-muted);
  margin: 0;
}

/* Over a photo, the scrim is always dark, so the text is always light. */
.iv-postnav-item.has-image .iv-postnav-label {
  color: rgba(255, 252, 245, 0.72);
}
.iv-postnav-item.has-image .iv-postnav-title a {
  color: #fffcf5;
}
.iv-postnav-item.has-image .iv-postnav-blurb {
  color: rgba(255, 252, 245, 0.8);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.iv-footer {
  border-top: 1px solid var(--iv-border);
  padding: 36px 0 40px;
  font-size: 13.5px;
  color: var(--iv-ink-faint);
}

.iv-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.iv-footer a {
  color: var(--iv-ink-faint);
}

.iv-footer-spacer {
  flex: 1;
}

.iv-footer-rss {
  display: flex;
  align-items: center;
  gap: 5px;
}

.iv-footer-legal {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--iv-ink-faintest);
}

/* ==========================================================================
   Prism, retinted to the warm palette. Prism's own stylesheet is not loaded;
   these rules stand alone and inherit the .iv-prose pre/code box.
   ========================================================================== */

.iv-prose .token.comment,
.iv-prose .token.prolog,
.iv-prose .token.doctype,
.iv-prose .token.cdata {
  color: var(--iv-code-comment);
  font-style: italic;
}

.iv-prose .token.punctuation {
  color: var(--iv-code-punct);
}

.iv-prose .token.property,
.iv-prose .token.tag,
.iv-prose .token.boolean,
.iv-prose .token.number,
.iv-prose .token.constant,
.iv-prose .token.symbol,
.iv-prose .token.deleted {
  color: var(--iv-code-number);
}

.iv-prose .token.selector,
.iv-prose .token.attr-name,
.iv-prose .token.string,
.iv-prose .token.char,
.iv-prose .token.builtin,
.iv-prose .token.inserted {
  color: var(--iv-code-string);
}

.iv-prose .token.operator,
.iv-prose .token.entity,
.iv-prose .token.url {
  color: var(--iv-code-func);
}

.iv-prose .token.atrule,
.iv-prose .token.attr-value,
.iv-prose .token.keyword {
  color: var(--iv-code-keyword);
}

.iv-prose .token.function,
.iv-prose .token.class-name {
  color: var(--iv-code-func);
}

.iv-prose .token.regex,
.iv-prose .token.important,
.iv-prose .token.variable {
  color: var(--iv-code-var);
}

/* ==========================================================================
   Embeds a post can drop into markdown as raw HTML
   ========================================================================== */

.github-card {
  border: 1px solid var(--iv-border);
  border-radius: var(--iv-radius-md);
  padding: 1.2rem 1.5rem;
  margin: 24px 0;
  background: var(--iv-panel);
}

.github-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.github-icon {
  width: 20px;
  height: 20px;
  color: var(--iv-ink-faint);
  flex-shrink: 0;
}

.github-repo-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--iv-accent-text-strong);
}

.github-description {
  font-size: 0.85rem;
  color: var(--iv-ink-muted);
  margin: 0 0 0.8rem;
  line-height: 1.5;
}

.github-stats {
  display: flex;
  gap: 1.2rem;
  font-size: 0.8rem;
  color: var(--iv-ink-faint);
}

.mp3-player {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--iv-panel);
  border: 1px solid var(--iv-border);
  border-radius: var(--iv-radius-md);
  padding: 0.8rem 1.2rem;
  margin: 24px 0;
}

.mp3-play-btn {
  background: var(--iv-ink);
  color: var(--iv-paper);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mp3-play-btn:hover {
  background: var(--iv-ink-muted);
}

.mp3-progress-wrap {
  flex: 1;
  height: 6px;
  background: var(--iv-border);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.mp3-progress-bar {
  height: 100%;
  width: 0;
  background: var(--iv-accent);
  border-radius: 3px;
  pointer-events: none;
}

.mp3-time {
  font-size: 0.75rem;
  color: var(--iv-ink-faint);
  flex-shrink: 0;
  min-width: 3rem;
  text-align: right;
}

/* ==========================================================================
   Narrow screens
   ========================================================================== */

@media (max-width: 640px) {
  .iv-main {
    padding-top: 36px;
    padding-bottom: 56px;
  }

  .iv-article-title {
    font-size: 27px;
  }

  .iv-prose h1 {
    font-size: 27px;
  }

  .iv-prose h2 {
    font-size: 19px;
  }

  .iv-postnav-body {
    padding: 28px 24px;
  }

  .iv-postnav-item {
    min-height: 220px;
  }

  .iv-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .iv-footer-spacer {
    flex-basis: 100%;
  }
}
