/* ============== THEME INFO ================
   Roe Theme: Default
   Version: 0.9.9
   Bundled with: Roe v0.2.0

   This theme was installed from Roe. Leave this comment
   in place and the admin will detect when a new version
   is available and offer to update it.

   Either of these actions will create a custom theme outside of the updates system:

   - Change the "Roe Theme" name to anything else
   - install and rename css file in /site/theme/

   You can always download a fresh copy of the newest version of any built in theme.
*/

/* ============ THEME VARIABLES ============ */

:root {
  /* Light/Dark Mode */
  color-scheme: light dark;

  /* Layout */
  --container-width: 56rem;
  --sidebar-width: 11rem;
  --aside-width: 10rem;
  --aside-text-top-offset: 0.25rem;
  --aside-image-top-offset: 0.4rem;
  --product-copy-width: 65ch;

  /* Typography */
  --font-scale: 1em;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-heading: var(--font-body);
  --font-accent: var(--font-body);
  --font-mono:
    ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;

  /* Font Sizes */
  --text-xxs: 0.7rem;
  --text-xs: 0.775rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.75rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Spacing */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-gallery: 0.75rem;

  /* Colors */
  --color-bg: #ffffff;
  --color-bg-dim: #f5f5f5;
  --color-text: #000000;
  --color-heading: #000000;
  --color-logo: #000000;
  --color-nav-active: #000000;
  --color-muted: #666666;
  --color-really-muted: #e6e6e6;
  --color-link: #0000ee;
  --color-hover: var(--color-text);
  --color-visited: #0000ee;
  --color-link-collection: #000000;
  --color-border: #e3e3e3;
  --color-code-bg: #f5f5f5;
  --color-code-text: #000000;
  --color-highlight-text: #bfe3ff;

  /* Player tokens (used by audio + video players) */
  --player-bg: #f5f5f5;
  --player-border: #dddddd;
  --player-track: #cccccc;
  --player-accent: #333333;
  --player-accent-hover: #000000;
  --player-btn-color: #333333;
  --player-btn-play-color: #ffffff;
  --player-btn-hover-bg: rgba(0, 0, 0, 0.07);
  --player-meta-color: #888888;
  --player-overlay-bg: rgba(255, 255, 255, 0.75);
  --player-chapter-active-bg: rgba(0, 0, 0, 0.05);
}

/* ============ DARK MODE ============ */

@media (prefers-color-scheme: dark) {
  :root {
    /* Surface colors — near-black bases, not pure black (easier on the eyes) */
    --color-bg: #121212;
    --color-bg-dim: #1e1e1e;

    /* Text */
    --color-text: #e4e4e4;
    --color-heading: #f5f5f5;
    --color-logo: #f5f5f5;
    --color-nav-active: #f5f5f5;
    --color-muted: #a0a0a0;
    --color-link-collection: #f5f5f5;

    /* Links */
    --color-link: #6dabf0;
    --color-hover: #c1deff;
    --color-visited: #6dabf0;

    /* Structure */
    --color-border: #333333;
    --color-code-bg: #1e1e1e;
    --color-code-text: #e4e4e4;
    --color-highlight-text: #bfe3ff;

    /* Player tokens — same surfaces inverted, hover rgba flipped */
    --player-bg: #1e1e1e;
    --player-border: #2e2e2e;
    --player-track: #3a3a3a;
    --player-accent: #e8e8e8;
    --player-accent-hover: #ffffff;
    --player-btn-color: #e8e8e8;
    --player-btn-play-color: #121212;
    --player-btn-hover-bg: rgba(255, 255, 255, 0.08);
    --player-meta-color: #e8e8e8;
    --player-overlay-bg: rgba(0, 0, 0, 0.75);
    --player-chapter-active-bg: rgba(255, 255, 255, 0.08);
  }
}

/* ============== BASE STYLES =============== */

/* The `hidden` attribute must win over component display rules (e.g.
   .btn-primary { display: inline-block }), so JS that toggles [hidden] to
   show/hide actually hides. Without this, a display rule overrides the UA
   `[hidden] { display: none }` and the element stays visible. */
[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0 auto;
  padding: var(--space-6);
  max-width: var(--container-width);
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-heading);
}

strong,
b {
  font-weight: bold;
}

em,
i {
  font-style: italic;
}

a {
  color: var(--color-visited);
  text-decoration: underline;
}

a:not([class*="btn-"]):hover {
  color: var(--color-hover);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  margin: var(--space-2) 0;
}

button a {
  text-decoration: none;
}

picture {
  display: block;
}

article {
  margin: 0 auto;
}

sup {
  line-height: 1;
}

hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 0 0 0 0;
}

figure {
  margin: 0 0 0 0;
}

li > p {
  margin: 0 0 0 0;
}

a.heading-anchor,
.post-content a.heading-anchor {
  --heading-anchor-size: clamp(1.4rem, 0.85em, 1.4rem);
  --heading-anchor-color: currentColor;
  --heading-anchor-opacity: 0.25;
  --heading-anchor-offset-x: -0.02em;
  --heading-anchor-offset-y: 0rem;
  border-bottom: none;
}

/* =========== LAYOUT — SITE NAV ============ */

.site-nav {
  padding: var(--space-4) 0;
  margin-bottom: var(--space-0);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-nav h1 {
  font-size: var(--text-2xl);
  margin: 0;
}

.site-nav p {
  color: var(--color-text);
  margin: 0;
}

.site-nav a {
  text-decoration: underline;
  margin-right: var(--space-3);
}

.site-nav p a:first-child {
  margin-left: 0;
}

.site-nav a.active {
  color: var(--color-nav-active);
}

/* Site Logo */

.site-logo {
  font-size: var(--text-2xl);
  line-height: 1em;
  color: var(--color-logo);
  font-weight: 500;
  margin: 0;
}

.site-nav a.site-logo,
.site-nav a.site-logo:hover {
  color: var(--color-logo);
  text-decoration: none;
}

p.site-logo,
p.site-logo a,
p.site-logo a.active {
  color: var(--color-logo);
  text-decoration: none;
}

p.site-logo a:hover,
p.site-logo a.active:hover {
  color: var(--color-link);
}

p:has(.site-logo) {
  margin-bottom: var(--space-6);
}

/* Logo image variants */

.site-nav.logo .site-logo {
  background-image: var(--logo-url);
  background-repeat: no-repeat;
  background-size: 32px 32px;
}

.site-nav.logo.logo-beside_text .site-logo {
  padding-left: 42px;
  background-position: left center;
}

.site-nav.logo.logo-replace_text .site-logo {
  margin: 0 0 0 0;
  background-image: none;
}

.site-nav.logo.logo-replace_text .site-logo a {
  display: block;
  width: 134px;
  height: 24px;
  font-size: 0;
  background-image: var(--logo-url);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* ================ SITE ACTIONS (cart, member icon) ================= */

.site-actions {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  z-index: 100;
}

.site-action {
  display: flex;
  align-items: center;
  position: relative;
  text-decoration: none;
  color: var(--color-link);
}

.site-action svg {
  height: var(--space-5);
  width: var(--space-5);
}

.snipcart-items-count {
  font-size: calc(var(--text-xs) * 0.7);
  font-weight: 600;
  color: var(--color-link);
  border-radius: 999px;
  min-width: 1.25em;
  text-align: center;
  position: absolute;
  top: calc(var(--space-1) * -1.1);
  right: calc(var(--space-1) * -2);
}

.snipcart-link,
.member-link {
  font-size: var(--text-xs);
}

/* ================ SITE SEARCH ================= */

/* Toggle: sits with the cart/member icons. It carries `.site-action` too,
   so it inherits their color + svg sizing; this just resets the <button>. */
.site-actions .site-search svg {
  height: var(--space-4);
  width: var(--space-4);
}

.site-search-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-link);
}

/* In-content trigger (```search block / collection `search: true`). It sits in
   a .collection-header row beside the heading (or alone, pushed right). */

.collection-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.collection-header h2 {
  margin: var(--space-2) 0 var(--space-4) 0;
}

.site-search-trigger {
  margin: var(--space-3) 0 0 0;
  background: none;
  border: none;
  padding: var(--space-1);
  cursor: pointer;
  line-height: 0;
  opacity: 0.4;
}

.site-search-trigger:hover {
  opacity: 0.8;
}

.content .site-search-trigger img,
.site-search-trigger svg {
  margin: 0 0 0 0;
  color: var(--color-muted);
  height: var(--space-4);
  width: var(--space-4);
}

