/* =========================================================================
   WW1AHT MASTER — PUBLIC FORMS
   -------------------------------------------------------------------------
   Styles for theme-rendered public forms. At present that is the Great War
   story submission form ([ww1aht_story_form], assets/custom/setup-story-
   submissions.php).

   LOADED CONDITIONALLY, like _diary.css — only on a page that actually
   carries the shortcode. It is NOT part of the main enqueue chain in
   setup-assets.php and must not be added to it: _plugins.css only wins over
   the ww1-bookings and ww1-poetry stylesheets because the theme's enqueues
   run after theirs, and reordering that chain breaks the booking calendar and
   the poetry form.

   THIS FILE IS NOT _plugins.css. That one restyles the two plugins' own
   front-ends. This one styles markup the THEME renders, so there is no
   specificity contest to win here — keep selectors flat and low.

   Tokens only — no hardcoded colours. Note the accessibility rule from
   _variables.css: the raw brass --accent fails AA as text on light, so tan
   TEXT uses --accent-ink.
   ========================================================================= */

.ww1-form-wrap {
  max-width: var(--maxw-read);
  margin: var(--space-xl) auto;
}

.ww1-form__title {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  color: var(--primary);
  margin: 0 0 var(--space-md);
}

.ww1-form__intro {
  font-size: var(--fs-lead);
  line-height: var(--line-body);
  margin: 0 0 var(--space-md);
}

/* The expectation-setting paragraph. Deliberately quieter than the intro but
   NOT hidden — a charity that cannot publish everything should say so plainly
   rather than bury it. */
.ww1-form__note {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
  margin: 0 0 var(--space-lg);
}

/* ---- The form itself ---------------------------------------------------- */

.ww1-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

.ww1-form__row {
  margin: 0 0 var(--space-lg);
}

.ww1-form__row label {
  display: block;
  font-weight: var(--fw-semibold);
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.ww1-form .req {
  color: var(--roundel-red);
  font-weight: var(--fw-heading);
}

.ww1-form input[type="text"],
.ww1-form input[type="email"],
.ww1-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--font-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.ww1-form textarea {
  resize: vertical;
  min-height: 12em;
}

.ww1-form input[type="text"]:focus,
.ww1-form input[type="email"]:focus,
.ww1-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(42, 62, 92, 0.12);
}

.ww1-form__hint {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: var(--space-xs);
}

/* ---- The consent tick --------------------------------------------------- */

.ww1-form__row--check label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-weight: var(--fw-body);
  color: var(--text);
}

.ww1-form__row--check input[type="checkbox"] {
  margin-top: 0.35em;
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
}

.ww1-form__row--check .ww1-form__hint {
  margin-left: calc(1.1em + var(--space-sm));
}

/* ---- Honeypot ----------------------------------------------------------- */
/* Hidden from people, present in the DOM for bots. Not display:none — some
   bots skip anything with that — and never type="hidden", which they read as
   "do not fill". Off-screen and out of the tab order instead. */
.ww1-form__hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Errors and the thank-you ------------------------------------------- */

.ww1-form__errors {
  background: var(--surface);
  border: 1px solid var(--roundel-red);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: var(--space-md);
  margin: 0 0 var(--space-lg);
}

.ww1-form__errors p { margin: 0 0 var(--space-sm); }
.ww1-form__errors ul { margin: 0; padding-left: 1.25em; }
.ww1-form__errors li { margin-bottom: var(--space-xs); }

.ww1-form--done {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: var(--space-lg);
  max-width: var(--maxw-read);
  margin: var(--space-xl) auto;
}

.ww1-form--done h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  color: var(--primary);
  margin: 0 0 var(--space-sm);
}

.ww1-form--done p { margin: 0; line-height: var(--line-body); }

.ww1-form__actions { margin: 0; }

/* ---- reCAPTCHA ---------------------------------------------------------- */
/* Google's widget is a fixed-width iframe (302px) and will overflow a narrow
   phone. Scale it down rather than let it push the page sideways. */
@media (max-width: 360px) {
  .ww1-form .g-recaptcha {
    transform: scale(0.87);
    transform-origin: 0 0;
  }
}

/* ---- Small screens ------------------------------------------------------ */
@media (max-width: 600px) {
  .ww1-form { padding: var(--space-md); }
  .ww1-form-wrap { margin: var(--space-lg) auto; }
}
