/* East End Home Care Limited — site styles
   Brand: navy #1B2A4A, teal #2AABB3
   Type:  Source Serif 4 (headings) / Source Sans 3 (body)
   Base font size is deliberately 18px: much of the audience is older. */

:root {
  --navy: #1B2A4A;
  --navy-700: #142038;
  --navy-300: #55688B;
  --teal: #2AABB3;
  --teal-dark: #147A81;
  --ink: #23313F;
  --muted: #56687A;
  --paper: #F3F6F8;
  --paper-warm: #FBFCFD;
  --line: #D9E1E7;
  --white: #FFFFFF;
  --focus: #B8451F;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  --wrap: 1140px;
  --gap: 2rem;
  --radius: 3px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 .6em;
  font-weight: 600;
}
h1 { font-size: 2.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.95rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.08rem; font-family: var(--sans); font-weight: 700; }

p { margin: 0 0 1.1em; max-width: 68ch; }
ul, ol { max-width: 68ch; }
li { margin-bottom: .4em; }

a { color: var(--teal-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy); }

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

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

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: #fff; padding: .7rem 1.1rem; z-index: 100;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- utility bar ---------- */
.topbar {
  background: var(--navy);
  color: #DCE4EE;
  font-size: .93rem;
}
.topbar .wrap {
  display: flex; flex-wrap: wrap; gap: .4rem 1.6rem;
  align-items: center; justify-content: space-between;
  padding-top: .5rem; padding-bottom: .5rem;
}
.topbar a { color: #fff; font-weight: 600; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }
.topbar .hours { color: #AFBDD0; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--line); background: var(--white); }
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1rem; padding-bottom: 1rem;
}
.wordmark { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.wordmark .mark {
  width: 54px; height: auto; flex: 0 0 auto;
}
@media (max-width: 480px) { .wordmark .mark { width: 44px; } }
.wordmark .name {
  font-family: var(--serif); color: var(--navy);
  font-size: 1.22rem; font-weight: 600; line-height: 1.15;
}
.wordmark .sub { display: block; font-family: var(--sans); font-size: .76rem; color: var(--muted); font-weight: 400; }

.navtoggle {
  display: none; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .55rem .8rem; font: inherit;
  font-size: .95rem; color: var(--navy); cursor: pointer;
}

.mainnav ul { list-style: none; display: flex; gap: 1.15rem; margin: 0; padding: 0; align-items: center; }
.mainnav a {
  color: var(--navy); text-decoration: none; font-weight: 600; font-size: .97rem;
  padding: .3rem 0; border-bottom: 2px solid transparent; white-space: nowrap;
}
.mainnav a:hover { border-bottom-color: var(--teal); }
.mainnav a[aria-current="page"] { border-bottom-color: var(--teal); }
.mainnav .nav-cta {
  background: var(--teal-dark); color: #fff; padding: .55rem 1rem; white-space: nowrap;
  border-radius: var(--radius); border-bottom: none;
}
.mainnav .nav-cta:hover { background: var(--navy); border-bottom-color: transparent; }

@media (max-width: 1200px) {
  .navtoggle { display: block; }
  .mainnav { display: none; width: 100%; }
  .mainnav.open { display: block; }
  .masthead .wrap { flex-wrap: wrap; }
  .mainnav ul { flex-direction: column; align-items: flex-start; gap: 0; padding-bottom: .8rem; }
  .mainnav li { width: 100%; border-top: 1px solid var(--line); }
  .mainnav a { display: block; padding: .8rem 0; }
  .mainnav .nav-cta { display: inline-block; margin: .7rem 0; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 1.02rem;
  padding: .85rem 1.5rem; border-radius: var(--radius); text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--teal-dark); color: #fff; }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--teal); color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.2rem; }

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--line); background: var(--paper-warm); }
.hero .wrap {
  display: grid; grid-template-columns: 1fr 1.02fr; gap: 3rem;
  align-items: center; padding-top: 3.2rem; padding-bottom: 3.2rem;
}
.hero h1 { margin-bottom: .5rem; }
.hero .lede { font-size: 1.18rem; color: var(--muted); max-width: 34ch; }
.hero-choice { margin-top: 1.8rem; }
.hero-choice p { font-size: .98rem; color: var(--muted); margin-bottom: .6rem; }
.hero-figure { margin: 0; }
.hero-figure img {
  border-radius: var(--radius); border: 1px solid var(--line);
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 45%;
}
.hero-figure figcaption { font-size: .82rem; color: var(--muted); margin-top: .5rem; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.2rem; padding-bottom: 2.2rem; }
  h1 { font-size: 2.05rem; }
  h2 { font-size: 1.65rem; }
}

