/* =====================================================
   BASE — custom properties, reset, typography
   ===================================================== */

:root {
  /* Original site colour palette */
  --color-bg-page:       #43457A;   /* outer page: dark purple */
  --color-bg-content:    #FAFFDF;   /* content area: warm cream */
  --color-bg-tint:       #F2F9CC;   /* slightly darker cream for accents */
  --color-text-primary:  #584D4D;   /* body text: warm brownish grey (original rgb 88,77,77) */
  --color-text-secondary:#7A6E6E;
  --color-site-name:     #AD7B12;   /* gold/amber for site header name (original rgb 173,123,18) */
  --color-accent:        #0433FF;   /* royal blue — headings, CTA (original rgb 4,51,255) */
  --color-accent-hover:  #0020CC;   /* darker blue for hover states */
  --color-border:        #CCCC99;   /* warm beige border */
  --color-divider:       #BBBB88;
  --color-nav-text:      #666666;   /* original nav link colour */
  --color-nav-active:    #463C3C;   /* original hover/current colour */
  --color-focus-ring:    #5577CC;
  --color-link:          #584D4D;   /* links same warm grey as body text, with underline */

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;

  /* Typography */
  --font-body:   Georgia, 'Times New Roman', serif;
  --font-nav:    Arial, Helvetica, sans-serif;
  --text-sm:     0.875rem;
  --text-base:   1rem;
  --text-lg:     1.125rem;
  --text-xl:     1.25rem;
  --text-2xl:    1.5rem;
  --text-3xl:    1.875rem;
  --leading:     1.65;

  /* Layout */
  --content-max: 920px;
  --content-pad: 1.5rem;
  --radius:      3px;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--color-text-primary);
  background-color: var(--color-bg-page);
  -webkit-font-smoothing: antialiased;
}

img, picture {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-link);
  text-decoration: underline;
}

a:visited {
  color: #797979;
  text-decoration: underline;
}

a:hover {
  color: #000;
  text-decoration: underline;
}

h1 { font-size: var(--text-3xl); line-height: 1.2; }
h2 { font-size: var(--text-2xl); line-height: 1.3; }
h3 { font-size: var(--text-xl);  line-height: 1.3; }

h1, h2, h3 {
  color: var(--color-accent);
  font-weight: bold;
}

p {
  max-width: 72ch;
}

/* ---- Focus styles ---- */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-focus-ring);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: bold;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---- Responsive visibility ---- */
@media (max-width: 600px) {
  .desktop-only { display: 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;
}
