/* RANCARE Connect — concept site
   Built for WCAG 2.1 AA. Every text/background pair below is checked at 4.5:1 or better
   (most are 7:1+). Do not add new colour pairs without checking them. */

:root {
  --ink: #1C2426;          /* body text          on --paper 15.6:1 */
  --muted: #3F4B4F;        /* secondary text     on --paper  9.2:1 */
  --paper: #FFFFFF;
  --cream: #FBF5EA;        /* section background */
  --sand: #DEB887;         /* their brand colour — backgrounds only, always with --ink text */
  --sand-soft: #F3E3C8;
  --brown: #6B3F0E;        /* links + buttons    on --paper  8.9:1 */
  --brown-dk: #4E2D08;
  --forest: #1E3B33;       /* dark bands; white on it 11.9:1 */
  --gold: #FFD84D;         /* focus ring + highlights on dark */
  --ph-bg: #FFF1B8;        /* placeholder highlight */
  --ph-ink: #4A3A00;       /* on --ph-bg 9.6:1 */
  --ok: #1E5E3C;
  --bad: #A4231B;          /* error text on white 6.9:1 */
  --line: #8A7B66;         /* borders: 3:1+ against white for form fields */
  --f-head: "Lexend", "Atkinson Hyperlegible", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Lexend", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --wrap: 1120px;
  --r: 10px;
  --fs: 1.125rem;          /* 18px base */
  color-scheme: light;
}
html[data-text="lg"] { --fs: 1.3rem; }
html[data-text="xl"] { --fs: 1.5rem; }