/* Top-anchored panel — reads like an extension of the nav. */
.site-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: var(--space-4) var(--space-6);
}

.site-search-box {
  max-width: var(--container-width);
  margin: 0 auto;
}

.site-search-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Active scope facets — removable pills on their own line above the input,
   so they never eat into the input width. */
.site-search-context {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

/* An explicit `display` overrides the `hidden` attribute, so restore it —
   otherwise the empty container shows on unscoped (site-wide) search. */
.site-search-context[hidden] {
  display: none;
}

/* Each active facet: rectangular (rounded-xs), muted, with an × to remove. */
.site-search-context-label {
  background-color: var(--color-really-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: calc(var(--space-1) * 0.2) calc(var(--space-1) * 1.1);
  border: 1px solid var(--color-border);
  border-radius: 1px;
  font-size: var(--text-xxs);
  text-transform: uppercase;
  color: var(--color-muted);
  white-space: nowrap;
}

.site-search-context-remove {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--color-muted);
  font-size: var(--text-base);
  line-height: 1;
  position: relative;
  top: -1px;
}

.site-search-context-remove:hover {
  color: var(--color-text);
}

/* Input mirrors the member-form fields. */
.site-search-input {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  font-family: inherit;
  font-size: var(--text-lg);
  color: var(--color-text);
  box-sizing: border-box;
}

.site-search-input:focus {
  outline: 2px solid var(--color-link);
  outline-offset: -1px;
}

.site-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 0.9em;
  width: 0.9em;
  cursor: pointer;
  /* SVG × as a mask so `background-color` sets the color */
  background-color: currentColor; /* or any color you want */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 6 6 18M6 6l12 12' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 6 6 18M6 6l12 12' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.site-search-close {
  background: none;
  border: none;
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
  color: var(--color-muted);
  font-size: var(--text-2xl);
  line-height: 1;
}

.site-search-close:hover {
  color: var(--color-text);
}

.site-search-results {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.site-search-results:empty {
  height: 0;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.site-search-result {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.site-search-result-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.site-search-result-link {
  color: var(--color-link);
  text-decoration: none;
  font-size: var(--text-base);
}

.site-search-result-link:hover {
  text-decoration: underline;
}

.site-search-result-link--active {
  background-color: var(--color-really-muted);
}

/* Clickable type / post-type pill (with +) — click adds that facet to scope. */
.site-search-result-type {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: calc(var(--space-1) * 0.4) calc(var(--space-1) * 0.8);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  background: var(--color-bg);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-xxs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
  line-height: 1;
}

.site-search-result-type:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

.site-search-result-type-add {
  font-weight: 600;
}

.site-search-result-paid {
  font-size: var(--text-xxs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
}

.site-search-result-excerpt {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.site-search-empty {
  margin: var(--space-4) 0 0;
  color: var(--color-muted);
}

/* Site actions - responsive CSS */

@media (min-width: 1100px) {
  .site-action svg {
    height: calc(var(--space-5) * 1.2);
    width: calc(var(--space-5) * 1.2);
  }

  .site-actions .site-search svg {
    height: calc(var(--space-4) * 1.2);
    width: calc(var(--space-4) * 1.2);
  }
}

/* ============ LAYOUT — SIDEBAR ============ */

body:not(.has-sidebar) article {
  margin-top: var(--space-4);
}

body.has-sidebar,
body.sidebar-right {
  display: block;
}

.site-sidebar {
  display: none;
}

@media (min-width: 769px) {
  body.has-sidebar {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-areas:
      "nav nav"
      "sidebar main"
      "footer footer";
    row-gap: var(--space-4);
    column-gap: var(--space-8);
    max-width: var(--container-width);
  }

  body.sidebar-right {
    grid-template-columns: 1fr var(--sidebar-width);
    grid-template-areas:
      "nav nav"
      "main sidebar"
      "footer footer";
  }

  body.has-sidebar .site-nav {
    grid-area: nav;
  }
  body.has-sidebar .site-sidebar {
    grid-area: sidebar;
    display: block;
  }
  body.has-sidebar main {
    grid-area: main;
    min-width: 0;
  }
  body.has-sidebar .site-footer {
    grid-area: footer;
  }

  .site-sidebar {
    font-size: var(--text-sm);
    color: var(--color-text);
    border-right: 1px solid var(--color-border);
    padding-right: var(--space-4);
  }

  body.sidebar-right .site-sidebar {
    border-right: none;
    border-left: 1px solid var(--color-border);
    padding-right: 0;
    padding-left: var(--space-4);
  }

  .site-sidebar img {
    max-width: 100%;
    height: auto;
  }

  .site-sidebar h2 {
    font-size: var(--text-lg);
    margin: 0 0 var(--space-2);
  }

  .site-sidebar p,
  .site-sidebar ul {
    margin: 0 0 var(--space-3);
    line-height: 1.2;
  }

  .site-sidebar ul {
    list-style: none;
    padding: 0;
  }

  .site-sidebar li {
    margin-bottom: var(--space-1);
  }

  .site-sidebar a {
    color: var(--color-link);
  }
}

/* ============ LAYOUT - FOOTER ============= */

.site-footer {
  margin-top: var(--space-16);
  padding: var(--space-8) 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.site-footer a {
  text-decoration: underline;
}

/* ============ FLASH MESSAGES ============== */

div.flash {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-dim);
  font-size: var(--text-sm);
}

div.flash mark {
  background-color: var(--color-highlight-text);
}

/* ======== POST/PAGE CONTENT GLOBAL ======== */

/* First element in any content block never has top margin */
.content > :first-child {
  margin-top: 0 !important;
}

.content h1 {
  font-size: var(--text-4xl);
  line-height: 1;
  margin: var(--space-0) 0 var(--space-4) 0;
  font-weight: 700;
  color: var(--color-heading);
}

.content h2 {
  font-size: var(--text-2xl);
  line-height: 1.15;
  margin-top: var(--space-6);
  margin-bottom: var(--space-4);
  font-weight: 700;
}

.content h3 {
  font-size: var(--text-2xl);
  line-height: 1.25;
  margin: var(--space-6) 0 var(--space-3) 0;
  font-weight: 700;
}

.content h4 {
  font-size: var(--text-xl);
  line-height: 1.25;
  margin: var(--space-6) 0 var(--space-2) 0;
  font-weight: 700;
}

.content h5 {
  font-size: var(--text-lg);
  line-height: 1.25;
  margin: var(--space-6) 0 var(--space-1) 0;
  font-weight: 700;
}

.content p {
  margin-top: 0;
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.content p:empty,
.content p:-moz-only-whitespace {
  display: none;
}

.content ul,
.content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.content li > ul,
.content li > ol {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

.content li {
  margin-bottom: var(--space-1);
  line-height: 1.6;
}

.content strong,
.content b {
  font-weight: 700;
}

.content em,
.content i {
  font-style: italic;
}

.content blockquote {
  margin: 0 0 var(--space-4) var(--space-2);
  padding-left: var(--space-3);
  border-left: 3px solid var(--color-border);
  color: var(--color-text);
  font-style: italic;
}

.content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-code-bg);
  color: var(--color-code-text);
  padding: var(--space-1) calc(var(--space-2) * 0.7);
  border: 1px solid var(--color-border);
}

.content pre {
  background-color: var(--color-code-bg);
  padding: var(--space-4);
  margin-top: var(--space-2);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  border: 1px solid var(--color-border);
  white-space: pre-wrap;
}

.content pre code {
  background: none;
  padding: 0;
  border: none;
}

.content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-top: 0;
  margin-bottom: var(--space-6);
}

.content figure img,
.content figure picture {
  /*margin-bottom: var(--space-1);*/
}

.content hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin-top: 0;
  margin-bottom: var(--space-6);
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  margin-bottom: var(--space-6);
}

.content th,
.content td {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  text-align: left;
}

.content th {
  background-color: var(--color-code-bg);
  font-weight: 700;
}

/* Footnotes */

a.footnote {
  text-decoration: none;
}

.content .footnotes,
.footnotes {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.content .footnotes ol,
.footnotes ol {
  padding-left: var(--space-0);
  list-style: none;
}

.footnotes ol li {
  position: relative;
  padding-left: 2em;
  margin-bottom: var(--space-2);
}

.footnotes p {
  margin: 0 0 var(--space-1) 0;
}

.footnotes .gallery {
  margin-bottom: var(--space-0);
}

.footnotes blockquote {
  margin: var(--space-1) 0 var(--space-1) 0;
}

a.footnote-backlink-number {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 1.5em;
  text-align: right;
  text-decoration: none;
  color: var(--color-link);
}

a.footnote-backlink-number:hover {
  text-decoration: underline;
}

.footnote-tooltip {
  position: absolute;
  z-index: 100;
  max-width: 22rem;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  line-height: 1.2;
  color: var(--color-text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.footnote-tooltip p {
  margin: 0 0 0 0;
}

.footnote-tooltip code {
  background: var(--color-code-bg);
  border-radius: 1px;
  padding: 0rem var(--space-1);
  border: 1px solid var(--color-border);
}

/* Poetry block (preserves line breaks, no paragraph margins) */

.poetry {
  white-space: pre-wrap;
  font-family: var(--font-body);
  line-height: 1.5;
  margin: var(--space-6) 0;
}

/* Post/page Content Global - Media Queries */

@media (min-width: 601px) {
  .content h2 {
    font-size: var(--text-3xl);
  }
}

/* ============ POST/PAGE SINGLE ============ */

.post-header {
  margin-bottom: var(--space-2);
}

.post-header-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-4);
  margin: 0 0 var(--space-0) 0;
}

.page h1,
.post-header h1 {
  font-size: var(--text-3xl);
  line-height: 1.1;
  margin: 0 0 var(--space-6) 0;
  font-weight: 700;
  color: var(--color-heading);
}

.post-header-top > div {
  /* the RSS link's wrapper stays its natural width, never shrinks */
  flex-shrink: 0;
}

.post-header .post-subtitle {
  font-size: var(--text-lg);
  line-height: 1.4;
  margin: 0 0 0 0;
  color: var(--color-muted);
  font-weight: 400;
}

.post-header picture {
  display: block;
  margin: 0 0 var(--space-6);
}

.post-header picture img {
  width: 100%;
  height: auto;
  display: block;
  margin: var(--space-2) 0 0 0;
}

h1.post-title {
  margin: 0 0 var(--space-1) 0;
}

.post-meta {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: 0 0 0 0;
}

.post-meta time {
  font-variant-numeric: tabular-nums;
}

.post-meta .post-author {
  font-style: italic;
}

.post-content hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-4) 0;
}

/*.post-content a {
  color: var(--color-link);
}*/

.post-content h2 a,
.post-content h3 a {
  color: inherit;
  text-decoration: none;
}

.post mark {
  background-color: var(--color-highlight-text);
  color: var(--color-text);
}

@media (prefers-color-scheme: dark) {
  .post mark {
    color: var(--color-bg);
  }
}

@media (min-width: 601px) {
  .page h1,
  .post-header h1 {
    font-size: var(--text-4xl);
  }
  .post-header .post-subtitle {
    font-size: var(--text-xl);
    margin: 0 0 var(--space-1) 0;
  }
}

/* ============== COLLECTIONS =============== */

.collection-page-heading {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  margin: var(--space-4) 0;
}

.collection-page-heading h1 {
  margin: 0;
}

p.collection-description {
  background-color: var(--color-code-bg);
  border: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-3);
  margin: 0;
  font-size: var(--text-sm);
}

p.collection-more a {
  color: var(--color-link);
  font-size: var(--text-sm);
}

p.collection-more a:hover {
  color: var(--color-hover);
}

.pagination {
  font-size: var(--text-base);
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.pagination-info {
  margin: 0 var(--space-4);
}

.collection {
  margin-bottom: var(--space-6);
}

.collection-heading {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
  color: var(--color-heading);
  font-weight: 700;
}

.collection h2 {
  font-size: var(--text-3xl);
  /*margin: var(--space-2) 0 var(--space-4) 0;*/
}

.collection h3 {
  margin: 0;
}

.collection ul {
  list-style: none;
  padding: 0;
}

.collection li {
  margin-bottom: var(--space-3);
}

.collection a {
  color: var(--color-link);
  text-decoration: none;
}

.collection a:hover {
  color: var(--color-hover);
}

.collection .item-title {
  color: var(--color-link);
}

.collection .item-subtitle,
.collection .item-excerpt {
  color: var(--color-muted);
}

.collection .item-meta {
  color: var(--color-muted);
}

/* List */

.collection.list .collection-item {
  margin-bottom: var(--space-4);
}

.collection.list .item-title {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.collection.list .item-subtitle {
  font-size: var(--text-lg);
  font-style: italic;
  margin: 0;
}

.collection.list .item-meta {
  font-size: var(--text-sm);
  margin: 0;
}

.collection.list .title-media-icon,
.collection.list .paid-lock-icon {
  vertical-align: -1px;
}

/* Compact - single line, link, date • author */

.collection.compact .item-title {
  font-size: var(--text-base);
  font-weight: 700;
}

.collection.compact .item-date,
.collection.compact .item-author {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.collection.compact .item-author {
  font-style: italic;
}

.collection.compact .title-media-icon,
.collection.compact .paid-lock-icon {
  vertical-align: -4px;
}

/* Full — Image + body when item has media */

.collection.full .collection-item {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
}

.collection.full .item-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-0);
  font-weight: 700;
}

.collection.full .item-body {
  max-width: 70%;
}

.collection.full .item-subtitle {
  font-size: var(--text-lg);
  line-height: 1.45;
  margin: var(--space-1) 0 0 0;
}

.collection.full .item-excerpt {
  font-size: var(--text-sm);
  line-height: 1.45;
  margin: var(--space-1) 0 0 0;
}

.collection.full .item-meta {
  font-size: var(--text-xs);
  margin: var(--space-1) 0 0 0;
}

.collection.full .item-author {
  font-style: italic;
}

.collection.full .collection-item:has(.item-image) {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;
}

.collection-item img {
  max-width: 100%;
  height: auto;
  margin: 0 0 0 0;
}

.collection.full .collection-item:has(.item-image) .item-body {
  flex: 1;
  min-width: 0;
}

.collection.full .collection-item .item-image {
  flex-shrink: 0;
  width: 100%;
  position: relative;
}

.collection.full .collection-item .item-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.title-media-icon,
.paid-lock-icon {
  padding-left: var(--space-1);
  vertical-align: -1px;
  opacity: 0.5;
}

@media (min-width: 601px) {
  .collection.full .collection-item .item-image {
    width: 180px;
  }
}

.collection.full .collection-item .item-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1.5 / 1;
  object-fit: cover;
}

.collection.full .title-media-icon {
  padding-left: var(--space-1);
  vertical-align: -1px;
  opacity: 0.5;
}

@media (min-width: 601px) {
  .collection.full .collection-item:has(.item-image) {
    flex-direction: row;
    /*flex-direction: row-reverse;*/
  }
}

/* Links */

.collection.links .collection-item {
  margin-bottom: var(--space-1);
}

.collection.links .item-title {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
  font-weight: 400;
}

.collection.links .item-subtitle {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin: 0 0 0 0;
  line-height: 1;
}

/* Nav — a bare link list for layout areas (navigation, footer, sidebar).
   `style: horizontal|vertical` toggles the modifier class; default vertical. */

.collection.menu {
  margin: 0 0 0 0;
}

.collection.menu ul {
  margin: 0 0 0 0;
}

.collection.menu li {
  margin: 0 0 0 0;
}

.collection.menu a {
  text-decoration: underline;
}

.collection-menu {
  list-style: none;
  margin: 0 0 0 0;
  padding: 0;
  display: flex;
  row-gap: var(--space-4);
}

.collection-menu-vertical {
  flex-direction: column;
}

.collection-menu-horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.collection-menu-item {
  margin: 0;
}

/* Collection Glossary */

.collection.glossary dl {
  margin: 0 0 0 0;
  max-width: 60%;
}

.collection.glossary .glossary-entry {
  margin: 0 0 var(--space-4) 0;
}

.collection.glossary dd {
  font-size: var(--text-sm);
  margin-inline-start: var(--space-0);
}

.collection.glossary .item-title {
  font-size: var(--text-lg);
}

.collection.glossary .item-title a {
  text-decoration: underline;
}

.collection.glossary .item-subtitle {
  font-size: var(--text-base);
  font-style: italic;
  line-height: 1.3;
  margin: 0 0 var(--space-1) 0;
}

.collection.glossary .item-excerpt {
  font-size: var(--text-sm);
}

/* Collection Grids */

.collection-grid {
  display: grid;
  gap: var(--space-8);
  margin: var(--space-4) 0;
}

.collection-grid-2,
.collection-grid-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .collection-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .collection-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .collection.glossary dl {
    margin: 0 0 0 0;
    max-width: 100%;
  }
}

.collection-grid .collection {
  margin: 0;
}

.collection-grid h2 {
  font-size: var(--text-3xl);
  margin-top: 0;
}

@media (max-width: 630px) {
  .collection.glossary dl {
    margin: 0 0 0 0;
    max-width: 100%;
  }
}

/* ================ GALLERIES =============== */

.gallery {
  margin-bottom: var(--space-6);
}

.gallery-row {
  display: grid;
  gap: var(--space-gallery);
  margin-bottom: var(--space-gallery);
}

.gallery-row:has(figure),
.gallery-row:last-child {
  margin-bottom: 0;
}

.gallery-col-1 {
  grid-template-columns: 1fr;
}

.gallery-col-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-col-3 {
  grid-template-columns: repeat(3, 1fr);
}

.content .gallery img {
  margin: 0;
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

.gallery-col-1 img {
  aspect-ratio: auto;
}

.gallery-col-2 img {
  aspect-ratio: 1;
}

.gallery-col-3 img {
  aspect-ratio: 1 / 1;
}

.gallery-figure .gallery {
  margin-bottom: 0;
}

.gallery-figure .gallery-caption {
  margin-top: 0;
}

.gallery figure {
  margin: 0;
}

.gallery figcaption,
figcaption {
  margin-top: var(--space-1);
  margin-bottom: var(--space-gallery);
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-style: italic;
  text-align: center;
}

@media (min-width: 601px) {
  .gallery figcaption {
    font-size: var(--text-sm);
  }
}

/* --- Gallery item wrapper + click-to-zoom --------------------------------
   Each image is wrapped in .gallery-item (the grid/track cell) and a
   .gallery-zoom-link (the click target). Zoom is pure CSS: the link points
   at an overlay's #id and .gallery-zoom:target reveals it — no JS needed.
   gallery.js only adds keyboard/extra niceties. Restyle freely. */

.gallery-item {
  margin: 0;
  min-width: 0;
}

.gallery-item picture {
  display: block;
}

.gallery-zoom-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

/* Native popover lightbox: the browser hides [popover] until open and
   renders it in the top layer (immune to ancestor transforms/overflow).
   We only style the open state, the backdrop, and the image. */
.gallery-zoom {
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: var(--space-4);
  border: 0;
  background: transparent;
  overflow: hidden;
  cursor: zoom-out;
}

.gallery-zoom:popover-open {
  display: grid;
  place-items: center;
}

.gallery-zoom::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.gallery-zoom-image {
  max-width: min(100%, 1600px);
  max-height: 90vh;
  width: auto !important;
  height: auto;
  object-fit: contain !important;
  border: 0 !important;
}

.gallery-zoom-close {
  position: fixed;
  top: var(--space-3);
  right: var(--space-4);
  z-index: 1;
  padding: 0;
  border: 0;
  background: none;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
}

/* Explicit gallery ratios (grids only — carousels size by height).
   Images crop to fill; `object-fit: cover` comes from `.content .gallery img`.
   `auto`/`original` keep the image's natural shape instead. */

.gallery-ratio-square .gallery-row img {
  aspect-ratio: 1 / 1;
}
.gallery-ratio-portrait .gallery-row img {
  aspect-ratio: 3 / 4;
}
.gallery-ratio-landscape .gallery-row img,
.gallery-ratio-tv .gallery-row img {
  aspect-ratio: 4 / 3;
}
.gallery-ratio-wide .gallery-row img {
  aspect-ratio: 16 / 9;
}
.gallery-ratio-cinema .gallery-row img,
.gallery-ratio-film .gallery-row img {
  aspect-ratio: 21 / 9;
}
.gallery-ratio-auto .gallery-row img,
.gallery-ratio-original .gallery-row img {
  aspect-ratio: auto;
  object-fit: contain;
}

/* --- Carousel (slideshow: true) ------------------------------------------
   CSS scroll-snap does the scrolling/snapping with no JS. gallery.js adds
   prev/next buttons and dots as progressive enhancement. */

.gallery-carousel {
  position: relative;
}

.gallery-carousel .gallery-track {
  display: flex;
  gap: var(--space-gallery);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overflow-anchor: none;
}

.gallery-carousel .gallery-item {
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.gallery-carousel .gallery-item img {
  display: block;
  height: min(70vh, 32rem);
  width: auto;
  max-width: none;
  object-fit: contain;
}

.gallery-carousel .gallery-item figcaption {
  font-size: var(--text-xs);
  margin-bottom: 0;
}

.gallery-carousel .gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.gallery-carousel:has(figcaption) .gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-0);
}

.gallery-nav-button {
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.5rem;
  padding: 0;
  margin: 0;
  border: none;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.gallery-nav-button::before {
  content: "";
  display: block;
  width: 0.4rem;
  height: 0.4rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.gallery-prev::before {
  transform: rotate(-135deg);
} /* points left  */
.gallery-next::before {
  transform: rotate(45deg);
} /* points right */

.gallery-nav-button:hover {
  border-color: var(--color-text);
}

.gallery-dots {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.gallery-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: background 0.15s ease;
}

.gallery-dot[aria-current="true"] {
  background: var(--color-text);
}

/* ================= CARDS ================== */

.card {
  position: relative;
}

/* Pullquote */

.card-pullquote {
  text-align: center;
  font-size: var(--text-xl);
  padding: var(--space-2);
  margin: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  clear: both;
}

.card-pullquote p {
  line-height: 1.4;
  margin: 0;
  padding: 0;
}

.card-pullquote cite {
  font-size: var(--text-base);
  font-style: italic;
}

.pullquote-merge {
  margin-bottom: var(--space-4);
}

.pullquote-merge p {
  display: inline;
}

.pullquote-center {
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.pullquote-center + p {
  margin-top: 0;
}

.pullquote-left,
.pullquote-right {
  float: none;
  width: 100%;
  margin: var(--space-4) 0;
}

@media (min-width: 769px) {
  .pullquote-left {
    clear: none;
    float: left;
    width: 40%;
    margin: var(--space-2) var(--space-4) var(--space-2) 0;
  }

  .pullquote-right {
    clear: none;
    float: right;
    width: 40%;
    margin: var(--space-2) 0 var(--space-2) var(--space-4);
  }
}

/* Post Link Cards (small / medium / large) */

.card.post-link-small,
.card.post-link-medium,
.card.post-link-large {
  display: flex;
  text-decoration: none;
  align-items: flex-start;
  border: 1px solid var(--color-border);
}

.card.post-link-small .card-content,
.card.post-link-medium .card-content,
.card.post-link-large .card-content {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.card.post-link-small:hover,
.card.post-link-medium:hover,
.card.post-link-large:hover {
  background: var(--color-code-bg);
}

.card[class*="post-link-"] {
  cursor: pointer;
}

.card[class*="post-link-"] .card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card[class*="post-link-"] .card-content {
  flex: 1;
  min-width: 0;
}

.card[class*="post-link-"] .card-title a {
  color: inherit;
  text-decoration: none;
}

.card[class*="post-link-"] .card-title a:hover {
  text-decoration: underline;
}

.card[class*="post-link-"] .card-image {
  object-fit: cover;
  flex-shrink: 0;
  margin: 0;
  border: 1px solid var(--color-border);
  display: block;
}

.card[class*="post-link-"] .card-subtitle {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--text-sm);
  line-height: 1.3;
  color: var(--color-muted);
  font-style: italic;
}

.card[class*="post-link-"] .card-link {
  display: inline-block;
  color: var(--color-link);
  text-decoration: underline;
  font-size: var(--text-xs);
  margin: auto 0 0 0;
}

.card.post-link-large .card-link {
  margin: 0 0 0 0;
}

.card[class*="post-link-"] .card-link:hover {
  color: var(--color-text);
}

.card[class*="post-link-"] .card-metadata {
  font-size: var(--text-xxs);
  text-transform: uppercase;
}

.card[class*="post-link-"] .card-author {
  font-style: italic;
}

.card .card-price {
  font-family: var(--font-mono);
  color: var(--color-muted);
}

/* Excerpt typography — applies to all post-link sizes (small / medium /
   large) since they all use .card-excerpt now. */
/*.card[class*="post-link-"] .card-excerpt {
  margin: var(--space-2) 0 0 0;
  font-size: var(--text-base);
  line-height: 1.4;
  color: var(--color-text);
}*/

/* Post Link - Small */

.card.post-link-small {
  gap: var(--space-4);
  padding: var(--space-3);
  margin: var(--space-0) 0 var(--space-4) 0;
}

.card.post-link-small .card-image {
  width: 80px;
  height: 80px;
  display: block;
}

.card.post-link-small .card-title {
  margin: 0 0 calc(var(--space-1) * 0.5) 0;
  font-size: var(--text-base);
  font-weight: 700;
}

.card.post-link-small .card-subtitle,
.card.product-link-small .card-excerpt {
  font-size: var(--text-sm);
  line-height: 1.3;
}

.card.post-link-small .card-metadata {
  margin: 0 0 var(--space-1) 0;
  color: var(--color-muted);
}

/* Product Link - Small */

.product-link-small .card-header {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.product-variant {
  font-size: var(--text-xs);
  background-color: var(--color-muted);
  color: var(--color-bg);
  line-height: 1;
  padding: var(--space-1) var(--space-1);
}

.product-link-small .card-excerpt {
  font-size: var(--text-sm);
  margin-bottom: var(--space-0);
}

.product-link-small .card-price {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  line-height: 1;
}

/* Post Link - Medium */

.card.post-link-medium {
  gap: var(--space-5);
  padding: var(--space-3);
  margin: var(--space-4) 0 var(--space-8) 0;
}

.card.post-link-medium .card-image {
  width: 120px;
  height: 120px;
  display: block;
}

.card.post-link-medium .card-title {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.card.post-link-medium .card-subtitle {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--text-sm);
  line-height: 1.3;
  color: var(--color-muted);
  font-style: italic;
}

.card.post-link-medium .card-metadata {
  margin: 0 0 var(--space-2) 0;
  color: var(--color-muted);
}

.card.post-link-medium .card-body {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text);
}

/* Product Link - Medium */

.product-link-medium .card-header {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.card.product-link-medium .card-title {
  font-size: var(--text-xl);
}

.product-link-medium .card-excerpt {
  font-size: var(--text-base);
  line-height: 1.3;
  margin-bottom: var(--space-1);
}

.post-link-medium.product-link-medium .card-link {
  font-size: var(--text-base);
}

/* Post Link - Large
   Grid layout with template areas. Mobile-first single column where
   the image sits between metadata and excerpt. Desktop (≥960px) uses
   a two-column grid with the image on the left spanning all text
   rows. Adding/removing a breakpoint = editing one template-areas
   string; HTML order doesn't matter. */

.card.post-link-large {
  /* Override the shared .card flex layout — grid is what enables the
     responsive reflow without changing HTML order. */
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "subtitle"
    "metadata"
    "image"
    "excerpt-link";
  padding: var(--space-4);
  margin: var(--space-4) 0 var(--space-6) 0;
}

/* Map each direct child to its named area. Direct-child (>)
   selectors so anything nested inside (e.g. <a> in .card-title)
   isn't accidentally caught. */
/* title cell: the bare <h4> on posts/variant-less cards, or the .card-header
   wrapper (title + variant) on product cards that have a variant. */
.card.post-link-large > .card-title,
.card.post-link-large > .card-header {
  grid-area: title;
}
.card.post-link-large > .card-subtitle {
  grid-area: subtitle;
}
.card.post-link-large > .card-metadata {
  grid-area: metadata;
}
.card.post-link-large > picture,
.card.post-link-large > img.card-image {
  grid-area: image;
}
/* Excerpt + link share one grid cell and lay out as a flex row. The nested
   .card-excerpt / .card-link are flex children here, not grid items. */
.card.post-link-large > .large-card-excerpt-link {
  grid-area: excerpt-link;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* read-more sits on its own line, right-aligned */
  gap: var(--space-2);
}
.card.post-link-large > .large-card-excerpt-link > .card-excerpt {
  align-self: stretch; /* excerpt fills the width; its text stays left */
  min-width: 0;
  line-height: 1.3;
  margin: 0;
}
.card.post-link-large > .large-card-excerpt-link > .card-link {
  white-space: nowrap;
}

/* Image sizing — fills its grid cell width and keeps proportions.
   Picture wrapper has to be block-level for sizing to apply when
   ResponsiveImageRenderer added variants. */
.card.post-link-large > picture {
  display: block;
}

.card.post-link-large .card-image {
  border: none;
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: var(--space-4);
}

.card.post-link-large.no-image {
  /* Image-less cards collapse the image row so there's no empty space.
     Modifier class is added in the partial when image is blank. */
  grid-template-areas:
    "title"
    "subtitle"
    "metadata"
    "excerpt"
    "link";
}

/* Typography — unchanged by the layout switch, since these target
   the same descendant elements regardless of the parent's display. */
.card.post-link-large .card-title {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--text-2xl);
  font-weight: 700;
}

.card.post-link-large .card-subtitle {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--text-base);
  line-height: 1.3;
  color: var(--color-muted);
  font-style: italic;
}

.card.post-link-large .card-metadata {
  margin: 0 0 var(--space-2) 0;
  color: var(--color-muted);
}

.card.post-link-large .card-excerpt {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-sm);
}

.card.post-link-large .card-link {
  font-size: var(--text-sm);
}

/* Mid breakpoint (≥601px) — bump the excerpt up to text-base for the
   awkward sizes where the card is still single-column but the viewport
   has room for a slightly larger reading size. The desktop rule below
   overrides this back to text-sm at ≥960. Order matters: this block
   MUST appear before the 960px block so the later block wins at the
   overlap. */
@media (min-width: 601px) {
  .card.post-link-large .card-excerpt {
    font-size: var(--text-base);
  }
}

/* Product Link - Large */

.product-link-large .card-header {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-2);
}

.product-link-large .card-price {
  font-size: var(--text-lg);
}

.post-link-large.product-link-large .card-excerpt {
  font-size: var(--text-lg);
  line-height: 1.3;
}

.post-link-large.product-link-large .card-link {
  font-size: var(--text-base);
  margin-top: 0;
}

/* Asides */

.card-aside {
  float: none;
  width: auto;
  margin: var(--space-6) 0;
  display: grid;
  grid-template-columns: minmax(0, 30%) 1fr;
  gap: var(--space-4);
  align-items: start;
  color: var(--color-muted);
  font-size: var(--text-xs);
  line-height: 1.4;
  border: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-2);
}

