/*
 * Haus of Contour — the contact page.
 *
 * The studio facts, the map, and the enquiry form. The form controls here are
 * the site's only text inputs of any size, so their styling lives with the
 * page that owns them.
 */

/* --------------------------------------------------------- studio facts */

.facts { margin-top: 76px; }

.facts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 44px;
}

.facts__item {
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}

.facts__item .prose { margin-top: 14px; }

.facts__item .prose--muted { color: var(--muted); max-width: 34ch; }

/* Contact details underline on the rule colour, not the accent, so the block
   does not read as four terracotta links. */
.facts__item a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.facts__item a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- the map */

.map { margin-top: 80px; }

/*
 * The frame is sized and bordered here; contact.js drops an iframe in once the
 * block is near the viewport. Until then — and forever, without JavaScript —
 * the slot below holds the address and the directions link, so the section is
 * never an empty rectangle.
 */
.map__frame {
  position: relative;
  border: 1px solid var(--rule);
  height: clamp(320px, 46vh, 520px);
  overflow: hidden;
  background: #E7E1D7;
}

.map__frame > iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  /* Pulls the map's colour back towards the page's ground. */
  filter: grayscale(1) contrast(0.92) sepia(0.16) brightness(1.03);
}

/* The slot itself only centres; it stays transparent so the map reads around
   the card. contact.js hides the whole slot on the iframe's load event. */
.map__slot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/*
 * The card carries the ground. contact.js inserts the iframe behind the slot
 * and only hides the slot once the iframe fires load, so while the tiles are
 * drawing the address would otherwise sit on a half-rendered map. Solid, so
 * it stays readable at every moment of that, and if load never fires at all.
 */
.map__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  max-width: 100%;
  padding: 26px 32px;
  background: var(--raised);
  border: 1px solid var(--rule);
}

@media (max-width: 480px) {
  .map__card { padding: 20px 22px; }
}

.map__foot {
  margin-top: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

/* The two directions buttons travel together as one item of .map__foot, so
   the paragraph keeps its side of the row until the whole foot wraps. */
.map__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.map__directions {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 64ch;
  text-wrap: pretty;
}

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

.enquire {
  margin-top: 96px;
  border-top: 1px solid var(--rule);
  background: var(--raised);
  padding-top: 88px;
  padding-bottom: 88px;
}

.enquire__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 72px;
  align-items: start;
}

.enquire__title { max-width: 20ch; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.06; }

.enquire__note {
  margin: 26px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 48ch;
}

.form { display: flex; flex-direction: column; gap: 24px; }

.field { display: block; }

.field__label { padding-bottom: 10px; }

.field__control {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--shell);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 15px 14px;
  transition: border-color var(--shift);
}
.field__control:focus { border-color: var(--accent); }

textarea.field__control { resize: vertical; }

/* The select loses its native chevron, so one is drawn back on. */
select.field__control {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) calc(50% + 1px),
    calc(100% - 14px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.form__actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.form__status {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}
.form__status[data-state="error"] { color: var(--accent); }

/* The confirmation that replaces the form once a message is away. */
.sent {
  border-top: 1px solid var(--accent);
  padding-top: 26px;
}

.sent__label { color: var(--accent); }

.sent__line { margin: 16px 0 0; max-width: 44ch; color: var(--ink); }

.sent__note {
  margin: 16px 0 24px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 48ch;
}

.sent__actions { display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 719px) {
  .facts { margin-top: 48px; }
  .map { margin-top: 56px; }
  .enquire { padding-top: 64px; padding-bottom: 64px; margin-top: 64px; }
  .enquire__grid { gap: 48px; }
}
