/* contact.css: contact.html only. The booking form and map facade (COMPONENTS.md 29 and 30), then the page layout. */

/* == 29. Forms == */

.form-panel { --panel-pad: clamp(var(--space-5), 4vw, var(--space-7)); padding: var(--panel-pad); border-radius: var(--radius-sm); background: var(--color-surface-2); }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
@media (min-width: 43.75em) {
  .form-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--wide { grid-column: 1 / -1; }
  /* Paired fields share rows */
  @supports (grid-template-rows: subgrid) {
    .form-grid--two > .field:not(.field--wide) { grid-row: span 4; grid-template-rows: subgrid; row-gap: var(--space-2); }
  }
}
.form-note { margin-bottom: var(--space-6); font-size: var(--step-small); color: var(--color-text-muted); }

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); align-content: start; }
.field__label { font-weight: 700; font-size: var(--step-small); line-height: var(--leading-tight); }
.field__help { font-size: var(--step-small); line-height: var(--leading-lead); color: var(--color-text-muted); }
.field__control { position: relative; }
.field__input {
  display: block; width: 100%; min-height: var(--btn-h); padding: var(--space-3) var(--space-4);
  border: var(--border-field) solid var(--color-field-border); border-radius: var(--radius-sm);
  background: var(--color-white); color: var(--color-ink); line-height: var(--leading-tight);
}
.field__input:hover { border-color: var(--color-ink-muted); }
.field__input[aria-invalid="true"] { border-color: var(--color-error); box-shadow: inset 0 0 0 var(--border-hairline) var(--color-error); }
textarea.field__input { min-height: 8rem; resize: vertical; line-height: var(--leading-body); }
select.field__input { appearance: none; padding-right: var(--space-8); }
.field__chevron { position: absolute; top: 50%; right: var(--space-4); transform: translateY(-50%); pointer-events: none; color: var(--color-brand); }
input[type="date"].field__input { appearance: none; }
/* The ring stays on the field while focus is on its calendar button (Chromium drops :focus-visible there) */
input[type="date"].field__input:focus-within { outline: var(--focus-ring) solid var(--color-focus); outline-offset: var(--focus-offset); }
.field__error { color: var(--color-error); font-weight: 700; line-height: var(--leading-lead); }

.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.check__input {
  appearance: none; width: var(--icon-size); height: var(--icon-size); margin: 0; cursor: pointer; border: var(--border-field) solid var(--color-field-border);
  border-radius: var(--radius-sm); background: var(--color-white) center / 80% no-repeat;
}
.check__input:checked { border-color: var(--color-brand); background-color: var(--color-brand); background-image: var(--check-tick); }
/* The label is the 44px target */
.check__label { padding-block: var(--space-3); margin-block: calc(-1 * var(--space-3)); font-size: var(--step-small); line-height: var(--leading-lead); cursor: pointer; }
.check .field__error { grid-column: 2; }
.check__input[aria-invalid="true"] { outline: var(--border-strong) solid var(--color-error); outline-offset: var(--border-strong); }

.booking__honeypot { display: none; }
.booking__note { margin-top: var(--space-4); color: var(--color-text-muted); }
.booking__note .icon { color: var(--color-brand); }
/* No JavaScript: the phone line opens the form and replaces the button; no demo note */
html:not(.js) .form-note { margin-bottom: var(--space-3); }
.booking__note--top { margin: 0 0 var(--space-6); }
html:not(.js) :is(.booking__actions, .booking__note--demo) { display: none; }
.booking__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-6); }
/* contact.js scrolls these in after a submit, clear of the header */
.booking__form .field, .booking__success { scroll-margin-top: var(--scroll-offset); }
/* Touch phones: the WhatsApp button steps aside while a field is in use (main.js lifts fields for keyboards; max-width for iOS 15) */
@media (max-width: 43.74em) and (pointer: coarse) { body:has(.booking__form :focus) .whatsapp-float { visibility: hidden; } }
.booking__success:not([hidden]) { display: grid; gap: var(--space-4); justify-items: start; animation: dialog-in var(--t-3); }
.booking__success-art { width: 12.5rem; height: auto; margin-bottom: var(--space-2); }
.booking__success-title { font-size: var(--step-h2); }

/* == 30. Map facade: a full-bleed strip, the card in line with the container. It reserves the map and the
   link row that moves under it (contact.js keeps a taller card's height), so loading moves nothing below. == */

.map-section { --map-h: 26rem; --map-edge: max(var(--gutter), (100% - var(--container)) / 2); background: var(--color-surface-2); }
@media (min-width: 43.75em) { .map-section { --map-h: 28rem; } }
@media (min-width: 62.5em) { .map-section { --map-h: 30rem; } }
.map-facade {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center start; min-height: calc(var(--map-h) + 2 * var(--space-4) + var(--tap-target));
  padding: var(--space-7) var(--map-edge); overflow: hidden; background-color: var(--color-surface-2);
  background-image: linear-gradient(112deg, transparent calc(42% - 6px), var(--color-white) calc(42% - 6px) calc(42% + 6px), transparent 0),
    repeating-linear-gradient(22deg, transparent 0 74px, var(--color-white) 74px 77px),
    repeating-linear-gradient(112deg, transparent 0 118px, var(--color-white) 118px 121px);
}
.map-facade__card {
  position: relative; display: grid; gap: var(--space-3); justify-items: start; width: min(100%, 24rem);
  padding: var(--space-5); border-radius: var(--radius-sm); background: var(--color-surface);
}
@media (min-width: 43.75em) { .map-facade__card { padding: var(--space-6); } }
.map-facade__address { color: var(--color-text-muted); }
.map-facade__note { font-size: var(--step-tiny); color: var(--color-text-muted); }
.map-facade__link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap-target); font-weight: 700; }
.map-facade__link .icon { --icon-size: var(--icon-size-xs); }
/* Without JavaScript the map cannot load: the card keeps the address and the Google Maps link */
html:not(.js) :is([data-map-load], .map-facade__note) { display: none; }
.map-facade.is-loaded { display: block; min-height: 0; padding: 0; background-image: none; }
/* The map takes focus on load; an iframe never shows :focus, so the strip draws the ring */
.map-facade.is-loaded:focus-within { outline: var(--focus-ring) solid var(--color-focus); outline-offset: calc(-1 * var(--focus-ring)); }
.map-facade__frame { width: 100%; height: var(--map-h); border: 0; }
.map-facade__after { padding: var(--space-4) var(--map-edge); }