.card-aside:not(:has(.aside-image)) {
  grid-template-columns: 1fr;
}
.card-aside:not(:has(.aside-image)) .aside-text,
.card-aside:not(:has(.aside-image)) .aside-link {
  grid-column: 1;
}

.card-aside.image-only {
  display: none;
}

.card-aside .aside-image {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: auto;
  margin: 0 0 0 0;
  display: block;
}

a.aside-link-inline {
  text-decoration: underline;
  color: var(--color-muted);
}

.card-aside .aside-link-inline:hover {
  color: var(--color-text);
}

.card-aside .aside-link {
  margin: var(--space-2) 0 0 0;
  display: inline-block;
  font-weight: bold;
  text-decoration: underline;
  color: var(--color-muted);
  text-wrap: nowrap;
}

.card-aside .aside-link:hover {
  color: var(--color-text);
}

.card-aside .aside-wrapper {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-aside .aside-wrapper:hover {
  opacity: 0.7;
}

.aside-text > :first-child {
  margin-top: 0;
}
.aside-text > :last-child {
  margin-bottom: 0;
}

article .content,
.home.content {
  position: relative;
  margin-right: auto;
}

@media (max-width: 480px) {
  .card-aside {
    grid-template-columns: 1fr;
  }
  .card-aside .aside-image {
    grid-column: 1;
    grid-row: 1;
  }
  .card-aside .aside-body {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (min-width: 601px) {
  .card-aside {
    border: 1px solid var(--color-border);
    position: static;
    float: right;
    /*margin: var(--space-3) 0 var(--space-2) 1rem;*/
    margin: 0 0 var(--space-2) var(--space-2);
    /*padding: 0.8rem;*/
    left: auto;
    transform: none;
    clear: right;
    width: 200px;
    display: block;
  }

  .card-aside.image-only {
    border: none;
    display: block;
  }

  .card-aside.image-only .aside-image {
    margin: 0 0 var(--space-3) auto;
  }

  .card-aside .aside-image {
    margin: 0 0 var(--space-2) 0;
  }

  .card-aside .aside-link {
    margin: var(--space-2) 0 0 0;
  }
}

@media (min-width: 960px) {
  article .content:has(.card-aside),
  .home.content:has(.card-aside) {
    margin-left: var(--aside-width);
    /*max-width: var(--aside-content-width);*/
  }

  .card-aside + :is(p, h2, h3, h4, ul, ol, blockquote) {
    margin-top: 0;
  }

  .card-aside {
    position: absolute;
    left: calc(var(--aside-width) * -1);
    width: calc(var(--aside-width) - 14px);
    overflow-wrap: break-word;
    float: none;
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    border: none;
    text-align: right;
  }

  .card-aside .aside-image,
  .card-aside.image-only .aside-image {
    margin: var(--aside-image-top-offset) 0 var(--space-3) auto;
  }

  .card-aside .aside-text {
    margin: var(--aside-text-top-offset) 0 0 0;
  }
}

/* ============ MEDIA PLAYERS =============== */

/* Audio Player */

.audio-player {
  padding: var(--space-5);
  background: var(--player-bg);
  border: 1px solid var(--player-border);
  margin: var(--space-6) 0;
}

.player-header {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.player-header img {
  border: 1px solid var(--color-border);
  margin: 0;
}

.player-artwork {
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  object-fit: cover;
  flex-shrink: 0;
}

.player-info {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.player-title {
  font-weight: 600;
  font-size: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-meta {
  font-size: var(--text-sm);
  color: var(--player-meta-color);
  margin-top: 0.15rem;
}

.episode-meta span + span::before {
  content: " · ";
}

.now-playing {
  font-size: 0.75rem;
  color: var(--player-accent);
  margin-top: 0.2rem;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress */

.player-progress {
  position: relative;
  height: 6px;
  background: var(--player-track);
  cursor: pointer;
  margin: var(--space-1) 0;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--player-accent);
  pointer-events: none;
  transition: width 0.1s linear;
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--player-accent);
  background: var(--color-bg);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.player-progress:hover .progress-handle {
  opacity: 1;
}

.player-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--player-meta-color);
}

/* Controls */

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.player-controls-center {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.controls-center {
  display: flex;
}

.player-btn {
  background: none;
  border: none;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--player-btn-color);
  display: flex;
  align-items: center;
  justify-content: center;
  /*border-radius: 50%;*/
  transition:
    background 0.15s,
    color 0.15s;
}

.player-btn:hover {
  background: var(--player-btn-hover-bg);
}

.btn-skip svg {
  width: 30px;
  height: 30px;
}

.btn-play {
  width: 40px;
  height: 40px;
  background: var(--player-accent);
  color: var(--player-btn-play-color);
  border-radius: 50%;
}

.btn-play:hover {
  background: var(--player-accent-hover);
  color: var(--player-btn-play-color);
}

.btn-play svg {
  width: 26px;
  height: 26px;
}

.btn-play .icon-pause {
  display: none;
}

.btn-play[data-playing="true"] .icon-play {
  display: none;
}

.btn-play[data-playing="true"] .icon-pause {
  display: block;
}

.btn-speed {
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  min-width: var(--space-12);
  border: 1px solid var(--player-border);
  border-radius: 0.1rem;
  background: var(--color-bg);
  color: var(--player-btn-color);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

/* Prev/Next episode in player */

.btn-wrapper {
  flex: 1;
  display: flex;
  min-width: 0;
}

.btn-wrapper:first-child {
  justify-content: flex-start;
}
.btn-wrapper:last-child {
  justify-content: flex-end;
}

.btn-episode {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--player-btn-color);
  background: none;
  border: none;
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
  transition: background 0.15s;
  flex: 0 0 auto;
  max-width: 80%;
}

a.btn-episode {
  color: var(--player-btn-color);
}

.btn-prev {
  justify-content: flex-start;
}
.btn-next {
  justify-content: flex-end;
}

.btn-episode:hover {
  background: var(--player-btn-hover-bg);
}

.btn-episode.is-disabled {
  opacity: 0;
  pointer-events: none;
}

.btn-episode svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.episode-nav-title {
  font-size: var(--text-xxs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--player-meta-color);
  line-height: 1.2;
}

.btn-prev .episode-nav-title {
  text-align: left;
}
.btn-next .episode-nav-title {
  text-align: right;
}

/* Chapters */

.player-chapters {
  border-top: 1px solid var(--player-border);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
}

.player-chapters-heading {
  font-size: var(--space-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--player-meta-color);
  margin-bottom: var(--space-2);
}

.chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.chapter {
  display: flex;
  gap: var(--space-3);
  padding: 0.35rem var(--space-2);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.1s;
}

.chapter:hover,
.chapter.is-active {
  background: var(--player-chapter-active-bg);
}

.chapter.is-active {
  font-weight: 600;
}

.chapter-time {
  color: var(--player-meta-color);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 3.5rem;
}

/* Video Player */

.video-player-container {
  position: relative;
  background: #000;
  overflow: hidden;
  /*margin: var(--space-6) 0;*/
}

.video-player-video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-controls {
  background: #1a1a1a;
  padding: var(--space-2) var(--space-3);
}

.video-progress {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: height 0.2s;
  margin-bottom: var(--space-2);
}

.video-progress:hover {
  height: 6px;
}

.video-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: #ffffff;
  pointer-events: none;
}

.video-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s;
  pointer-events: none;
}

.video-progress:hover .video-progress-handle,
.video-progress:active .video-progress-handle {
  transform: translate(-50%, -50%) scale(1);
}

.video-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.video-controls-left,
.video-controls-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.video-btn {
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

a.video-btn {
  color: var(--color-bg);
}

@media (prefers-color-scheme: dark) {
  a.video-btn {
    color: var(--color-text);
  }
}

.video-btn:hover {
  opacity: 0.8;
}

.video-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.video-btn.btn-play-pause svg {
  width: 28px;
  height: 28px;
}

.video-btn.btn-episode-nav.btn-prev.is-disabled {
  display: none;
}

.video-btn.btn-episode-nav.is-disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.video-time {
  color: #fff;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  margin-left: 12px;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.video-time-separator {
  opacity: 0.6;
}

.video-btn.btn-fullscreen {
  margin-left: auto;
}

.video-btn.btn-fullscreen .icon-fullscreen-exit {
  display: none;
}

.video-player-container.is-fullscreen .video-player-video {
  height: 100%;
  aspect-ratio: auto;
}

.video-player-container.is-fullscreen
  .video-btn.btn-fullscreen
  .icon-fullscreen {
  display: none;
}

.video-player-container.is-fullscreen
  .video-btn.btn-fullscreen
  .icon-fullscreen-exit {
  display: block;
}

.video-btn.btn-play-pause .icon-pause {
  display: none;
}

.video-player-container.is-playing .video-btn.btn-play-pause .icon-play {
  display: none;
}

.video-player-container.is-playing .video-btn.btn-play-pause .icon-pause {
  display: block;
}

/* ================ PODCAST ================= */

article.post-podcast {
  margin-left: 0;
}

.podcast-hero {
  gap: var(--space-4);
  position: relative;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  align-items: center;
  justify-content: center;
}

.podcast-hero > picture img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
}

.hero-player .audio-player {
  background: var(--player-overlay-bg);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(8px);
  margin: 0;
}

.podcast-hero.is-no-cover {
  display: block;
}

.podcast-hero.is-no-cover .hero-player {
  position: static;
  padding: 0;
  width: 100%;
}

.podcast-hero.is-no-cover .hero-player .audio-player {
  background: var(--player-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--player-border);
}

p.podcast-audio-fallback {
  font-size: var(--text-xs);
  margin: 0 0 0 0;
  line-height: 1;
  position: absolute;
  right: 0;
}

/* Episode list */

.episode-list {
  margin-top: var(--space-8);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-0);
}

.episode-list ol {
  list-style: none;
  padding-left: 0;
}

.episode-list li {
  margin-bottom: 0;
}

.episode-list h2 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.episode {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.episode-list-meta {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.episode-item {
  border-bottom: 1px solid var(--color-border);
}

.episode-item.is-current {
  background: var(--color-bg-dim);
}

.episode-item a {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}

.episode-item a:hover {
  background: var(--player-btn-hover-bg);
}

.episode-item a > span {
  font-size: 0.95rem;
}

.episode-item.is-current a > span {
  font-weight: 600;
}

.episode-meta-row {
  display: flex;
  gap: var(--space-3);
  font-size: 0.75rem;
  color: var(--player-meta-color);
}

.episode-number {
  font-weight: 600;
}

/* Subscribe / feed */

/* Subscribe block spacing — used on episode pages and on podcast-connected
   pages (pages/show.html.erb), so it's not scoped to .podcast-episode. */
.podcast-subscribe {
  margin-top: var(--space-6);
  font-size: 0.85rem;
}

/* Larger feed-link variant */

.podcast-subscribe .feed-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem var(--space-3);
  border: 1px solid var(--player-border);
  color: var(--player-btn-color);
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: normal;
  opacity: 1;
}

.podcast-subscribe .feed-link:hover {
  background: var(--player-btn-hover-bg);
}

.feed-link {
  font-size: var(--text-xxs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border: 1px solid currentColor;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.feed-link:hover {
  opacity: 1;
}

.feed-link-private {
  opacity: 0.8;
}

/* Subscribe links row (app/service links + RSS). Used both inline and
   inside the collapsible menu below. */
.subscribe-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* Menu mode (subscribe_display: menu): a native <details> disclosure —
   the "Subscribe" button is the <summary> styled as a button, and
   clicking it reveals the links. No JS. */
.podcast-subscribe--menu > summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
}

.podcast-subscribe--menu > summary::-webkit-details-marker {
  display: none;
}

.podcast-subscribe--menu[open] > summary {
  margin-bottom: var(--space-3);
}

/* ============ DOCUMENTATION =============== */

.docs-back-link {
  margin-bottom: var(--space-0);
  font-size: var(--text-sm);
  display: inline-block;
}

.content.documentation p mark,
.documentation mark {
  background-color: var(--color-highlight-text);
  color: var(--color-text);
  padding: 0 calc(var(--space-1) * 0.8);
  border-radius: 1px;
  line-height: 1;
}

.documentation img.screenshot {
  border: 1px solid var(--color-muted);
}

@media (prefers-color-scheme: dark) {
  .content.documentation p mark,
  .documentation mark {
    color: var(--color-bg);
  }
}

.content.documentation p code {
  padding: calc(var(--space-1) * 0.5) calc(var(--space-2) * 0.5);
}

.content.documentation a code {
  color: var(--color-link);
}

.content.documentation a:hover code {
  color: var(--color-text);
}

.content.documentation li pre {
  padding: var(--space-4) var(--space-4) var(--space-2) var(--space-4);
  margin: 0;
}

.content.documentation li code {
  font-size: var(--text-xs);
  padding: calc(var(--space-1) * 0.5) calc(var(--space-2) * 0.5);
}

.content.documentation li pre code {
  padding: 0;
}

.page-documentation .collection-grid,
.documentation .collection-grid {
  display: grid;
  column-gap: var(--space-8);
  row-gap: var(--space-4);
  margin: var(--space-4) 0;
}

.page-documentation .collection-grid h2 {
  font-size: var(--text-2xl);
  margin-top: 0;
}

.content.documentation table {
  font-size: var(--text-sm);
  line-height: 2;
}

/* =============== UTILITIES ================ */

.back-link {
  display: inline-block;
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  color: var(--color-link);
  text-decoration: underline;
}

.back-link:hover {
  color: var(--color-text);
}

hr.clear-floats {
  clear: both;
  border-top: none;
}

/* ================= FORMS ================== */

/* Global form vocabulary. Promoted from member pages (the only place forms
   appear today); any future form reuses these. Member-specific bits stay in
   the Members section. */

.form-field {
  margin-bottom: var(--space-4);
}

.form-field label {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
  color: var(--color-muted);
}

.form-field input[type="email"],
.form-field input[type="text"],
.form-field input[type="password"] {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--color-text);
  box-sizing: border-box;
}

.form-field input:focus {
  outline: 2px solid var(--color-link);
  outline-offset: -1px;
}

.form-actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.form-actions a {
  text-decoration: none;
}

/* ================ BUTTONS ================= */

/* Global button vocabulary: .btn-* classes any feature reuses (share menu,
   products, member forms). Member pages override the .btn-* palette at higher
   specificity — those overrides live in the Members section. */

.btn-primary {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--color-heading);
  color: var(--color-bg);
  border: 1px solid var(--color-heading);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--color-bg);
  color: var(--color-heading);
}

