/* ==========================================================================
   NEXIRA CONSULTING: CONTACT & ENQUIRY JOURNEY (Stage 08B)
   Page-specific styles for contact.html and enquiry-received.html only.
   Every selector is scoped to .page-contact or prefixed ct- so no other page
   is affected. Loaded after nexira.css and service-detail.css (sd-hero reused).
   Stage 07E rule respected: no decorative short rules; structural lines only.
   ========================================================================== */

/* ---------- 01 HERO (shorter than a flagship hero) ---------------------- */
.page-contact .ct-hero { padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.page-contact .ct-hero .sd-crumbs { margin-bottom: var(--s-6); }
.ct-hero__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 0.5rem + 4vw, 5rem); align-items: end; }
.page-contact .ct-hero h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem); max-width: 12ch; margin: var(--s-4) 0 0; }
.ct-hero__copy .sd-hero__lede { margin: 0; }
.ct-quick { display: none; list-style: none; margin: var(--s-5) 0 0; padding: 0; gap: var(--s-3); flex-wrap: wrap; }
.ct-quick .btn { min-height: 48px; }

/* ---------- 02 MAIN: form 7 / panel 5 ---------------------------------- */
.ct-main { background: var(--ivory); padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.ct-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 1rem + 3vw, 4rem); align-items: start; }

/* Form surface */
.ct-form { background: var(--paper); border: 1px solid var(--line); padding: clamp(1.5rem, 1rem + 2.5vw, 3.25rem); }
.ct-form__title { font-size: var(--fs-xl); margin: 0 0 var(--s-3); }
.ct-form__intro { margin: 0 0 var(--s-6); color: var(--text-muted); font-size: 0.95rem; }

/* Sections: a full-width structural divider between sections (not a decorative short rule) */
.ct-sec { border: 0; margin: 0; padding: var(--s-6) 0 var(--s-2); min-width: 0; border-top: 1px solid var(--line); }
.ct-sec > legend { float: left; width: 100%; padding: 0; margin: 0 0 var(--s-5); }
.ct-sec > :not(legend) { clear: both; }
.ct-sec__h { display: block; font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.2; color: var(--ink); }

/* Fields */
.ct-field { margin: 0 0 1.3rem; } /* 08B revision: within-section rhythm reduced ~13% (was 1.5rem) */
.ct-label { display: block; margin: 0 0 0.35rem; font-weight: 600; font-size: 0.98rem; color: var(--ink); line-height: 1.4; padding: 0; }
.ct-opt { font-weight: 400; color: var(--text-muted); }
.ct-hint { margin: 0 0 0.5rem; font-size: 0.9rem; line-height: 1.5; color: var(--text-muted); max-width: 40rem; }
.ct-help { margin: 0.45rem 0 0; font-size: 0.88rem; line-height: 1.5; color: var(--text-muted); max-width: 40rem; }
.ct-help:empty { display: none; }

