/* ==========================================================
   style.css  -  the look of every page

   Colors are set in config.js. The values here are only a
   fallback in case config.js does not load.

   Sections in this file:
   1. Basics (fonts, colors, spacing)
   2. Header and menu
   3. Buttons
   4. Home page sections
   5. Footer
   6. Phone and tablet sizes
   ========================================================== */


/* ---------- 1. Basics ---------- */

:root {
  --primary: #0b5cab;
  --dark:    #0a2540;
  --accent:  #ff8552;
  --tint:    #eaf3fb;
  --bar:     #0d73d4;   /* header and footer background (set in config.js) */
  --text:    #24323f;   /* body text */
  --muted:   #51606e;   /* lighter text, still easy to read */
  --line:    #d9e2ea;   /* thin borders */
  --radius:  14px;      /* rounded corners */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* System fonts: nothing to download, so pages load fast */
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.65;
  color: var(--text);
  background: #ffffff;
}

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

h1, h2, h3 {
  color: var(--dark);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

a { color: var(--primary); }
a:hover { text-decoration-thickness: 2px; }

/* A clear outline for people who use the keyboard */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Keeps content from stretching too wide on big screens */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 80px 0; }
/* First section right under a page title: smaller gap above it */
.section.after-title { padding-top: 24px; }
.section-tint { background: var(--tint); }