.btn-secondary {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: transparent;
  color: var(--color-heading);
  border: 1px solid var(--color-text);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--color-heading);
}

.btn-outline {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background-color: transparent;
  border: 1px solid var(--color-link);
  color: var(--color-link);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  text-decoration: none;
  text-wrap: nowrap;
  box-sizing: border-box;
  line-height: normal;
}

.btn-outline:hover {
  background-color: var(--color-link);
  color: var(--color-bg);
}

.btn-destructive {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background-color: transparent;
  border: 1px solid var(--color-link);
  color: var(--color-link);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  text-decoration: none;
  text-wrap: nowrap;
  box-sizing: border-box;
  line-height: normal;
}

.btn-destructive:hover {
  background-color: var(--color-link);
  color: var(--color-bg);
}

/* Grid modifier — smaller, tighter (product collection grid) */

.btn-grid {
  padding: var(--space-1) var(--space-1);
  font-size: var(--text-sm);
}

/* ================= SHARE ================== */

/* Share button (Roe-anji `for: share`): a single trigger (.btn-primary) that
   reveals Copy link + Email (.btn-outline) on desktop, or opens the native
   share sheet on touch. `.share` is the wrapper hook — style/align every share
   button here (e.g. add `justify-content: center`). Per-instance tweaks come
   from a `style:` value → `.share-<token>`. */

