/* ============================================================
   Black Sheep Gathering — Global Stylesheet
   Modern CSS with custom properties, no Bootstrap dependency.
   ============================================================ */

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
  /* Colours */
  --color-primary: #333;
  --color-primary-light: #555;
  --color-accent: #0056b3;
  --color-accent-hover: #003d80;
  --color-highlight: #0077cc;
  --color-heading: #333;
  --color-text: #444;
  --color-text-light: #666;
  --color-muted: #a5a5a5;

  --color-sidebar-bg: #ebbb5d;
  --color-sidebar-hover: #f8d269;
  --color-sidebar-text: #774433;
  --color-sidebar-heading: #65330a;

  --color-maroon: #871a1c;
  --color-warning: #df3b02;

  --color-bg: #fff;
  --color-bg-alt: #f6f6f6;
  --color-bg-footer: #40331d;
  --color-border: #ddd;
  --color-border-light: #eee;

  /* Typography */
  --font-family:
    "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  --font-size-base: 1rem;
  --line-height-base: 1.6;

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

  /* Layout */
  --container-max: 1200px;
  --sidebar-width: 240px;
  --border-radius: 6px;
  --border-radius-sm: 4px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

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

* {
  margin: 0;
  padding: 0;
}

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

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

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

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

a {
  color: var(--color-accent);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--color-accent-hover);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family);
  line-height: 1.3;
  color: var(--color-heading);
  margin-bottom: var(--space-sm);
}

h1 {
  font-size: 1.875rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.25rem;
}
h4 {
  font-size: 1.125rem;
}

p {
  margin-bottom: var(--space-md);
}

ul,
ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-xs);
}

table {
  border-collapse: collapse;
  width: 100%;
}

td,
th {
  padding: var(--space-xs) var(--space-sm);
  vertical-align: top;
  text-align: left;
}

hr {
  border: 0;
  height: 1px;
  background-color: var(--color-border);
  margin: var(--space-xl) 0;
}

strong,
b {
  font-weight: 600;
}

/* ---------- Focus Styles (Accessibility) ---------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- Visually Hidden (screen-reader text) ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Float Images (used by many view pages) ---------- */
.float-right {
  float: right;
  margin: 0 0 var(--space-md) var(--space-md);
  max-width: 400px;
  border-radius: var(--border-radius);
}

.float-left {
  float: left;
  margin: var(--space-sm) var(--space-md) var(--space-md) 0;
  max-width: 400px;
  border-radius: var(--border-radius);
}

@media (max-width: 600px) {
  .float-right,
  .float-left {
    float: none;
    display: block;
    max-width: 100%;
    margin: var(--space-md) auto;
  }
}
