/* Morden Hall booking form. Everything is scoped under .mhb so it cannot clash with the theme.
 *
 * Values are taken from the live "Your Enquiry" form on mordenhall.com:
 *   headings and buttons  "Gothic" (Trade Gothic Bold Extended, loaded by the site), 700, uppercase
 *   labels, inputs, copy  Cormorant, ink #59514e, inputs 22px with a 1px #69727d border, 47px high
 *   button                #b48c73, 18px, padding 15px 50px, square corners
 *   panel background      #fcf6f3
 * Only Cormorant weights 400, 600 and 700 are used. On the live site weight 500 fails to load and
 * falls back to Arial, so it is avoided here.
 */
.mhb {
  --mhb-accent: #b48c73;
  --mhb-accent-dark: #96705a;
  --mhb-ink: #59514e;
  --mhb-muted: #7d7572;
  --mhb-line: #69727d;
  --mhb-soft-line: #d9cfc9;
  --mhb-bg: #fcf6f3;
  --mhb-field: #ffffff;
  --mhb-error: #a8322a;
  --mhb-heading-font: Gothic, "Trade Gothic LT Std", "Century Gothic", "Questrial", sans-serif;
  --mhb-body-font: Cormorant, "Cormorant Garamond", Georgia, serif;
  box-sizing: border-box;
  max-width: 640px;
  margin: 0 auto;
  color: var(--mhb-ink);
  font-family: var(--mhb-body-font);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  font-variant-numeric: lining-nums; /* even-height digits, so dates and times line up */
  text-align: left;
}
.mhb *, .mhb *::before, .mhb *::after { box-sizing: border-box; }
.mhb [hidden] { display: none !important; }