.share {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.share [data-share-target="feedback"] {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* Action menu — the options a button→menu action reveals (share, and later
   subscribe). Reusable hook, so every family member's menu buttons are sized
   once: a step smaller than the trigger. */
.button-menu {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.button-menu .btn-primary,
.button-menu .btn-outline,
.button-menu button {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

/* Alignment (`style: left|center|right`) — full-width row so it can shift */
.share-left {
  display: flex;
  justify-content: flex-start;
}

.share-center {
  display: flex;
  justify-content: center;
}

.share-right {
  display: flex;
  justify-content: flex-end;
}

/* Compact (`style: small`) */
.share-small .btn-primary,
.share-small .btn-outline {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

/* ================ MEMBERS ================= */

/* Member pages (account/edit) */

.member-page .account-details {
  margin: 0 0 var(--space-6) 0;
}

.member-page .account-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.member-page .account-actions form {
  display: contents;
}

/* Member pages (signup/signin/upgrade/donate/unsubscribe wrapper) */

.member-page {
  max-width: 26rem;
  margin: var(--space-12) auto;
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  font-size: var(--text-base);
}

.member-page h1 {
  margin: 0 0 var(--space-2) 0;
}

.member-page form {
  margin: 0 0;
}

/* Buttons (member palette) — override the global .btn-* colors on member pages
   (link-coloured rather than the heading-coloured global default). The base
   reset also applies to bare <button> here (e.g. donate presets). */

.member-page button,
.member-page [class*="btn-"] {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-base);
  cursor: pointer;
  text-decoration: none;
  text-wrap: nowrap;
  box-sizing: border-box;
  line-height: normal;
}

.member-page button:hover,
.member-page [class*="btn-"]:hover {
  background-color: var(--color-bg-dim);
}

.member-page .btn-primary {
  background-color: var(--color-link);
  color: var(--color-bg);
  border-color: var(--color-link);
}

.member-page .btn-primary:hover {
  background-color: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
}

.member-page .btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-link);
  color: var(--color-link);
}

.member-page .btn-outline:hover {
  background-color: var(--color-link);
  color: var(--color-bg);
}

.member-page .btn-destructive {
  border: 1px solid var(--color-link);
  color: var(--color-link);
}

.member-page .btn-destructive:hover {
  background-color: var(--color-link);
  color: var(--color-bg);
}

.checkout-form-wrapper {
  margin-top: var(--space-6);
}

.checkout-form-wrapper.is-guest .member-checkout,
.checkout-form-wrapper.is-member .non-member-checkout {
  display: none;
}

/* Alerts */

.member-page .alert {
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-dim);
}

.member-page .alert h1 {
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-2) 0;
  color: var(--color-text);
}

