/* ------------------------------------------------------------------
   Shared base stylesheet — copy to updated_website_<domain>/assets/style.css
   and override ONLY the custom properties in :root per site.
   Mobile-first. No framework, no CDN, no jQuery.
   ------------------------------------------------------------------ */

:root {
  /* --- palette: OVERRIDE PER SITE (derive from the old site's colours) --- */
  --brand:      #1b294d;
  --brand-dark: #111a33;
  --accent:     #7a1a1a;
  --ink:        #1f2328;
  --muted:      #5c666e;
  --line:       #e0e3ea;
  --bg:         #ffffff;
  --bg-soft:    #f1f3f9;
  --on-brand:   #ffffff;

  /* --- type: 17–18px body, 1.65 line-height, ~70ch measure --- */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: var(--font-body);
  --fs-body:   1.0625rem;          /* 17px */
  --lh-body:   1.65;
  --measure:   70ch;

  /* --- rhythm --- */
  --sp-1: .5rem;  --sp-2: 1rem;   --sp-3: 1.5rem;
  --sp-4: 2rem;   --sp-5: 3rem;   --sp-6: 4.5rem;
  --wrap: 1120px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
}

@media (min-width: 48rem) {
  :root { --fs-body: 1.125rem; --lh-body: 1.7; }   /* 18px on tablet+ */
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, video, iframe, svg { max-width: 100%; height: auto; }
img { display: block; }

/* ------------------------------------------------------------------ type */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 var(--sp-2);
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.9rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2rem); margin-top: var(--sp-5); letter-spacing: -.01em; }
h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.35rem); margin-top: var(--sp-4); }
p, ul, ol, dl, blockquote, table, figure { margin: 0 0 var(--sp-3); }
p, li { max-width: var(--measure); }
ul, ol { padding-left: 1.35em; }
li + li { margin-top: .35em; }
small { font-size: .875em; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--brand-dark); }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px;
}

blockquote {
  border-left: 4px solid var(--brand); padding: var(--sp-1) var(--sp-3);
  color: var(--muted); font-style: italic;
}

/* ------------------------------------------------------------------ layout */
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--sp-5); }
.section--soft { background: var(--bg-soft); }
.prose > :first-child { margin-top: 0; }

.grid { display: grid; gap: var(--sp-3); }
@media (min-width: 40rem) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--on-brand); padding: var(--sp-1) var(--sp-2);
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2); min-height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-name { font-weight: 700; font-size: 1.15rem; color: var(--ink); letter-spacing: -.01em; }
.brand img { max-height: 44px; width: auto; }

.nav-toggle {
  display: grid; place-content: center; gap: 5px;
  width: 44px; height: 44px;              /* >=44px touch target */
  background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.nav-toggle-bar {
  display: block; width: 22px; height: 2px; background: var(--ink);
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav { display: none; }
.site-nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.site-nav ul { list-style: none; margin: 0; padding: var(--sp-1) var(--sp-2); }
.site-nav li { margin: 0; }
.site-nav a {
  display: block; padding: .8rem .5rem; min-height: 44px;
  text-decoration: none; color: var(--ink); font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.site-nav li:last-child a { border-bottom: 0; }
.site-nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }

@media (min-width: 52rem) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open {
    display: block; position: static; box-shadow: none; border: 0; background: none;
  }
  .site-nav ul { display: flex; gap: var(--sp-1); padding: 0; }
  .site-nav a {
    border: 0; padding: .55rem .8rem; border-radius: 8px;
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .site-nav a:hover { background: var(--bg-soft); }
  .site-nav a[aria-current="page"] { background: var(--bg-soft); }
}

/* ------------------------------------------------------------------ hero */
.hero { padding-block: var(--sp-5) var(--sp-4); background: var(--bg-soft); }
.hero h1 { margin-bottom: var(--sp-2); }
.hero p { font-size: 1.1em; color: var(--muted); }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.card-body { padding: var(--sp-2) var(--sp-3) var(--sp-3); }
.card h3 { margin-top: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .65rem 1.4rem;
  background: var(--brand); color: var(--on-brand); text-decoration: none;
  border: 1px solid var(--brand); border-radius: 8px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-brand); }
.btn--ghost { background: none; color: var(--brand); }
.btn--ghost:hover { background: var(--bg-soft); color: var(--brand-dark); }

/* ------------------------------------------------------------------ media */
figure { margin-inline: 0; }
figcaption { font-size: .9em; color: var(--muted); margin-top: var(--sp-1); }

.gallery { display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }

/* tables reflow: scroll inside their own container, page never scrolls sideways */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: var(--sp-3); }
table { border-collapse: collapse; width: 100%; min-width: 32rem; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); font-weight: 600; }

/* video embeds — kept as content, responsive 16:9, never overflowing */
.video-embed {
  position: relative; width: 100%; margin: var(--sp-3) 0;
  aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden;
}
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
/* older engines without aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .video-embed { height: 0; padding-bottom: 56.25%; }
}
.video-embed + figcaption { font-size: .9em; color: var(--muted); margin-top: calc(var(--sp-1) * -1); }

/* AdSense / ad units — kept, never allowed to break the flow */
.ad-slot { margin: var(--sp-4) 0; text-align: center; max-width: 100%; overflow: hidden; }
.ad-slot ins, .ad-slot iframe { max-width: 100% !important; }

/* ------------------------------------------------------------------ forms */
.form { max-width: 40rem; }
.field { margin-bottom: var(--sp-3); }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field .hint { display: block; font-weight: 400; font-size: .9em; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], textarea, select {
  width: 100%; min-height: 44px; padding: .65rem .8rem;
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
textarea { min-height: 10rem; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #c0392b; }
.field-error { color: #a5281b; font-size: .92em; margin-top: .3rem; }

/* honeypot — hidden from humans, still reachable by bots */
.hp-field {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.alert { padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); margin-bottom: var(--sp-3); }
.alert--ok   { background: #e8f5ec; border: 1px solid #b7dfc4; color: #1c5c33; }
.alert--err  { background: #fdecea; border: 1px solid #f5c2bc; color: #8f2318; }

/* ------------------------------------------------------------------ footer */
.site-footer {
  margin-top: var(--sp-6);
  background: var(--bg-soft); border-top: 1px solid var(--line);
  padding-block: var(--sp-4) var(--sp-2);
}
.footer-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand { font-weight: 700; font-size: 1.1rem; margin-bottom: .3rem; }
.footer-tagline { color: var(--muted); }
.footer-heading { font-weight: 600; margin-bottom: var(--sp-1); }
.footer-links, .footer-contact { list-style: none; margin: 0; padding: 0; }
.footer-links a, .footer-contact a { display: inline-block; padding: .35rem 0; min-height: 32px; }
.footer-contact address { font-style: normal; color: var(--muted); }
.footer-bottom {
  margin-top: var(--sp-4); padding-top: var(--sp-2);
  border-top: 1px solid var(--line); color: var(--muted); font-size: .92em;
}
.footer-bottom p { margin: 0; }

/* ------------------------------------------------------------------ utils */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

@media print {
  .site-header, .site-footer, .nav-toggle, .skip-link, .ad-slot { display: none !important; }
  body { font-size: 11pt; }
}