/* ---------- cqc strip ---------- */
.cqc-strip { background: var(--navy); color: #E3E9F1; }
.cqc-strip .wrap { padding-top: 1.1rem; padding-bottom: 1.1rem; }
.cqc-strip p { margin: 0; max-width: 92ch; font-size: .97rem; }
.cqc-strip a { color: #8FD9DE; }
.cqc-strip a:hover { color: #fff; }

/* ---------- sections ---------- */
.band { padding: 3.4rem 0; border-bottom: 1px solid var(--line); }
.band-paper { background: var(--paper); }
.band-navy { background: var(--navy); color: #DCE4EE; border-bottom: none; }
.band-navy h2, .band-navy h3 { color: #fff; }
.band-navy a:not(.btn) { color: #8FD9DE; }
.band-navy .btn-light { background: #fff; color: var(--navy); }
.band-navy .btn-light:hover { background: var(--teal); color: var(--navy); }
.band-tight { padding: 2.4rem 0; }

.section-head { max-width: 62ch; margin-bottom: 2.2rem; }
.section-head p { color: var(--muted); font-size: 1.06rem; margin-bottom: 0; }

/* ---------- steps (a genuine sequence) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; list-style: none; padding: 0; margin: 0; max-width: none; }
.steps li { border-top: 3px solid var(--teal); padding-top: 1rem; margin: 0; }
.steps .n { font-family: var(--serif); font-size: 1.05rem; color: var(--teal-dark); font-weight: 600; }
.steps h3 { margin: .2rem 0 .4rem; font-size: 1.18rem; }
.steps p { margin: 0; color: var(--muted); font-size: .98rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 1.5rem; } }

/* ---------- cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem;
}
.card h3 { margin-bottom: .45rem; }
.card p { margin-bottom: 0; color: var(--muted); font-size: .99rem; }
.card ul { margin: .6rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .97rem; }

/* funding cards carry a teal edge so the three routes read as one set */
.card-funding { border-left: 4px solid var(--teal); }

/* ---------- split feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split img { border-radius: var(--radius); border: 1px solid var(--line); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 1.8rem; } }

/* ---------- areas ---------- */
.arealist { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; max-width: none; }
.arealist li {
  border: 1px solid var(--line); background: var(--white);
  border-radius: var(--radius); padding: .5rem .95rem; margin: 0; font-size: .97rem;
}

/* ---------- vacancies ---------- */
.vac-filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1.8rem; }
.vac-filters label { display: block; font-size: .9rem; font-weight: 600; color: var(--navy); margin-bottom: .3rem; }
.vac-filters select, .vac-filters input {
  font: inherit; font-size: 1rem; padding: .6rem .7rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink);
  min-width: 13rem;
}
.vacancy { border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: var(--radius); margin-bottom: 1.2rem; background: #fff; }
.vacancy > .vac-head { padding: 1.4rem 1.5rem; }
.vacancy h3 { margin-bottom: .5rem; }
.vac-meta { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 1rem; max-width: none; }
.vac-meta li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .25rem .7rem; font-size: .9rem; margin: 0; color: var(--navy); }
.vac-detail { border-top: 1px solid var(--line); padding: 1.4rem 1.5rem; background: var(--paper-warm); }
.vac-detail h4 { margin-top: 1.2rem; }
.vac-detail h4:first-child { margin-top: 0; }
.vac-empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; color: var(--muted); }
.linkbtn { background: none; border: none; font: inherit; font-weight: 600; color: var(--teal-dark); cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- forms ---------- */
.form-field { margin-bottom: 1.2rem; max-width: 34rem; }
.form-field label { display: block; font-weight: 600; color: var(--navy); margin-bottom: .35rem; }
.form-field .hint { font-size: .9rem; color: var(--muted); margin: 0 0 .4rem; }
.form-field input, .form-field textarea, .form-field select {
  font: inherit; width: 100%; padding: .7rem .8rem;
  border: 1px solid var(--navy-300); border-radius: var(--radius); background: #fff; color: var(--ink);
}
.form-field textarea { min-height: 8rem; resize: vertical; }
.hidden-field { position: absolute; left: -9999px; }

/* ---------- prose pages ---------- */
.prose { padding: 3rem 0; }
.prose h2 { margin-top: 2.4rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.8rem; }
.prose .updated { color: var(--muted); font-size: .95rem; }
.pagehead { background: var(--paper); border-bottom: 1px solid var(--line); padding: 2.6rem 0; }
.pagehead h1 { margin-bottom: .3rem; }
.pagehead p { color: var(--muted); font-size: 1.1rem; margin-bottom: 0; }

.keyvals { border-collapse: collapse; width: 100%; max-width: 42rem; margin: 1rem 0 1.5rem; }
.keyvals th, .keyvals td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); font-size: .98rem; vertical-align: top; }
.keyvals th { width: 42%; color: var(--navy); font-weight: 600; }

.callout { border: 1px solid var(--line); border-left: 4px solid var(--teal); background: var(--paper); padding: 1.2rem 1.4rem; border-radius: var(--radius); margin: 1.5rem 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- recruitment band ---------- */
.recruit .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: center; }
.recruit p { color: #C3CEDD; }
@media (max-width: 860px) { .recruit .wrap { grid-template-columns: 1fr; gap: 1.4rem; } }

/* ---------- footer ---------- */
.sitefoot { background: var(--navy-700); color: #B9C5D6; padding: 3rem 0 0; font-size: .97rem; }
.sitefoot h2 { color: #fff; font-size: 1.05rem; font-family: var(--sans); font-weight: 700; margin-bottom: .8rem; }
.sitefoot a { color: #CFDAE8; text-decoration: none; }
.sitefoot a:hover { color: #fff; text-decoration: underline; }
.footgrid { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr; gap: 2.5rem; padding-bottom: 2.4rem; }
.footgrid ul { list-style: none; padding: 0; margin: 0; }
.footgrid li { margin-bottom: .5rem; }
.footgrid address { font-style: normal; line-height: 1.7; }
@media (max-width: 820px) { .footgrid { grid-template-columns: 1fr; gap: 1.8rem; } }
.legal { border-top: 1px solid #2B3B58; padding: 1.4rem 0 2rem; font-size: .87rem; color: #8FA0B8; }
.legal p { max-width: 90ch; margin-bottom: .5rem; }
.legal a { color: #A9BAD1; }

/* =====================================================================
   PHONE LAYOUT
   Controls are full width so nothing is ragged, and vertical rhythm is
   tightened — desktop padding reads as loose and unfinished on a phone.
   ===================================================================== */

/* long email addresses must never push the layout wide */
.keyvals td, .footgrid address, .prose p { overflow-wrap: anywhere; }

@media (max-width: 680px) {
  .wrap { padding-left: 1.1rem; padding-right: 1.1rem; }

  /* every button the same width — the main cause of the ragged look */
  .btn-row { flex-direction: column; align-items: stretch; gap: .7rem; }
  .btn-row .btn { display: block; width: 100%; text-align: center; }
  form .btn, .prose > .btn { display: block; width: 100%; text-align: center; }

  /* filters line up in a single column instead of three odd widths */
  .vac-filters { flex-direction: column; align-items: stretch; gap: .9rem; margin-bottom: 1.4rem; }
  .vac-filters > div { width: 100%; }
  .vac-filters select, .vac-filters input { width: 100%; min-width: 0; }

  /* tighter vertical rhythm */
  .band { padding: 2.4rem 0; }
  .band-tight { padding: 1.7rem 0; }
  .prose { padding: 2.1rem 0; }
  .pagehead { padding: 1.9rem 0; }
  .hero .wrap { padding-top: 1.8rem; padding-bottom: 1.8rem; gap: 1.5rem; }
  .section-head { margin-bottom: 1.4rem; }
  .grid { gap: 1rem; }
  .card { padding: 1.25rem; }
  .prose h2 { margin-top: 1.9rem; }
  .prose h3 { margin-top: 1.4rem; }
  .callout { padding: 1.1rem 1.15rem; margin: 1.2rem 0; }
  .steps { gap: 1.2rem; }
  .split { gap: 1.4rem; }

  /* key/value tables stack rather than squeezing into two columns */
  .keyvals, .keyvals tbody, .keyvals tr, .keyvals th, .keyvals td { display: block; width: 100%; }
  .keyvals tr { border-bottom: 1px solid var(--line); padding: .7rem 0; }
  .keyvals th { padding: 0 0 .15rem; border: none; font-size: .88rem; color: var(--muted); }
  .keyvals td { padding: 0; border: none; }

  .vac-meta li { font-size: .86rem; }
  .vacancy > .vac-head, .vac-detail { padding: 1.15rem 1.15rem; }
  .form-field { margin-bottom: 1rem; }
  .form-field textarea { min-height: 7rem; }

  .sitefoot { padding-top: 2.2rem; }
  .footgrid { gap: 1.6rem; padding-bottom: 1.8rem; }
}

@media (max-width: 420px) {
  h1 { font-size: 1.82rem; }
  h2 { font-size: 1.45rem; }
  h3 { font-size: 1.15rem; }
  body { font-size: 17px; }
  .hero .lede { font-size: 1.08rem; }
  .wordmark .name { font-size: 1.08rem; }
  .wordmark .sub { font-size: .72rem; }
}

/* =====================================================================
   POLISH
   ===================================================================== */

/* header stays in view while scrolling */
.masthead { position: sticky; top: 0; z-index: 50; transition: box-shadow .2s ease; }
.masthead.scrolled { box-shadow: 0 2px 12px rgba(27, 42, 74, .08); }

/* trust strip replaces the long CQC paragraph */
.trust-strip { background: var(--navy); color: #fff; }
.trust-strip ul {
  list-style: none; margin: 0; padding: 1.05rem 0; max-width: none;
  display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: .8rem 1.5rem;
}
.trust-strip li { display: flex; align-items: center; gap: .55rem; margin: 0; font-weight: 600; font-size: .98rem; }
.trust-strip svg { width: 20px; height: 20px; fill: var(--teal); flex: 0 0 auto; }
.trust-strip a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
.trust-strip a:hover { text-decoration-color: #fff; }
@media (max-width: 900px) { .trust-strip ul { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .trust-strip ul { grid-template-columns: 1fr; gap: .6rem; } .trust-strip li { font-size: .95rem; } }

/* service and funding cards respond to hover */
.card { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.card:hover { border-color: #BFCDD8; box-shadow: 0 4px 16px rgba(27, 42, 74, .07); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }

/* images get a touch more finish */
.hero-figure img, .split img { box-shadow: 0 8px 28px rgba(27, 42, 74, .10); border-color: transparent; }

/* footer logo */
.footmark { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.4rem; text-decoration: none !important; }
.footmark img { width: 48px; height: auto; }
.footmark span { font-family: var(--serif); color: #fff; font-size: 1.12rem; font-weight: 600; line-height: 1.2; }

/* section headings get a short teal rule */
.section-head h2::after, .prose > .wrap > h2::after, .band > .wrap > h2::after {
  content: ""; display: block; width: 44px; height: 3px; background: var(--teal); margin-top: .55rem; border-radius: 2px;
}