.member-page .alert h2 {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-2) 0;
  color: var(--color-text);
}

.member-page .alert p {
  margin: 0;
  color: var(--color-text);
}

.member-page .alert-note {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-top: var(--space-2);
}

.member-page .alert--success {
  border-color: var(--color-link);
  background-color: rgba(0, 0, 238, 0.04);
}

.member-page .alert--success h1,
.member-page .alert--success h2 {
  color: var(--color-link);
}

.member-page .alert--warning {
  border-color: var(--color-heading);
  background-color: var(--color-bg-dim);
}

.member-page .alert--warning h1,
.member-page .alert--warning h2 {
  color: var(--color-heading);
}

.member-page .alert--error {
  border-color: #dc2626;
  background-color: rgba(220, 38, 38, 0.05);
}

.member-page .alert--error h1,
.member-page .alert--error h2 {
  color: #dc2626;
}

.member-page .alert--info {
  border-color: var(--color-border);
  background-color: var(--color-bg);
}

.member-page .form-errors {
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid #dc2626;
  background-color: rgba(220, 38, 38, 0.05);
}

.member-page .form-errors h3 {
  font-size: var(--text-base);
  margin: 0 0 var(--space-2) 0;
  color: #dc2626;
}

.member-page .form-errors ul {
  margin: 0;
  padding-left: var(--space-4);
  color: #991b1b;
}

