/* ============================================================
   BASE.CSS — Design System: Variables, Reset, Typography
   IGCSE History 0470 Student Study Site
   ============================================================ */

/* ----------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------- */
:root {
  /* Brand colours */
  --navy:         #1c2f5e;
  --navy-dark:    #131f3f;
  --navy-light:   #243a72;
  --cambridge:    #2e5496;
  --cambridge-lt: #4a72b8;
  --sky:          #d6e4f7;

  /* Topic accent colours — used for topic cards and section headers */
  --kq1:          #c8861a;   /* Amber — treaties, Paris Peace */
  --kq1-light:    #fef3dc;
  --kq2:          #2a8a5c;   /* Green — League of Nations */
  --kq2-light:    #dff2ea;
  --kq3:          #b03030;   /* Red — collapse of peace */
  --kq3-light:    #fae0e0;
  --germany:      #6b4c93;   /* Purple — depth study */
  --germany-light:#ede5f5;

  /* Neutral palette */
  --white:        #ffffff;
  --bg:           #f7f8fc;
  --bg-warm:      #fafaf8;
  --surface:      #ffffff;
  --border:       #dde3ef;
  --border-dark:  #b8c4dc;
  --text:         #1a1f2e;
  --text-mid:     #3d4560;
  --text-muted:   #6b7494;
  --text-light:   #9ba3be;

  /* Semantic colours */
  --warning-bg:   #fff8e6;
  --warning-border:#f0c040;
  --warning-text: #7a5200;
  --success:      #2a8a5c;
  --error:        #b03030;

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Outfit', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Type scale */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */

  /* Spacing scale (8px base) */
  --sp-1:  0.25rem;  /* 4px  */
  --sp-2:  0.5rem;   /* 8px  */
  --sp-3:  0.75rem;  /* 12px */
  --sp-4:  1rem;     /* 16px */
  --sp-5:  1.25rem;  /* 20px */
  --sp-6:  1.5rem;   /* 24px */
  --sp-8:  2rem;     /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */
  --sp-16: 4rem;     /* 64px */
  --sp-20: 5rem;     /* 80px */

  /* Border radius */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(28,47,94,0.08), 0 1px 2px rgba(28,47,94,0.04);
  --shadow:    0 4px 12px rgba(28,47,94,0.10), 0 2px 4px rgba(28,47,94,0.06);
  --shadow-lg: 0 12px 32px rgba(28,47,94,0.14), 0 4px 8px rgba(28,47,94,0.08);
  --shadow-card: 0 2px 8px rgba(28,47,94,0.08);

  /* Transitions */
  --transition: 200ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;
  --sidebar-width: 260px;
}

/* ----------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--cambridge);
  text-decoration: none;
  transition: color var(--transition);
}

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

/* ----------------------------------------------------------
   3. TYPOGRAPHY
   ---------------------------------------------------------- */

/* Display headings — Cormorant Garamond for academic character */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl)); }

/* Subheadings — body font for clarity */
h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy);
}

h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--sp-4);
  color: var(--text-mid);
  line-height: 1.7;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 700;
  color: var(--text);
}

em {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   4. PROSE CONTENT (used in content/notes pages)
   ---------------------------------------------------------- */
.prose h2 {
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--border);
}

.prose h3 {
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.prose p {
  margin-bottom: var(--sp-5);
}

.prose ul, .prose ol {
  list-style: revert;
  padding-left: var(--sp-6);
  margin-bottom: var(--sp-5);
}

.prose li {
  margin-bottom: var(--sp-2);
  color: var(--text-mid);
  line-height: 1.7;
}

.prose blockquote {
  border-left: 4px solid var(--cambridge);
  padding: var(--sp-4) var(--sp-6);
  background: var(--sky);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--sp-6) 0;
  font-style: italic;
  color: var(--navy);
}

.prose blockquote cite {
  display: block;
  margin-top: var(--sp-2);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   5. UTILITY CLASSES
   ---------------------------------------------------------- */
.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;
}

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

.container--narrow {
  max-width: 800px;
}

.text-center { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: var(--text-sm); }
.text-lg      { font-size: var(--text-lg); }

.mt-auto { margin-top: auto; }
.mb-0    { margin-bottom: 0; }

/* Topic colour utilities */
.accent-kq1     { color: var(--kq1); }
.accent-kq2     { color: var(--kq2); }
.accent-kq3     { color: var(--kq3); }
.accent-germany { color: var(--germany); }

.bg-kq1     { background: var(--kq1-light); }
.bg-kq2     { background: var(--kq2-light); }
.bg-kq3     { background: var(--kq3-light); }
.bg-germany { background: var(--germany-light); }

/* ----------------------------------------------------------
   6. GOOGLE FONTS IMPORT
   (loaded via <link> in HTML for performance control)
   Fonts: Cormorant Garamond (display) + Outfit (body)
   ---------------------------------------------------------- */