/* Small label above a heading */
.eyebrow {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

/* Centered heading block at the top of a section */
.section-head {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}
.section-head p { color: var(--muted); font-size: 1.125rem; }

/* "Skip to main content" link. Hidden until someone presses Tab. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--dark);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }


/* ---------- 2. Header and menu ---------- */

/* The header uses the --bar color (same as the footer), with white text.
   Keep --bar dark enough that white text stays easy to read. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar);
  box-shadow: 0 2px 14px rgba(10, 37, 64, 0.20);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
}

/* The logo sits on a white card so its blue circle doesn't blend into the bar */
.logo {
  display: inline-flex;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 12px;
}
.logo img { height: 62px; width: auto; }

.main-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}
.main-menu ul {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-menu ul a {
  display: block;
  padding: 10px 12px;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  text-transform: uppercase;   /* menu shows in capitals (Basu, 10/26/2026); the labels in config.js stay normal */
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 8px;
}
.main-menu ul a:hover { background: rgba(255, 255, 255, 0.16); }
.main-menu ul a[aria-current="page"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

/* "Call" button in the header: white with dark text */
.site-header .header-phone,
.site-header .header-phone:hover {
  color: var(--dark);
  background: #ffffff;
  border-color: #ffffff;
}

/* The Menu button only shows on phones (see section 6) */
.menu-button {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  color: var(--dark);
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
/* Three-line menu icon drawn with CSS */
.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after  { top: 6px; }


/* ---------- 3. Buttons ---------- */

.button {
  display: inline-block;
  padding: 14px 26px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  color: #ffffff;
  background: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(10, 37, 64, 0.18);
}

/* Main call to action: coral with dark text (good contrast) */
.button-accent {
  color: var(--dark);
  background: var(--accent);
  border-color: var(--accent);
}

/* Outline style for the second button in a pair */
.button-outline {
  color: var(--primary);
  background: #ffffff;
}

/* White button for dark backgrounds */
.button-light {
  color: var(--dark);
  background: #ffffff;
  border-color: #ffffff;
}

.button-small { padding: 10px 18px; font-size: 0.95rem; white-space: nowrap; }

.button-row { display: flex; flex-wrap: wrap; gap: 14px; }


/* ---------- 4. Home page sections ---------- */

/* 4a. Top banner */
.hero {
  background: linear-gradient(180deg, var(--tint) 0%, #ffffff 100%);
  padding: 72px 0 48px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-lead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 34em;
  margin-bottom: 28px;
}
.hero-note {
  margin: 22px 0 0;
  font-size: 0.98rem;
  color: var(--muted);
}
.hero-photo {
  position: relative;
}
.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 24px 48px rgba(10, 37, 64, 0.18);
}
/* Soft coral shape behind the photo */
.hero-photo::before {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 62%;
  height: 62%;
  background: var(--accent);
  opacity: 0.28;
  border-radius: 28px;
  z-index: 0;
}
.hero-photo img { position: relative; z-index: 1; }

/* 4b. Service cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(10, 37, 64, 0.06);
}
.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.card-body { padding: 28px; display: flex; flex-direction: column; flex: 1; }
.card-body p { color: var(--muted); }
.card-link {
  margin-top: auto;
  font-weight: 700;
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }
.card-link span { display: inline-block; transition: transform 0.15s ease; }
.card-link:hover span { transform: translateX(4px); }

/* 4c. Numbered steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  background: #ffffff;
  border-radius: var(--radius);
  padding: 30px 28px;
  border: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
  background: var(--primary);
  border-radius: 50%;
}
.steps p { color: var(--muted); margin: 0; }

/* 4d. Values */
.values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  text-align: center;
}
.value-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  color: var(--primary);
  background: var(--tint);
  border-radius: 50%;
}
.value-icon svg { width: 32px; height: 32px; }
.values p { color: var(--muted); margin: 0; }

/* 4e. Blue band asking people to become home providers */
.band {
  background: var(--dark);
  color: #ffffff;
  padding: 72px 0;
}
.band-grid {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 40px;
  align-items: center;
}
.band h2 { color: #ffffff; }
.band p { color: #d5e2ee; font-size: 1.125rem; margin: 0; max-width: 40em; }
.band .eyebrow { color: #ffb596; }

/* Light version of the band, for the last section before the footer.
   It blends with the page instead of sitting dark against the blue footer. */
.band.band-light { background: var(--tint); color: var(--text); }
.band.band-light h2 { color: var(--dark); }
.band.band-light p { color: var(--muted); }
.band.band-light .eyebrow { color: var(--primary); }
.band.band-light p a { color: var(--primary); }
.band.band-light .button-light { border-color: var(--primary); color: var(--primary); }

/* 4f. Contact strip */
.contact-strip {
  display: grid;
  /* The middle box is wider so a long email address fits on one line */
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 28px;
}
.contact-item {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}
.contact-item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.contact-item p { margin: 0; color: var(--muted); }
.contact-item a { font-weight: 700; overflow-wrap: anywhere; }


/* ---------- 5. Footer ---------- */

/* Same --bar color as the header. All footer text is white so it stays easy to read. */
.site-footer {
  background: var(--bar);
  color: #ffffff;
  padding-top: 64px;
  font-size: 0.98rem;
}
.site-footer a { color: #ffffff; }
.site-footer h2 {
  color: #ffffff;
  font-size: 0.9rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}
/* The logo sits on a white tile so it stays readable on the blue footer */
.footer-logo {
  display: inline-block;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.footer-logo img { height: 56px; width: auto; }
.footer-about p { max-width: 30em; }
.footer-contact a { overflow-wrap: anywhere; }
.footer-menu ul { list-style: none; margin: 0; padding: 0; }
.footer-menu li { margin-bottom: 8px; }
.footer-menu a { text-decoration: none; }
.footer-menu a:hover { text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  padding-top: 20px;
  padding-bottom: 24px;
}
.footer-bottom p { margin: 0; font-size: 0.9rem; }


/* ---------- 5b. Inner pages (About and others) ---------- */

/* Title banner at the top of every page except Home */
.page-title {
  background: linear-gradient(180deg, var(--tint) 0%, #ffffff 100%);
  padding: 64px 0 40px;
}
.page-title p {
  max-width: 40em;
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0;
}

/* Text on one side, photo on the other */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(10, 37, 64, 0.14);
}

/* Same as .split, but the photo sits on the left on wide screens */
.split-reverse img { order: -1; }

/* When a link jumps to a section, stop the sticky header from covering its heading */
[id] { scroll-margin-top: 110px; }

/* Row of "jump to" links under a page title */
.jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
}
.jump-links a {
  display: inline-block;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.jump-links a:hover { border-color: var(--primary); }

/* List with a check mark in front of each line */
.check-list {
  list-style: none;
  margin: 0 0 1.4em;
  padding: 0;
}
.check-list li {
  position: relative;
  padding-left: 36px;
  margin-bottom: 12px;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tint);
}
/* On a light blue section the circle is white, so it still shows */
.section-tint .check-list li::before { background: #ffffff; }
/* The check mark itself, drawn with two borders */
.check-list li::after {
  content: "";
  position: absolute;
  left: 8px;
  top: calc(0.2em + 5px);
  width: 5px;
  height: 9px;
  border: solid var(--primary);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Two boxes side by side (Mission and Vision) */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 34px 32px;
}
.panel-accent { border-top-color: var(--accent); }
.panel p { margin: 0; font-size: 1.125rem; }
.panel p + p { margin-top: 14px; }   /* space between two paragraphs in a box */

/* A box that marks content we still need from the client */
.todo {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 30px;
  text-align: center;
  color: var(--muted);
  background: #ffffff;
  border: 2px dashed #9fb3c5;
  border-radius: var(--radius);
}
.todo p { margin: 0; }


/* ---------- 5c. Forms ---------- */

/* Text on the left, form on the right */
.form-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: start;
}

.form-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 34px;
  box-shadow: 0 10px 28px rgba(10, 37, 64, 0.08);
}

/* One question: its label, then its box */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}
.field .hint {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
  border: 1.5px solid #8a9bab;     /* dark enough to see the box clearly */
  border-radius: 10px;
}
.field textarea { min-height: 130px; resize: vertical; }

/* Drop-down list, styled to match the text boxes */
.field select {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
  border: 1.5px solid #8a9bab;
  border-radius: 10px;
}
.field select:focus {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--primary);
}

/* A group of tick boxes with one shared question above them */
.choices {
  border: 0;
  margin: 0 0 20px;
  padding: 0;
}
.choices legend {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
  padding: 0;
}
.choices label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.choices input { width: 20px; height: 20px; accent-color: var(--primary); }
/* Small grey help line under a tick-box question */
.choices .hint {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
}

/* Privacy notice above a form */
.notice {
  margin: 0 0 24px;
  padding: 16px 18px;
  font-size: 0.97rem;
  color: var(--dark);
  background: var(--tint);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
}
.notice strong { display: block; margin-bottom: 2px; }
.field input:focus, .field textarea:focus {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--primary);
}
.field input[type="file"] { font: inherit; max-width: 100%; }

/* Two fields side by side on wide screens */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Hidden trap field. People never see it, spam robots fill it in. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note { font-size: 0.92rem; color: var(--muted); margin: 18px 0 0; }

/* Message shown after pressing Send */
.form-status {
  display: none;
  margin: 18px 0 0;
  padding: 14px 16px;
  color: var(--dark);
  background: #fff1e9;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
}
.form-status.is-visible { display: block; }

/* Contact details list: a small label, then the detail */
.detail-list { margin: 24px 0 0; }
.detail-list dt {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 20px;
}
.detail-list dd {
  margin: 4px 0 0;
  font-size: 1.125rem;
  color: var(--dark);
  overflow-wrap: anywhere;
}
.detail-list a { font-weight: 600; }

/* Map */
.map {
  display: block;
  width: 100%;
  height: 400px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Three plain boxes in a row (used for "What you get from us") */
.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.trio > div {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
}
.trio p { color: var(--muted); margin: 0; }


/* ---------- 5d. Services page ---------- */

/* Hides text on screen but keeps it for screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Less space above and below the row of service boxes */
.section-tight { padding: 8px 0 64px; }

/* Row of service boxes. They wrap onto more lines on smaller screens. */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.service-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 26px 18px 24px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(10, 37, 64, 0.06);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.service-tile:hover { transform: translateY(-3px); border-color: var(--primary); }
.service-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.service-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 14px;
  color: var(--primary);
  background: var(--tint);
  border-radius: 50%;
}
.service-icon svg { width: 28px; height: 28px; }
.service-name { font-weight: 700; color: var(--dark); line-height: 1.3; margin-bottom: 6px; }
.service-line { font-size: 0.95rem; color: var(--muted); line-height: 1.45; }

/* Home page version: a "Learn more" line pinned to the bottom of each box */
.service-more {
  margin-top: auto;
  padding-top: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}
.service-tile:hover .service-more { text-decoration: underline; }

/* Contact page: address box beside the map */
.map-layout {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 32px;
  align-items: stretch;
}
.map-layout .map { height: 100%; min-height: 360px; }

/* Link at the bottom of a quick-link box */
.trio > div { display: flex; flex-direction: column; }
.trio .quick-link { margin-top: auto; padding-top: 16px; font-weight: 700; }
.trio .quick-link a { text-decoration: none; }
.trio .quick-link a:hover { text-decoration: underline; }

/* ---------- About page: organization chart ----------
   Boxes joined by lines, top to bottom. On phones (section 6)
   it becomes a list with one line down the left side. */

.org {
  --org-line: #9fb3c5;     /* color of the connecting lines */
  --org-gap: 28px;         /* space between the three teams */
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* One box in the chart. The colored bar on the left matches the client's printed chart. */
.org-node {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 18px 22px 18px 26px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(10, 37, 64, 0.08);
}
.org-name { font-size: 1.1rem; margin: 0; }
.org-role { margin: 2px 0 0; color: var(--muted); font-size: 0.97rem; }

/* The two leaders: a bit bigger, with an initials circle */
.org-lead { display: flex; align-items: center; gap: 16px; max-width: 360px; }
.org-lead .org-name { font-size: 1.25rem; }
.org-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  font-weight: 800;
  font-size: 1.1rem;
  color: #ffffff;
  background: var(--dark);
  border-radius: 50%;
}

/* A box that lists a team (Nurse Trainers, Program Managers) */
.org-team h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.org-team ul { list-style: none; margin: 0; padding: 0; }
.org-team li { padding: 2px 0; font-weight: 600; color: var(--dark); }

/* Bar colors, taken from the client's chart */
.bar-red    { border-left-color: #c8323c; }
.bar-navy   { border-left-color: #1f4e79; }
.bar-gold   { border-left-color: #e0a020; }
.bar-green  { border-left-color: #1e7a4c; }
.bar-blue   { border-left-color: #2747b8; }
.bar-orange { border-left-color: #d9532b; }
.org-lead.bar-red  .org-avatar { background: #c8323c; }
.org-lead.bar-navy .org-avatar { background: #1f4e79; }

/* Short vertical line between two boxes */
.org-link {
  width: 2px;
  height: 28px;
  background: var(--org-line);
}

/* The three teams, side by side, hanging from one line */
.org-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--org-gap);
  width: 100%;
  list-style: none;
  margin: 28px 0 0;        /* room for the line down from Paul */
  padding: 28px 0 0;       /* room for the lines down to each team */
}
/* Line down from the Director of Operations */
.org-branches::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 50%;
  width: 2px;
  height: 28px;
  background: var(--org-line);
}
/* Line across, from the middle of the first team to the middle of the last */
.org-branches::after {
  content: "";
  position: absolute;
  top: 0;
  left:  calc((100% - 2 * var(--org-gap)) / 6);
  right: calc((100% - 2 * var(--org-gap)) / 6);
  height: 2px;
  background: var(--org-line);
}
.org-branches > li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Line down to each team */
.org-branches > li::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 50%;
  width: 2px;
  height: 28px;
  background: var(--org-line);
}

/* Same boxes as .trio, but two per row (Careers page "How it works") */
.trio.duo { grid-template-columns: repeat(2, 1fr); }

/* Careers page: "Other jobs" box, text on the left, buttons on the right */
.jobs-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 36px 40px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(10, 37, 64, 0.08);
}
.jobs-box h2 { font-size: 1.6rem; }
.jobs-box p { margin: 0; color: var(--muted); max-width: 40em; }

/* ---------- Resources page ---------- */

/* "Need help right now?" box at the top */
.help-now {
  padding: 30px 32px;
  background: #fff1e9;
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
}
.help-now h2 { font-size: 1.5rem; margin-bottom: 18px; }
.help-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.help-grid li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: #ffffff;
  border-radius: 10px;
}
.help-grid strong { color: var(--dark); font-size: 0.97rem; line-height: 1.35; }
.help-grid a { font-weight: 800; font-size: 1.1rem; margin-top: auto; }
.help-note { margin: 0; font-size: 0.97rem; color: var(--dark); }
.nowrap { white-space: nowrap; }   /* keeps a phone number on one line */

/* Group heading with a round icon */
.res-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.res-head h2 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.res-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #ffffff;
  background: var(--primary);
  border-radius: 50%;
}
.res-icon svg { width: 26px; height: 26px; }

/* Link cards, four across on wide screens */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.res-card {
  display: flex;
  flex-direction: column;
  padding: 24px 24px 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(10, 37, 64, 0.06);
}
.res-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.res-card p { color: var(--muted); font-size: 0.97rem; margin: 0 0 16px; }
.res-card a { margin-top: auto; font-weight: 700; }
.res-note { margin: 40px 0 0; font-size: 0.92rem; color: var(--muted); text-align: center; }

/* Home page: line under the contact boxes that points to Resources */
.res-pointer { margin: 32px 0 0; text-align: center; color: var(--muted); }
.res-pointer a { font-weight: 700; }

/* A single centered button under a section */
.center-row { text-align: center; margin: 36px 0 0; }

/* Box beside the text on services that have no photo */
.side-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: 0 10px 28px rgba(10, 37, 64, 0.08);
}
.side-panel h3 { margin-bottom: 12px; }
.side-panel .detail-list { margin-top: 0; }
.side-panel .detail-list dt:first-child { margin-top: 0; }
.side-panel .detail-list dd { font-size: 1.02rem; }
/* Coral top line for the emergency box */
.side-panel-alert { border-top-color: var(--accent); }
.side-panel-small { font-size: 0.95rem; color: var(--muted); margin: 0; }
/* On phones the text always comes first (see section 6) */
.split-reverse .side-panel { order: -1; }


/* ---------- 6. Phone and tablet sizes ---------- */

/* Tablets and small laptops: the menu moves behind a Menu button */
@media (max-width: 1080px) {
  .menu-button { display: inline-flex; }

  .main-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 24px 24px;
    background: var(--bar);   /* same blue as the header, so the white text stays readable */
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 16px 24px rgba(10, 37, 64, 0.20);
  }
  .main-menu.is-open { display: flex; }
  .main-menu ul { flex-direction: column; gap: 2px; }
  .main-menu ul a { padding: 14px 12px; font-size: 1.05rem; }
  .main-menu ul a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--accent); }
  .header-phone { padding: 14px 18px; }
}