.member-page .form-errors li {
  margin-bottom: var(--space-1);
}

.member-page .password-display {
  padding: var(--space-4);
  margin: var(--space-3) 0;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-dim);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  word-break: break-all;
}

.member-page .password-note {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: var(--space-3);
}

/* Donation presets */

.member-page .donate-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.member-page .donate-presets button {
  flex: 1 1 auto;
  min-width: var(--space-16);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-base);
  cursor: pointer;
}

.member-page .donate-presets button:hover {
  background-color: var(--color-bg-dim);
}

.member-page .donate-presets button.is-selected {
  background-color: var(--color-link);
  color: var(--color-bg);
  border-color: var(--color-link);
}

/* Paid-content gate */

.paid-content-gate {
  font-size: var(--text-2xl);
  text-align: center;
  margin: var(--space-8) 0;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.paid-content-gate a {
  color: var(--color-link);
  text-decoration: none;
}

/* ========== STORE — PRODUCT PAGE ========== */

.product .content {
  max-width: var(--container-width);
  display: grid;
  grid-template-columns: 1fr min(var(--product-copy-width), 100%) 1fr;
  row-gap: var(--space-0);
}

.product-top {
  display: contents;
  /* product_content wraps everything above the first `---` (hero, title, price,
     button) in .product-top.*/
}

.product-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-2);
  color: var(--color-heading);
}

