/*
 * Side Quest for Ghost, by Peachfin Themes (https://peachfinthemes.com/).
 * A chronological quest log, set like a photocopied zine: one margin column
 * for dates, one violet rail, one text column.
 *
 * Fonts: DM Sans and Fira Code, bundled in assets/fonts and licensed under the
 * SIL Open Font License 1.1 (OFL.txt beside each font). No font service and
 * no remote font request. DM Sans ships as 400 and 700, upright and italic;
 * Fira Code is one variable file, 300 to 700. Each family is split into a
 * common-characters file (-c) and a rest file (-x); browsers download a file
 * only when a page uses one of its characters.
 */


@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dm-sans/DMSans-Regular-x.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+000D, U+0100-0107, U+010A-011B, U+011E-0123, U+0126-0133, U+0136-0137, U+0139-0148, U+014A-015B, U+015E-0165, U+0168-017E, U+018F, U+0192, U+01FC-01FD, U+0218-021B, U+0237, U+0259, U+02C6-02C7, U+02D8-02DD, U+0301-0304, U+0306-0308, U+030A-030C, U+0312, U+0326-0328, U+03C0, U+1E80-1E85, U+1E9E, U+1EBC-1EBD, U+1EF2-1EF3, U+1EF8-1EF9, U+201E, U+2020-2022, U+2030, U+2039, U+2044, U+2074, U+20A8, U+20AC, U+20B9-20BA, U+20BD, U+2113, U+2122, U+2126, U+212E, U+2191, U+2193-2199, U+2202, U+2206, U+220F, U+2211-2212, U+2215, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+FB01-FB02;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dm-sans/DMSans-Regular-c.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00AC, U+00AE-00FF, U+0300, U+2013-2014, U+2018-201A, U+201C-201D, U+2026, U+203A, U+2190, U+2192;
}

@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dm-sans/DMSans-Italic-x.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+000D, U+0100-0107, U+010A-011B, U+011E-0123, U+0126-0133, U+0136-0137, U+0139-0148, U+014A-015B, U+015E-0165, U+0168-017E, U+018F, U+0192, U+01FC-01FD, U+0218-021B, U+0237, U+0259, U+02C6-02C7, U+02D8-02DD, U+0301-0304, U+0306-0308, U+030A-030C, U+0312, U+0326-0328, U+03C0, U+1E80-1E85, U+1E9E, U+1EBC-1EBD, U+1EF2-1EF3, U+1EF8-1EF9, U+201E, U+2020-2022, U+2030, U+2039, U+2044, U+2074, U+20A8, U+20AC, U+20B9-20BA, U+20BD, U+2113, U+2122, U+2126, U+212E, U+2191, U+2193-2199, U+2202, U+2206, U+220F, U+2211-2212, U+2215, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+FB01-FB02;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dm-sans/DMSans-Italic-c.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00AC, U+00AE-00FF, U+0300, U+2013-2014, U+2018-201A, U+201C-201D, U+2026, U+203A, U+2190, U+2192;
}

@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dm-sans/DMSans-Bold-x.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+000D, U+0100-0107, U+010A-011B, U+011E-0123, U+0126-0133, U+0136-0137, U+0139-0148, U+014A-015B, U+015E-0165, U+0168-017E, U+018F, U+0192, U+01FC-01FD, U+0218-021B, U+0237, U+0259, U+02C6-02C7, U+02D8-02DD, U+0301-0304, U+0306-0308, U+030A-030C, U+0312, U+0326-0328, U+03C0, U+1E80-1E85, U+1E9E, U+1EBC-1EBD, U+1EF2-1EF3, U+1EF8-1EF9, U+201E, U+2020-2022, U+2030, U+2039, U+2044, U+2074, U+20A8, U+20AC, U+20B9-20BA, U+20BD, U+2113, U+2122, U+2126, U+212E, U+2191, U+2193-2199, U+2202, U+2206, U+220F, U+2211-2212, U+2215, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+FB01-FB02;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dm-sans/DMSans-Bold-c.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00AC, U+00AE-00FF, U+0300, U+2013-2014, U+2018-201A, U+201C-201D, U+2026, U+203A, U+2190, U+2192;
}

@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dm-sans/DMSans-BoldItalic-x.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+000D, U+0100-0107, U+010A-011B, U+011E-0123, U+0126-0133, U+0136-0137, U+0139-0148, U+014A-015B, U+015E-0165, U+0168-017E, U+018F, U+0192, U+01FC-01FD, U+0218-021B, U+0237, U+0259, U+02C6-02C7, U+02D8-02DD, U+0301-0304, U+0306-0308, U+030A-030C, U+0312, U+0326-0328, U+03C0, U+1E80-1E85, U+1E9E, U+1EBC-1EBD, U+1EF2-1EF3, U+1EF8-1EF9, U+201E, U+2020-2022, U+2030, U+2039, U+2044, U+2074, U+20A8, U+20AC, U+20B9-20BA, U+20BD, U+2113, U+2122, U+2126, U+212E, U+2191, U+2193-2199, U+2202, U+2206, U+220F, U+2211-2212, U+2215, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+FB01-FB02;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dm-sans/DMSans-BoldItalic-c.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00AC, U+00AE-00FF, U+0300, U+2013-2014, U+2018-201A, U+201C-201D, U+2026, U+203A, U+2190, U+2192;
}