@media (max-width: 860px) {
  .section { padding: 56px 0; }
  .section.after-title { padding-top: 16px; }
  .hero { padding: 40px 0 36px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo::before { right: -8px; bottom: -10px; }
  .card-grid, .steps, .values, .contact-strip { grid-template-columns: 1fr; }
  .values { gap: 32px; }
  .band-grid { grid-template-columns: 1fr; gap: 28px; }
  .page-title { padding: 40px 0 28px; }
  .split, .pair { grid-template-columns: 1fr; gap: 28px; }
  .split-reverse img, .split-reverse .side-panel { order: 0; }   /* on phones the text always comes first */
  .section-tight { padding: 4px 0 48px; }
  .form-layout, .trio, .field-row, .map-layout { grid-template-columns: 1fr; }
  .map-layout .map { min-height: 300px; }
  .jobs-box { grid-template-columns: 1fr; gap: 22px; padding: 28px 22px; }
  .trio.duo { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr 1fr; }
  .help-now { padding: 24px 20px; }
  /* Organization chart becomes a list with one line down the left */
  .org { align-items: stretch; }
  .org-node, .org-lead { max-width: none; }
  .org > .org-link { margin-left: 34px; }
  .org-branches {
    grid-template-columns: minmax(0, 1fr);
    width: auto;             /* stops the boxes running off the right edge */
    gap: 16px;
    margin: 0 0 0 34px;
    padding: 16px 0 0 22px;
    border-left: 2px solid var(--org-line);
  }
  .org-branches::before, .org-branches::after { display: none; }
  .org-branches > li { align-items: stretch; }
  /* Short line from the left rail to each team */
  .org-branches > li::before {
    top: 30px;
    left: -22px;
    width: 22px;
    height: 2px;
  }
  .org-branches .org-link { height: 14px; margin-left: 24px; }
  .form-layout { gap: 32px; }
  .field-row { gap: 0; }
  .form-card { padding: 28px 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 480px) {
  /* Left and right only, so sections keep their own top and bottom spacing */
  .container { padding-left: 18px; padding-right: 18px; }
  .header-inner { min-height: 72px; }
  .logo img { height: 54px; }
  .button-row .button { width: 100%; }

  /* Service boxes become short rows: icon on the left, text on the right */
  .service-grid { gap: 12px; }
  .service-tile {
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 14px;
    align-items: center;
    padding: 14px 16px;
    text-align: left;
  }
  .service-icon { width: 48px; height: 48px; margin: 0; grid-row: span 3; }
  .service-more { padding-top: 4px; }
  .help-grid { grid-template-columns: 1fr; }
  .service-icon svg { width: 24px; height: 24px; }
  .service-name { margin: 0; }
}

/* Respect people who turn off motion in their device settings */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .card-link span, .service-tile { transition: none; }
  .button:hover, .service-tile:hover { transform: none; }
}
