/* Neobrutalism Design - Inspired by epub-manager */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Warm Dark Theme - Enhanced Reading Experience */
:root {
  /* Color Variables - Enhanced Warm Dark Theme */
  --bg-color: #2a2a28;
  --bg-light: #323330;
  --text-color: #d5cfc5;
  --text-secondary: #c0b8a8;
  --text-muted: #a8a298;
  --link-color: #d4af37;
  --link-hover: #e6c158;
  --border-color: #474541;
  
  /* Advanced Surface Colors */
  --surface-0: #2e2f2c;
  --surface-1: #3b3c39;
  --surface-2: #444541;
  --surface-elevated: #4d4e4b;
  --blockquote-bg: rgba(125, 211, 192, 0.04);
  --code-bg: #2f302d;
  --code-border: rgba(125, 211, 192, 0.12);
  
  /* Selection & Highlight Colors */
  --selection-bg: rgba(125, 211, 192, 0.08);
  --selection-text: #f2ede6;
  --selection-highlight: rgba(125, 211, 192, 0.06);
  --selection-border: rgba(125, 211, 192, 0.15);
  --focus-ring: rgba(125, 211, 192, 0.25);
  
  /* Mapped to existing variable names for compatibility */
  --background: var(--bg-color);
  --secondary-background: var(--surface-0);
  --foreground: var(--text-color);
  --main-foreground: var(--text-color);
  --main: var(--link-color);
  --border: var(--border-color);
  --ring: var(--border-color);
  --overlay: rgba(42, 42, 40, 0.8);
  --shadow: 4px 4px 0px 0px var(--border);
  
  /* Component colors */
  --card: var(--surface-1);
  --card-foreground: var(--text-color);
  --primary: var(--link-color);
  --primary-foreground: var(--bg-color);
  --secondary: var(--surface-1);
  --secondary-foreground: var(--text-color);
  --muted: var(--surface-2);
  --muted-foreground: var(--text-muted);
  --accent: var(--link-color);
  --accent-foreground: var(--bg-color);
  --destructive: #e85d75;
  --destructive-foreground: var(--text-color);
  
  /* Neobrutalism fonts */
  --font-sans: 'Public Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  --font-title: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  
  /* Reading fonts - for article content */
  --font-serif-primary: 'Literata', Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
  
  /* Neobrutalism border radius - sharp corners */
  --radius: 0px;
  --radius-base: 0px;
  
  /* Neo-brutalism shadows */
  --shadow-sm: 2px 2px 0px var(--border-color);
  --shadow-md: 4px 4px 0px var(--border-color);
  --shadow-lg: 6px 6px 0px var(--border-color);
  
  /* Font weights */
  --font-weight-base: 500;
  --font-weight-heading: 800;
  
  /* Reading Experience Settings */
  --letter-spacing-base: 0.008em;
  --letter-spacing-headings: -0.02em;
  --word-spacing-base: 0.03em;
  --line-height-reading: 1.6;
  --optimal-line-length: 75ch;
  --paragraph-spacing: clamp(1.2em, 2.5vw, 1.8em);
  
  /* Rhythm and Spacing */
  --rhythm-base: 1.5rem;
  --rhythm-small: 0.75rem;
  --rhythm-large: 3rem;
}

html {
  font-size: 16px;
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 2rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-weight: var(--font-weight-base);
  font-feature-settings: 'liga' 1, 'kern' 1;
  font-variant-numeric: tabular-nums;
}

/* Typography Scale - Neobrutalism */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  font-weight: var(--font-weight-heading);
  color: var(--foreground);
}

h1 {
  font-size: 1.75rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.0625rem;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.5rem;
  color: var(--foreground);
}

/* Header - Neobrutalism */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

header > a.site-logo {
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--background);
  text-decoration: none;
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--link-color);
  padding: 0.4rem 1.3rem 0.5rem;
  border: 5px solid var(--border);
  border-radius: 0;
  box-shadow: 7px 7px 0 var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1;
  min-height: 2.6rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

header > a.site-logo:hover,
header > a.site-logo:focus-visible {
  color: var(--background);
  transform: translate(-3px, -3px);
  box-shadow: 10px 10px 0 var(--border-color);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  font-size: 0.9375rem;
  color: var(--foreground);
  text-decoration: none;
  font-weight: var(--font-weight-base);
  transition: color 0.2s ease;
}

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