/* progress */
.mhb-progress { display: flex; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.mhb-progress li { flex: 1; margin: 0; padding: 10px 0 0; border-top: 3px solid var(--mhb-soft-line); font-family: var(--mhb-heading-font); font-size: 10px; font-weight: 700; line-height: 1.4; text-transform: uppercase; color: #a39b97; }
.mhb-progress li.is-done, .mhb-progress li.is-current { border-color: var(--mhb-accent); }
.mhb-progress li.is-current { color: var(--mhb-ink); }

.mhb-title { margin: 0 0 2px; padding: 0; font-family: var(--mhb-heading-font); font-size: 22px; font-weight: 700; line-height: 1.5; letter-spacing: normal; text-transform: uppercase; color: var(--mhb-ink); }
.mhb-title:focus { outline: none; }
.mhb-lead { margin: 0 0 18px; color: var(--mhb-muted); font-size: 20px; }

/* fields */
.mhb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 10px; }
.mhb-field { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 0; border: 0; }
.mhb-full { grid-column: 1 / -1; }
.mhb-label, .mhb-field > legend { margin: 0 0 8px; padding: 0; font-family: var(--mhb-body-font); font-size: 20px; font-weight: 600; line-height: 1; color: var(--mhb-ink); }
.mhb-opt { font-weight: 400; color: var(--mhb-muted); }
.mhb input[type=text], .mhb input[type=email], .mhb input[type=tel], .mhb input[type=number], .mhb input[type=date], .mhb select, .mhb textarea {
  width: 100%; height: 47px; margin: 0; padding: 6px 16px;
  border: 1px solid var(--mhb-line); border-radius: 0; background: var(--mhb-field);
  color: var(--mhb-ink); font-family: var(--mhb-body-font); font-size: 22px; font-weight: 400; line-height: 1.5;
  appearance: auto; box-shadow: none;
}
.mhb textarea { height: auto; min-height: 110px; resize: vertical; }
.mhb input:focus-visible, .mhb select:focus-visible, .mhb textarea:focus-visible, .mhb button:focus-visible, .mhb-chip input:focus-visible + span, .mhb-choice input:focus-visible + span {
  outline: 2px solid var(--mhb-accent-dark); outline-offset: 2px;
}
.mhb [aria-invalid=true] { border-color: var(--mhb-error); }
.mhb-error { margin: 5px 0 0; font-size: 18px; font-weight: 600; color: var(--mhb-error); }
.mhb-hint { margin: 8px 0 0; font-size: 19px; color: var(--mhb-muted); }
.mhb-check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 0; font-size: 20px; line-height: 1.3; color: var(--mhb-ink); cursor: pointer; }
.mhb-check input { width: 18px; height: 18px; margin: 4px 0 0; flex: none; accent-color: var(--mhb-accent); }
.mhb-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* chips (event type) and choice cards (visit yes / no) */
.mhb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mhb-chip, .mhb-choice { position: relative; margin: 0; cursor: pointer; }
.mhb-chip input, .mhb-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mhb-chip span { display: block; padding: 8px 18px; border: 1px solid var(--mhb-line); background: var(--mhb-field); font-size: 20px; line-height: 1.4; }
.mhb-chip input:checked + span, .mhb-choice input:checked + span { border-color: var(--mhb-accent); background: var(--mhb-accent); color: #fff; }
.mhb-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.mhb-choice span { display: block; height: 100%; padding: 12px 16px; border: 1px solid var(--mhb-line); background: var(--mhb-field); }
.mhb-choice b { display: block; font-size: 21px; font-weight: 600; }
.mhb-choice small { font-size: 18px; }

/* date and time picker */
.mhb-pick-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 47px; margin: 0; padding: 6px 16px; border: 1px solid var(--mhb-line); border-radius: 0; background: var(--mhb-field); color: var(--mhb-ink); font-family: var(--mhb-body-font); font-size: 22px; font-weight: 400; line-height: 1.4; text-align: left; text-transform: none; letter-spacing: normal; cursor: pointer; }
.mhb-pick-btn.is-empty span { color: var(--mhb-muted); }
.mhb-pick-btn em { flex: none; font-family: var(--mhb-heading-font); font-size: 10px; font-style: normal; font-weight: 700; text-transform: uppercase; color: var(--mhb-accent-dark); }
.mhb-picker { margin-top: 8px; padding: 16px; border: 1px solid var(--mhb-line); background: var(--mhb-field); }
.mhb-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mhb-cal-head strong { font-family: var(--mhb-heading-font); font-size: 14px; font-weight: 700; text-transform: uppercase; }
.mhb-cal-nav { width: 40px; height: 40px; padding: 0; border: 1px solid var(--mhb-soft-line); border-radius: 0; background: transparent; color: var(--mhb-ink); font-family: var(--mhb-body-font); font-size: 24px; line-height: 1; cursor: pointer; }
.mhb-cal-nav:disabled { opacity: .3; cursor: default; }
.mhb-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mhb-cal-dow { padding: 4px 0; font-family: var(--mhb-heading-font); font-size: 9px; font-weight: 700; text-transform: uppercase; text-align: center; color: #a39b97; }
.mhb-day { height: 40px; width: 100%; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 0; background: transparent; color: #b9b2ae; font-family: var(--mhb-body-font); font-size: 20px; font-weight: 400; line-height: 1; }
.mhb-day.is-open { border-color: var(--mhb-accent); background: #f6ece6; color: var(--mhb-ink); font-weight: 700; cursor: pointer; }
.mhb-day.is-open:hover { background: #eedccf; }
.mhb-day.is-picked, .mhb-day.is-picked:hover { background: var(--mhb-accent); color: #fff; }
.mhb-times { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--mhb-soft-line); }
.mhb-times p { margin: 0 0 10px; font-size: 20px; font-weight: 600; }
.mhb-time-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mhb-time { min-width: 88px; min-height: 44px; margin: 0; padding: 6px 14px; border: 1px solid var(--mhb-accent); border-radius: 0; background: #fff; color: var(--mhb-ink); font-family: var(--mhb-body-font); font-size: 21px; font-weight: 600; line-height: 1.2; cursor: pointer; }
.mhb-time:hover, .mhb-time.is-picked { background: var(--mhb-accent); color: #fff; }
.mhb-time:disabled { border-color: var(--mhb-soft-line); background: transparent; color: #b9b2ae; font-weight: 400; text-decoration: line-through; cursor: default; }

/* navigation */
.mhb-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; }
.mhb-btn { min-height: 48px; margin: 0; padding: 15px 50px; border: 0; border-radius: 0; background: var(--mhb-accent); color: #fff; font-family: var(--mhb-heading-font); font-size: 18px; font-weight: 700; line-height: 1; letter-spacing: normal; text-transform: uppercase; cursor: pointer; }
.mhb-btn:hover { background: var(--mhb-accent-dark); color: #fff; }
.mhb-btn:disabled { opacity: .6; cursor: wait; }
.mhb-back { margin: 0; padding: 10px 4px; border: 0; background: none; color: var(--mhb-muted); font-family: var(--mhb-body-font); font-size: 20px; text-decoration: underline; text-transform: none; cursor: pointer; }
.mhb-alert { margin: 16px 0 0; padding: 10px 14px; border-left: 3px solid var(--mhb-error); background: #fbeceb; color: var(--mhb-error); font-size: 19px; font-weight: 600; }
@media (max-width: 480px) {
  .mhb-btn { padding: 15px 26px; font-size: 16px; }
  .mhb-progress li { font-size: 9px; }
}

/* confirmation */
.mhb-done { padding: 12px 0; text-align: center; font-size: 21px; }
.mhb-done p { margin: 0 0 10px; }
.mhb-done .mhb-tick { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; background: var(--mhb-accent); color: #fff; font-family: Arial, sans-serif; font-size: 28px; }
.mhb-done .mhb-when { margin: 14px auto; padding: 14px 18px; max-width: 400px; border: 1px solid var(--mhb-accent); background: #fff; font-size: 24px; font-weight: 600; }

/* ---- Smooth resize ----
 * Each step is as tall as its content. When the step changes, or the calendar opens or closes, the
 * script animates the form's height so a popup glides to its new size instead of jumping. */
.mhb form { margin: 0; }
