/* ==========================================================================
   kh-forms.css — public forms (collaboration request, newsletter)
   Loaded per page through {% block css %}; kh.css already provides
   .kh-field / .kh-input / .kh-btn / .kh-alert / .kh-visually-hidden.
   ========================================================================== */

.kh-form {
  max-width: 40rem;
}

/* hint under the field, error beside it — both tied to the input by id */
.kh-field__hint {
  margin: 0;
  font-size: var(--fs-caption);
  color: var(--text-3);
  line-height: 1.7;
}

.kh-field__error {
  margin: 0;
  font-size: var(--fs-caption);
  color: var(--neg);
  line-height: 1.7;
  font-weight: 600;
}

.kh-field--invalid .kh-input {
  border-color: var(--neg);
}

.kh-field__optional {
  font-weight: 400;
  color: var(--text-3);
}

/* two short fields side by side on wide screens, stacked on phones */
.kh-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--sp-4);
}

@media (max-width: 640px) {
  .kh-form__row {
    grid-template-columns: 1fr;
  }
}

/* native select restyled to match .kh-input; chevron sits on the inline-end.
   A data-URI cannot read a token, so the stroke mirrors --text-3 for each
   theme (kh.css: dark #778095, light #7a8296) — keep them in step. */
.kh-select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23778095' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  background-size: 16px;
  cursor: pointer;
}

[data-theme='light'] .kh-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8296' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

[dir='ltr'] .kh-select {
  background-position: right 1rem center;
}

.kh-select option {
  color: var(--text);
  background: var(--surface);
}

/* honeypot: off-canvas, not display:none, so naive bots still fill it */
.kh-honeypot {
  position: absolute;
  inset-inline-start: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* checkbox + long label (consent) */
.kh-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: var(--sp-4);
}

.kh-check__input,
.kh-check input[type='checkbox'] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0.2rem 0 0;
  accent-color: var(--accent);
}

.kh-check label {
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.8;
}

.kh-check .kh-field__error {
  flex-basis: 100%;
}

.kh-form__privacy {
  margin: var(--sp-3) 0 var(--sp-4);
  font-size: var(--fs-caption);
  color: var(--text-3);
  line-height: 1.9;
}

/* what-you-get list on the newsletter page */
.kh-newsletter__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.kh-newsletter__list li {
  padding-inline-start: 1.1rem;
  position: relative;
  line-height: 1.9;
  color: var(--text-2);
}

.kh-newsletter__list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.85em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.kh-newsletter__list strong {
  color: var(--text);
}

/* compact include (homepage / article pages) */
.kh-newsletter {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--sp-5) var(--sp-4);
}

.kh-newsletter__title {
  margin: 0.4rem 0 0.3rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.kh-newsletter__pitch {
  margin: 0 0 var(--sp-4);
  color: var(--text-2);
  line-height: 1.9;
}

.kh-newsletter__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.kh-newsletter__row .kh-input {
  flex: 1 1 14rem;
  min-width: 0;
}

.kh-newsletter__row .kh-btn {
  flex: 0 0 auto;
}

.kh-newsletter__note {
  margin: 0;
  font-size: var(--fs-caption);
  color: var(--text-3);
}

/* status pages: keep the long Persian sentence readable */
.kh-status-page__lead {
  line-height: 2;
}
