/**
 * Contribute to the Hook Archive, [gw_hook_contribute]
 * (docs/PLAN-hook-archive-contributions.md, P3).
 *
 * Every colour is one of the hook reference's shared tokens (gw-tokens.css),
 * so the page matches the hook pages it will be linked from and is ready for
 * the dark theme, which P6 switches on for this page. Until then the page is
 * light whatever a visitor chose: the tokens' dark values apply only to a page
 * the theme has listed, and this one is not listed yet. The sheet is in
 * tools/theme-sheets.json with a budget of no literal colours from its first
 * day, so that stays true.
 *
 * The `html body` prefix is the hook pages' own: it outranks the site theme's
 * rules for buttons, inputs and headings without an !important.
 */

html body .hc-contribute {
  color: var(--gwd-ink);
  font-family: var(--gwd-sans);
  font-size: 16px;
  line-height: 1.55;
}
html body .hc-contribute [hidden] { display: none !important; }
html body .hc-contribute h2,
html body .hc-contribute h3 { color: var(--gwd-ink); font-family: var(--gwd-serif); font-weight: 400; line-height: 1.2; margin: 0 0 12px; }
html body .hc-contribute h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.02em; }
html body .hc-contribute h3 { font-size: 24px; margin-top: 36px; }
html body .hc-contribute h2:focus,
html body .hc-contribute .hc-contribute-summary:focus { outline: none; }
html body .hc-contribute p { margin: 0 0 12px; }
html body .hc-contribute .hc-contribute-eyebrow { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gwd-muted); }
html body .hc-contribute .hc-contribute-lede { max-width: 56ch; font-size: 18px; color: var(--gwd-text2); }
html body .hc-contribute .hc-contribute-help { font-size: 13.5px; color: var(--gwd-muted); }

/* ── What the page says before any script runs ──────────────────────── */
html body .hc-contribute .hc-contribute-state { margin: 0 0 20px; padding: 10px 14px; border-left: 3px solid var(--gwd-line-strong); background: var(--gwd-light); font-size: 15px; }
html body .hc-contribute .hc-contribute-state.is-note { border-left-color: var(--gwd-info-line); background: var(--gwd-info-bg); color: var(--gwd-info-fg); }
html body .hc-contribute .hc-contribute-state.is-warn { border-left-color: var(--gwd-warn-line); background: var(--gwd-warn-bg); color: var(--gwd-warn-fg); }

html body .hc-contribute .hc-contribute-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; padding-bottom: 28px; border-bottom: 1px solid var(--gwd-line); }
html body .hc-contribute .hc-contribute-note { padding: 22px 24px; border: 1px solid var(--gwd-line); border-top: 3px solid var(--gwd-green); background: var(--gwd-light); }
html body .hc-contribute .hc-contribute-note h3 { margin-top: 0; }

html body .hc-contribute .hc-contribute-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
html body .hc-contribute .hc-contribute-type {
  display: block; width: 100%; min-height: 132px; padding: 18px 16px; text-align: left; cursor: pointer;
  border: 1px solid var(--gwd-line); border-radius: 2px; background: var(--gwd-light); color: var(--gwd-ink);
  font: inherit; text-transform: none; letter-spacing: 0; box-shadow: none;
}
html body .hc-contribute .hc-contribute-type b { display: block; margin-bottom: 8px; font-size: 15px; }
html body .hc-contribute .hc-contribute-type span { display: block; font-size: 13.5px; color: var(--gwd-muted); }
html body .hc-contribute .hc-contribute-type:hover:not(:disabled),
html body .hc-contribute .hc-contribute-type:focus-visible { border-color: var(--gwd-green); background: var(--gwd-surface); }
html body .hc-contribute .hc-contribute-type:disabled { cursor: default; opacity: .62; }
html body .hc-contribute .hc-contribute-type .hc-contribute-paused { margin-top: 8px; color: var(--gwd-warn-fg); }

