/* Book a Tour modal: a cream card over the ink, on every page but Contact.
   Scoped entirely to `.tour-modal` so it can sit alongside any page stylesheet.
   Field styling mirrors contact.css by hand rather than by import, so the two
   can drift apart later without one breaking the other. */

.tour-modal {
  /* Local echoes of the contact page's field tokens. Kept off :root so a page
     stylesheet loaded after this one is never touched. */
  --tm-field-bg: #FFFCFA;
  --tm-field-border: #E0C9C1;

  width: calc(100% - 48px);
  max-width: 640px;
  max-height: min(88vh, 900px);
  margin: auto;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  box-shadow: 0 30px 80px rgba(43, 33, 36, 0.34);
  overflow: hidden; /* the inner scroller does the scrolling */
  /* Column flex so the scroller can own the overflow. The `:not([open])` rule
     below puts back the display:none the UA stylesheet would have given us. */
  display: flex;
  flex-direction: column;
}

/* The ink, translucent. Written literally as well as through the token because
   custom properties only reach ::backdrop in newer engines. */
.tour-modal::backdrop {
  background: rgba(43, 33, 36, 0.72);
  backdrop-filter: blur(3px);
}

.tour-modal:not([open]) { display: none; }

/* ---------- Shell ---------- */
.tour-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 46px 48px 44px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}


/* ---------- Heading ---------- */
.tour-modal-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 34px; /* clear of the close button */
}

.tour-modal-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--maroon);
}

.tour-modal-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 38px);
  line-height: 1.14;
  color: var(--ink);
}

.tour-modal-sub {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--muted);
}

.tour-modal-rule {
  width: 54px;
  height: 1px;
  background: var(--maroon);
  opacity: 0.5;
}

/* ---------- Form ---------- */
.tour-modal-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.tour-modal-form[hidden] { display: none; }

.tm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tm-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tm-field input,
.tm-field select,
.tm-field textarea {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  background: var(--tm-field-bg);
  border: 1px solid var(--tm-field-border);
  border-radius: 2px;
  padding: 12px 13px;
  width: 100%;
  box-sizing: border-box;
}

.tm-field textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

.tm-field input:focus,
.tm-field select:focus,
.tm-field textarea:focus {
  outline: 2px solid var(--maroon);
  outline-offset: -1px;
}

.tm-field input::placeholder,
.tm-field textarea::placeholder { color: var(--rose-muted); }

/* Honeypot: present for bots, gone for everyone else. */
.tm-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.tm-submit {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--maroon);
  padding: 16px 32px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.25s ease, opacity 0.25s ease;
}
.tm-submit:hover { background: var(--maroon-dark); }
.tm-submit[disabled] { opacity: 0.6; cursor: default; }

.tm-fineprint {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* The honest degrade: if the API is down, the venue email is right there. */
.tm-note {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--blush);
  border: 1px solid var(--border);
  padding: 13px 15px;
}
.tm-note[hidden] { display: none; }
.tm-note a { color: var(--maroon); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Sent state ---------- */
.tm-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  background: var(--blush);
  border: 1px solid var(--border);
  padding: 56px 40px;
}
.tm-sent[hidden] { display: none; }
.tm-sent:focus { outline: none; }

.tm-sent-title {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.2;
}

.tm-sent p {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}

.tm-sent-close {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.tm-sent-close:hover { color: var(--maroon); border-color: var(--maroon); }

/* ---------- Scroll lock ---------- */
body.tour-modal-open { overflow: hidden; }

/* ---------- Entrance ---------- */
@keyframes tour-modal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tour-modal-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.tour-modal[open] { animation: tour-modal-in 0.34s cubic-bezier(0.22, 0.61, 0.36, 1); }
.tour-modal[open]::backdrop { animation: tour-modal-backdrop-in 0.34s ease; }

@media (prefers-reduced-motion: reduce) {
  /* A plain fade, no travel. */
  .tour-modal[open] { animation: tour-modal-backdrop-in 0.2s ease; }
  .tour-modal[open]::backdrop { animation: tour-modal-backdrop-in 0.2s ease; }
  .tour-modal-close,
  .tm-submit,
  .tm-sent-close { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .tour-modal-scroll { padding: 40px 30px 36px; }
  .tm-row { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 640px) {
  /* Full-width sheet: the card takes the screen and scrolls inside itself. */
  .tour-modal {
    width: 100%;
    max-width: none;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
  }
  .tour-modal-scroll { padding: 56px 22px 32px; gap: 22px; }
  .tour-modal-head { padding-right: 26px; }
  .tm-submit { align-self: stretch; text-align: center; }
  /* On the full-height sheet the thank-you fills what the form left behind. */
  .tm-sent { flex: 1 0 auto; justify-content: center; padding: 44px 22px; }
  .tm-sent-title { font-size: 28px; }
}