.product h2 {
  font-size: var(--text-xl);
  margin: 0 0 var(--space-6) 0;
}

.product h3 {
  color: var(--color-heading);
  font-size: var(--text-xl);
}

.product p {
  font-size: var(--text-base);
  line-height: 1.5;
}

.product .gallery {
  margin: 0 0 0 0;
}

/* Base sizing for the product's own body images — the hero and any inline
   photos. Galleries and cards bring their own layout, so exclude them. */
.product img:not(.gallery *):not(.card *) {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  margin: 0 auto var(--space-4);
  display: block;
}

.product img.product-image {
  border: 1px solid var(--color-border);
}

.product ul.product-variant-list {
  font-size: var(--text-base);
  list-style: none;
  color: var(--color-link);
  margin-top: var(--space-2);
  padding-left: 0;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.product ul.product-variant-list li {
  margin-bottom: var(--space-2);
}

.product ul.product-variant-list .product-variant-item {
  display: contents;
}

.product ul.product-variant-list .variant-name {
  justify-self: start;
}

.product ul.product-variant-list .variant-price {
  color: var(--color-muted);
  justify-self: end;
}

/* The button (last cell) sits at the far right of its 1fr column. */
.product ul.product-variant-list .product-variant-item > :last-child {
  justify-self: start;
  margin: 0 0 0 0;
}

.product ul button {
  color: var(--color-link);
  background-color: var(--color-bg);
  border: 1px solid var(--color-link);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
}

.product ul button:hover {
  background-color: var(--color-link);
  color: var(--color-bg);
}

.product .content > *,
.product-top > * {
  grid-column: 2;
  margin-block: 0;
}

/* Images, captioned figures, and galleries span all three tracks — full width.
   Listed for both the loose grid children and the .product-top-wrapped hero. */
.product .content > p:has(img),
.product .content > p:has(picture),
.product .content > figure,
.product .content > .gallery,
.product .content > .gallery-figure,
.product-top > p:has(img),
.product-top > p:has(picture),
.product-top > figure,
.product-top > .gallery,
.product-top > .gallery-figure {
  grid-column: 1 / -1;
}

@media (min-width: 521px) {
  .product-title {
    font-size: var(--text-4xl);
  }

  .product h2 {
    font-size: var(--text-2xl);
  }
}

/* ==== STORE — PRODUCT COLLECTION GRID ===== */

article.page-store,
article.page-store .content {
  padding-top: 0;
  max-width: var(--container-width);
}

article.page-store h1 {
  color: var(--color-heading);
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

article.page-store p {
  font-size: var(--text-base);
  line-height: 1.5;
}

article.page-store h2 {
  color: var(--color-heading);
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

@media (min-width: 401px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 601px) {
  .product-grid {
    gap: var(--space-8);
  }
}

@media (min-width: 769px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 901px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

.grid-item {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.grid-item-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  margin-bottom: var(--space-2);
  overflow: hidden;
}

.grid-item-image a {
  display: flex;
  width: 100%;
  height: 100%;
}

.grid-item-image img {
  margin: 0;
  display: block;
  background: var(--color-bg);
}

/* Aspect-ratio containers driven by class on the image */

/* Aspect-ratio containers driven by the class on the image. Product images
   are never cropped (object-fit: contain) — they sit inside the ratio box. */
.grid-item-image:has(.img-square) {
  aspect-ratio: 1 / 1;
}
.grid-item-image:has(.img-portrait) {
  aspect-ratio: 3 / 4;
}
.grid-item-image:has(.img-landscape),
.grid-item-image:has(.img-tv) {
  aspect-ratio: 4 / 3;
}
.grid-item-image:has(.img-wide) {
  aspect-ratio: 16 / 9;
}
.grid-item-image:has(.img-cinema),
.grid-item-image:has(.img-film) {
  aspect-ratio: 21 / 9;
}
/* img-auto / img-original: no container ratio → natural sizing */

.img-auto,
.img-original,
.img-square,
.img-portrait,
.img-landscape,
.img-tv,
.img-wide,
.img-cinema,
.img-film {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Product images are never cropped: EVERY explicit ratio
   (square / portrait / landscape / tv / wide / cinema / film) fills its ratio
   cell so `contain` + `center` engage — the whole image shows, a landscape
   photo centered vertically, a portrait poster horizontally — with a subtle
   matte behind the letterbox and an outline framing the cell. `img-auto` /
   `img-original` stay natural (no fixed cell, no letterbox — good for a
   single-category grid). Photo galleries are separate and use `cover`. */
.grid-item-image img:not(.img-auto):not(.img-original) {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--color-bg-dim);
}

/* When variants exist the image is wrapped in <picture> (inline by default,
   collapses to the image's natural size), so the inner <img>'s `height: 100%`
   has nothing to fill. Make the wrapper fill so the <img> above can. */
.grid-item-image picture:has(img:not(.img-auto):not(.img-original)) {
  display: block;
  width: 100%;
  height: 100%;
}

/* Frame the cell without changing its size — outline never takes space, so the
   ratio box stays exact. */
.grid-item-image:has(img:not(.img-auto):not(.img-original)) {
  outline: 1px solid var(--color-border);
  outline-offset: -1px;
}

.grid-item-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.grid-item-title a {
  color: var(--color-heading);
  text-decoration: none;
}

.grid-item-title a:hover {
  text-decoration: underline;
}

.grid-item-description {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.5;
}

.grid-item-variants {
  display: none;
}

.grid-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.grid-item-price {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-heading);
}

/* ============== BREADCRUMBS =============== */

.breadcrumbs {
  margin-top: calc(var(--space-4) * -1);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.breadcrumb-link {
  color: var(--color-link);
  text-decoration: none;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-text,
.breadcrumb-current {
  color: var(--color-text);
}

.breadcrumb-current {
  font-weight: 600;
}

/* ============== CUSTOM CODE =============== */
[data-typewriter]::after {
  color: var(--color-link);
  font-weight: bold;
  margin-left: 1px;
}
