/* =====================================================================
   JDE niche-site theme
   One file: a small reset, a short token block, and the handful of
   components every site is built from. Reskin a site by overriding
   --brand (and only --brand) in a <style> on that site's pages.
   ===================================================================== */

:root {
  --brand: #2d6aae;        /* buttons, links, numbers, accents */
  --ink: #15212b;          /* headings */
  --text: #3a4853;         /* body copy */
  --muted: #64727c;        /* captions, hints */
  --line: #e1e7ec;         /* borders, dividers */
  --bg: #ffffff;           /* page */
  --alt: #f4f6f8;          /* alternate section band, cards */
  --dark: #15212b;         /* footer */
  --error: #b42318;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 6px;
  --maxw: 1320px;
  --narrow: 880px;         /* centered inner columns: FAQ, steps, forms */
  --gutter: clamp(16px, 4vw, 32px);
  --space: clamp(56px, 8vw, 96px);   /* vertical rhythm between sections */
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
img, svg, iframe { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ---- base ---- */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }   /* keep #anchors clear of the sticky header */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { font-family: var(--font); font-size: 1.0625rem; line-height: 1.65; color: var(--text); background: var(--bg); }
body { min-height: 100vh; display: flex; flex-direction: column; }   /* footer sits at the bottom on short pages */
main { flex: 1; }
h1, h2, h3 { color: var(--ink); line-height: 1.15; font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p + p, :is(h1, h2) + p { margin-top: 1em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }   /* script-focused targets (thank-you heading) aren't controls */
img { height: auto; }   /* width/height attrs reserve space; CSS keeps images fluid */

/* "Skip to content": hidden until focused by keyboard */
.skip { position: absolute; left: 12px; top: -100px; z-index: 20; padding: 10px 14px; border-radius: var(--radius); background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: var(--narrow); margin-inline: auto; }
.center { text-align: center; }
.center .actions { justify-content: center; }
.muted { color: var(--muted); }

/* ---- buttons ---- */
.btn {
  display: inline-block; padding: .8em 1.4em; border-radius: var(--radius); border: 2px solid var(--brand);
  background: var(--brand); color: #fff; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(.9); }
.btn.secondary { background: transparent; color: var(--brand); }
.btn.secondary:hover { background: var(--alt); filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }

/* ---- header ---- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; line-height: 1.2; }
.brand img { width: 36px; height: auto; flex: none; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.site-header nav { display: flex; align-items: center; gap: 24px; }
.site-header nav a:not(.btn) { text-decoration: none; font-size: .95rem; }
.site-header nav a:not(.btn):hover { color: var(--brand); }
.site-header .btn { padding: .65em 1.1em; font-size: .92rem; }
@media (max-width: 760px) { .site-header nav a:not(.btn) { display: none; } }

/* ---- sections ---- */
section { padding-block: var(--space); }
section.alt { background: var(--alt); }
.section-head { margin-bottom: 40px; }
.section-head p { margin-top: 10px; color: var(--muted); }
.section-head.center { max-width: 680px; margin-inline: auto; }

/* ---- hero: copy beside a photo; stacks on narrow screens ---- */
.hero { padding-block: clamp(40px, 6vw, 72px); }
.hero .wrap, .split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero .lead { font-size: 1.15rem; margin-top: 16px; max-width: 48ch; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 12px; }
.photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--alt); }
@media (max-width: 820px) { .hero .wrap, .split { grid-template-columns: 1fr; } }

/* ---- cards (feature trio etc.) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card { background: var(--bg); border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: var(--radius); padding: 24px; }
.card :is(h2, h3) { font-size: 1.15rem; }   /* feature cards use h2 when they follow the h1 directly */
.card p { margin-top: 6px; color: var(--muted); }
section.alt .card { border-color: transparent; border-top-color: var(--brand); }
.card + :not(.card) { margin-top: 24px; }

/* ---- numbered steps ---- */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 16px; max-width: var(--narrow); margin-inline: auto; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: start; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700;
}
.steps li > * { padding-top: 7px; }
.steps + .actions { justify-content: center; }

/* ---- stats ---- */
.stats { display: flex; flex-wrap: wrap; gap: 16px 40px; margin-top: 28px; }
.stats b { display: block; font-size: 2rem; line-height: 1; color: var(--brand); }
.stats span { font-size: .85rem; color: var(--muted); }

/* ---- people (expert / team) ---- */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 20px; }
.person { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: start; background: var(--alt); border-radius: var(--radius); padding: 24px; }
section.alt .person { background: var(--bg); }
.person img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.person > :only-child { grid-column: 1 / -1; }   /* no headshot on file */
.person .role { font-size: .9rem; color: var(--brand); margin-bottom: 8px; }
.person .actions { margin-top: 16px; }
.people.solo { max-width: var(--narrow); margin-inline: auto; grid-template-columns: 1fr; }
@media (max-width: 520px) { .person { grid-template-columns: 1fr; } }

/* ---- long-form article copy ---- */
.prose { max-width: 780px; margin-inline: auto; }
.prose h2 { margin: 1.8em 0 .5em; }
.prose h3 { margin: 1.6em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 1em 0; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--brand); }

/* ---- FAQ ---- */
.faq { max-width: var(--narrow); margin-inline: auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 32px 18px 0; font-weight: 600; color: var(--ink); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 1.4rem; font-weight: 400; color: var(--brand); }
.faq details[open] summary::after { content: "–"; }
.faq details > :not(summary) { padding-bottom: 18px; }
.faq ul { padding-left: 1.3em; margin-top: 1em; }

/* ---- photo strip ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }

/* ---- forms ---- */
.form-card { max-width: var(--narrow); margin-inline: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); }
.form-card h1 { font-size: clamp(1.7rem, 3.5vw, 2.2rem); }
.reqnote { font-size: .88rem; color: var(--muted); margin-top: 8px; }
.req { color: var(--error); }
fieldset { border: 0; padding: 0; margin: 28px 0 0; }
legend { font-weight: 700; color: var(--ink); margin-bottom: 4px; padding: 0; }
legend + .hint { margin-bottom: 12px; }
.hint { font-size: .88rem; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 14px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .fields { grid-template-columns: 1fr; } }
.field label { display: block; font-size: .92rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: .7em .8em; border: 1px solid #c9d2da; border-radius: var(--radius); background: #fff; font-size: 1rem;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.field .err { display: none; font-size: .85rem; color: var(--error); margin-top: 4px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--error); }
.field.invalid .err { display: block; }
.choices { display: grid; gap: 10px; margin-top: 10px; }
.choices label { display: flex; gap: 10px; align-items: center; font-weight: 400; color: var(--text); margin: 0; }
.choices input { width: auto; accent-color: var(--brand); }
.form-error { flex-basis: 100%; color: var(--error); font-size: .92rem; }
.form-error:empty { display: none; }
.success { display: none; }
body.done form, body.done .form-intro { display: none; }
body.done .success { display: block; }

/* ---- footer ---- */
.site-footer { background: var(--dark); color: #c3ccd3; padding-block: 40px; font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; align-items: center; }
.site-footer .brand { color: #fff; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover, .site-footer .legal p a { text-decoration: underline; }
.site-footer :focus-visible { outline-color: #fff; }   /* brand blue is under 3:1 on the dark footer */
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer .legal {
  flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; color: #8e9aa4; font-size: .85rem;
}
.social { display: flex; gap: 8px; }
.social a { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius); color: #c3ccd3; }
.social a:hover { color: #fff; border-color: #fff; }
.social svg { width: 16px; height: 16px; }
