/* ============== THEME INFO ================
   Roe Theme: Roe Site
   Version: 0.0.34
*/

/* ============ DESIGN VARIABLES ============ */

:root {
  /* Site is always in dark mode */
  color-scheme: dark;

  /* Layout */
  --container-width: 48rem;
  --sidebar-width: 11rem;
  --aside-width: 10rem;
  --aside-text-top-offset: 0.25rem;
  --aside-image-top-offset: 0.4rem;

  /* 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 (Dark Theme) */

  /* Surface colors — near-black bases, not pure black (easier on 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: #c64320;
  --color-hover: #e47e5d;
  --color-visited: #c64320;

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

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

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

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-2) var(--space-8) var(--space-8) var(--space-8);
  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,
a:visited {
  color: var(--color-visited);
  text-decoration: underline;
}

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

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

picture {
  display: block;
}

article {
  margin: 0 auto;
}

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

sup {
  line-height: 1;
}

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

/* =========== 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: none;
  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-family: "Berkeley Mono";*/
  font-weight: 500;
  /*font-style: italic;*/
  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;
}

/* Navigation Cart Link */

.nav-cart-wrapper {
  margin-left: auto;
}

.nav-cart {
  text-decoration: none;
  position: relative;
}

.nav-cart sup {
  font-size: var(--text-xs);
  background: var(--color-link);
  color: var(--color-bg);
  border-radius: 999px;
  padding: 0 var(--space-1);
  margin-left: var(--space-1);
}

/* ============ 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);
}

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

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

.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-xl);
  line-height: 1.25;
  margin: var(--space-6) 0 var(--space-2) 0;
  font-weight: 700;
}

.content h4 {
  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 ul ul,
.content ol ol {
  margin-top: var(--space-2);
}

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

.content a {
  color: var(--color-link);
  text-decoration: underline;
}

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

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

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

.content blockquote {
  margin: 0 0 var(--space-6) var(--space-3);
  padding-left: var(--space-4);
  border-left: 3px solid var(--color-link);
  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: 0;
  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 hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin-top: 0;
  margin-bottom: var(--space-8);
}

.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 */

.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 0 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 ============ */

/* Home */

.home-header h1 {
  min-height: 2lh;
}

.page-home .content h2:first-of-type {
  color: var(--color-muted);
  margin: 0 0 var(--space-8) 0;
}

.download-btn-wrapper {
  margin: var(--space-16) auto var(--space-12) auto;
  text-align: center;
}

.download-btn-wrapper svg {
  margin: var(--space-4) auto var(--space-2) auto;
  display: block;
  height: 8rem;
  width: 8rem;
}

.page-home .content .download-btn-wrapper h2.roe-logo-h2 {
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.download-btn-wrapper a.btn-primary {
  display: inline-block;
  margin: 0 auto var(--space-2) auto;
  font-size: var(--text-xl);
}

.download-btn-wrapper a {
  font-size: var(--text-sm);
  display: block;
}

.page-home ul {
  font-size: var(--text-lg);
}

.page-home ul li ul {
  margin-top: 0;
}

.page-home ul li ul li {
  color: var(--color-muted);
  font-size: var(--text-xs);
  list-style-type: none;
}

/* All */

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

.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 (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-8) 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-text);
}

.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-4) 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-text);
}

.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;
}

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

.collection.compact li a {
  font-size: var(--text-base);
}

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

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

/* 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 {
  padding-left: var(--space-1);
  vertical-align: -4px;
  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;
}

.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-2);
}

.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;
}

* 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-xs);
}

/* Collection Grids */

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

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

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

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

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

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

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

.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 {
  max-height: 70vh;
  object-fit: contain;
}

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

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

.gallery figure {
  margin: 0;
}

.gallery 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);
  }
}

/* ================= 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 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-"] .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-link {
  display: inline-block;
  color: var(--color-link);
  text-decoration: underline;
  font-size: var(--text-xs);
  margin: auto 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;
}

/* 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-6) 0;
}

.card.post-link-small .card-image {
  width: 75px;
  height: 75px;
  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-metadata {
  margin: 0 0 var(--space-1) 0;
  color: var(--color-muted);
}

/* Post Link - Medium */

