/*
 * Location: css/base.css
 * Design tokens, reset and typography. Shared by the public site and admin.
 *
 * Palette: palm green from Imo's oil-palm country, palm-oil gold for dates
 * and highlights, on a cool off-white so photographs carry the colour.
 */

:root {
  /* Colour */
  --paper: #f6f7f2;
  --surface: #ffffff;
  --ink: #1e2722;
  --muted: #56625b;
  --line: #d8ddd6;
  --palm: #1f5a3a;
  --palm-deep: #143d27;
  --palm-tint: #e3ede6;
  --gold: #e3a72f;
  --gold-soft: #f6e2b5;
  --danger: #a3312a;

  /* Type */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;

  /* Modular scale, ratio ~1.25 from a 17px base */
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.625rem;
  --step-3: 2.0625rem;
  --step-4: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
  --step-5: clamp(2.75rem, 1.6rem + 5.2vw, 5.5rem);

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 72rem;
  --measure: 68ch;
  --radius: 6px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

::selection {
  background: var(--gold-soft);
}

/* The hidden attribute always wins, even over classes that set display */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  color: var(--ink);
}

.skip-link:focus {
  top: var(--space-4);
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
