/* =========================================================
   Forumly — Global Stylesheet
   A restrained UK B2B healthcare-technology visual language:
   navy, teal, generous whitespace, strong type hierarchy.
   ========================================================= */

:root {
  --color-navy:        #0F2A43;
  --color-navy-dark:   #0A1D30;
  --color-teal:        #1C7C82;
  --color-teal-light:  #5FBEC4;
  --color-bg:          #F7F9FA;
  --color-surface:     #FFFFFF;
  --color-border:      #E1E7EC;
  --color-text:        #29323C;
  --color-text-muted:  #5B6774;
  --color-success:     #1E7A46;
  --color-danger:      #B3261E;

  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container-width: 1180px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 42, 67, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 42, 67, 0.08);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-teal); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { color: var(--color-navy); line-height: 1.25; margin: 0 0 0.6em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
address { font-style: normal; }
button { font-family: inherit; }

.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: -9999px;
  top: 0;
  background: var(--color-navy);
  color: #fff;
  padding: 0.75em 1.25em;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--color-teal-light);
  outline-offset: 2px;
}

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

section { padding: 64px 0; }
section.alt { background: var(--color-surface); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-teal);
  margin-bottom: 0.75em;
}

.section-head { max-width: 720px; margin: 0 0 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85em 1.6em;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--color-teal); color: #fff; }
.btn--primary:hover { background: var(--color-navy); }
.btn--outline { background: transparent; color: var(--color-navy); border-color: var(--color-border); }
.btn--outline:hover { border-color: var(--color-navy); }
.btn--on-dark { background: #fff; color: var(--color-navy); }
.btn--on-dark:hover { background: var(--color-teal-light); }
.btn--small { padding: 0.5em 1.1em; font-size: 0.85rem; }

/* ---------- Header / Navigation ---------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}
.site-header__logo img { display: block; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: flex-end;
}
.primary-nav__list {
  display: flex;
  align-items: center;
  gap: 22px;
}
.primary-nav__list > li > a,
.dropdown-toggle,
.dropdown-parent-link {
  color: var(--color-navy);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 0;
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.primary-nav__list > li > a:hover,
.dropdown-toggle:hover { color: var(--color-teal); text-decoration: none; cursor: pointer; }
.primary-nav__list a.active { color: var(--color-teal); }

.has-dropdown { position: relative; }
.has-dropdown .dropdown-parent-link { display: none; }
.dropdown-menu {
  display: none;
  position: absolute;
  /* Sits flush against the trigger (top: 100%, no margin) — a
     margin-top here would create a dead zone of empty space the
     mouse has to cross to reach the menu, dropping :hover for an
     instant and closing the menu before a link inside it can be
     clicked. The same visual breathing room comes from padding
     instead, which stays part of this element's own hoverable box. */
  top: 100%;
  left: 0;
  min-width: 260px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown.is-open .dropdown-menu {
  display: block;
}
.dropdown-menu li a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.92rem;
}
.dropdown-menu li a:hover {
  background: var(--color-bg);
  color: var(--color-teal);
  text-decoration: none;
}

.primary-nav__cta { white-space: nowrap; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle__bar {
  width: 20px;
  height: 2px;
  background: var(--color-navy);
  margin: 0 auto;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding: 18px 0 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: var(--color-text-muted); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--color-border); }