/* == Intro and booking: one limewash stretch, the form high on the page == */

.contact-intro { padding-bottom: clamp(var(--space-6), 5vw, var(--space-8)); }
.booking { padding-top: 0; }
.booking__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-9); }
/* Links to #book show the panel's top (three classes outrank the shared scroll-margin rule) */
.booking .booking__panel > .booking__form { scroll-margin-top: calc(var(--scroll-offset) + var(--panel-pad)); }
.booking__title { margin-bottom: var(--space-2); }
/* Phones: the panel runs edge to edge, so the fields get the full width */
.booking__panel { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; }

/* Contact details: the address, three ways in, the full week and what to do if it hurts */
.details, .details__contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7); align-content: start; }
.details__title { margin-bottom: calc(-1 * var(--space-3)); }
.details__contact { gap: var(--space-5); }
.details__address { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); }
.details__address p { padding-top: var(--space-2); }
.details__links { display: grid; gap: var(--space-3); }
.details__link { gap: var(--space-4); }
.details__item { display: grid; line-height: var(--leading-tight); }
.details__label { font-size: var(--step-small); color: var(--color-text-muted); }
.details__value { font-weight: 700; color: var(--color-heading); }
/* The email may break after the @ rather than push the page sideways */
.details__value--email { white-space: normal; overflow-wrap: anywhere; }
.details__urgent {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); justify-items: start; padding: clamp(var(--space-5), 3vw, var(--space-6));
  border-radius: var(--radius-sm); background: var(--color-surface-3);
}
/* The inline phone link: a 44px target from a box behind it, so the ring stays on the number */
.details__urgent-link { position: relative; white-space: normal; }
.details__urgent-link::after { content: ""; position: absolute; inset: calc(50% - var(--tap-target) / 2) 0; }
.details__urgent-title, .route__title { font-size: var(--step-list); line-height: var(--leading-tight); }

@media (min-width: 43.75em) {
  .booking__panel { margin-inline: 0; border-radius: var(--radius-sm); }
  /* Under the form: the ways in beside the week, the emergency note across both */
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .details__title, .details__urgent { grid-column: 1 / -1; }
}
@media (min-width: 62.5em) {
  /* The sage panel runs to the foot of the details column, so both columns end level */
  .booking__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--space-8); align-items: start; }
  .booking__panel { align-self: stretch; }
  .booking__panel:has(> .booking__success:not([hidden])) { display: grid; align-content: center; }
  .details { grid-template-columns: minmax(0, 1fr); padding-top: var(--panel-pad); }
}

/* == Getting here (P6): the directions beside a portrait collage == */

.getting-here { padding-bottom: var(--space-9); }
.getting-here__grid { display: grid; gap: var(--space-7); grid-template-areas: "title" "collage" "route"; }
.getting-here__title { grid-area: title; }
.getting-here__collage { grid-area: collage; }
.route { grid-area: route; border-top: var(--border-hairline) solid var(--color-rule); }
.route__item {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4);
  padding-block: var(--space-5); border-bottom: var(--border-hairline) solid var(--color-rule);
}
.route__title { margin-block: var(--space-2); }
.route__text { color: var(--color-text-muted); }

@media (min-width: 43.75em) {
  .getting-here__grid { row-gap: var(--space-8); }
  .route { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-7); border-top: 0; }
  .route__item:nth-child(-n + 2) { border-top: var(--border-hairline) solid var(--color-rule); }
  /* An odd last item closes the list across both columns instead of leaving a gap */
  .route__item:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* From 1000px the collage stands beside the list, in the phone's portrait arrangement, and stays in view */
@media (min-width: 62.5em) {
  .getting-here__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "title collage" "route collage"; column-gap: var(--space-8); row-gap: var(--space-6);
  }
  .route { grid-template-columns: minmax(0, 1fr); }
  .route__item:nth-child(2) { border-top: 0; }
  .route__item:last-child:nth-child(odd) { grid-column: auto; }
  .getting-here__collage {
    position: sticky; top: calc(var(--header-h) + var(--space-6)); align-self: start;
    grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(9, minmax(0, 1fr)); aspect-ratio: 6 / 9.2;
  }
  .getting-here .collage__item--tall { grid-area: 1 / 1 / 6 / 5; }
  .getting-here .collage__item--small { grid-area: 1 / 5 / 3 / 7; }
  .getting-here .collage__accent { grid-area: 3 / 5 / 6 / 7; }
  .getting-here .collage__item--wide { grid-area: 6 / 1 / 10 / 7; }
}