@font-face {
  font-family: 'Fira Code';
  src: url('../fonts/fira-code/FiraCode-VariableFont_wght-x.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+000D, U+0100-017E, U+0192, U+01FC-01FF, U+0218-021B, U+0237, U+02B9-02BA, U+02BC, U+02C6-02C7, U+02C9, U+02D8-02DD, U+0301-0308, U+030A-030C, U+030F, U+0313-0314, U+0326-0327, U+0335-0336, U+0342, U+0345, U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03E1, U+03F0-0479, U+048A-052F, U+1405, U+140A, U+1E80-1E85, U+1E9E, U+1EF2-1EF3, U+1F00-1F15, U+1F18-1F1D, U+1F20-1F45, U+1F48-1F4D, U+1F50-1F57, U+1F59, U+1F5B, U+1F5D, U+1F5F-1F7D, U+1F80-1FB4, U+1FB6-1FC4, U+1FC6-1FD3, U+1FD6-1FDB, U+1FDD-1FEF, U+1FF2-1FF4, U+1FF6-1FFE, U+2007-2008, U+200B, U+2012, U+2015-2017, U+201E, U+2020-2022, U+2030, U+2039, U+2044, U+204A, U+2070, U+2074-208E, U+20AC, U+20AF, U+20B9-20BA, U+20BD, U+2102, U+210D, U+2113, U+2115-2116, U+2119-211A, U+211D, U+2122, U+2124, U+212E, U+2153-215F, U+218A-218B, U+2191, U+2193-2199, U+21A9, U+21B0-21B3, U+21DE-21DF, U+21E4-21EA, U+2200, U+2202-220D, U+220F, U+2211-2212, U+2215, U+2219-221A, U+221E, U+2227-222B, U+2234-2236, U+2248, U+2260-2262, U+2264-2265, U+2282-228B, U+22A2-22AF, U+2300, U+2302-2306, U+2310, U+2318, U+2320-2321, U+2324-2328, U+232B, U+2387-2388, U+238B, U+239B-23AD, U+23CE-23CF, U+2400-2426, U+2500-25AF, U+25B2, U+25B6, U+25BA, U+25BC, U+25C0, U+25C4, U+25C6-25C7, U+25C9-25CB, U+25CE-25D3, U+25D5-25D7, U+25D9-25E5, U+25E7-25EB, U+25EF-25F7, U+2610-2612, U+2620, U+2630-2637, U+2639-263C, U+2640, U+2642, U+2660, U+2663, U+2665-2666, U+266A-266B, U+2713, U+2770-2771, U+27A1, U+27E8-27E9, U+27F0-27FF, U+2B05-2B07, U+2E3A-2E3B, U+300C-300D, U+E000-E003, U+E0A0-E0A2, U+E0B0-E0B3, U+FEFF, U+FF62-FF63, U+1D539, U+1F310;
}
@font-face {
  font-family: 'Fira Code';
  src: url('../fonts/fira-code/FiraCode-VariableFont_wght-c.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0300, U+2013-2014, U+2018-201A, U+201C-201D, U+2026, U+203A, U+2190, U+2192;
}

/* ==========================================================================
   Tokens. Switches from the theme's custom settings arrive as data-*
   attributes on <html> (see default.hbs). Lime is a marker colour only:
   text on lime always uses --on-lime, never white, and lime is never text.
   ========================================================================== */

:root {
  --paper: #ffffff;
  --ink: #161616;
  --violet: #5b3df5;
  --on-violet: #ffffff;
  --lime: #d4f542;
  --on-lime: #161616;
  --tint: #f3f1fe;
  --rule: #dadada;
  --muted: #5e5e66;

  --sans: var(--gh-font-body, "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  --heading: var(--gh-font-heading, var(--sans));
  --mono: "Fira Code", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --measure: 43.75rem;
  --wide: 75rem;
  --content-wide: 64rem;
  --radius: 0px;
  --thumb: 128px;
  --entry-gap: 3.25rem;
  --block-gap: 1.75rem;
  --date-position: sticky;

  --margin: 8.5rem;
  --rail-gutter: 2.25rem;
  --rail: 2px;
  --node: 13px;
  --step--1: 0.9375rem;
  --step-0: 1.125rem;
  --step-1: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem);
  --step-2: clamp(1.75rem, 1.2rem + 2.2vw, 2.9rem);
  --step-3: clamp(2.6rem, 1.4rem + 5vw, 5.25rem);
  color-scheme: light;
}

/* After dark: pale violet and lime on charcoal. */
:root[data-palette="dark"] {
  --paper: #17171c;
  --ink: #f2f2f5;
  --violet: #a898ff;
  --on-violet: #161616;
  --tint: #22222a;
  --rule: #3a3a44;
  --muted: #b4b4be;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-palette="system"] {
    --paper: #17171c;
    --ink: #f2f2f5;
    --violet: #a898ff;
    --on-violet: #161616;
    --tint: #22222a;
    --rule: #3a3a44;
    --muted: #b4b4be;
    color-scheme: dark;
  }
}

/* Site accent colour as the rail colour. Its lightness is clamped so links
   and button text keep at least 4.5:1 on either palette. Browsers without
   relative colour syntax keep Side Quest violet. */
@supports (color: oklch(from red l c h)) {
  :root[data-rail="accent"] {
    --violet: oklch(from var(--ghost-accent-color, #5b3df5) min(l, 0.5) c h);
    --on-violet: #ffffff;
  }

  :root[data-rail="accent"][data-palette="dark"] {
    --violet: oklch(from var(--ghost-accent-color, #a898ff) max(l, 0.77) min(c, 0.17) h);
    --on-violet: #161616;
  }

  @media (prefers-color-scheme: dark) {
    :root[data-rail="accent"][data-palette="system"] {
      --violet: oklch(from var(--ghost-accent-color, #a898ff) max(l, 0.77) min(c, 0.17) h);
      --on-violet: #161616;
    }
  }
}

:root[data-marks="off"] {
  --mark: transparent;
  --mark-text: inherit;
  --mark-pad: 0;
}

:root[data-density="compact"] { --entry-gap: 2rem; --block-gap: 1.25rem; }
:root[data-density="spacious"] { --entry-gap: 4.5rem; --block-gap: 2.5rem; }
:root[data-thumb="small"] { --thumb: 96px; }
:root[data-thumb="large"] { --thumb: 168px; }
:root[data-corners="rounded"] { --radius: 6px; }
:root[data-margin-dates="static"] { --date-position: static; }
:root[data-sheets="off"] .sq-sheet { display: none; }

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
video,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--violet);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--ink);
  text-decoration-thickness: 2px;
}

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

::selection {
  background: var(--lime);
  color: var(--on-lime);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--heading);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

/* Long unbroken words (a URL, code or a name without spaces) wrap inside the column instead of widening narrow screens. */
h1, h2, h3, h4, h5, h6, p, li, dt, dd, blockquote, figcaption, .sq-header__name, .sq-header__tagline, .sq-nav a, .sq-kicker, .sq-meta, .sq-byline, .sq-entryhead__meta a, .sq-tags a, .sq-postnav a, .sq-footer__name, .sq-footer__nav a { overflow-wrap: anywhere; }
td, th, caption { overflow-wrap: break-word; }

p {
  margin: 0;
}

code,
kbd,
samp,
pre {
  font-family: var(--mono);
  font-size: 0.9em;
}

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

.sq-skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 30;
  padding: 0.6rem 1rem;
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 700;
}

.sq-skip:focus {
  top: 1rem;
  color: var(--on-lime);
}

main:focus {
  outline: none;
}

.sq-wide {
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sq-main {
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

/* Labels */
.sq-kicker {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.sq-kicker::before {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 0.6em;
  vertical-align: 0.02em;
  background: var(--lime);
  border: 2px solid var(--ink);
}

.sq-standfirst {
  max-width: 42ch;
  color: var(--muted);
}

.sq-section-title {
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--ink);
  font-size: var(--step-1);
}

.sq-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
}

.sq-empty {
  color: var(--muted);
}

.sq-access {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0 0.4em;
  border: 1px solid currentColor;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

.sq-entryhead__main .sq-access {
  margin-left: 0;
}

/* Highlight marks: lime behind titles. "Highlight marks" off sets --mark to transparent. */
.sq-mark,
.sq-entry__title a,
.sq-shelf__title a {
  padding: var(--mark-pad, 0 0.14em);
  background: var(--mark, var(--lime));
  color: var(--mark-text, var(--on-lime));
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Rail node: a lime square outlined in the rail colour */
.sq-entry__body::before,
.sq-entryhead__main::before {
  content: "";
  position: absolute;
  width: var(--node);
  height: var(--node);
  left: calc((var(--rail) + var(--node)) / -2);
  background: var(--lime);
  border: 2px solid var(--violet);
  box-shadow: 0 0 0 3px var(--paper);
}

/* Buttons and inputs */
.sq-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.3rem;
  border: 0;
  border-radius: 0;
  background: var(--violet);
  color: var(--on-violet);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}

.sq-button:hover {
  background: var(--ink);
  color: var(--paper);
}

.sq-button--small {
  padding: 0.45rem 0.9rem;
}

.sq-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.sq-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* ==========================================================================
   Header: compact bar, inline links, lime current mark, heavy rule
   ========================================================================== */

.sq-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 0.75rem var(--gutter);
  border-bottom: 4px solid var(--violet);
}

.sq-header__id {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 1rem;
  min-width: 0;
}

.sq-header__name {
  color: inherit;
  text-decoration: none;
  font-family: var(--heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.sq-header__name:hover {
  color: inherit;
}

.sq-header__logo {
  display: block;
  width: auto;
  max-height: 2.5rem;
}

.sq-header__tagline {
  max-width: 34ch;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.4;
  color: var(--muted);
}

.sq-header__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  min-width: 0;
}

.sq-nav ul,
.sq-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sq-nav a,
.sq-actions__link {
  display: inline-block;
  min-height: 44px;
  padding: 0.45rem 0.5rem;
  color: inherit;
  text-decoration: none;
  font-size: var(--step--1);
  line-height: 1.75;
}

.sq-nav a:hover,
.sq-actions__link:hover {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--violet);
}

.sq-nav a[aria-current="page"] {
  background: var(--mark, var(--lime));
  color: var(--mark-text, var(--on-lime));
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.sq-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.sq-search:hover {
  color: var(--violet);
}

/* ==========================================================================
   Home masthead
   ========================================================================== */

.sq-mast {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(15rem, 1fr);
  gap: 1rem 3rem;
  align-items: end;
  padding-block: clamp(1.75rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2rem);
  border-bottom: 2px solid var(--ink);
}

.sq-mast > .sq-kicker {
  grid-column: 1 / -1;
}

.sq-mast__title {
  max-width: 15ch;
  font-size: var(--step-3);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.sq-mast__title .sq-mark {
  padding: var(--mark-pad, 0 0.1em);
}

.sq-mast__aside {
  display: grid;
  gap: 1rem;
}

.sq-mast__intro {
  font-size: 1.05rem;
}

.sq-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: var(--step--1);
}

.sq-topics a {
  display: inline-block;
  padding-block: 0.5rem;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
}

.sq-topics__count {
  color: var(--muted);
}

/* ==========================================================================
   The timeline
   ========================================================================== */

.sq-rail-wrap {
  padding-top: clamp(1.75rem, 4vw, 2.75rem);
}

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

.sq-entry {
  display: grid;
  grid-template-columns: var(--margin) minmax(0, 1fr);
}

.sq-entry__date {
  grid-column: 1;
  align-self: start;
  position: var(--date-position, sticky);
  top: 1.25rem;
  padding: 0.5rem 1.25rem 0 0;
  text-align: right;
  line-height: 1.3;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--violet);
}

.sq-entry__body {
  grid-column: 2;
  position: relative;
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0 0 var(--entry-gap) var(--rail-gutter);
  border-left: var(--rail) solid var(--violet);
}

.sq-entry__body::before {
  top: 0.7rem;
}

.sq-entry__cat {
  min-height: 1.65em;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
}

.sq-entry__cat a {
  color: inherit;
  text-decoration: none;
}

.sq-entry__cat a:hover {
  text-decoration: underline;
}

.sq-entry__title {
  max-width: 24ch;
  margin-bottom: 0.55rem;
  font-size: var(--step-2);
  line-height: 1.22;
}

.sq-entry__title a {
  text-decoration: none;
}

.sq-entry__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--violet);
}

.sq-entry__row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.sq-entry__thumb {
  flex: 0 0 var(--thumb);
  width: var(--thumb);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.sq-entry__excerpt {
  max-width: 56ch;
  min-width: 0;
  color: var(--muted);
}

/* Text-only entries: the excerpt is the content, so it is set larger and in ink. */
.sq-entry__row:not(:has(.sq-entry__thumb)) .sq-entry__excerpt {
  font-size: 1.1rem;
  color: var(--ink);
}

.sq-empty--rail {
  margin-left: var(--margin);
  padding-left: var(--rail-gutter);
  border-left: var(--rail) dashed var(--violet);
}

/* ==========================================================================
   Pagination with the sheet number
   ========================================================================== */

.sq-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  margin-left: var(--margin);
  padding: 1.25rem 0 0 var(--rail-gutter);
  border-left: var(--rail) dashed var(--violet);
  font-family: var(--mono);
  font-size: var(--step--1);
}

.sq-shelf--archive + .sq-pages {
  margin-left: 0;
  margin-top: 1.5rem;
}

.sq-sheet {
  flex-basis: 100%;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.sq-pages__numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sq-pages__numbers a,
.sq-pages__numbers span,
.sq-pages__step {
  display: inline-block;
  min-width: 44px;
  min-height: 44px;
  line-height: 44px;
  text-align: center;
}

.sq-pages__numbers [aria-current="page"] {
  background: var(--violet);
  color: var(--on-violet);
}

.sq-pages__gap {
  color: var(--muted);
}

/* ==========================================================================
   Page headings line up with the timeline's text column
   ========================================================================== */

.sq-pagehead {
  display: grid;
  gap: 0.75rem;
  padding-block: clamp(1.75rem, 4vw, 3rem) 1.5rem;
  padding-left: calc(var(--gutter) + var(--margin) + var(--rail-gutter));
  border-bottom: 2px solid var(--ink);
}

.sq-pagehead__title {
  max-width: 18ch;
  font-size: var(--step-3);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.sq-pagehead--shelf {
  border-bottom: 0;
  padding-bottom: 1.75rem;
  background:
    linear-gradient(var(--lime), var(--lime)) calc(var(--gutter) + var(--margin) + var(--rail-gutter)) 100% / 3rem 8px no-repeat,
    linear-gradient(var(--violet), var(--violet)) var(--gutter) calc(100% - 3px) / calc(100% - 2 * var(--gutter)) 2px no-repeat;
}

.sq-author {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.75rem;
}

.sq-author__photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}

.sq-author__text {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 16rem;
}

/* ==========================================================================
   Entry (post)
   ========================================================================== */

.sq-entryhead {
  display: grid;
  grid-template-columns: var(--margin) minmax(0, 1fr);
  align-items: start;
  padding-block: clamp(1.75rem, 4vw, 3rem) 2rem;
  border-bottom: 2px solid var(--ink);
}

.sq-entryhead--photo {
  grid-template-columns: var(--margin) minmax(0, 1fr) auto;
}

.sq-entryhead__meta {
  grid-column: 1;
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem 1.25rem 0 0;
  text-align: right;
  font-family: var(--mono);
  font-size: var(--step--1);
}

.sq-entryhead__meta time {
  font-weight: 600;
  color: var(--violet);
}

.sq-entryhead__meta a,
.sq-entryhead__time {
  color: var(--muted);
}

.sq-entryhead__main {
  grid-column: 2;
  position: relative;
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding-left: var(--rail-gutter);
  border-left: var(--rail) solid var(--violet);
}

.sq-entryhead__main::before {
  top: 0.75rem;
}

.sq-entryhead__title {
  max-width: 18ch;
  font-size: var(--step-3);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.sq-entryhead__main .sq-standfirst {
  font-size: var(--step-1);
  line-height: 1.4;
}

.sq-byline {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
}

.sq-byline a {
  color: inherit;
}

.sq-entryhead__figure {
  grid-column: 3;
  width: clamp(8rem, 17vw, 14rem);
  margin: 0 0 0 2rem;
}

.sq-entryhead__photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.sq-article {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(1.75rem, 4vw, 2.75rem) var(--gutter) 0;
  overflow-wrap: break-word;
}

.sq-article > * + *,
.sq-prose > * + * {
  margin-top: var(--block-gap);
}

.sq-article--intro {
  padding-top: 1.5rem;
}

.sq-page-figure img {
  width: 100%;
}

/* Post and page content */
.sq-prose :where(p, ul, ol, dl, blockquote, pre, table, figure) {
  margin-bottom: 0;
}

.sq-prose :where(figure) {
  margin-inline: 0;
}

.sq-prose :where(ul, ol) {
  padding-left: 1.25rem;
}

.sq-prose li + li {
  margin-top: 0.35rem;
}

.sq-prose > :where(h2, h3, h4, h5, h6) {
  margin-top: calc(var(--block-gap) * 1.5);
}

.sq-prose > :where(h2, h3, h4, h5, h6) + * {
  margin-top: 1rem;
}

.sq-prose h2 {
  font-size: var(--step-1);
  line-height: 1.25;
}

.sq-prose h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}

.sq-prose :where(h4, h5, h6) {
  font-size: 1.125rem;
  line-height: 1.35;
}

.sq-prose img {
  border-radius: var(--radius);
}

.sq-prose > blockquote:not([class]) {
  margin-inline: 0;
  padding: 0.15rem 0 0.15rem 1.25rem;
  border-left: 4px solid var(--lime);
  font-size: var(--step-1);
  line-height: 1.45;
}

.sq-prose .kg-blockquote-alt {
  margin-inline: 0;
  padding: 0.5rem 0;
  border-block: 2px solid var(--ink);
  font-size: var(--step-2);
  font-weight: 700;
  font-style: normal;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: left;
}

.sq-prose hr {
  height: 0;
  margin-block: calc(var(--block-gap) * 1.5);
  border: 0;
  border-top: 2px dotted var(--muted);
}

.sq-prose :not(pre) > code {
  padding: 0.1em 0.3em;
  background: var(--tint);
  border-radius: 3px;
}

.sq-prose pre {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  background: var(--tint);
  border-left: 4px solid var(--violet);
  line-height: 1.5;
  -webkit-overflow-scrolling: touch;
}

.sq-prose table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.sq-prose :where(th, td) {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.sq-prose th {
  border-bottom: 2px solid var(--ink);
  font-family: var(--mono);
  font-weight: 600;
}

/* Checkpoints: each Heading 2 is numbered and drawn on the entry's own rail.
   The rail runs from the first Heading 2 until a divider (horizontal rule),
   so a finished note after a divider sits outside it, as in Side Quest. */
.sq-checkpointed {
  counter-reset: checkpoint;
}

.sq-checkpointed > h2 {
  position: relative;
  counter-increment: checkpoint;
}

.sq-checkpointed > h2::before {
  content: counter(checkpoint, decimal-leading-zero);
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.3;
  color: var(--violet);
}

.sq-checkpointed > h2::after {
  content: "";
  position: absolute;
  top: calc(var(--block-gap) + 0.2rem);
  left: calc((var(--rail) + var(--node)) / -2);
  width: var(--node);
  height: var(--node);
  background: var(--lime);
  border: 2px solid var(--violet);
}

.sq-checkpointed > :is(h2, h2 ~ *):not(hr, hr ~ *, .kg-card) {
  margin-top: 0;
  padding-top: var(--block-gap);
  padding-left: 1.75rem;
  border-left: var(--rail) solid var(--violet);
}

/* The rail beside a card is placed from the card's padding edge, so cards with a left border say how wide it is. */
.sq-prose .kg-callout-card { --card-border: 8px; }
.sq-prose .kg-audio-card,
.sq-prose .kg-cta-card.kg-cta-bg-none,
.sq-prose .kg-cta-card.kg-cta-bg-white { --card-border: 2px; }

/* Cards keep their own padding, borders and backgrounds: they are indented
   instead, and the rail is drawn beside them. Wide and full cards break out. */
.sq-checkpointed > .kg-card:is(h2 ~ *):not(hr ~ *, .kg-width-wide, .kg-width-full) {
  position: relative;
  margin-left: 1.75rem;
  width: auto;
  min-width: 0;
}

.sq-checkpointed > .kg-card:is(h2 ~ *):not(hr ~ *, .kg-width-wide, .kg-width-full)::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--block-gap) - 1px);
  bottom: -1px;
  left: calc(-1.75rem - var(--rail) - var(--card-border, 0px));
  border-left: var(--rail) solid var(--violet);
}

.sq-checkpointed > .kg-card:is(h2 ~ *) + :not(.kg-card) {
  margin-top: 0;
}

.sq-checkpointed > h2:first-of-type {
  margin-top: calc(var(--block-gap) * 1.5);
  padding-top: 0;
}

.sq-checkpointed > h2:first-of-type::after {
  top: 0.2rem;
}

.sq-checkpointed > h2 + * {
  padding-top: 1rem;
}

/* Facts strip: add it with an HTML card (see README, "Facts strip"). */
.sq-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin: 0;
  border-block: 2px solid var(--ink);
}