.breadcrumbs a { color: var(--color-text-muted); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-dark) 100%);
  color: #fff;
  padding: 88px 0;
}
.hero h1 { color: #fff; max-width: 780px; }
.hero p.lead { color: #C9D6E2; font-size: 1.15rem; max-width: 620px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.hero__inner { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 32px; }
.hero__visual { display: flex; justify-content: center; }
.hero__visual img { width: 100%; max-width: 420px; }

.page-hero {
  background: var(--color-navy);
  color: #fff;
  padding: 56px 0;
}
.page-hero h1 { color: #fff; margin-bottom: 0.4em; }
.page-hero p { color: #C9D6E2; max-width: 680px; }

/* ---------- Stat / trust bar ---------- */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  margin-top: -56px;
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-md);
}
.stat-bar__item { text-align: center; }
.stat-bar__figure { font-size: 1.7rem; font-weight: 700; color: var(--color-navy); display: block; }
.stat-bar__label { font-size: 0.85rem; color: var(--color-text-muted); }

/* ---------- Card grids ---------- */
.grid { display: grid; gap: 28px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
}
.card h3 { margin-bottom: 0.5em; }
.card p { color: var(--color-text-muted); }
.card--link { display: block; transition: box-shadow .15s ease, transform .15s ease; }
.card--link:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }

.icon-badge {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(28,124,130,0.1);
  color: var(--color-teal);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-weight: 700;
}

/* ---------- Numbered steps ---------- */
.steps { counter-reset: step; display: grid; gap: 24px; }
.step { display: flex; gap: 20px; align-items: flex-start; }
.step::before {
  counter-increment: step;
  content: counter(step);
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- Team ---------- */
.team-card { text-align: center; }
.team-card img {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  border: 3px solid var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-border);
}
.team-card__role { color: var(--color-teal); font-weight: 600; font-size: 0.9rem; }
.team-card__location { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 0.75em; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; color: var(--color-navy); }
.form-group .hint { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 4px; }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--color-text);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--color-teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(28,124,130,0.15);
}
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.checkbox-item { display: flex; align-items: flex-start; gap: 8px; font-size: 0.92rem; }
.checkbox-item input { width: auto; margin-top: 3px; }
.form-error { color: var(--color-danger); font-size: 0.85rem; margin-top: 6px; }
.form-success-box {
  background: rgba(30,122,70,0.08);
  border: 1px solid rgba(30,122,70,0.3);
  color: var(--color-success);
  padding: 20px;
  border-radius: var(--radius-md);
}
.form-error-box {
  background: rgba(179,38,30,0.08);
  border: 1px solid rgba(179,38,30,0.3);
  color: var(--color-danger);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}
.honeypot-field { position: absolute; left: -9999px; opacity: 0; }

/* ---------- Blog article content ---------- */
.blog-content { font-size: 1.05rem; line-height: 1.75; }
.blog-content h2 { margin-top: 1.6em; font-size: 1.4rem; }
.blog-content h3 { margin-top: 1.4em; }
.blog-content p { margin-bottom: 1.2em; }
.blog-content ul, .blog-content ol { margin: 0 0 1.2em; padding-left: 22px; color: var(--color-text); }
.blog-content a { text-decoration: underline; }
.blog-content img { border-radius: var(--radius-md); margin: 1.2em 0; }

/* ---------- Key/value detail list (e.g. careers job facts) ---------- */
.detail-list { margin: 16px 0; border-top: 1px solid var(--color-border); }
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.detail-row__label { color: var(--color-text-muted); font-weight: 600; }
.detail-row__value { text-align: right; }

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 20px 0;
}
.faq-item summary {
  font-weight: 600;
  color: var(--color-navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--color-teal); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: 12px; color: var(--color-text-muted); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--color-navy);
  color: #fff;
  text-align: center;
  padding: 72px 0;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #C9D6E2; max-width: 560px; margin: 0 auto 28px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-navy-dark); color: #C9D6E2; padding: 64px 0 0; }
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 0.9fr 0.9fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 48px;
}
.site-footer__col h2 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; }
.site-footer__col ul li { margin-bottom: 10px; }
.site-footer__col a { color: #C9D6E2; }
.site-footer__col a:hover { color: #fff; }
.site-footer__brand p { margin-top: 12px; color: #93A3B3; font-size: 0.9rem; }
.site-footer address a { display: inline-block; margin-top: 4px; }
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  font-size: 0.85rem;
  color: #93A3B3;
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--color-navy-dark);
  color: #fff;
  z-index: 200;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
}
.cookie-banner__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; color: #C9D6E2; }
.cookie-banner a { color: #fff; text-decoration: underline; }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 120px 0; }
.error-page .error-code { font-size: 4rem; font-weight: 700; color: var(--color-teal); }

/* ---------- Utility ---------- */
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