html body .hc-contribute .hc-contribute-lower { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 clamp(24px, 4vw, 56px); }
html body .hc-contribute .hc-contribute-steps { margin: 0; padding: 0 0 0 22px; }
html body .hc-contribute .hc-contribute-steps li { margin: 0 0 12px; padding-left: 4px; }
html body .hc-contribute .hc-contribute-steps b { display: block; }
html body .hc-contribute details { border-bottom: 1px solid var(--gwd-line); padding: 10px 0; }
html body .hc-contribute details summary { cursor: pointer; font-weight: 600; }
html body .hc-contribute details p { margin: 10px 0 2px; color: var(--gwd-text2); }
html body .hc-contribute .hc-contribute-lost { margin-top: 32px; }

/* ── The form ───────────────────────────────────────────────────────── */
html body .hc-contribute .hc-contribute-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 18px; }
@media (min-width: 900px) {
  html body .hc-contribute .hc-contribute-layout { grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); }
  html body .hc-contribute .hc-contribute-guide { position: sticky; top: 48px; align-self: start; }
}
html body .hc-contribute .hc-contribute-guide { padding: 20px 22px; border: 1px solid var(--gwd-line); background: var(--gwd-light); }
html body .hc-contribute .hc-contribute-guide h3 { margin-top: 0; font-size: 20px; }
html body .hc-contribute .hc-contribute-guide h3 + ul { margin: 0 0 18px; padding-left: 18px; font-size: 14.5px; }
html body .hc-contribute .hc-contribute-guide li { margin-bottom: 8px; }

html body .hc-contribute .hc-contribute-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
html body .hc-contribute .hc-contribute-field { margin: 0 0 18px; min-width: 0; }
html body .hc-contribute .hc-contribute-field label { display: block; margin: 0 0 5px; font-size: 14px; font-weight: 600; color: var(--gwd-ink); }
html body .hc-contribute .hc-contribute-field input[type="text"],
html body .hc-contribute .hc-contribute-field input[type="email"],
html body .hc-contribute .hc-contribute-field input[type="search"],
html body .hc-contribute .hc-contribute-field select,
html body .hc-contribute .hc-contribute-field textarea {
  display: block; width: 100%; max-width: 100%; box-sizing: border-box; margin: 0; padding: 9px 11px;
  border: 1px solid var(--gwd-edge); border-radius: 3px; background: var(--gwd-field); color: var(--gwd-ink);
  font: 16px/1.45 var(--gwd-sans); box-shadow: none;
}
html body .hc-contribute .hc-contribute-field textarea { resize: vertical; }
html body .hc-contribute .hc-contribute-field input[type="file"] { display: block; max-width: 100%; font: 15px/1.4 var(--gwd-sans); color: var(--gwd-ink); }
html body .hc-contribute .hc-contribute-field :focus-visible,
html body .hc-contribute button:focus-visible,
html body .hc-contribute a:focus-visible,
html body .hc-contribute summary:focus-visible { outline: 2px solid var(--gwd-orange); outline-offset: 2px; }
html body .hc-contribute .hc-contribute-field [aria-invalid="true"] { border-color: var(--gwd-bad-line); }
html body .hc-contribute .hc-contribute-field .hc-contribute-help { margin: 5px 0 0; }
html body .hc-contribute .hc-contribute-error { margin: 5px 0 0; font-size: 13.5px; font-weight: 600; color: var(--gwd-bad-fg); }
html body .hc-contribute .hc-contribute-summary { margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--gwd-bad-line); border-left-width: 4px; background: var(--gwd-bad-bg); color: var(--gwd-ink); }
html body .hc-contribute .hc-contribute-summary h3 { margin: 0 0 8px; font: 700 16px/1.3 var(--gwd-sans); }
html body .hc-contribute .hc-contribute-summary ul { margin: 0; padding-left: 20px; }
html body .hc-contribute .hc-contribute-summary a { color: var(--gwd-ink); text-decoration: underline; }

/* The honeypot: off the page for people, present for a script that fills every field. */
html body .hc-contribute .hc-contribute-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

html body .hc-contribute .hc-contribute-results { list-style: none; margin: 6px 0 0; padding: 0; }
html body .hc-contribute .hc-contribute-results li { margin: 0 0 4px; }
html body .hc-contribute .hc-contribute-result {
  display: block; width: 100%; padding: 8px 11px; text-align: left; cursor: pointer;
  border: 1px solid var(--gwd-line); border-radius: 3px; background: var(--gwd-surface); color: var(--gwd-ink);
  font: 15px/1.4 var(--gwd-sans); text-transform: none; letter-spacing: 0; box-shadow: none;
}
html body .hc-contribute .hc-contribute-result:hover { border-color: var(--gwd-green); background: var(--gwd-green-soft); }
html body .hc-contribute .hc-contribute-chosen { margin: 0; padding: 9px 11px; border: 1px solid var(--gwd-line); background: var(--gwd-green-soft); }