.sq-facts > div {
  padding: 0.85rem 1rem;
  border-left: 1px solid var(--rule);
  line-height: 1.45;
}

.sq-facts > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.sq-facts dt {
  margin-bottom: 0.2rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
}

.sq-facts > div:first-child dt::before {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 0.45em;
  background: var(--lime);
  border: 2px solid var(--ink);
}

.sq-facts dd {
  margin: 0;
}

.sq-figure {
  margin: 0;
}

.sq-figure img {
  width: 100%;
  border-radius: var(--radius);
}

figcaption {
  margin-top: 0.5rem;
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--muted);
}

.sq-entryhead__figure figcaption {
  font-size: 0.875rem;
}

.sq-tags {
  font-size: var(--step--1);
}

.sq-comments {
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}

/* Ghost's comments, Portal and search frames are light-scheme documents.
   On a dark page a frame whose colour scheme differs from its document is
   painted on an opaque white canvas, so the frames are set to the scheme of
   the document inside them and stay transparent. Each app takes its own
   light or dark look from the theme (comments mode, accent colour). */
#ghost-comments-root iframe,
#ghost-portal-root iframe,
#sodo-search-root iframe {
  color-scheme: light;
}

.sq-postnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem 2rem;
  padding-block: 1rem;
  border-block: 2px solid var(--ink);
}