/* High-contrast mode: black on white, underlined everything, no tints */
html[data-contrast="high"] {
  --ink: #000; --muted: #000; --cream: #fff; --sand: #fff; --sand-soft: #fff;
  --brown: #000; --brown-dk: #000; --forest: #000; --line: #000; --ph-bg: #fff; --ph-ink: #000;
}
html[data-contrast="high"] .card, html[data-contrast="high"] .panel,
html[data-contrast="high"] .ph, html[data-contrast="high"] .photo { border: 2px solid #000; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--fs)/1.65 var(--f-body); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--brown); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--brown-dk); text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--gold); border-radius: 3px; }
.band-dark :focus-visible, .site-foot :focus-visible { outline-color: var(--gold); box-shadow: 0 0 0 6px var(--ink); }

h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.15rem); }
h3 { font-size: 1.3rem; }
p, ul, ol { margin: 0 0 1em; max-width: 68ch; }
li + li { margin-top: .35em; }
strong { font-weight: 700; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 700px) { .wrap { padding-inline: 28px; } }
section { padding-block: clamp(48px, 7vw, 88px); }
.cream { background: var(--cream); }
.band-dark { background: var(--forest); color: #fff; }
.band-dark h2, .band-dark h3 { color: #fff; }
.band-dark a { color: #fff; }
.lede { font-size: 1.2em; color: var(--muted); max-width: 60ch; }
.eyebrow { font: 600 .85em/1.3 var(--f-head); letter-spacing: .06em; text-transform: uppercase; color: var(--brown); margin-bottom: .6em; }
.band-dark .eyebrow { color: var(--gold); }

/* skip link */
.skip { position: absolute; left: 12px; top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 8px; font-weight: 700; }
.skip:focus { top: 0; color: #fff; }

/* concept strip */
.concept { background: var(--ph-bg); color: var(--ph-ink); font-size: .85rem; line-height: 1.45; border-bottom: 2px solid var(--ph-ink); }
.concept .wrap { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; align-items: center; padding-block: 9px; }
.concept strong { text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.concept a { color: var(--ph-ink); font-weight: 700; }

/* display tools */
.tools { background: var(--cream); border-bottom: 1px solid #E6D9C2; font-size: .9rem; }
.tools .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: flex-end; align-items: center; padding-block: 6px; }
.tools fieldset { border: 0; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tools legend { float: left; margin-right: 6px; font-weight: 700; }
.tools button { font: inherit; font-weight: 700; min-height: 44px; min-width: 44px; padding: 6px 12px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; cursor: pointer; }
.tools button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tools a { font-weight: 700; color: var(--ink); }

/* header */
.site-head { background: var(--paper); border-bottom: 4px solid var(--sand); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 52px; height: 52px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; font: 700 1.25rem/1 var(--f-head); color: var(--ink); flex: none; }
.brand-name { font: 700 1.3rem/1.1 var(--f-head); letter-spacing: .01em; }
.brand-name small { display: block; font: 400 .8rem/1.3 var(--f-body); color: var(--muted); margin-top: 3px; letter-spacing: 0; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.nav li + li { margin-top: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--ink); }
.nav a:hover { background: var(--sand-soft); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.head-call { font-weight: 700; white-space: nowrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 24px; border-radius: 999px; font: 700 1em/1.2 var(--f-body); text-decoration: none; border: 3px solid var(--brown); background: var(--brown); color: #fff; cursor: pointer; }
.btn:hover { background: var(--brown-dk); border-color: var(--brown-dk); color: #fff; }
.btn-ghost { background: transparent; color: var(--brown); }
.btn-ghost:hover { background: var(--sand-soft); color: var(--brown-dk); }
.band-dark .btn { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.band-dark .btn-ghost { background: transparent; color: #fff; border-color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }

/* hero */
.hero { background: var(--cream); padding-block: clamp(40px, 6vw, 80px); }
.hero .wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.15fr .85fr; } }
.hero h1 span { display: block; color: var(--brown); }

/* placeholders */
.ph { background: var(--ph-bg); color: var(--ph-ink); padding: 0 .25em; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.photo { background: repeating-linear-gradient(135deg, var(--sand-soft) 0 14px, #EFDDBE 14px 28px); border: 2px dashed var(--line); border-radius: var(--r); display: grid; place-items: center; text-align: center; padding: 24px; min-height: 260px; color: var(--ink); }
.photo p { margin: 0; max-width: 34ch; font-size: .95em; }
.photo strong { display: block; font-family: var(--f-head); margin-bottom: 4px; }

/* cards + grids */
.grid { display: grid; gap: 20px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--paper); border: 2px solid #E6D9C2; border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; }
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.card .more { margin-top: auto; padding-top: 10px; font-weight: 700; }
.panel { background: var(--sand-soft); border-left: 8px solid var(--sand); border-radius: var(--r); padding: 22px 24px; }
.panel > :last-child { margin-bottom: 0; }

/* facts list */
.facts { display: grid; gap: 0; margin: 0; border-top: 2px solid #E6D9C2; max-width: none; }
.facts div { display: grid; gap: 4px 20px; padding: 14px 0; border-bottom: 2px solid #E6D9C2; }
@media (min-width: 700px) { .facts div { grid-template-columns: 220px 1fr; } }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }

/* steps */
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 16px; max-width: none; }
.steps li { counter-increment: s; position: relative; padding: 20px 20px 20px 76px; background: var(--paper); border: 2px solid #E6D9C2; border-radius: var(--r); margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 20px; top: 18px; width: 40px; height: 40px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font: 700 1.1rem/1 var(--f-head); }
.steps h3 { margin-bottom: .25em; font-size: 1.15rem; }
.steps p { margin: 0; }

/* funding table */
.table-wrap { overflow-x: auto; border: 2px solid #E6D9C2; border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; min-width: 620px; background: var(--paper); }
caption { text-align: left; padding: 14px 16px; font-weight: 700; font-family: var(--f-head); }
th, td { text-align: left; vertical-align: top; padding: 14px 16px; border-top: 2px solid #E6D9C2; }
thead th { background: var(--forest); color: #fff; border-top: 0; }
tbody th { background: var(--cream); }

/* programme blocks */
.prog { display: grid; gap: 28px; align-items: start; padding-block: 40px; border-top: 2px solid #E6D9C2; }
.prog:first-of-type { border-top: 0; }
@media (min-width: 900px) { .prog { grid-template-columns: 1.2fr .8fr; } }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1em; }
.tags li { margin: 0; background: var(--sand-soft); border: 1px solid var(--sand); border-radius: 999px; padding: 4px 12px; font-size: .9em; font-weight: 700; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; max-width: none; }
.jump li { margin: 0; }
.jump a { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 16px; border: 2px solid var(--brown); border-radius: 999px; font-weight: 700; text-decoration: none; }
.jump a:hover { background: var(--sand-soft); }

/* forms */
.form { display: grid; gap: 26px; max-width: 760px; }
fieldset.group { border: 2px solid #E6D9C2; border-radius: var(--r); padding: 20px 22px 24px; margin: 0; background: var(--paper); }
fieldset.group > legend { font: 700 1.25rem/1.3 var(--f-head); padding: 0 8px; }
.field { display: grid; gap: 6px; margin-top: 18px; }
.field:first-of-type { margin-top: 8px; }
label, .q { font-weight: 700; }
.hint { color: var(--muted); font-size: .92em; margin: 0; }
.req { color: var(--bad); }
input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 48px; width: 100%; max-width: 32rem;
}
textarea { min-height: 130px; max-width: 100%; }
input.short { max-width: 10rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); }
[aria-invalid="true"] { border-color: var(--bad) !important; border-width: 3px !important; }
.choices { display: grid; gap: 8px; margin-top: 6px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 2px solid #E6D9C2; border-radius: 8px; background: #fff; cursor: pointer; font-weight: 400; }
.choice:hover { border-color: var(--line); }
.choice input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--brown); }
.choice span strong { display: block; }
.choice span em { display: block; font-style: normal; color: var(--muted); font-size: .92em; }
.error { color: var(--bad); font-weight: 700; margin: 0; }
.error::before { content: "Error: "; }
.err-summary { border: 4px solid var(--bad); border-radius: var(--r); padding: 18px 22px; background: #fff; }
.err-summary h2 { font-size: 1.3rem; color: var(--bad); }
.err-summary ul { margin: 0; }
.done { border: 4px solid var(--ok); border-radius: var(--r); padding: 22px 24px; background: #fff; }
.done h2 { color: var(--ok); }

/* easy read */
.er { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; max-width: 820px; }
.er li { display: grid; grid-template-columns: 96px 1fr; gap: 22px; align-items: center; margin: 0; padding: 18px; background: var(--paper); border: 2px solid #E6D9C2; border-radius: var(--r); font-size: 1.15em; line-height: 1.5; }
.er li p { margin: 0 0 .35em; }
.er li p:last-child { margin: 0; }
.er svg { width: 96px; height: 96px; }
@media (max-width: 420px) { .er li { grid-template-columns: 64px 1fr; gap: 14px; } .er svg { width: 64px; height: 64px; } }

/* footer */
.site-foot { background: var(--forest); color: #fff; padding-block: 48px 28px; font-size: .95em; }
.site-foot a { color: #fff; }
.site-foot .cols { display: grid; gap: 28px; }
@media (min-width: 800px) { .site-foot .cols { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-foot h2 { color: #fff; font-size: 1.1rem; }
.site-foot ul { list-style: none; padding: 0; }
.site-foot address { font-style: normal; }
.reg { display: inline-block; border: 2px solid var(--gold); border-radius: 8px; padding: 10px 14px; margin-top: 6px; }
.foot-base { border-top: 1px solid #5E7A71; margin-top: 30px; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .9em; }
.ack { max-width: 75ch; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Reflow fixes: let long words (email addresses) wrap instead of widening grids at 320px */
.grid > *, .cols > *, .er li > div, .prog > *, .hero .wrap > *, .facts dd { min-width: 0; }
a[href^="mailto:"], address, .facts dd { overflow-wrap: anywhere; }

/* Target size: small utility links get a 44px tap area */
.concept a, .tools a, .foot-base a { display: inline-flex; align-items: center; min-height: 44px; }
p, li, dd, h1, h2, h3, legend, label { overflow-wrap: break-word; }
