/* ============================================================
   AVISON — Kontaktformular
   Eine Quelle fuer die Startseite (Sektion „Wo drueckt der Schuh?")
   und die Projektseiten (im Fuss). Die Farben kommen ueber die
   --footer-Token der umgebenden Flaeche: Startseite .kontakt
   (style.css), Projektseiten .footer__kontakt (unten). Das Absenden
   steuert kontakt.js.
   ============================================================ */

.contact {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
  text-align: left;
}

.contact__field { display: flex; flex-direction: column; gap: 0.5rem; grid-column: span 3; }
.contact__field--full { grid-column: 1 / -1; }
/* Die drei Auswahlfelder stehen nebeneinander in einer Reihe. */
.contact__field--frage { grid-column: span 2; }
@media (max-width: 720px) {
  .contact { grid-template-columns: 1fr; }
  .contact__field, .contact__field--frage, .contact__field--full { grid-column: 1 / -1; }
}
.contact__field label {
  font-family: var(--font-mono);
  /* Zwei Stufen kraeftiger (400 → 600) und groesser: die Fragen sollen
     so fest stehen wie die Antworten darunter. */
  font-weight: 600;
  font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--footer-fg);
}
.contact__field input,
.contact__field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--footer-line);
  color: var(--footer-fg);
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 0.6rem 0.1rem;
  resize: vertical;
  transition: border-color 0.3s;
}
.contact__field input:focus,
.contact__field textarea:focus {
  outline: none;
  border-bottom-color: var(--footer-em);
}
/* Beim Klick ins Feld laeuft einmal der Einstrich (wie beim Einstieg
   der Texte) auf der Grundlinie durch: von links auf volle Breite,
   sofort nach rechts wieder weg. Als eigener Strich auf dem Feldkasten,
   weil ein <input> keinen Hintergrundverlauf animieren kann, ohne die
   Grundlinie zu verlieren. Danach bleibt die Grundlinie in Almond. */
.contact__field { position: relative; }
.contact__field::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--footer-em);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
.contact__field:focus-within::after {
  animation: feldstrich 1.1s cubic-bezier(0.65, 0, 0.35, 1) both;
}
@keyframes feldstrich {
  0%   { transform: scaleX(0); transform-origin: 0 50%; }
  48%  { transform: scaleX(1); transform-origin: 0 50%; }
  52%  { transform: scaleX(1); transform-origin: 100% 50%; }
  100% { transform: scaleX(0); transform-origin: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .contact__field:focus-within::after { animation: none; }
}
/* ---- Vorsortierung: drei Auswahlfelder ----
   Dieselbe Optik wie Name und E-Mail: nur eine Grundlinie, kein
   Kasten. Den Pfeil zeichnet die Huelle per Maske, damit er die
   Textfarbe traegt und mit dem Zustand des Feldes mitgeht. Das
   Auswahlfeld selbst bleibt ein natives <select>: bedienbar mit
   Tastatur, Screenreader und auf dem Handy mit dem Systemrad. */
.contact__select { position: relative; display: block; color: var(--footer-dim); }
.contact__select::after {
  content: "";
  position: absolute; right: 0.1rem; top: 50%;
  width: 0.85rem; height: 0.85rem;
  margin-top: -0.42rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
  transition: transform 0.3s var(--ease-out);
}
.contact__select:hover, .contact__select:focus-within { color: var(--footer-fg); }
.contact__select:focus-within::after { transform: translateY(2px); }

.contact__field select {
  -webkit-appearance: none; appearance: none;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--footer-line);
  border-radius: 0;
  color: var(--footer-fg);
  font-family: var(--font-display);
  font-size: 1.1rem;
  padding: 0.6rem 1.6rem 0.6rem 0.1rem;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}
.contact__field select:invalid { color: var(--footer-dim); }
.contact__field select:hover { border-color: var(--footer-fg); }
.contact__field select:focus { outline: none; border-color: var(--footer-em); }
.contact__field select:focus-visible { outline: 2px solid var(--footer-em); outline-offset: 3px; }
/* Natives Menue (Firefox, Safari, aeltere Chromes): wenigstens die
   Farben der Flaeche statt Systemweiss. */
