/* Merfin Shares - accessible static rebuild
   Colours checked against WCAG 2.1 AA:
   body text #5C5E6C on white  = 6.4:1
   headings  #3D404F on white  = 10.3:1
   white on brand red #DC0F3A  = 5.0:1
   link red  #B30C2F on white  = 7.0:1
   focus     #000529 / #FFFFFF  >= 3:1 on every background used */

@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@300;400;600;700&display=swap');

:root {
  --red: #DC0F3A;
  --red-dark: #B30C2F;
  --heading: #3D404F;
  --text: #5C5E6C;
  --muted-bg: #F7F8FA;
  --focus: #000529;
  --error: #B00020;
  --container: 880px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'League Spartan', 'SpartanMB', Arial, sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: #ffffff;
}

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

h1, h2, h3, h4 {
  font-family: 'League Spartan', 'SpartanMB', Arial, sans-serif;
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 0.6em;
  font-weight: 700;
}
h2 { font-size: 2.1rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.05rem; }
strong, b { font-weight: 700; color: var(--heading); }
p { margin: 0 0 1em; }

a { color: var(--red-dark); }
a:hover, a:focus { color: #7A0820; text-decoration: underline; }

/* Visible focus for every interactive element (audit: Header 35, About 34, Downloads 33, Contacts 36) */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.on-red a:focus-visible, .on-red button:focus-visible {
  outline-color: #ffffff;
}

.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: absolute; left: 12px; top: -60px;
  background: var(--focus); color: #fff;
  padding: 10px 16px; border-radius: 4px; z-index: 1000;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.site-header { background: #fff; }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 96px;
}
.logo img { width: 52px; height: 52px; border-radius: 50%; }

.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 22px; flex-wrap: wrap;
}
.main-nav a {
  color: var(--heading); text-decoration: none;
  font-weight: 600; font-size: 0.92rem;
  padding: 6px 2px; display: inline-block;
}
.main-nav a:hover, .main-nav a:focus { color: var(--red-dark); text-decoration: underline; }
.main-nav a[aria-current="page"] { color: var(--red-dark); }

.nav-toggle {
  display: none; background: none; border: 2px solid var(--heading);
  border-radius: 6px; padding: 6px 10px; font: inherit; font-weight: 600;
  color: var(--heading); cursor: pointer;
}

