/* ===== CSS Custom Properties ===== */
:root {
  /* Colour tokens — values set by theme.css */
  --color-bg: #faf8f5;
  --color-surface: #f0ebe3;
  --color-text-primary: #1a1a2e;
  --color-text-secondary: #4a4a6a;
  --color-accent: #7a5c10;
  --color-accent-hover: #5d4509;
  --color-border: #d4c9b8;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Type scale */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Radius tokens */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Shadow tokens */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.06);

  /* Text colour for use on the accent background (passes WCAG AA in both themes) */
  --color-on-accent: #ffffff;
}

/* ===== Modern CSS Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== Body ===== */
body {
  font-family: Georgia, 'Times New Roman', 'Palatino Linotype', Palatino, serif;
  line-height: 1.7;
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Responsive base font size */
html {
  font-size: 16px;
}

@media (min-width: 768px) {
  html {
    font-size: 17px;
  }
}

@media (min-width: 1200px) {
  html {
    font-size: 18px;
  }
}

/* ===== Smooth Scroll ===== */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ===== Anchors ===== */
a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

/* ===== Focus Visible Ring ===== */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ===== Images ===== */
img,
svg {
  display: block;
  max-width: 100%;
}

/* ===== Prose list styles — only inside .prose ===== */
.prose ul,
.prose ol {
  list-style: revert;
  padding-left: var(--space-lg);
}

/* Suppress default list styling everywhere else */
ul,
ol {
  list-style: none;
}

/* ===== Screen-reader only ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