.sq-postnav:not(:has(a)) {
  display: none;
}

.sq-postnav a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.35;
}

.sq-postnav a:hover {
  text-decoration: underline;
}

.sq-postnav__newer {
  text-align: right;
}

.sq-postnav__label {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--muted);
}

.sq-nearby,
.sq-browse {
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.sq-nearby > * + * {
  margin-top: 1.5rem;
}

/* ==========================================================================
   Dotted-leader title lists and category shelves
   ========================================================================== */

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

.sq-list > li {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(1.5rem, 1fr) auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.sq-list > li:nth-child(3n) {
  border-bottom: 2px solid var(--violet);
}

.sq-list > li::after {
  content: "";
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  border-bottom: 2px dotted var(--muted);
}

.sq-list__title {
  grid-column: 1;
  grid-row: 1;
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.sq-list__title a {
  color: inherit;
  text-decoration: none;
}

.sq-list__title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--violet);
}

.sq-list__date {
  grid-column: 3;
  grid-row: 1;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--violet);
}

.sq-errors > li {
  display: block;
}

.sq-errors > li::after {
  display: none;
}

.sq-shelves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 2.75rem 3.5rem;
  padding-top: 2rem;
}

.sq-shelf {
  --tick: 0%;
}

.sq-shelf:nth-child(4n + 2) { --tick: 33%; }
.sq-shelf:nth-child(4n + 3) { --tick: 66%; }
.sq-shelf:nth-child(4n + 4) { --tick: 100%; }

