/* ==========================================================================
   Design tokens + base styles
   Shared by every page. Loaded last in base.html so it wins over Bootstrap/MDB.
   ========================================================================== */

:root {
  /* Type families — swap these two lines to change the whole site's voice */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Surfaces */
  --bg: #faf9f7;          /* warm off-white page */
  --surface: #ffffff;     /* cards */
  --surface-sunk: #f2efea; /* image wells, subtle bands */

  /* Ink */
  --ink: #1a1a18;
  --ink-soft: #4a4741;
  --ink-muted: #6b6862;

  /* Lines + accent */
  --line: #e6e2db;
  --accent: #2f5d50;       /* deep botanical green */
  --accent-hover: #24473d;
  --accent-tint: #eef3f0;

  /* Type scale */
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.35rem, 1.1rem + 0.8vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.875rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Shape */
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* Shadows — soft and low, not the old hard offsets */
  --shadow-sm: 0 1px 2px rgb(26 26 24 / 0.04), 0 2px 8px rgb(26 26 24 / 0.05);
  --shadow-md: 0 4px 12px rgb(26 26 24 / 0.07), 0 12px 28px rgb(26 26 24 / 0.07);

  /* Layout */
  --measure: 68ch;
  --page-max: 1240px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --header-h: 4.5rem;
}

/* --------------------------------------------------------------------------
   Reset / element defaults
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* keep anchor targets clear of the fixed header */
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 var(--space-sm);
}

p {
  margin: 0 0 var(--space-sm);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Visible focus for keyboard users — the old site had none at all */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Shared layout helpers
   -------------------------------------------------------------------------- */

.page {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Section heading with a short rule under it */
.section-head {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-head h2 {
  font-size: var(--step-3);
  margin-bottom: var(--space-xs);
}

.section-head p {
  color: var(--ink-muted);
  max-width: 46ch;
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-xs);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease,
              border-color 0.18s ease, transform 0.18s ease;
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--ink);
  background-color: var(--surface);
}

.btn:active {
  transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   Django messages
   -------------------------------------------------------------------------- */

#message-container {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 100;
  display: grid;
  gap: var(--space-xs);
}

.message-box {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--step--1);
  /* base.js fades these out after 3s by setting opacity */
  transition: opacity 0.5s ease;
}

.message-box.error {
  border-left-color: #b3261e;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