.ct-input, .ct-select {
  display: block; width: 100%; min-height: 50px; margin: 0;
  padding: 0.7rem 0.85rem;
  font: inherit; font-size: 1rem; line-height: 1.4; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 0;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ct-input--md { max-width: 24rem; }
.ct-input:hover, .ct-select:hover { border-color: var(--text-muted); }
.ct-input:focus, .ct-select:focus { outline: 2px solid var(--gold-text); outline-offset: 3px; border-color: var(--ink); } /* matches site :focus-visible (2px gold, 3px offset) */
.ct-choice input:focus-visible, .ct-textbtn:focus-visible, .ct-send:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 3px; }
.ct-select {
  -webkit-appearance: none; appearance: none; padding-right: 2.75rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5l4 4 4-4' fill='none' stroke='%23151515' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.95rem center; background-size: 12px;
}
.ct-textarea { min-height: 9.5rem; resize: vertical; }
.ct-count { margin: 0.4rem 0 0; font-size: 0.82rem; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Radio groups */
.ct-group { border: 0; margin: 0 0 1.3rem; padding: 0; min-width: 0; }
.ct-group > legend { margin-bottom: 0.5rem; }
.ct-choices { display: grid; gap: 0.15rem; }
.ct-choices--row { grid-template-columns: repeat(3, max-content); gap: 0.15rem var(--s-6); }
.ct-choice { display: flex; align-items: center; gap: 0.7rem; min-height: 44px; cursor: pointer; font-size: 0.98rem; line-height: 1.35; }
.ct-choice input { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; accent-color: var(--ink); cursor: pointer; }
.ct-choice input:disabled + span { color: var(--text-muted); }

/* Calm notes: confidentiality (before message) and boundary (after message) */
.ct-conf { margin: 0 0 1.1rem; padding: 0.1rem 0 0.1rem 0.9rem; border-left: 2px solid var(--line-strong); font-size: 0.88rem; line-height: 1.55; color: var(--text-muted); max-width: 40rem; } /* 08B revision: calm guidance, no panel */
.ct-boundary { margin: 0 0 var(--s-4); font-size: 0.88rem; line-height: 1.55; color: var(--text-muted); max-width: 42rem; }

/* Contextual route note (Project / Programme) and preselection note */
.ct-context { margin: 0 0 var(--s-5); font-size: 0.92rem; color: var(--text-muted); }

/* Regulatory Diagnostic state: a confirmed choice, not an error or a locked field */
.ct-intent { margin: 0 0 var(--s-5); padding: var(--s-5); background: #fff; border: 1px solid var(--line-strong); }
.ct-intent__line { margin: 0 0 var(--s-2); font-size: 1rem; }
.ct-intent__k { color: var(--text-muted); }
.ct-intent__v { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; color: var(--ink); }
.ct-intent__d { margin: 0 0 var(--s-3); font-size: 0.92rem; color: var(--text-muted); max-width: 40rem; }

/* Text-style button (Choose a different area / Check the form) */
.ct-textbtn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0; margin: 0;
  font: inherit; font-size: 0.92rem; font-weight: 600; color: var(--gold-text);
  background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px;
}
.ct-textbtn:hover { color: var(--ink); }

/* Conditional call block */
.ct-call { margin: 0 0 var(--s-3); }
.ct-call .ct-help { margin: 0 0 var(--s-4); }
.ct-call a { color: var(--gold-text); }

/* Privacy + submit */
.ct-submit { border-top: 1px solid var(--line); padding-top: var(--s-6); }
.ct-privacy { margin: 0 0 var(--s-5); font-size: 0.9rem; line-height: 1.55; color: var(--text-muted); max-width: 42rem; }
.ct-privacy a { color: var(--gold-text); }
.ct-send { min-width: 14rem; min-height: 52px; }
.ct-send:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* PRE-LAUNCH note (development state; removed at go-live) */
.ct-prelaunch { margin-top: var(--s-5); padding: var(--s-4) var(--s-5); border: 1px dashed var(--line-strong); font-size: 0.88rem; color: var(--text-muted); max-width: 42rem; }
.ct-prelaunch p { margin: 0; }
.ct-prelaunch .ct-textbtn { margin-top: var(--s-2); }
.ct-prelaunch__result:empty { display: none; }
.ct-prelaunch__result { margin-top: var(--s-2) !important; color: var(--ink); font-weight: 600; }

/* Spam trap: removed from view and from assistive technology */
.ct-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Errors: functional status colour, never colour alone (text + border + summary) */
.ct-errors { margin: 0 0 var(--s-6); padding: var(--s-5); border: 2px solid #9b2c1f; background: #fff; }
.ct-errors:focus { outline: 2px solid var(--gold-text); outline-offset: 3px; }
.ct-errors__title { font-size: var(--fs-md); margin: 0 0 var(--s-3); font-family: var(--sans); font-weight: 700; color: var(--ink); }
.ct-errors__list { margin: 0; padding-left: 1.1rem; }
.ct-errors__list a { color: #9b2c1f; font-weight: 600; }
.ct-error { margin: 0 0 0.4rem; font-size: 0.92rem; font-weight: 600; color: #9b2c1f; }
.is-invalid .ct-input, .is-invalid .ct-select { border: 2px solid #9b2c1f; }
.ct-field.is-invalid, .ct-group.is-invalid { padding-left: var(--s-4); border-left: 3px solid #9b2c1f; }

/* ---------- CONTACT / FOUNDER PANEL ------------------------------------ */
.ct-panel { background: var(--ink); color: var(--on-dark); }
.ct-panel__photo { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink-2); } /* 08D: wide office contact image (1672x941 source); near-full frame, not a portrait crop */
.ct-panel__photo picture { display: block; width: 100%; height: 100%; }
.ct-panel__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; }
.ct-panel__body { padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.ct-panel .eyebrow { margin-bottom: var(--s-3); }
.ct-panel__h { font-size: var(--fs-xl); margin: 0 0 var(--s-5); color: var(--on-dark); }

.ct-lines { margin: 0 0 var(--s-5); }
.ct-line { padding: var(--s-4) 0; border-top: 1px solid var(--line-dark); }
.ct-line dt { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-soft); margin: 0 0 0.3rem; }
.ct-line dd { margin: 0; }
.ct-line__link { font-family: var(--serif); font-size: 1.3rem; color: var(--on-dark); text-decoration: none; overflow-wrap: anywhere; display: inline-block; min-height: 44px; padding: 0.35rem 0; }
.ct-line__link:hover { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 0.2em; }
.ct-line__note { display: block; margin-top: 0.2rem; font-size: 0.88rem; line-height: 1.5; color: var(--on-dark-muted); }
.ct-resp { margin: 0 0 var(--s-6); padding: var(--s-4) 0 0; border-top: 1px solid var(--line-dark); font-family: var(--serif); font-size: 1.08rem; line-height: 1.5; color: var(--on-dark); }

.ct-next__h { font-size: var(--fs-md); margin: 0 0 var(--s-4); color: var(--on-dark); }
.ct-next { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.ct-next li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: var(--s-3); font-size: 0.92rem; line-height: 1.55; color: var(--on-dark-muted); }
.ct-next__n { font-family: var(--serif); font-size: 1.35rem; line-height: 1.1; color: var(--gold-soft); }
.ct-next strong { display: block; color: var(--on-dark); font-weight: 600; margin-bottom: 0.1rem; }

/* ---------- CONFIRMATION PAGE ----------------------------------------- */
.ct-done { padding-block: clamp(3.5rem, 2rem + 6vw, 7rem); }
.ct-done__inner { max-width: 46rem; }
.page-enquiry-received .ct-done h1 { font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.6rem); max-width: 22ch; margin: var(--s-4) 0 var(--s-6); }
.ct-done__p { color: var(--on-dark-muted); max-width: 40rem; margin: 0 0 var(--s-6); }
.ct-lines--done { max-width: 30rem; margin-bottom: var(--s-6); }

/* ---------- RESPONSIVE ------------------------------------------------- */
@media (max-width: 1100px) {
  .ct-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
@media (max-width: 960px) {
  .ct-hero__grid { grid-template-columns: 1fr; gap: var(--s-4); align-items: start; }
  .ct-quick { display: flex; }
  .ct-grid { grid-template-columns: 1fr; }
  /* 08D: panel stacks at tablet so the wide office image is never cut into a tall portrait */
}
@media (max-width: 640px) {
  .ct-quick li { flex: 1 1 100%; }
  .ct-quick .btn { width: 100%; justify-content: center; }
  .ct-form { padding: var(--s-5) var(--s-4); margin-inline: calc(-1 * var(--s-1)); }
  .ct-input--md { max-width: none; }
  .ct-send { width: 100%; }
  .ct-line__link { font-size: 1.15rem; }
  .ct-sec__h { font-size: 1.3rem; }
}

/* ==========================================================================
   STAGE 08E: FORM COMPRESSION
   Two-column field grid inside each section when the FORM itself is wide
   enough (container query, so it responds to the form width, not the viewport).
   DOM order = visual order = keyboard order: fields flow left to right, row by row.
   Hidden fields (hidden attribute) drop out of the grid and the next field moves up.
   ========================================================================== */
.ct-form { container-type: inline-size; container-name: ctform; }
.ct-form [hidden] { display: none !important; } /* hidden conditional fields must never be re-shown by grid display rules */
.ct-cols { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 1.25rem; }
.ct-cols > .ct-field { margin-bottom: 1.15rem; min-width: 0; }
.ct-cols .ct-input--md { max-width: none; }

/* Lighter section headings: hierarchy from type, not vertical distance */
.ct-sec { padding: var(--s-5) 0 0.35rem; }
.ct-sec > legend { margin-bottom: var(--s-4); }
.ct-sec__h { font-size: 1.22rem; }
.ct-form__intro { margin-bottom: var(--s-5); }
.ct-hint--sec { margin: -0.35rem 0 0.9rem; }

/* Message: comfortable but not oversized */
.ct-textarea { min-height: 8.5rem; }

/* Contact preference: compact, horizontal */
#fld-pref, #fld-time { margin-bottom: 0.6rem; }
.ct-choices--row { grid-template-columns: repeat(3, max-content); gap: 0 var(--s-6); }
.ct-call .ct-help { margin: 0 0 0.6rem; }
.ct-submit { padding-top: var(--s-5); }
.ct-privacy { margin-bottom: var(--s-4); }

@container ctform (min-width: 480px) {
  .ct-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* Paired fields share row tracks (subgrid) so labels, controls and helper text line up
     across the pair regardless of label length, errors or helper text. */
  @supports (grid-template-rows: subgrid) {
    .ct-cols > .ct-field { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; }
    .ct-cols > .ct-field > .ct-label { grid-row: 1; align-self: end; }
    .ct-cols > .ct-field > .ct-hint  { grid-row: 2; }
    .ct-cols > .ct-field > .ct-error { grid-row: 3; }
    .ct-cols > .ct-field > .ct-input,
    .ct-cols > .ct-field > .ct-select { grid-row: 4; }
    .ct-cols > .ct-field > .ct-help  { grid-row: 5; }
  }
}
/* Phone widths: one column, radios stacked for easy tapping */
@media (max-width: 640px) {
  .ct-choices--row { grid-template-columns: 1fr; }
}


/* ==========================================================================
   STAGE 08F: FINAL CONTACT PAGE RECOMPOSITION
   Overrides the 08B–08E presentation only. Enquiry logic is unchanged.
   ========================================================================== */

/* Composition: form about 60% left, contact column about 40% right.
   DOM order is contact actions then form; grid placement puts the form left on desktop. */
.ct-main { padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.ct-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(1.5rem, 0.5rem + 2.5vw, 3rem); }
.ct-formwrap { grid-column: 1; grid-row: 1; }
.ct-panel { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 1.5rem); }

/* Contact column: photograph + two actions only */
.ct-panel__photo { aspect-ratio: 4 / 3; }
.ct-panel__photo img { object-position: 60% 50%; }
.ct-actions { list-style: none; margin: 0; padding: 0; }
.ct-actions li + li { border-top: 1px solid var(--line-dark); }
.ct-action { display: flex; align-items: center; gap: 1.1rem; min-height: 64px; padding: 1.15rem clamp(1.25rem, 0.75rem + 1.2vw, 1.75rem); color: var(--on-dark); text-decoration: none; }
.ct-action__icon { flex: none; width: 46px; height: 46px; padding: 11px; color: var(--gold-soft); border: 1px solid var(--line-dark-2); }
.ct-action__text { display: flex; flex-direction: column; min-width: 0; }
.ct-action__k { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-soft); }
.ct-action__v { font-family: var(--serif); font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem); line-height: 1.3; overflow-wrap: anywhere; }
.ct-action:hover .ct-action__v { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.ct-action:hover .ct-action__icon { border-color: var(--gold-soft); }
.ct-action:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: -4px; }

/* Form: two visible headings, no chapter dividers */
.ct-form { padding: clamp(1.5rem, 1rem + 2vw, 2.75rem); }
.ct-form__title { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin: 0 0 0.3rem; }
.ct-form__intro { margin: 0 0 1.5rem; font-size: 0.9rem; }
.ct-sec { border-top: 0; padding: 0; margin: 0 0 0.5rem; }
.ct-sec > legend { margin-bottom: 0.85rem; }
.ct-sec__h { font-size: 1.3rem; }
.ct-cols { column-gap: 1.25rem; }
.ct-cols > .ct-field { margin-bottom: 1rem; }
.ct-cols > .ct-field--full { grid-column: 1 / -1; }
.ct-cols--help { margin-top: 0.1rem; }
.ct-intent { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.ct-intent__d { margin-bottom: 0.25rem; }

/* Long selects: full selected value always readable (mirrored, wrapping text) */
.ct-selectwrap { position: relative; }
.ct-selectwrap__val { display: none; }
.js .ct-selectwrap {
  min-height: 50px; padding: 0.7rem 2.75rem 0.7rem 0.85rem; background: #fff; border: 1px solid var(--line-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5l4 4 4-4' fill='none' stroke='%23151515' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.95rem center; background-size: 12px;
  transition: border-color var(--dur) var(--ease);
}
.js .ct-selectwrap__val { display: block; font-size: 1rem; line-height: 1.4; color: var(--ink); }
.js .ct-selectwrap__val.is-placeholder { color: var(--text); }
.js .ct-selectwrap > select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; border: 0; }
.js .ct-selectwrap:hover { border-color: var(--text-muted); }
.js .ct-selectwrap:focus-within { outline: 2px solid var(--gold-text); outline-offset: 3px; border-color: var(--ink); }
.is-invalid .ct-selectwrap { border: 2px solid #9b2c1f; }
@supports (grid-template-rows: subgrid) {
  @container ctform (min-width: 480px) {
    .ct-cols > .ct-field > .ct-selectwrap { grid-row: 4; }
  }
}

/* Message: label, short helper, calm confidentiality line, textarea, then boundary + counter */
.ct-field--msg { margin: 0.25rem 0 1.1rem; }
.ct-field--msg .ct-hint { margin-bottom: 0.3rem; }
.ct-conf { margin: 0 0 0.55rem; padding: 0; border: 0; font-size: 0.84rem; line-height: 1.5; color: var(--text-muted); max-width: 44rem; }
.ct-textarea { min-height: 7.5rem; }
.ct-msgfoot { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-top: 0.45rem; }
.ct-boundary { margin: 0; font-size: 0.8rem; line-height: 1.5; color: var(--text-muted); max-width: 38rem; }
.ct-count { margin: 0; flex: none; white-space: nowrap; font-size: 0.8rem; }

/* Contact preference: question + compact horizontal choices */
.ct-pref { margin: 0 0 0.4rem; }
.ct-pref > legend { margin-bottom: 0.3rem; }
.ct-choice { min-height: 44px; }
.ct-call { margin: 0 0 0.4rem; }
.ct-call .ct-help { margin: 0 0 0.35rem; }
#fld-time { margin-bottom: 0; }

/* Privacy + Send: one tight group */
.ct-submit { border-top: 0; padding-top: 0.6rem; }
.ct-privacy { margin: 0 0 0.9rem; font-size: 0.86rem; }
.ct-prelaunch { margin-top: 1.25rem; }

/* WHAT HAPPENS NEXT: one restrained full-width band below both columns */
.ct-steps { background: var(--paper); border-top: 1px solid var(--line); padding-block: clamp(2.25rem, 1.5rem + 2.5vw, 3.75rem); }
.ct-steps__h { font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); margin: 0 0 1.5rem; }
.ct-steps__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 0.5rem + 2.5vw, 3rem); }
.ct-steps__n { display: block; font-family: var(--serif); font-size: 1.35rem; line-height: 1; color: var(--gold-text); margin-bottom: 0.6rem; }
.ct-steps__t { font-family: var(--sans); font-size: 0.98rem; font-weight: 600; margin: 0 0 0.25rem; color: var(--ink); }
.ct-steps__list p { margin: 0; font-size: 0.93rem; line-height: 1.55; color: var(--text-muted); }
.ct-steps__resp { margin: 1.5rem 0 0; font-family: var(--serif); font-size: 1.05rem; color: var(--ink); }

/* Tablet: single column composition; contact column becomes image | actions */
@media (max-width: 960px) {
  .ct-grid { grid-template-columns: minmax(0, 1fr); }
  .ct-formwrap, .ct-panel { grid-column: 1; grid-row: auto; }
  .ct-panel { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .ct-panel__photo { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .ct-panel__photo img { position: static; }
}
@media (max-width: 640px) {
  .ct-panel { display: block; }
  .ct-msgfoot { flex-direction: column-reverse; gap: 0.35rem; }
  .ct-count { align-self: flex-end; }
  .ct-steps__list { grid-template-columns: 1fr; gap: 1.25rem; }
  .ct-action__v { font-size: 1.05rem; }
}