.sq-shelf__title {
  margin-bottom: 0.35rem;
  padding-top: 1.1rem;
  font-size: var(--step-1);
  line-height: 1.3;
  background:
    linear-gradient(var(--ink), var(--ink)) var(--tick) 0 / 2.75rem 6px no-repeat,
    linear-gradient(var(--violet), var(--violet)) 0 2px / 100% 2px no-repeat;
}

.sq-shelf__title a {
  text-decoration: none;
}

.sq-shelf__title a:hover {
  text-decoration: underline;
}

.sq-shelf__desc {
  font-size: var(--step--1);
  color: var(--muted);
}

.sq-shelf__more {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: var(--step--1);
}

.sq-shelf--archive {
  padding-top: 1.5rem;
}

.sq-shelf--archive .sq-list__title {
  font-size: 1.3rem;
}

/* ==========================================================================
   Email signup (Ghost members)
   ========================================================================== */

.sq-signup {
  margin-bottom: 2.5rem;
}

.sq-signup__box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: end;
  gap: 1.25rem 3rem;
  padding: 1.5rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-top: 6px solid var(--violet);
}

.sq-signup__text {
  display: grid;
  gap: 0.5rem;
}

.sq-signup__title {
  font-size: var(--step-1);
  line-height: 1.25;
}

