/* ==========================================================================
   Contact page and enquiry forms (design.md §8 Contact, §9, §5.4):
   contact cards, the form (1 column → 2-column field pairs by container width),
   the mini form on the session pages (#enquire), error states, the click-to-load map. Colours come from tokens only, so the
   Charcoal theme works without overrides.
   ========================================================================== */

/* the content follows the short hero closely */
.page-hero + .contact-section { padding-top: var(--stack-lg); }

/* Phones: cards, then the form, then the map (DOM order = visual order at every width).
   lg+: cards beside the form (5/7), the map full width below both. */
.contact-layout { display: grid; gap: var(--section-y) var(--stack-lg); }
.contact-layout > * { min-width: 0; }
@media (min-width: 64em) {
  .contact-layout { grid-template-columns: 5fr 7fr; align-items: start; }
  .contact-map { grid-column: 1 / -1; }
}
.contact-layout h2 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem); }
.contact-intro { margin-top: var(--stack-sm); color: var(--c-ink-soft); max-width: 46ch; }

/* ---- contact cards ---------------------------------------------------------- */
.contact-quick { container-type: inline-size; }
.contact-cards { list-style: none; display: grid; gap: 12px; margin-top: var(--stack-md); }
@container (min-width: 34rem) { .contact-cards { grid-template-columns: repeat(2, 1fr); } }
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  height: 100%;
  min-height: var(--tap);
  padding: 18px 20px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-linen);
  color: var(--c-ink);
  text-decoration: none;
  transition: background-color var(--dur-theme), border-color .3s;
}
.contact-card:hover { color: var(--c-ink); border-color: var(--c-accent); }
.contact-card-icon { width: 26px; height: 26px; margin-top: 2px; color: var(--c-brand); }
.contact-card-icon.icon-wa { color: var(--c-whatsapp-ink); }
.contact-card-body { display: grid; gap: 2px; min-width: 0; }
.contact-card-label { font-size: .72rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--c-accent-deep); }
.contact-card-value { font-family: var(--ff-display); font-size: 1.35rem; line-height: 1.3; overflow-wrap: anywhere; }
.contact-card-note { font-size: .9rem; color: var(--c-ink-soft); line-height: 1.5; }
.contact-studio { display: flex; align-items: center; gap: 10px; margin-top: var(--stack-md); font-size: .9rem; letter-spacing: .06em; color: var(--c-ink-soft); }
.contact-studio .icon { width: 20px; height: 20px; color: var(--c-accent-deep); }

/* ---- form ------------------------------------------------------------------- */
.contact-form-wrap { width: 100%; max-width: 760px; }
@media (min-width: 64em) { .contact-form-wrap { justify-self: end; } }
.enquiry-form { container-type: inline-size; margin-top: var(--stack-md); }
.field-grid { display: grid; gap: 20px; }
@container (min-width: 34rem) {
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .field--full { grid-column: 1 / -1; }
}
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field label { font-size: .95rem; font-weight: 400; color: var(--c-ink); line-height: 1.4; }
.field .req { color: var(--c-error); }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--c-field-line);
  border-radius: var(--radius);
  background-color: var(--c-field);
  color: var(--c-ink);
  font-weight: 300;
  line-height: 1.4;
  transition: border-color .2s, box-shadow .2s, background-color var(--dur-theme);
}
.field input[type="date"] { appearance: none; -webkit-appearance: none; } /* iOS: keep the 52px height */
.field input::-webkit-date-and-time-value { text-align: left; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--c-ink-soft); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand); outline: none; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.field [aria-invalid="true"] { border-color: var(--c-error); box-shadow: 0 0 0 1px var(--c-error); }
.field-hint { font-size: .85rem; color: var(--c-ink-soft); line-height: 1.5; }
.field-error { font-size: .9rem; font-weight: 400; color: var(--c-error); line-height: 1.5; }
.field-error:empty { display: none; }

/* honeypot + no-JS timing beacon: never shown, never focusable */
.hp { display: none !important; }

.form-actions { display: grid; gap: 14px; margin-top: var(--stack-md); }
.form-actions .btn { width: 100%; }
@media (min-width: 30em) { .form-actions .btn { width: auto; justify-self: start; min-width: 240px; } }
.form-actions .btn[aria-disabled="true"] { opacity: .7; cursor: progress; }
.form-privacy { font-size: .88rem; color: var(--c-ink-soft); }
/* below lg the sticky bar is hidden while the submit row is on screen (main.js); scroll targets also keep clear of it */
@media (max-width: 63.99em) {
  html:has([data-enquiry-form]) { scroll-padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 16px); }
}

/* ---- mini enquiry form on the session pages (#enquire): the same fields, max ~760px, centred ---------- */
.enquire-wrap.container { width: min(100% - 2 * var(--gutter), 760px); }
.enquire-section .section-head { margin-bottom: 0; }
.enquire-section .section-head .lead { max-width: 52ch; }
.enquiry-form--mini .field textarea { min-height: 120px; }
.enquire-section .form-success { background: var(--c-ivory); }

/* error summary: shown by form.js (or rendered visible by contact.php after a no-JS send); :target is kept
   for old /contact/?error=1#form-alert links */
.form-alert {
  display: none;
  margin-top: var(--stack-md);
  padding: 16px 18px;
  border: 1px solid var(--c-line);
  border-left: 3px solid var(--c-error);
  border-radius: var(--radius);
  background: var(--c-linen);
  color: var(--c-ink);
}
/* is-dismissed: form.js closed it (replaceState alone does not reset :target) */
.form-alert:target:not(.is-dismissed), .form-alert.is-visible { display: block; }
.form-alert:focus { outline: none; }
.form-alert:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 3px; }
.form-alert-title { font-weight: 500; }
.form-alert p + p { margin-top: 4px; }

/* in-place success (JS) */
.form-success {
  margin-top: var(--stack-md);
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius);
  background: var(--c-linen);
  transition: background-color var(--dur-theme);
}
.form-success:focus { outline: none; }
.form-success h3 { font-size: var(--fs-h3); }
.form-success h3 em { color: var(--c-accent); }
.form-success p { margin-top: var(--stack-sm); color: var(--c-ink-soft); }
.form-success .btn-row { margin-top: var(--stack-md); }

/* ---- map: click to load ------------------------------------------------------- */
.contact-map-head { margin-bottom: var(--stack-md); }
.map-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--c-greige);
  transition: background-color var(--dur-theme);
}
@media (min-width: 48em) { .map-frame { aspect-ratio: 16 / 9; } }
@media (min-width: 64em) { .map-frame { aspect-ratio: 21 / 8; } }
.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}
.map-pin { width: 36px; height: 36px; color: var(--c-accent-deep); }
.map-note { max-width: 32ch; font-size: .95rem; color: var(--c-ink); }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.contact-map .btn-row { margin-top: var(--stack-sm); }

@media print {
  .enquiry-form, .form-alert, .map-frame { display: none !important; }
}
