/* Contact page — form + contact panel (QA-28 redesign).
   The page hero is the shared `.pagehero`; fields, buttons and `.field-error`
   are the shared primitives from base.css. Only the layout, the topic pills
   and the panel live here. Tokens only, per tokens.css. */

.ct {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--sp-9);
  align-items: start;
  padding-bottom: var(--sp-10);
}

/* ---- form ---------------------------------------------------------------- */

.ct__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  max-width: 44rem;
}

.ct__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
}

.ct__field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.ct__field > label,
.ct__label {
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--ink-muted);
}

.ct__field > p {
  margin: 0;
}

/* The fields sit flush in their column: no trailing field rhythm, and the
   body's leading rather than the tighter default control line-height. */
.ct .field {
  margin-bottom: 0;
}

.ct input.field,
.ct textarea.field {
  line-height: 1.65;
}

.ct__textarea {
  resize: vertical;
  min-height: 10rem;
  font-family: var(--font-body);
}

/* ---- topic pills ----------------------------------------------------------
   A native radio group, visually a row of pills. The input covers its pill
   (opacity 0), so the whole pill is the hit area and keyboard focus, arrow
   keys and form submission stay native. */

.ct__topics {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ct__label {
  display: block;
  padding: 0;
  margin-bottom: var(--sp-3);
}

.ct__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.ct__pill {
  position: relative;
  display: inline-flex;
}

.ct__pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ct__pill span {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 var(--sp-4);
  border: 1px solid var(--rule-strong);
  color: var(--ink-muted);
  font-size: var(--step-0);
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.ct__pill:hover span {
  border-color: var(--ink);
  color: var(--ink);
}

.ct__pill input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

.ct__pill input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---- submit, states ------------------------------------------------------ */

.ct__submit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.ct__submit p,
.ct__server-error {
  margin: 0;
}

.ct__done {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-7);
  background: var(--ground-sunken);
  border: 1px solid var(--rule);
}

.ct__done > * {
  margin: 0;
}

/* ---- contact panel ------------------------------------------------------- */

.ct__panel {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-5));
  display: flex;
  flex-direction: column;
  background: var(--ground-sunken);
  border: 1px solid var(--rule);
}

.ct__card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-6);
}

.ct__card + .ct__card {
  border-top: 1px solid var(--rule);
}

.ct__card > * {
  margin: 0;
}

/* Link colours are scoped through .ct__card on purpose. Shopline's base sheet
   colours every `a:not(.button)` and `a:not(.button):hover` at specificity
   0,2,1, which beats a bare `.ct__mail:hover` (0,2,0) and ties
   `.ct__links a:hover`. One extra class wins outright, no !important. */
.ct__card .ct__mail {
  align-self: flex-start;
  padding-bottom: 2px;
  font-size: var(--step-1);
  color: var(--ink);
  border-bottom: 1px solid var(--gold-line);
}

.ct__card .ct__mail:hover {
  color: var(--gold-text);
}

.ct__card-text {
  color: var(--ink);
}

.ct__links {
  list-style: none;
  margin: var(--sp-2) 0 0;
  padding: 0;
}

.ct__card .ct__links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding-block: var(--sp-3);
  border-top: 1px solid var(--rule);
  color: var(--ink);
}

.ct__card .ct__links li:last-child a {
  border-bottom: 1px solid var(--rule);
}

.ct__card .ct__links a::after {
  content: "→";
  color: var(--gold-text);
  transition: transform var(--dur-fast) var(--ease-out);
}

.ct__card .ct__links a:hover {
  color: var(--gold-text);
}

.ct__card .ct__links a:hover::after {
  transform: translateX(3px);
}

/* ---- narrow -------------------------------------------------------------- */

@media (max-width: 860px) {
  .ct {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-7);
  }

  .ct__panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .ct__row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ct__pill span,
  .ct__links a::after {
    transition: none;
  }
}