.sq-signup__row {
  display: flex;
  gap: 0.5rem;
}

.sq-signup__row .sq-button {
  flex: none;
}

.sq-signup__busy,
.sq-signup__msg {
  display: none;
}

.sq-signup__msg {
  margin-top: 0.6rem;
  font-size: var(--step--1);
}

.sq-signup__form.loading .sq-signup__label { display: none; }
.sq-signup__form.loading .sq-signup__busy { display: inline; }
.sq-signup__form.success .sq-signup__msg--success,
.sq-signup__form.error .sq-signup__msg--error { display: block; }
.sq-signup__form.success .sq-signup__row { display: none; }

.sq-signup__msg--error {
  padding-left: 0.6rem;
  border-left: 4px solid currentColor;
}

/* Members-only and paid entries: the locked part's call to action (partials/content-cta.hbs) */
.sq-paywall {
  display: grid;
  justify-items: start;
  gap: 0.85rem;
  margin-top: var(--block-gap);
  padding: 1.5rem;
  border: 2px solid var(--ink);
  border-top: 6px solid var(--violet);
}

.sq-paywall__title {
  font-size: var(--step-1);
  line-height: 1.25;
}

.sq-paywall__signin {
  font-size: var(--step--1);
  color: var(--muted);
}

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

.sq-footer {
  padding-top: 2.5rem;
  background: var(--tint);
  border-top: 4px solid var(--violet);
}

.sq-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

.sq-footer__id {
  display: grid;
  gap: 0.5rem;
  max-width: 26rem;
}

.sq-footer__name a {
  color: inherit;
  text-decoration: none;
  font-family: var(--heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sq-footer__note {
  font-size: var(--step--1);
}

.sq-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: var(--step--1);
}

.sq-footer__nav a {
  display: inline-block;
  padding-block: 0.5rem;
  color: inherit;
}

.sq-footer__base {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.sq-footer__copy {
  color: var(--muted);
}

.sq-footer__credit a {
  color: inherit;
}

/* ==========================================================================
   Koenig editor cards. Ghost's own card CSS and scripts load with
   card_assets; the rules below set Side Quest's type, colours and widths.
   ========================================================================== */

/* Ghost's cards read --ghost-accent-color; inside content it is the theme's
   contrast-safe rail colour, and text on it uses --on-violet. */
.sq-prose {
  --ghost-accent-color: var(--violet);
}

.sq-prose .kg-callout-card.kg-callout-card-accent,
.sq-prose .kg-button-card a.kg-btn-accent,
.sq-prose .kg-product-card a.kg-product-card-btn-accent,
.sq-prose a.kg-cta-button.kg-style-accent {
  color: var(--on-violet);
}

.sq-prose .kg-audio-card .kg-audio-time,
.sq-prose .kg-audio-card .kg-audio-playback-rate {
  color: var(--muted);
}

.sq-prose .kg-width-wide,
.sq-prose .kg-width-full {
  position: relative;
}

.sq-prose .kg-width-wide {
  width: min(var(--content-wide), calc(100vw - 2 * var(--gutter)));
  max-width: none;
  margin-left: calc(50% - min(var(--content-wide), calc(100vw - 2 * var(--gutter))) / 2);
}

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

.sq-prose .kg-width-wide img,
.sq-prose .kg-width-full img {
  width: 100%;
}

.sq-prose .kg-width-full img,
.sq-prose .kg-width-full .kg-image {
  border-radius: 0;
}

.sq-prose .kg-width-full figcaption {
  padding-inline: var(--gutter);
}

.sq-prose .kg-image-card img {
  margin-inline: auto;
}

.sq-prose .kg-card figcaption {
  text-align: left;
}

.sq-prose .kg-embed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sq-prose .kg-embed-card > * {
  max-width: 100%;
}

/* Gallery */
.sq-prose .kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sq-prose .kg-gallery-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0.75rem;
}

.sq-prose .kg-gallery-image img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  border-radius: var(--radius);
}

.sq-prose .kg-gallery-row:not(:first-of-type),
.sq-prose .kg-gallery-image:not(:first-of-type) {
  margin: 0;
}

/* Bookmark */
.sq-prose .kg-bookmark-card,
.sq-prose .kg-bookmark-card * {
  box-sizing: border-box;
}

.sq-prose .kg-bookmark-card a.kg-bookmark-container,
.sq-prose .kg-bookmark-card a.kg-bookmark-container:hover {
  display: flex;
  min-height: 9rem;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-top: 6px solid var(--violet);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
}

.sq-prose .kg-bookmark-container:hover .kg-bookmark-title {
  text-decoration: underline;
  text-decoration-color: var(--violet);
}

.sq-prose .kg-bookmark-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  padding: 1.1rem 1.25rem;
}

.sq-prose .kg-bookmark-title {
  font-family: var(--heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

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

.sq-prose .kg-bookmark-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--muted);
}

.sq-prose .kg-bookmark-icon {
  width: 20px;
  height: 20px;
}