html body .hc-contribute .hc-contribute-files { list-style: none; margin: 10px 0 0; padding: 0; }
html body .hc-contribute .hc-contribute-file { margin: 0 0 12px; padding: 14px 16px 2px; border: 1px solid var(--gwd-line); background: var(--gwd-light); }
html body .hc-contribute .hc-contribute-file-name { overflow-wrap: anywhere; }
html body .hc-contribute .hc-contribute-file-name span { color: var(--gwd-muted); font-size: 13.5px; }

/* ── Buttons ────────────────────────────────────────────────────────── */
html body .hc-contribute .hc-contribute-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 18px 0 12px; }
html body .hc-contribute .hc-contribute-button {
  display: inline-block; padding: 12px 22px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--gwd-btn-line); border-radius: 2px; background: var(--gwd-btn-bg); color: var(--gwd-btn-fg);
  font: 600 15px/1.3 var(--gwd-sans); text-transform: none; letter-spacing: 0; box-shadow: none;
}
html body .hc-contribute .hc-contribute-button:disabled { cursor: default; opacity: .5; }
html body .hc-contribute .hc-contribute-button--quiet { background: var(--gwd-surface); color: var(--gwd-ink); }
html body .hc-contribute .hc-contribute-link {
  padding: 0; border: 0; background: none; cursor: pointer; color: var(--gwd-link);
  font: inherit; text-decoration: underline; text-transform: none; letter-spacing: 0; box-shadow: none;
}
html body .hc-contribute .hc-contribute-link:disabled { cursor: default; opacity: .5; }

/* ── Preview and receipt ────────────────────────────────────────────── */
html body .hc-contribute .hc-contribute-preview,
html body .hc-contribute .hc-contribute-receipt { max-width: 760px; margin-top: 18px; }
html body .hc-contribute .hc-contribute-preview h3 { margin-top: 0; }
html body .hc-contribute .hc-contribute-rows { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 0; margin: 0 0 18px; border-top: 1px solid var(--gwd-line); }
html body .hc-contribute .hc-contribute-rows dt,
html body .hc-contribute .hc-contribute-rows dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--gwd-line); }
html body .hc-contribute .hc-contribute-rows dt { padding-right: 14px; font-size: 13.5px; color: var(--gwd-muted); }
html body .hc-contribute .hc-contribute-rows dd { white-space: pre-wrap; overflow-wrap: anywhere; }
html body .hc-contribute .hc-contribute-banner { padding: 11px 14px; border-left: 3px solid var(--gwd-green); background: var(--gwd-green-soft); color: var(--gwd-green-text); }
html body .hc-contribute .hc-contribute-check { display: flex; gap: 10px; align-items: flex-start; }
html body .hc-contribute .hc-contribute-check input { margin-top: 5px; flex: none; }
html body .hc-contribute .hc-contribute-check label { font-weight: 400; }
html body .hc-contribute progress { display: block; width: 100%; max-width: 420px; height: 10px; accent-color: var(--gwd-green); }
html body .hc-contribute .hc-contribute-receipt-id { font: 14px/1.5 var(--gwd-mono); overflow-wrap: anywhere; background: var(--gwd-chip); padding: 2px 6px; }

@media (max-width: 720px) {
  html body .hc-contribute .hc-contribute-hero { grid-template-columns: minmax(0, 1fr); }
  html body .hc-contribute .hc-contribute-rows { grid-template-columns: minmax(0, 1fr); }
  html body .hc-contribute .hc-contribute-rows dt { padding-bottom: 0; border-bottom: 0; }
  html body .hc-contribute .hc-contribute-type { min-height: 0; }
}
@media print {
  html body .hc-contribute .hc-contribute-types,
  html body .hc-contribute .hc-contribute-lost,
  html body .hc-contribute .hc-contribute-actions { display: none !important; }
}