/* Main Content */
main {
  margin-bottom: 4rem;
}

main > h1 {
  margin-bottom: 0.5rem;
}

main > p {
  color: var(--muted-foreground);
  margin-bottom: 3rem;
}

/* Article List - Minimal (Table of Contents style) */
main > ul {
  list-style: none;
  padding: 0;
}

main > ul > li {
  padding: 0.5rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

main > ul > li > a {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-family: var(--font-title);
  letter-spacing: -0.01em;
}

main > ul > li > a:hover {
  color: var(--link-color);
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--link-color);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

main > ul > li > .article-dots {
  flex: 1;
  border-bottom: 1px dotted var(--border-color);
  margin: 0 0.5rem;
  min-width: 2rem;
}

main > ul > li > .article-number {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  text-align: right;
  flex-shrink: 0;
}

time {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  margin-left: 0.75rem;
}

/* Article Content - Reading Optimized (from ebook-styles.css) */
article {
  font-family: var(--font-serif-primary);
  font-size: 1.1875rem; /* ~19px for optimal reading */
  line-height: var(--line-height-reading);
  letter-spacing: var(--letter-spacing-base);
  word-spacing: var(--word-spacing-base);
  max-width: var(--optimal-line-length);
  margin: 0 auto;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
  
  /* Advanced typography features */
  hyphens: auto;
  user-select: text;
  will-change: scroll-position;
}

/* Base font size for all text containers in articles */
article div,
article li,
article dd,
article dt,
article td,
article th,
article a {
  font-size: 1.1875rem !important;
  line-height: var(--line-height-reading) !important;
}

/* Spans inherit from parent, except in code blocks */
article span:not(pre span):not(code span) {
  font-size: 1.1875rem !important;
  line-height: var(--line-height-reading) !important;
}

article > h1 {
  font-size: 1.4em !important;
  margin-top: 0 !important;
  margin-bottom: 0.5em !important;
  font-weight: 800 !important;
  font-family: var(--font-serif-primary) !important;
  letter-spacing: var(--letter-spacing-headings) !important;
  line-height: 1.3 !important;
  text-indent: 0 !important;
  text-align: left !important;
  text-wrap: balance;
  position: relative;
  background: none !important;
  background-color: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

article > time {
  display: block;
  margin-bottom: 3rem;
  margin-left: 0;
  padding-bottom: 0;
  border-bottom: none;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

article p {
  color: var(--foreground);
  font-size: 1.1875rem !important; /* ~19px */
  line-height: var(--line-height-reading) !important;
  font-weight: 400 !important;
  word-spacing: var(--word-spacing-base) !important;
  letter-spacing: var(--letter-spacing-base) !important;
  margin-bottom: var(--paragraph-spacing) !important;
  text-indent: 0 !important;
  
  /* Enhanced readability */
  text-align: left !important;
  hanging-punctuation: first last !important;
  
  /* Reading flow optimization */
  orphans: 3 !important;
  widows: 3 !important;
  position: relative !important;
}

/* Hide empty paragraphs */
article p:empty,
article p:blank {
  display: none !important;
}

/* Headings in articles */
article h1,
article h2,
article h3,
article h4,
article h5,
article h6 {
  color: var(--foreground) !important;
  margin: 0.9em 0 0.4em 0 !important;
  font-family: var(--font-serif-primary) !important;
  font-weight: 700 !important;
  letter-spacing: var(--letter-spacing-headings) !important;
  line-height: 1.3 !important;
  text-indent: 0 !important;
  text-align: left !important;
  text-wrap: balance;
  position: relative;
  background: none !important;
  background-color: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Main article title - no top margin */
article > h1:first-of-type {
  margin-top: 0 !important;
}

article h2 {
  font-size: 1.3em !important;
  margin-top: 0.75em !important;
  margin-bottom: 0.35em !important;
  font-weight: 700 !important;
}

article h3 {
  font-size: 1.2em !important;
  margin-top: 0.75em !important;
  margin-bottom: 0.35em !important;
  font-weight: 700 !important;
}

article h4 {
  font-size: 1.15em !important;
  margin-top: 0.65em !important;
  margin-bottom: 0.3em !important;
  font-weight: 600 !important;
}

article h5 {
  font-size: 1.1em !important;
  margin-top: 0.55em !important;
  margin-bottom: 0.25em !important;
  font-weight: 600 !important;
}

article h6 {
  font-size: 1.05em !important;
  margin-top: 0.5em !important;
  margin-bottom: 0.25em !important;
  font-weight: 600 !important;
}

/* Paragraph spacing */
article p + p {
  margin-top: 1.4em !important;
}

/* First paragraph after heading */
article h1 + p,
article h2 + p,
article h3 + p,
article h4 + p,
article h5 + p,
article h6 + p {
  margin-top: 1em !important;
}

/* Paragraph to heading spacing */
article p + h1,
article p + h2,
article p + h3,
article p + h4,
article p + h5,
article p + h6 {
  margin-top: 3em !important;
}

/* Sequential heading spacing */
article h1 + h2,
article h2 + h3,
article h3 + h4,
article h4 + h5,
article h5 + h6 {
  margin-top: 1.8em !important;
}

/* Links - Reading Optimized in articles */
article a {
  color: var(--link-color);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

article a:focus {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  article a:hover {
    color: var(--link-hover);
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--link-hover);
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
  }
}

/* Links - Neobrutalism for non-article content */
:not(article) a {
  color: var(--link-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

:not(article) a:hover {
  color: var(--link-hover);
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--link-hover);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* Lists in Content - Neo-brutal punch */
article ul,
article ol {
  margin: 1.5em 0;
  padding-left: 0;
  list-style: none;
  color: var(--foreground) !important;
}

article ol {
  counter-reset: brutal-counter;
}

article li {
  margin: 0.6em 0;
  padding-left: 1.8rem;
  position: relative;
  line-height: var(--line-height-reading) !important;
  font-size: 1.1875rem !important;
  color: var(--foreground) !important;
  font-family: var(--font-serif-primary) !important;
}

article ul li::before,
article ol li::before {
  position: absolute;
  left: 0;
  top: 0.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

article ul li::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--border-color);
  background: var(--link-color);
}

article ol li {
  counter-increment: brutal-counter;
}

article ol li::before {
  content: counter(brutal-counter, decimal-leading-zero);
  background: var(--secondary-background);
  color: var(--link-color);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--border-color);
  width: 1.6rem;
  height: 1.3rem;
  font-weight: 700;
  line-height: 1.15;
}

/* List item paragraphs */
article li p {
  margin: 0.5em 0 !important;
  font-size: 1.1875rem !important;
  line-height: var(--line-height-reading) !important;
}

article li p:first-child {
  margin-top: 0 !important;
}

article li p:last-child {
  margin-bottom: 0 !important;
}

/* Nested lists */
article li > ul,
article li > ol {
  margin: 0.5em 0 0.5em 0;
  padding-left: 1.5rem;
}

/* Reset default markers since we use pseudo-elements */
article ul li::marker,
article ol li::marker {
  content: none;
}

/* Code - Reading Optimized */
article code:not(pre code) {
  background-color: var(--secondary-background);
  color: var(--foreground);
  padding: 0.15em 0.35em;
  border-radius: 0;
  font-family: var(--font-mono) !important;
  font-size: 0.7em !important;
  border: 2px solid var(--border);
}

article pre {
  background-color: var(--secondary-background) !important;
  color: var(--foreground) !important;
  border: 3px solid var(--border);
  border-radius: 0;
  padding: 1em 1.2em;
  overflow-x: auto;
  font-family: var(--font-mono) !important;
  font-size: 0.65em !important;
  line-height: 1.5;
  margin: 1.5em 0 2em 0;
  font-variant-ligatures: common-ligatures;
  font-feature-settings: 'liga' 1, 'calt' 1;
  
  /* Neo-brutalism shadow */
  box-shadow: var(--shadow-md);
  position: relative;
}

article pre code {
  background: none;
  padding: 0;
  font-size: inherit !important;
  line-height: 1.5;
  border: none;
  box-shadow: none;
}

/* Images - Reading Optimized */
article img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em auto;
  border-radius: 0;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
  filter: brightness(0.98) contrast(1.02);
}

article figure {
  margin: 1.5em auto;
}

/* Oversize media treatment - mirror blockquote gutters when space allows */
article figure,
article img,
article table {
  width: calc(100% + 6em);
  max-width: calc(100% + 6em);
  margin-left: -3em;
  margin-right: -3em;
}

/* Blockquotes - Neo-brutalism with Oversize Effect */
article blockquote {
  border: 4px solid var(--link-color);
  border-left: 6px solid var(--link-color);
  margin: 2em 0;
  padding: 1em 1.5em;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 1.15em !important;
  line-height: var(--line-height-reading) !important;
  border-radius: 0;
  background: var(--surface-1);
  box-shadow: var(--shadow-lg);
  position: relative;
  
  /* Oversize effect - expand beyond content width when space available */
  width: calc(100% + 6em);
  max-width: calc(100% + 6em);
  margin-left: -3em;
  margin-right: -3em;
  
  /* Neo-brutalism accent */
  transform: translateZ(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

article blockquote:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0px var(--border-color);
}

article blockquote p {
  color: var(--text-secondary) !important;
  font-size: 1.15em !important;
  font-style: italic;
}

article blockquote p:last-child {
  margin-bottom: 0 !important;
}

/* Blockquote sequences - remove spacing between consecutive blockquotes */
article blockquote + blockquote {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top: none;
}

/* Horizontal Rule - Reading Optimized */
article hr {
  border: none;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 2.5em 0;
}

/* Horizontal Rule - Neobrutalism for non-article content */
:not(article) hr {
  border: none;
  height: 2px;
  background: var(--border);
  margin: 3rem 0;
}

/* Tables - Reading Optimized */
article table {
  border-collapse: collapse;
  margin: 1.5em 0;
  border: 3px solid var(--border);
  font-size: 0.85em;
  table-layout: fixed;
  break-inside: auto;
  page-break-inside: auto;
  box-shadow: var(--shadow-md);
}

article table > caption {
  caption-side: top;
  text-align: center;
  font-weight: 600;
  font-family: var(--font-sans) !important;
  font-size: 0.9em;
  color: var(--foreground);
  padding: 0.5em;
  margin-bottom: 0.5em;
}

article tbody {
  background-color: var(--background);
}

article tr {
  border-bottom: 1px solid var(--border);
}

article tr:nth-child(even) {
  background-color: var(--secondary-background);
}

article tr:nth-child(odd) {
  background-color: var(--background);
}

article th,
article td {
  border: 2px solid var(--border);
  padding: 0.5em 0.75em;
  text-align: left;
  vertical-align: top;
  color: var(--foreground) !important;
  word-break: break-word;
  hyphens: auto;
  overflow-wrap: break-word;
  min-width: 50px;
}

article th {
  background-color: var(--secondary-background);
  font-weight: 600;
  font-family: var(--font-sans) !important;
}

article td p,
article th p {
  margin: 0.5em 0 !important;
  font-size: 1.0625rem !important; /* ~17px */
  line-height: 1.5 !important;
}

article td p:first-child,
article th p:first-child {
  margin-top: 0 !important;
}

article td p:last-child,
article th p:last-child {
  margin-bottom: 0 !important;
}

/* Tables - Neobrutalism for non-article content */
:not(article) table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
}

:not(article) th,
:not(article) td {
  border: 2px solid var(--border);
  padding: 0.75rem 1rem;
  text-align: left;
}

:not(article) th {
  background: var(--secondary-background);
  font-weight: 800;
  color: var(--foreground);
  font-family: var(--font-title);
}

:not(article) td {
  color: var(--foreground);
  background: var(--background);
}

/* Tags */
article > p:last-child {
  margin-top: 3rem;
  padding-top: 2rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Footer - Neobrutalism */
footer {
  padding-top: 2rem;
  border-top: 4px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

footer p {
  margin: 0;
}

/* Selection - Reading Optimized (wavy underline style) */
article ::selection,
article *::selection {
  background-color: transparent !important;
  background: transparent !important;
  color: #ffd700 !important;
  text-decoration-line: underline !important;
  text-decoration-style: wavy !important;
  text-decoration-color: #ffd700 !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 2px !important;
}

article ::-moz-selection,
article *::-moz-selection {
  background-color: transparent !important;
  background: transparent !important;
  color: #ffd700 !important;
  text-decoration-line: underline !important;
  text-decoration-style: wavy !important;
  text-decoration-color: #ffd700 !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 2px !important;
}

/* Selection for non-article content - Neobrutalism */
:not(article) ::selection {
  background-color: var(--main);
  color: var(--main-foreground);
}

:not(article) ::-moz-selection {
  background-color: var(--main);
  color: var(--main-foreground);
}

/* Tablet Responsive Typography (Reading Optimized) */
@media (max-width: 768px) {
  body {
    font-size: 18px !important;
    padding: 2rem 1.5rem;
  }
  
  article {
    font-size: 1.125rem !important; /* ~18px */
  }
  
  article p {
    font-size: 1.125rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.3em !important;
  }
  
  article div,
  article span,
  article li,
  article dd,
  article dt,
  article td,
  article th,
  article a {
    font-size: 1.125rem !important;
    line-height: 1.55 !important;
  }
  
  article h1 {
    font-size: 1.75em !important;
  }
  
  article h2 {
    font-size: 1.5em !important;
  }
  
  article h3 {
    font-size: 1.35em !important;
  }
  
  article h4 {
    font-size: 1.2em !important;
  }
  
  article h5 {
    font-size: 1.1em !important;
  }
  
  article h6 {
    font-size: 1.05em !important;
  }
  
  article pre {
    font-size: 0.7em !important;
  }
  
  article code:not(pre code) {
    font-size: 0.75em !important;
  }
  
  article blockquote {
    font-size: 1.1em !important;
    /* Reduce oversize on tablet */
    width: calc(100% + 3em);
    max-width: calc(100% + 3em);
    margin-left: -1.5em;
    margin-right: -1.5em;
    padding: 0.9em 1.2em;
    box-shadow: var(--shadow-md);
  }
  
  article figure,
  article img,
  article table {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  
  article blockquote:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0px var(--border-color);
  }
}

/* Mobile Responsive */
@media (max-width: 640px) {
  body {
    padding: 2rem 1.5rem;
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  nav {
    gap: 1rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  article {
    font-size: 1rem !important; /* ~16px */
  }
  
  article p {
    font-size: 1.125rem !important; /* ~18px */
    line-height: 1.55 !important;
    margin-bottom: 1.2em !important;
  }
  
  article div,
  article span,
  article li,
  article dd,
  article dt,
  article td,
  article th,
  article a {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }
  
  article > h1 {
    font-size: 1.5625em !important; /* ~25px */
  }
  
  article h2 {
    font-size: 1.3125em !important; /* ~21px */
  }
  
  article h3 {
    font-size: 1.125em !important; /* ~18px */
  }
  
  article h4 {
    font-size: 1.0625em !important; /* ~17px */
  }
  
  article h5 {
    font-size: 1.03125em !important; /* ~16.5px */
  }
  
  article h6 {
    font-size: 1.015625em !important; /* ~16.25px */
  }
  
  article pre {
    font-size: 0.7em !important;
    padding: 0.9em 1em;
  }
  
  article code:not(pre code) {
    font-size: 0.75em !important;
  }
  
  article blockquote {
    font-size: 1.05em !important;
    /* Remove oversize on mobile */
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0.8em 1em;
    box-shadow: var(--shadow-sm);
  }

  article figure,
  article img,
  article table {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  
  article blockquote:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
  
  main > ul > li > a {
    display: block;
  }
  
  time {
    display: block;
    margin-left: 0;
    margin-top: 0.25rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

:focus-visible {
  outline: 3px solid var(--link-color);
  outline-offset: 2px;
  box-shadow: var(--shadow-sm);
}

/* Back to home button */
.back-to-home {
  margin-top: 4rem;
}

.back-to-home a {
  display: inline-block;
  font-size: 1rem;
  color: var(--foreground);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 600;
  font-family: var(--font-title);
}

.back-to-home a:hover {
  color: var(--link-color);
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--link-color);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
