/* ==========================================================================
   pages.css — P4 pages: services, how we work, contact/brief, thank-you,
   legal, 404 and the standalone error page. Tokens and components only
   (tokens.css, components.css); mobile-first; no new colours.
   ========================================================================== */

/* ───────── Page head (views/partials/page-hero.ejs) ───────── */
.ph__aside { display: grid; gap: 18px; justify-items: start; }
.ph__aside .lede { justify-self: start; }
@media (min-width: 900px) {
  .ph__aside { justify-self: end; max-width: 31em; }
}
.ph h1 em { font-style: italic; color: var(--teal); }
.ph--compact h1 { font-size: clamp(38px, 4.6vw, 64px); line-height: 1.02; }

/* Sections that follow a page head sit closer than home sections */
.sec--tight { margin-top: var(--gap); }
.h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 2vw, 30px); line-height: 1.15; letter-spacing: -.012em; }
.sec-head--row { margin-bottom: clamp(20px, 2.4vw, 32px); }
@media (min-width: 900px) {
  .sec-head.sec-head--row { grid-template-columns: 1fr; }
  .sec-head.sec-head--row > :last-child { justify-self: start; max-width: none; }
}

/* ───────── Services ───────── */
.svc-list--links h3 a { text-decoration: none; }
.svc-list--links h3 a:hover { color: var(--teal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.svc-photo { min-height: 320px; }
.svc-photo .cap a { color: inherit; text-decoration: none; }
.svc-photo .cap a:hover { text-decoration: underline; }
.svc-team, .svc-how, .svc-feature { gap: 16px; min-height: 260px; }
.svc-feature .h3, .svc-team .h3 { max-width: 18em; }
.svc-feature.ce-13 { min-height: 0; }
.tile--ink .h3 { color: #fff; }
.svc-sub { font-size: clamp(26px, 2.4vw, 36px); margin: clamp(28px, 3vw, 44px) 0 clamp(18px, 2vw, 26px); }
.steps--3 li { min-height: 210px; }
@media (min-width: 1100px) { .steps--3 { grid-template-columns: repeat(3, 1fr); } }

.svc-points { display: flex; flex-direction: column; gap: 18px; }
.svc-ticks { list-style: none; margin: 0; padding: 0; display: grid; }
.svc-ticks li { display: flex; gap: 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15.5px; }
.svc-ticks svg { width: 15px; height: 15px; flex: none; color: var(--teal); position: relative; top: 2px; }
.svc-points .small { margin-top: auto; }

.svc-related { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
.svc-related li { position: relative; display: grid; gap: 10px; align-content: start; }
.svc-related .n { font: 600 11.5px/1.3 var(--ui); letter-spacing: .1em; color: var(--teal); }
.svc-related h3 a { text-decoration: none; }
.svc-related h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.svc-related li:hover h3 a { color: var(--teal); }
.svc-related li:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.svc-related h3 a:focus-visible { outline: none; }
@media (min-width: 760px) { .svc-related { grid-template-columns: repeat(3, 1fr); } }

/* ───────── How we work ───────── */
.hww-steps li { min-height: 300px; }
.hww-steps h3 { margin-top: 18px; }
.hww-steps .hww-more { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.hww-proof { margin-top: 0; }
.hww-offices ul { grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .hww-offices ul { grid-template-columns: repeat(3, 1fr); column-gap: var(--pad); }
}
.spring .link { margin-top: 4px; }

/* ───────── Contact / brief ───────── */
.contact-form { display: grid; gap: 14px; align-content: start; }
.contact-form__intro { max-width: 38em; margin-bottom: 6px; }
.contact-form .notice { display: flex; gap: 10px; align-items: center; }
.contact-form .notice svg { width: 18px; height: 18px; flex: none; color: var(--teal); }
.contact-swatches { gap: 14px; }
.contact-dealer { border-top: 1px solid var(--line); padding-top: 14px; }
.contact-offices li b { font-size: 26px; }

/* Form details used by views/partials/forms/* and form-field.ejs */
.form__row { align-items: start; }
.field { align-content: start; }
.field__opt { font-weight: 400; color: var(--muted); }
.field--full { grid-column: 1 / -1; }
.form__more { border-top: 1px solid var(--line); padding-top: 14px; }
.form__more > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer;
  font: 560 15px/1.2 var(--body); color: var(--ink);
}
.form__more > summary:hover { color: var(--teal); }
.form__more[open] > summary { margin-bottom: 12px; }
.form__note { font-size: 13.5px; line-height: 1.55; color: var(--muted); max-width: 46em; }
.form__note a { color: var(--teal-deep); text-underline-offset: 3px; }
.form__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.error-summary__title { font: 600 15px/1.3 var(--body); margin: 0; }
.error-summary a { color: inherit; text-underline-offset: 3px; }
.error-summary:focus { outline: 2px solid var(--error); outline-offset: 2px; }

/* ───────── Thank-you ───────── */
.thanks-next { display: grid; gap: 18px; align-content: start; }
.thanks-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; }
.thanks-steps li {
  counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line); font-size: 15.5px;
}
.thanks-steps li::before { content: counter(step); font: 300 30px/1 var(--serif); color: var(--teal); }

/* ───────── Legal ───────── */
.legal { display: grid; gap: var(--gap); align-items: start; }
@media (min-width: 1000px) { .legal { grid-template-columns: 260px minmax(0, 1fr); } }
.legal__nav { display: grid; gap: 12px; }
.legal__nav ul { list-style: none; margin: 0; padding: 0; display: grid; }
.legal__nav a { display: flex; align-items: center; min-height: 44px; border-top: 1px solid var(--line); text-decoration: none; font-size: 15.5px; }
.legal__nav a:hover { color: var(--teal); }
.legal__nav a[aria-current] { color: var(--teal-deep); font-weight: 600; }
@media (min-width: 1000px) { .legal__nav { position: sticky; top: 96px; } }
.legal__body { min-width: 0; }
.legal__notice { margin-bottom: 22px; max-width: 42em; }
.legal .prose { max-width: 46em; }
.legal .prose .updated { font-size: 14px; color: var(--muted); }
.legal .prose address { font-style: normal; line-height: 1.6; }
.legal .prose code { font-size: .9em; background: var(--stone); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.legal .prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal .prose th, .legal .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--line); }
.legal .prose th { font: 600 11.5px/1.3 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.legal .prose .table-scroll { overflow-x: auto; max-width: 100%; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); }
.legal .prose .table-scroll:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.legal .prose .table-scroll table { min-width: 720px; }
.legal .prose .linklike { color: var(--teal-deep); }

/* ───────── 404 ───────── */
.nf-families ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; }
@media (min-width: 760px) { .nf-families ul { grid-template-columns: repeat(2, 1fr); column-gap: var(--pad); } }
@media (min-width: 1100px) { .nf-families ul { grid-template-columns: repeat(3, 1fr); } }
.nf-families a { display: flex; gap: 12px; align-items: baseline; min-height: 48px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; font: 400 20px/1.2 var(--serif); }
.nf-families a:hover { color: var(--teal); }
.nf-families .n { font: 600 11.5px/1 var(--ui); letter-spacing: .1em; color: var(--teal); }