/* Social icons (audit: Header 8 and 32) */
.social-list {
  list-style: none; margin: 0; padding: 0; display: flex; gap: 8px;
}
.social-list a {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.social-list svg { width: 16px; height: 16px; fill: currentColor; }
.social-list .fb a { background: #3B5BDB; }
.social-list .tw a { background: #1D7FC4; }
.social-list .rd a { background: #1E8A5A; }
.social-list a:hover { filter: brightness(0.85); }

.site-footer .social-list a { width: 30px; height: 30px; background: transparent; }

/* ---------- Generic sections ---------- */
.section { padding: 72px 0; }
.section-tight { padding: 40px 0; }

.two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px; align-items: center;
}
.two-col.top { align-items: start; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border-radius: 40px; padding: 14px 34px;
  font-weight: 700; font-size: 0.92rem; text-decoration: none;
  border: 2px solid transparent;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover, .btn-red:focus { background: var(--red-dark); color: #fff; text-decoration: none; }
.btn-white { background: #fff; color: var(--red-dark); }
.btn-white:hover, .btn-white:focus { background: #FBE7EB; color: #7A0820; text-decoration: none; }
.btn svg { width: 12px; height: 12px; fill: currentColor; }

ul.bullets { padding-left: 18px; margin: 0 0 1em; }
ul.bullets li { margin-bottom: 0.45em; }

/* ---------- Home hero ---------- */
.hero { background: var(--red); color: #fff; }
.hero .container {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px;
  align-items: center; padding-top: 72px; padding-bottom: 72px;
}
.hero h1 { color: #fff; font-size: 2.3rem; text-transform: uppercase; }
.hero p { color: #fff; font-weight: 400; font-size: 0.9rem; }

.small-text { font-size: 0.9rem; }

/* Director contacts */
.directors { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.directors p { font-weight: 700; color: var(--heading); margin: 0; }

/* Quiz banner */
.quiz-banner img { border-radius: 6px; width: 100%; }

/* ---------- About ---------- */
.phone-box {
  background: var(--muted-bg); border-radius: 6px;
  padding: 22px 26px; display: inline-flex; align-items: center; gap: 14px;
  margin-top: 8px;
}
.phone-box svg { width: 30px; height: 30px; fill: var(--red); flex: none; }
.phone-box p { margin: 0; font-weight: 700; color: var(--heading); }
.phone-box a { color: var(--heading); text-decoration: none; }
.phone-box a:hover, .phone-box a:focus { color: var(--red-dark); text-decoration: underline; }

/* ---------- Services timeline ---------- */
.page-head { text-align: center; padding-top: 40px; }
.page-head h1 { font-size: 2.2rem; text-transform: uppercase; }
.page-head h2 { font-size: 1.9rem; }
.page-head h3 { font-size: 1.4rem; }

.timeline {
  list-style: none; margin: 32px auto 0; padding: 0 0 40px;
  position: relative; max-width: 560px;
}
.timeline::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 40px;
  width: 2px; background: var(--red); transform: translateX(-1px);
}
.timeline li {
  position: relative; width: 50%; padding: 0 28px 28px;
}
.timeline li:nth-child(odd) { margin-right: 50%; text-align: right; }
.timeline li:nth-child(even) { margin-left: 50%; }
.timeline .card {
  background: var(--red); color: #fff; padding: 12px 16px; border-radius: 2px;
  display: inline-block; text-align: inherit;
}
.timeline h4 { color: #fff; margin: 0 0 4px; font-size: 1.05rem; }
.timeline p { margin: 0; color: #fff; font-weight: 400; font-size: 0.85rem; }
.timeline .dot {
  position: absolute; top: 18px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--heading); border: 3px solid #fff;
}
.timeline li:nth-child(odd) .dot { right: -9px; }
.timeline li:nth-child(even) .dot { left: -9px; }

/* ---------- Downloads tabs (audit: Downloads 55) ---------- */
.tablist {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; padding: 0;
  list-style: none;
}
.tablist button {
  font: inherit; font-weight: 700; font-size: 0.92rem;
  padding: 12px 24px; border-radius: 40px; cursor: pointer;
  border: 2px solid var(--red); background: #fff; color: var(--red-dark);
}
.tablist button[aria-selected="true"] { background: var(--red); color: #fff; }
.tablist button:hover { background: #FBE7EB; }
.tablist button[aria-selected="true"]:hover { background: var(--red-dark); }
.tabpanel[hidden] { display: none; }
.doc-list { list-style: none; padding: 0; margin: 0 0 1.5em; columns: 2; column-gap: 32px; }
.doc-list li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid #ECEDF1; }
.doc-list .type { font-size: 0.75rem; font-weight: 600; color: var(--text); margin-left: 6px; }

/* ---------- Contacts ---------- */
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.contact-card { background: var(--muted-bg); border-radius: 6px; padding: 28px 24px; }
.contact-card svg { width: 30px; height: 30px; fill: var(--red); margin-bottom: 12px; }
.contact-card h2 { font-size: 1.25rem; }
.contact-card a { display: block; color: var(--heading); text-decoration: none; word-break: break-word; }
.contact-card a:hover, .contact-card a:focus { color: var(--red-dark); text-decoration: underline; }

.map-wrap iframe { width: 100%; height: 380px; border: 0; display: block; }

.contact-form { max-width: 640px; margin: 0 auto; }
.contact-form h2 { text-align: center; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; color: var(--heading); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--heading);
  padding: 12px 14px; border: 1px solid #767676; border-radius: 4px; background: #fff;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6B6B6B; opacity: 1; }
.field input:focus, .field textarea:focus { border-color: var(--focus); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.error-msg { color: var(--error); font-weight: 600; font-size: 0.9rem; margin-top: 6px; }
.error-msg:empty { display: none; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px; }
.check-row input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.check-row label { font-weight: 400; color: var(--text); }
.form-status { padding: 12px 16px; border-radius: 4px; margin-bottom: 18px; font-weight: 600; }
.form-status.ok { background: #E6F4EA; color: #1E5E2F; }
.form-status.bad { background: #FDECEE; color: var(--error); }
.form-status:empty { display: none; }
.hp-field { position: absolute; left: -9999px; }
.contact-form button[type="submit"] { border: 0; cursor: pointer; font-family: inherit; }

/* ---------- Disclaimer ---------- */
.prose { max-width: 760px; }
.prose p { text-align: justify; }

/* ---------- Footer ---------- */
.site-footer { background: var(--red); color: #fff; }
.site-footer .footer-top {
  display: grid; grid-template-columns: 90px 1fr 1fr 1.8fr; gap: 28px;
  padding-top: 56px; padding-bottom: 36px;
}
.footer-logo img { width: 72px; height: 72px; border-radius: 50%; background: #fff; }
.site-footer h2 { color: #fff; font-size: 0.98rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 4px; }
.site-footer p, .site-footer li { font-size: 0.82rem; font-weight: 400; color: #fff; }
.site-footer strong { color: #fff; }
/* audit Header 16: hover keeps white text (5:1) instead of navy (4:1) */
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.footer-bottom p { margin: 0; }

/* Scroll to top (audit: Header 56) */
.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px;
  border-radius: 50%; border: 2px solid #fff; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; visibility: hidden; transition: opacity .2s;
}
.to-top.show { opacity: 1; visibility: visible; }
.to-top svg { width: 18px; height: 18px; fill: currentColor; }
.to-top:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .site-header .container { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .nav-toggle { display: inline-block; }
  .main-nav { width: 100%; order: 3; }
  .main-nav ul { display: none; flex-direction: column; gap: 0; padding: 8px 0; }
  .main-nav.open ul { display: flex; }
  .main-nav a { padding: 10px 0; }
  .hero .container, .two-col, .directors { grid-template-columns: 1fr; }
  .two-col .media-first { order: -1; }
  .hero h1 { font-size: 1.8rem; }
  h2 { font-size: 1.7rem; }
  .contact-cards { grid-template-columns: 1fr; }
  .doc-list { columns: 1; }
  .site-footer .footer-top { grid-template-columns: 1fr 1fr; }
  .timeline::before { left: 9px; }
  .timeline li, .timeline li:nth-child(odd), .timeline li:nth-child(even) {
    width: auto; margin: 0; padding-left: 36px; padding-right: 0; text-align: left;
  }
  .timeline li:nth-child(odd) .dot, .timeline li:nth-child(even) .dot { left: 0; right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .to-top { transition: none; }
}

/* Image column shown first (left) while its text is read second */
@media (min-width: 861px) { .two-col > .media-first { order: -1; } }