.contact__field select option { background: var(--footer-bg); color: var(--footer-fg); }
.contact__field select option[value=""] { color: var(--footer-dim); }

/* Wo der Browser es kann (Chrome ab 135), zeichnen wir das
   aufgeklappte Menue selbst: Almond mit Blue Charcoal, beim Zeigen
   Burnt Orange. Ueberall sonst bleibt das native Menue von oben. */
@supports (appearance: base-select) {
  .contact__field select,
  .contact__field select::picker(select) { appearance: base-select; }
  .contact__field select::picker-icon { display: none; }   /* Pfeil kommt von der Huelle */
  .contact__field select::picker(select) {
    margin-top: 0.4rem;
    padding: 0.35rem;
    border: none;
    border-radius: 14px;
    background: #e9dac5;
    color: #232425;
    box-shadow: 0 18px 40px -18px rgba(35, 36, 37, 0.55);
  }
  .contact__field select option {
    padding: 0.6rem 0.9rem;
    border-radius: 9px;
    background: transparent;
    color: #232425;
    font-family: var(--font-display);
    font-size: 1rem;
  }
  .contact__field select option::checkmark { display: none; }
  .contact__field select option[value=""] { display: none; }
  .contact__field select option:hover,
  .contact__field select option:focus-visible {
    background: #be5e21;
    color: #e9dac5;
    outline: none;
  }
  .contact__field select option:checked { font-weight: 700; }
}

.contact__notiz {
  font-family: var(--font-type);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--footer-dim);
  margin-top: -0.4rem;
}

.contact__submit {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex; align-items: center; gap: 0.85rem;
  margin-top: 1rem;
  /* Knopf als Gegenstück zur Footer-Fläche — trägt in beiden Themes */
  background: var(--footer-fg); color: var(--footer-bg);
  border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  padding: 1.1rem 2.25rem; border-radius: 99px;
  transition: background-color 0.35s, color 0.35s;
}
.contact__submit svg { width: 20px; height: 20px; transition: transform 0.35s var(--ease-out); }
.contact__submit:hover svg { transform: translateX(5px); }
.contact__submit.is-sent { background: #8f8f45; color: #f8f6f3; }   /* Moss Green */

/* ---- Im Fuss der Projektseiten ----
   Dunkle Flaeche (Blue Charcoal): Schrift Almond, Akzent Burnt
   Orange. Der Knopf ist Burnt Orange mit Papier, wie „Schreib uns". */
.footer__kontakt {
  --footer-bg: #232425;
  --footer-fg: #e9dac5;
  --footer-dim: rgba(233, 218, 197, 0.7);
  --footer-line: rgba(233, 218, 197, 0.32);
  --footer-em: #be5e21;
  position: relative;
  max-width: 880px;
  margin: clamp(4rem, 8vw, 6.5rem) auto 0;
  text-align: center;
}
.footer__kontakt-titel {
  font-family: var(--font-serif, "Gambarino", serif); font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.05; letter-spacing: -0.015em;
  color: var(--footer-fg);
}
.footer__kontakt .kontakt__direct { margin-top: 1.5rem; }
.footer__kontakt .kontakt__direct a {
  font-family: var(--font-type);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--footer-fg);
  text-decoration: none;
  border-bottom: 1px solid var(--footer-line);
  padding-bottom: 0.15rem;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-origin: border-box;
  background-position: 100% 100%;
  background-size: 0 1px;
  transition: background-size 0.45s var(--ease-out);
}
.footer__kontakt .kontakt__direct a:hover,
.footer__kontakt .kontakt__direct a:focus-visible {
  background-position: 0 100%;
  background-size: 100% 1px;
}
.footer__kontakt .contact__submit {
  background: #be5e21; color: #f8f6f3;
  --wimpern-farbe: #be5e21;
}