.sq-prose .kg-bookmark-author,
.sq-prose .kg-bookmark-publisher {
  overflow: hidden;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sq-prose .kg-bookmark-thumbnail {
  position: relative;
  flex: 0 0 33%;
  min-width: 33%;
  max-height: 100%;
}

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

/* Callout: Side Quest's finished note, a tint box with a lime rule */
.sq-prose .kg-callout-card {
  display: flex;
  gap: 0.85rem;
  padding: 1.25rem 1.5rem;
  border-left: 8px solid var(--lime);
  border-radius: 0;
  background: var(--tint);
  color: var(--ink);
}

.sq-prose .kg-callout-card-grey,
.sq-prose .kg-callout-card-white { background: var(--tint); }

.sq-prose .kg-callout-card-blue { background: color-mix(in srgb, #3b82f6 12%, var(--paper)); }

.sq-prose .kg-callout-card-green { background: color-mix(in srgb, #22c55e 13%, var(--paper)); }

.sq-prose .kg-callout-card-yellow { background: color-mix(in srgb, #eab308 15%, var(--paper)); }

.sq-prose .kg-callout-card-red { background: color-mix(in srgb, #ef4444 12%, var(--paper)); }

.sq-prose .kg-callout-card-pink { background: color-mix(in srgb, #ec4899 12%, var(--paper)); }

.sq-prose .kg-callout-card-purple { background: color-mix(in srgb, #8b5cf6 13%, var(--paper)); }

.sq-prose .kg-callout-card-accent { background: var(--violet); color: var(--on-violet); border-left-color: var(--lime); }

.sq-prose .kg-callout-card-accent a { color: inherit; }

.sq-prose .kg-callout-emoji {
  font-size: 1.25rem;
  line-height: 1.5;
}

.sq-prose .kg-callout-text {
  font-size: var(--step-0);
  line-height: 1.6;
}

.sq-prose .kg-callout-text > strong:first-child,
.sq-prose .kg-callout-text > b:first-child {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Toggle */
.sq-prose .kg-toggle-card {
  padding: 1rem 0;
  border: 0;
  border-block: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sq-prose .kg-toggle-card + .kg-toggle-card {
  margin-top: 0;
  border-top: 0;
}

.sq-prose .kg-toggle-heading-text {
  font-family: var(--heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.sq-prose .kg-toggle-card-icon {
  color: var(--violet);
}

.sq-prose .kg-toggle-card-icon svg {
  color: var(--violet);
}

.sq-prose .kg-toggle-content {
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
}

/* Button */
.sq-prose .kg-button-card {
  display: flex;
}

.sq-prose .kg-button-card.kg-align-center {
  justify-content: center;
}

.sq-prose .kg-btn,
.sq-prose .kg-btn-accent,
.sq-prose .kg-product-card-button,
.sq-prose .kg-header-card-button,
.sq-prose .kg-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.3rem;
  border-radius: 0;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 700;
  text-decoration: none;
}

.sq-prose .kg-btn-accent,
.sq-prose .kg-product-card-btn-accent,
.sq-prose .kg-header-card-button.kg-style-accent,
.sq-prose .kg-cta-button.kg-style-accent {
  background: var(--violet);
  color: var(--on-violet);
}

.sq-prose .kg-btn-accent:hover,
.sq-prose .kg-product-card-btn-accent:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Product */
.sq-prose .kg-product-card-container {
  max-width: 34rem;
  padding: 1.25rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}

.sq-prose .kg-product-card-image {
  border-radius: var(--radius);
}

.sq-prose .kg-product-card-title {
  font-family: var(--heading);
  font-size: var(--step-1);
  color: var(--ink);
}

.sq-prose .kg-product-card-description {
  color: var(--muted);
}

.sq-prose .kg-product-card-rating-active svg {
  fill: var(--violet);
}

/* Video */
.sq-prose .kg-video-card video,
.sq-prose .kg-video-container {
  border-radius: var(--radius);
}

.sq-prose .kg-video-card .kg-video-player button {
  color: #fff;
}

/* Audio */
.sq-prose .kg-audio-card,
.sq-prose .kg-audio-player-container,
.sq-prose .kg-audio-player {
  min-width: 0;
  max-width: 100%;
}

.sq-prose .kg-audio-card {
  min-height: 6rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}

.sq-prose .kg-audio-thumbnail {
  border-radius: var(--radius);
}

.sq-prose .kg-audio-thumbnail.placeholder {
  background: var(--tint);
}

.sq-prose .kg-audio-thumbnail.placeholder svg {
  color: var(--violet);
}

.sq-prose .kg-audio-title {
  font-family: var(--heading);
  font-size: 1.125rem;
  color: var(--ink);
}

.sq-prose .kg-audio-player,
.sq-prose .kg-audio-current-time,
.sq-prose .kg-audio-duration,
.sq-prose .kg-audio-playback-rate {
  font-family: var(--mono);
  color: var(--ink);
}

.sq-prose .kg-audio-play-icon svg,
.sq-prose .kg-audio-pause-icon svg,
.sq-prose .kg-audio-mute-icon svg,
.sq-prose .kg-audio-unmute-icon svg {
  color: var(--violet);
}

.sq-prose .kg-audio-seek-slider,
.sq-prose .kg-audio-volume-slider {
  accent-color: var(--violet);
}

/* File */
.sq-prose .kg-file-card a.kg-file-card-container,
.sq-prose .kg-file-card a.kg-file-card-container:hover {
  padding: 1rem 1.25rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
  text-decoration: none;
}

.sq-prose .kg-file-card-title {
  font-family: var(--heading);
  font-size: 1.125rem;
  font-weight: 700;
}

.sq-prose .kg-file-card-caption,
.sq-prose .kg-file-card-metadata {
  font-size: var(--step--1);
  color: var(--muted);
}

.sq-prose .kg-file-card-filesize {
  font-family: var(--mono);
}

.sq-prose .kg-file-card-icon {
  color: var(--violet);
}

.sq-prose .kg-file-card-icon::before {
  background: var(--violet);
  opacity: 0.12;
  border-radius: 0;
}

/* Header (v1 and v2) */
.sq-prose .kg-header-card {
  font-family: var(--sans);
}

.sq-prose .kg-header-card h2,
.sq-prose .kg-header-card .kg-header-card-heading,
.sq-prose .kg-header-card .kg-header-card-header {
  font-family: var(--heading);
  letter-spacing: -0.03em;
}

.sq-prose .kg-header-card .kg-header-card-subheading,
.sq-prose .kg-header-card .kg-header-card-subheader {
  font-family: var(--sans);
}

.sq-prose .kg-header-card.kg-width-wide,
.sq-prose .kg-header-card.kg-width-full {
  border-radius: 0;
}

/* Signup card */
.sq-prose .kg-signup-card {
  font-family: var(--sans);
}

.sq-prose .kg-signup-card .kg-signup-card-heading {
  font-family: var(--heading);
  letter-spacing: -0.03em;
}

.sq-prose .kg-signup-card-input {
  border-radius: 0;
  font-family: var(--sans);
}

.sq-prose .kg-signup-card-button {
  border-radius: 0;
  font-family: var(--sans);
  font-weight: 700;
}

.sq-prose .kg-signup-card-disclaimer {
  font-size: var(--step--1);
}

/* Call to action (Ghost 6) */
.sq-prose .kg-cta-card {
  border-radius: 0;
  font-family: var(--sans);
}

.sq-prose .kg-cta-card.kg-cta-bg-none,
.sq-prose .kg-cta-card.kg-cta-bg-white {
  border: 2px solid var(--ink);
}

.sq-prose .kg-cta-sponsor-label,
.sq-prose .kg-cta-sponsor-label span {
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

.sq-prose .kg-cta-image {
  border-radius: var(--radius);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 68.75rem) {
  :root {
    --margin: 7rem;
    --rail-gutter: 1.75rem;
  }
}

@media (max-width: 56rem) {
  .sq-header__tagline {
    display: none;
  }
}

@media (max-width: 48.8rem) {
  :root {
    --margin: 0px;
    --rail-gutter: 1.25rem;
  }

  .sq-header {
    gap: 0.25rem 1rem;
  }

  .sq-header__tools {
    width: 100%;
    justify-content: space-between;
  }

  .sq-nav {
    margin-left: -0.5rem;
  }

  .sq-mast,
  .sq-signup__box {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .sq-signup__row {
    flex-wrap: wrap;
  }

  .sq-signup__row .sq-button {
    flex: 1 1 auto;
  }

  .sq-entry {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    padding-left: var(--rail-gutter);
    border-left: var(--rail) solid var(--violet);
  }

  .sq-entry::before {
    content: "";
    position: absolute;
    top: 0.3rem;
    left: calc((var(--rail) + var(--node)) / -2);
    width: var(--node);
    height: var(--node);
    background: var(--lime);
    border: 2px solid var(--violet);
    box-shadow: 0 0 0 3px var(--paper);
  }

  .sq-entry__date {
    position: static;
    padding: 0;
    margin-bottom: 0.35rem;
    text-align: left;
  }

  .sq-entry__body {
    grid-column: 1;
    padding-left: 0;
    border-left: 0;
  }

  .sq-entry__body::before {
    display: none;
  }

  .sq-entry__thumb {
    flex-basis: 5.5rem;
    width: 5.5rem;
  }

  .sq-log {
    margin-left: calc(var(--node) / 2);
  }

  .sq-pages,
  .sq-empty--rail {
    margin-left: calc(var(--node) / 2);
  }

  .sq-pagehead {
    padding-left: var(--gutter);
  }

  .sq-pagehead--shelf {
    background-position: var(--gutter) 100%, var(--gutter) calc(100% - 3px);
  }

  .sq-entryhead,
  .sq-entryhead--photo {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.75rem;
  }

  .sq-entryhead__meta {
    grid-column: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    padding: 0;
    text-align: left;
  }

  .sq-entryhead__main {
    grid-column: 1;
    margin-left: calc(var(--node) / 2);
  }

  .sq-entryhead__figure {
    grid-column: 1;
    grid-row: 1;
    width: 7rem;
    margin: 0;
  }

  .sq-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .sq-facts > div {
    padding: 0.75rem 0;
    border-left: 0;
  }

  .sq-facts > div + div {
    border-top: 1px solid var(--rule);
  }

  .sq-checkpointed > :is(h2, h2 ~ *):not(hr, hr ~ *, .kg-card) {
    margin-left: calc(var(--node) / 2);
    padding-left: 1.25rem;
  }

  .sq-checkpointed > .kg-card:is(h2 ~ *):not(hr ~ *, .kg-width-wide, .kg-width-full) {
    margin-left: calc(var(--node) / 2 + 1.25rem);
  }

  .sq-checkpointed > .kg-card:is(h2 ~ *):not(hr ~ *, .kg-width-wide, .kg-width-full)::before {
    left: calc(-1.25rem - var(--rail) - var(--card-border, 0px));
  }

  .sq-list > li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sq-list > li::after {
    display: none;
  }

  .sq-list__date {
    grid-column: 2;
  }

  .sq-postnav__newer {
    text-align: left;
  }

  .sq-prose .kg-bookmark-container {
    flex-direction: column-reverse;
  }

  .sq-prose .kg-bookmark-thumbnail {
    flex-basis: auto;
    min-height: 10rem;
    width: 100%;
  }
}

@media (max-width: 30rem) {
  .sq-prose .kg-audio-thumbnail,
  .sq-prose .kg-audio-volume-slider {
    display: none;
  }

  .sq-prose .kg-audio-player-container {
    padding-inline: 0.75rem;
  }

  .sq-list > li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }

  .sq-list__title,
  .sq-list__date {
    grid-column: 1;
    grid-row: auto;
  }

  .sq-entry__row {
    gap: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .sq-entry__date {
    position: static;
  }
}

@media print {
  .sq-header,
  .sq-footer,
  .sq-postnav,
  .sq-nearby,
  .sq-skip,
  .sq-comments {
    display: none !important;
  }

  .sq-entry__date {
    position: static;
  }

  body {
    background: #fff;
    color: #000;
  }
}
