/* ==========================================================================
   Base: design tokens, reset, typography, layout and shared components.
   Replaces Bootstrap and the old theme CSS. Page-specific styles live in
   header.css, home.css, gallery.css and site.css.
   ========================================================================== */

:root {
  /* Colour */
  --brand: #00baa2;          /* accent: lines, icons, backgrounds */
  --brand-ink: #007a6a;      /* teal for text on white (5.3:1, WCAG AA) */
  --brand-tint: #e8f7f4;
  --ink: #1f2d2a;
  --ink-muted: #5b6b67;
  --line: #e4ebe9;
  --surface: #fff;
  --surface-alt: #f4f6f5;      /* tinted section background */
  --surface-raised: #fff;      /* cards */
  --placeholder: #dfe6e4;      /* behind images while they load */
  --panel-dark: #1f2d2a;       /* dark panels with white text (both themes) */
  --header-bg: rgba(255, 255, 255, .85);
  --shadow: 31 45 42;          /* rgb() channels for shadows */
  --focus: #007a6a;            /* focus ring, 5.3:1 on white (WCAG 2.4.11 needs 3:1) */
  --input-border: #7f8e8a;     /* 3.4:1 – form field edges must be 3:1 */
  --input-border-hover: #5b6b67;
  --btn-bg: #007a6a;           /* 5.3:1 with white text */
  --btn-bg-hover: #1f2d2a;
  --btn-ink: #fff;
  --danger: #b42318;
  --success: #067647;
  --alert-success-bg: #ecfdf3;
  --alert-success-line: #abefc6;
  --alert-error-bg: #fef3f2;
  --alert-error-line: #fecdca;

  /* Type */
  --font-body: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --header-h: 76px;
  --container: 1140px;
  --gutter: 24px;
  --radius: 16px;

  color-scheme: light;
}

/* Dark theme: follows the visitor's system setting. */
@media (prefers-color-scheme: dark) {
  :root {
    --brand-ink: #5fe0cc;      /* teal text on dark (10:1) */
    --brand-tint: #133730;
    --ink: #e6eeeb;
    --ink-muted: #a2b2ad;
    --line: #2a3936;
    --surface: #0f1715;
    --surface-alt: #141f1c;
    --surface-raised: #1a2724;
    --placeholder: #22302d;
    --panel-dark: #1a2724;
    --header-bg: rgba(15, 23, 21, .82);
    --shadow: 0 0 0;
    --focus: #5fe0cc;
    --input-border: #647772;
    --input-border-hover: #8aa09a;
    --btn-bg: #5fe0cc;
    --btn-bg-hover: #9eede1;
    --btn-ink: #0f1715;
    --danger: #fda29b;
    --success: #75e0a7;
    --alert-success-bg: #0b2b1c;
    --alert-success-line: #116b43;
    --alert-error-bg: #3a1411;
    --alert-error-line: #7a271a;
    color-scheme: dark;
  }
}
@media (max-width: 991.98px) {
  :root { --header-h: 64px; --gutter: 16px; }
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
picture { display: contents; }   /* the <img> inside lays out as if the wrapper weren't there */
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}
p { text-wrap: pretty; }
ul[class], ol[class] { padding: 0; list-style: none; }
a { color: var(--brand-ink); text-decoration-thickness: from-font; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Dark areas use the light teal ring in both themes */
.site-footer, .home-hero, .lightbox, .contact-info, .page-banner.has-image { --focus: #5fe0cc; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--brand-tint); color: var(--ink); }

/* ---- Layout ------------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.main-content { display: block; }

/* ---- Accessibility helpers ---------------------------------------------- */
.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: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--panel-dark);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: #fff; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, transform .2s ease;
}
.btn:hover { background: var(--btn-bg-hover); color: var(--btn-ink); }
.btn:active { transform: translateY(1px); }

/* ---- Forms -------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink); }
.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;               /* 16px stops iOS from zooming in on focus */
  line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input { min-height: 160px; resize: vertical; }
.input:hover { border-color: var(--input-border-hover); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { font-size: 14px; color: var(--danger); }

/* ---- Alerts ------------------------------------------------------------- */
.alert {
  margin-block: 24px 0;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid;
  font-weight: 600;
}
.alert--success { background: var(--alert-success-bg); border-color: var(--alert-success-line); color: var(--success); }
.alert--error { background: var(--alert-error-bg); border-color: var(--alert-error-line); color: var(--danger); }

/* ---- Page transitions ---------------------------------------------------
   Cross-document view transitions (Chrome/Edge 126+, Safari 18.2+; others just
   navigate normally). Pages cross-fade; the header stays put. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.site-header { view-transition-name: site-header; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .25s; }
::view-transition-group(*) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }

/* ---- Motion ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
