/* =====================================================================
   space-contact.css - spacing / density pass for contact, thank-you, 404.
   Loaded only by contact.php, thank-you.php and 404.php (via $extraHead),
   after site.css + pages.css. Every rule is scoped to a page class
   (.ct-*, .ty-*, .nf-*) so it never leaks into other pages.
   8px rhythm: sections 72 desktop / ~56 tablet / 44 mobile,
   heading -> content 32-40, grid gaps 24 / 16.
   ===================================================================== */

/* ---------------------------------------------------------------- heroes */
.ct-hero.page-hero, .ty-hero.page-hero, .nf-hero.page-hero {
  padding-top: clamp(28px, 2vw + 20px, 56px);
  padding-bottom: clamp(32px, 2vw + 22px, 56px);
}
.ct-hero .breadcrumbs, .ty-hero .breadcrumbs, .nf-hero .breadcrumbs { margin-bottom: clamp(16px, 1vw + 12px, 24px); }
.ct-hero h1, .ty-hero h1, .nf-hero h1 { margin-bottom: 16px; }
.ct-hero .hero-actions, .ty-hero .hero-actions, .nf-hero .hero-actions { margin-top: 24px; }
/* contact: the cards band right below continues the hero */
.ct-hero.page-hero { padding-bottom: clamp(28px, 1.5vw + 20px, 48px); }

.ty-hero .ty-check { width: 56px; height: 56px; margin-bottom: 16px; font-size: 1.5rem; }
.nf-hero .nf-code { margin-bottom: 4px; font-size: clamp(3.5rem, 2.4rem + 4.4vw, 6.5rem); }

/* --------------------------------------------------------------- bands */
.ct-enquiry.band, .ct-map.band, .ty-next.band, .ty-products.band, .nf-band.band {
  padding: clamp(44px, 3vw + 30px, 72px) 0;
}
.ty-next .section-head, .ty-products .section-head { margin-bottom: clamp(24px, 1vw + 20px, 36px); }
.ty-products .page-more { margin-top: 32px; }

/* --------------------------------------------------- contact: reach cards */
.ct-reach.band { padding-top: 0; padding-bottom: clamp(36px, 2vw + 24px, 56px); }
.ct-reach .contact-cards { gap: 24px; }
.ct-reach .contact-card { padding: 24px; }
.ct-reach .contact-card .icon-badge { margin-bottom: 16px; width: 44px; height: 44px; font-size: 1.1rem; }
.ct-reach .contact-card .contact-badge { top: 24px; right: 20px; }
.ct-reach .contact-card p { margin-bottom: 12px; }
@media (max-width: 1080px) { .ct-reach .contact-cards { gap: 16px; } }
/* phones: icon in a left column, text on the right - halves the stack height */
@media (max-width: 520px) {
  .ct-reach .contact-cards { gap: 12px; }
  .ct-reach .contact-card {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-content: start;
    padding: 18px 16px;
  }
  .ct-reach .contact-card > * { grid-column: 2; }
  .ct-reach .contact-card .icon-badge { grid-column: 1; grid-row: 1 / span 4; margin: 0; }
  .ct-reach .contact-card .contact-badge { top: 18px; right: 14px; }
  .ct-reach .contact-card h3 { font-size: 1.08rem; margin-bottom: 4px; line-height: 1.4; }
  .ct-reach .contact-card p { font-size: .94rem; margin-bottom: 8px; }
  .ct-reach .contact-card-link, .ct-reach .contact-card address { display: inline-block; min-height: 24px; }
}

/* --------------------------------------------------- contact: form + aside */
.ct-enquiry .contact-layout { gap: clamp(24px, 2.4vw, 40px); }
.ct-enquiry .contact-form.form-card { padding: clamp(20px, 2vw + 12px, 40px); }
.ct-enquiry .contact-form h2 { margin-bottom: 4px; }
.ct-enquiry .contact-form .form-note { margin-bottom: 20px; }
.ct-enquiry .contact-form .form-grid { gap: 16px 20px; }
.ct-enquiry .contact-form .field { gap: 6px; }
.ct-enquiry .contact-form textarea { min-height: 128px; }
.ct-enquiry .contact-submit { margin-top: 24px; }
.ct-enquiry .contact-context { margin-bottom: 20px; }

.ct-enquiry .contact-aside { gap: 24px; }
.ct-enquiry .contact-aside .card { padding: clamp(20px, 1vw + 14px, 28px); }
.ct-enquiry .contact-aside h2 { margin-bottom: 16px; }
.ct-enquiry .contact-support-line { margin-bottom: 14px; }
.ct-enquiry .contact-details .text-muted { margin-bottom: 16px; }
.ct-enquiry .contact-next ol { gap: 14px; }
/* tablet: form full width, the two side cards side by side underneath */
@media (min-width: 641px) and (max-width: 960px) {
  .ct-enquiry .contact-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
}
@media (max-width: 960px) { .ct-enquiry .contact-layout { gap: 16px; } }
@media (max-width: 640px) {
  .ct-enquiry .contact-aside { gap: 16px; }
  .ct-enquiry .contact-form .form-grid { gap: 14px; }
}

