/* The contact page's form. Loaded after horizon.css on /contact only.
   Fields are hairline boxes on the void, labels are the gold mono labels,
   the submit is the site's action pill. */

.contact { align-content: center; row-gap: 2.6rem; }
.contact .hz-copy { max-width: min(42rem, 54vw); }

.contact-form {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.5rem;
  max-width: min(42rem, 54vw);
}

/* Name and email share a row, email the wider; their inputs line up at
   the bottom when a label wraps. The subject is as wide as its longest
   option. The handle, its hint and the message take the whole row. */
.contact-fields {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 1.25rem 1.5rem;
}
.contact-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-column: 1 / -1;
  align-content: end;
  gap: 0.5rem;
  min-width: 0;
}
.contact-field--name,
.contact-field--email { grid-column: auto; }
.contact-field--subject { justify-items: start; }

.contact-label,
.contact-hint { display: block; overflow-wrap: anywhere; }
.contact-hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--text);
  background: rgba(4, 7, 15, 0.9);
  border: 1px solid rgba(198, 228, 251, 0.28);
  border-radius: 4px;
  transition: border-color 0.25s ease;
}
.contact-form textarea { min-height: 10.5rem; resize: vertical; }
.contact-field--subject select { width: auto; max-width: 100%; }
.contact-form select {
  appearance: none;
  padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--dn-gold) 50%), linear-gradient(-45deg, transparent 50%, var(--dn-gold) 50%);
  background-position: calc(100% - 1.25rem) 55%, calc(100% - 0.9rem) 55%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
}
.contact-form select option { color: var(--text); background: var(--dn-navy); }
.contact-form input:hover,
.contact-form select:hover,
.contact-form textarea:hover { border-color: rgba(198, 228, 251, 0.5); }
.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible {
  border-color: var(--dn-gold);
  outline-offset: 2px;
}

/* The widget is 65 px tall; the box keeps the button from jumping when it
   draws. */
.contact-widget { min-height: 65px; }

/* Without scripts the widget cannot draw, and the deck's notice takes its
   place. The notice's paragraph exists only then: with scripting on, a
   noscript element holds text, not markup. So the empty box goes too.
   When scripts run but Turnstile's did not load, contact.js hides the box
   and shows the hidden copy, #contact-blocked. */
.contact-widget:has(+ noscript > .contact-noscript) { display: none; }
.contact-noscript {
  padding: 0.85rem 1rem;
  line-height: 1.5;
  color: var(--text-soft);
  border: 1px solid rgba(198, 228, 251, 0.28);
  border-radius: 4px;
  background: rgba(4, 7, 15, 0.9);
}

.contact-submit {
  justify-self: start;
  cursor: pointer;
  background: transparent;
}

/* The Worker redirects to /contact#contact-sent or #contact-failed. The
   message that is the target shows; both are hidden otherwise. The margin
   keeps it clear of the sticky header. No script is needed. */
.contact-status:target { display: block; }
.contact-status {
  scroll-margin-top: 8rem;
  padding: 0.85rem 1rem;
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--dn-ring);
  border: 1px solid rgba(236, 191, 119, 0.6);
  border-radius: 4px;
  background: rgba(4, 7, 15, 0.72);
}
.contact-status--failed { color: var(--text); border-color: var(--dn-orange); }

@media (max-width: 760px) {
  .contact { align-content: start; row-gap: 2rem; }
  .contact .hz-copy,
  .contact-form { max-width: none; }
  .contact-fields { grid-template-columns: minmax(0, 1fr); }
}