/* ───────── Standalone error page (views/error.ejs, no layout) ───────── */
.errpage {
  margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--body);
}
.errpage__card { width: 100%; max-width: 560px; background: var(--tile); border-radius: var(--r); padding: clamp(26px, 5vw, 44px); display: grid; gap: 16px; }
.errpage__brand { display: inline-flex; width: 54px; height: 54px; }
.errpage__brand img { width: 54px; height: 54px; }
.errpage__code { margin: 8px 0 0; font: 600 11.5px/1.3 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.errpage h1 { margin: 0; font: 400 clamp(34px, 6vw, 48px)/1.05 var(--serif); letter-spacing: -.02em; }
.errpage p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.errpage__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.errpage__btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border-radius: var(--r-pill); font: 560 15px/1 var(--body); text-decoration: none; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.errpage__btn--ink { background: var(--ink); color: #fff; box-shadow: none; }
.errpage__btn:focus-visible, .errpage__brand:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.errpage__dev pre { white-space: pre-wrap; font-size: 12px; background: var(--stone); padding: 12px; border-radius: var(--r-xs); overflow: auto; }

/* ───────── Small screens ───────── */
@media (max-width: 759px) {
  .svc-photo { min-height: 0; aspect-ratio: 4 / 5; }
  .svc-team, .svc-how, .svc-feature { min-height: 0; }
  .steps--3 li, .hww-steps li { min-height: 0; }
  .hww-steps .hww-more { grid-column: 2; }
  .hww-steps h3 { margin-top: 0; }
  .thanks-steps li { grid-template-columns: 32px 1fr; }
  .ph__aside .btn-row .btn { flex: 1 1 auto; }
}
.legal .prose td code { white-space: nowrap; overflow-wrap: normal; }