/* ------------------------------------------------------- contact: map */
.ct-map .map-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.ct-map .map-copy { padding: clamp(24px, 2vw + 12px, 40px); }
.ct-map .map-copy h2 { margin-bottom: 12px; }
.ct-map .map-copy address { margin-bottom: 20px; font-style: normal; }
.ct-map .map-copy .btn { margin-top: 24px; }
.map-facts { list-style: none; margin: 0; padding: 16px 0 0; display: grid; gap: 12px; border-top: 1px solid #ece6f1; }
.map-facts li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--text-2); line-height: 1.5; font-size: .96rem; }
.map-facts i { color: var(--brand); margin-top: 4px; text-align: center; }
.map-facts strong { display: block; color: var(--ink); font-weight: 600; }

.ct-map .map-frame { position: relative; min-height: 360px; overflow: hidden; }
.ct-map .map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; }
/* Meaningful backdrop while (or if) the Google map has not painted yet:
   a stylised street grid with the office pin, address and hours. */
.map-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  background-color: #f3eef7;
  background-image:
    linear-gradient(#fff 0 0), linear-gradient(#fff 0 0),
    repeating-linear-gradient(0deg, transparent 0 46px, rgba(96, 40, 116, .07) 46px 48px),
    repeating-linear-gradient(90deg, transparent 0 62px, rgba(96, 40, 116, .07) 62px 64px);
  background-size: 100% 14px, 14px 100%, auto, auto;
  background-position: 0 58%, 38% 0, 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
}
.map-road { position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(96, 40, 116, .06); }
.map-road-a { width: 140%; height: 10px; left: -20%; top: 30%; transform: rotate(-18deg); }
.map-road-b { width: 10px; height: 140%; left: 72%; top: -20%; transform: rotate(14deg); }
.map-road-c { width: 120%; height: 8px; left: -10%; top: 80%; transform: rotate(6deg); background: #e7dcef; }
.map-fallback-card {
  position: relative; display: grid; justify-items: center; gap: 2px; text-align: center;
  padding: 18px 22px; max-width: 280px; border-radius: 16px; background: #fff;
  box-shadow: 0 12px 32px -12px rgba(31, 15, 38, .3);
}
.map-fallback-card .map-pin { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 8px; border-radius: 50%; color: #fff; background: var(--brand); font-size: 1.05rem; }
.map-fallback-card strong { color: var(--ink); font-size: 1rem; }
.map-fallback-card span { color: var(--text-2); font-size: .92rem; }
.map-fallback-card small { margin-top: 6px; color: var(--brand); font-size: .8rem; font-weight: 600; }

/* keep copy + map side by side down to small tablets */
@media (min-width: 721px) and (max-width: 960px) {
  .ct-map .map-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .ct-map .map-frame { min-height: 100%; }
}
@media (max-width: 720px) {
  .ct-map .map-panel { grid-template-columns: minmax(0, 1fr); }
  .ct-map .map-frame { min-height: 260px; }
}

/* ------------------------------------------- thank-you + 404 tile headers */
/* Icon and label on one row instead of stacked: ~40px less per tile. */
.ty-steps .tile, .nf-grid .nf-col {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-content: start; align-items: center;
  padding: clamp(20px, 1vw + 16px, 28px);
}
.ty-steps .tile > *, .nf-grid .nf-col > * { grid-column: 1 / -1; }
.ty-steps .tile > .icon-badge, .nf-grid .nf-col > .icon-badge { grid-column: 1; width: 44px; height: 44px; margin: 0; font-size: 1.05rem; }
.ty-steps .tile > .tile-num { grid-column: 2; margin: 0; }
.ty-steps .tile > h3 { margin: 16px 0 8px; }
.nf-grid .nf-col > h2 { grid-column: 2; margin: 0; }
.nf-grid .nf-links { margin-top: 12px; gap: 0; }
.nf-grid .nf-links a { min-height: 44px; padding: 8px 0; }

/* tablet: no lone third tile - it spans the full row */
@media (min-width: 641px) and (max-width: 960px) {
  .ty-steps, .nf-grid { gap: 16px; }
  .ty-steps > :nth-child(3):last-child, .nf-grid > :nth-child(3):last-child { grid-column: 1 / -1; }
  .nf-grid > :nth-child(3):last-child .nf-links { display: block; columns: 2; column-gap: 32px; }
  .nf-grid > :nth-child(3):last-child .nf-links li { break-inside: avoid; }
}
@media (max-width: 640px) { .ty-steps, .nf-grid { gap: 16px; } }

/* thank-you products: 3 on desktop, 2x2 on tablet, 2 on phones */
.ty-products .grid-3 { gap: 24px; }
@media (min-width: 961px) { .ty-products .grid-3 > :nth-child(n+4) { display: none; } }
@media (max-width: 960px) { .ty-products .grid-3 { gap: 16px; } }
@media (max-width: 720px) { .ty-products .grid-3 > :nth-child(n+3) { display: none; } }