.card.post-link-medium {
  gap: var(--space-8);
  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);
}

/* 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. */
.card.post-link-large > .card-title {
  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;
}
.card.post-link-large > .card-excerpt {
  grid-area: excerpt;
}
.card.post-link-large > .card-link {
  grid-area: link;
}

/* 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);
}

/* Image-less cards collapse the image row so there's no empty space.
   Modifier class is added in the partial when image is blank. */
.card.post-link-large.no-image {
  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);
  }
}

/* Desktop layout — two columns, image left, link pinned to bottom
   of its cell so it lines up with the bottom of the image. */
@media (min-width: 960px) {
  .card.post-link-large {
    grid-template-columns: 45% 1fr;
    /* Four auto rows for the text, then 1fr for the link row so it
       absorbs the difference between the image's intrinsic height and
       the text rows' content height. Without the 1fr, the link's row
       would be auto-sized to the link itself and there'd be nothing
       for `align-self: end` to push against. With it, the link row
       fills the leftover space and `align-self: end` pins the link
       to the bottom of the image. */
    grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas:
      "image title"
      "image subtitle"
      "image metadata"
      "image excerpt"
      "image link";
    /* Row gap was applying between every text element on desktop and
       compounding with each element's own margin-bottom — way too
       much air. Drop it to 0 and let the elements' margins control
       inter-row spacing; keep the column gap so image and text don't
       touch. */
    row-gap: 0;
    column-gap: var(--space-8);
  }

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

  .card.post-link-large.no-image .card-excerpt {
    font-size: var(--text-base);
  }

  /* Image cell stretches to the full text-column height. */
  .card.post-link-large > picture,
  .card.post-link-large > img.card-image {
    align-self: stretch;
  }

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

  /* Same effect as the old flex `margin-top: auto` — pushes the link
     to the bottom of its (now-expanded) grid cell so it bottom-aligns
     with the image. */
  .card.post-link-large > .card-link {
    font-size: var(--text-xs);
    align-self: end;
  }

  /* No-image cards collapse back to a single column on desktop too,
     otherwise an empty 45% slot would sit next to the text. */
  .card.post-link-large.no-image {
    grid-template-columns: 1fr;
  }
}

/* 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);
}

.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(--color-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 */

.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;
}

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

.docs-back-link {
  margin-bottom: var(--space-4);
  display: inline-block;
}

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

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

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

/* =============== 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;
}

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

a.member-account-icon svg {
  height: var(--space-6);
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
}

/* 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 form {
  margin: var(--space-6) 0;
}

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

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

.member-page .form-field input[type="email"],
.member-page .form-field input[type="text"],
.member-page .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;
}

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

/* Member buttons */

.member-page button,
.member-page [class*="btn-"] {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  margin: 0 var(--space-2) 0 0;
  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;
  text-decoration: none;
}

.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-color: 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-color: var(--color-link);
  color: var(--color-link);
}

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

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

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

.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-lock-icon {
  padding-left: var(--space-1);
  vertical-align: -4px;
  opacity: 30%;
}

.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);
}

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

.product h2 {
  font-size: var(--text-2xl);
  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 img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  margin: 0 auto var(--space-4);
  display: block;
  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-6);
  padding-left: 0;
}

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

.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);
}

@media (min-width: 590px) {
  .product img {
    float: left;
    max-width: 45%;
    margin: 0 var(--space-6) var(--space-4) 0;
  }
}

.product h1 {
  font-size: var(--text-3xl);
}

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

@media (min-width: 521px) {
  .product h1 {
    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(4, 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-4);
  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 */

.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) {
  aspect-ratio: 4 / 3;
}
.grid-item-image:has(.img-wide) {
  aspect-ratio: 16 / 9;
}

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

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

.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-size: var(--text-base);
  font-weight: 700;
  color: var(--color-heading);
}

/* Buttons (canonical) */

.btn-primary,
a.btn-primary {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--color-link);
  color: var(--color-bg);
  border: 1px solid var(--color-link);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-base);
  letter-spacing: 0.05em;
  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-heading);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

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

/* Grid button modifier */

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

/* ============== 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;
}
