/* Forms ↔ festival API (js/fot-forms.js) · apply.html only.
   The honeypot, the sending state, the notes in the confirmations, the help lines and the add-to-calendar card.
   Builds on css/fot.css tokens (--fg, --fg-2, --hair, --soft, --accent, --accent-t, --err, --mono, --sans, --ease). */

/* honeypot: off-screen, never display:none (bots skip hidden fields) */
.fx-hp { position: absolute !important; left: -10000px; top: auto; inline-size: 1px; block-size: 1px; overflow: hidden; }

/* help lines with the festival email */
body.p-apply .ap-help { display: flex; flex-direction: column; gap: 8px; max-width: 42ch; padding-top: 14px; border-top: 1px solid var(--fg-3); }
body.p-apply .reg__know .ap-help { margin-top: 18px; }
body.p-apply .ap-help .small { font-size: 17px; line-height: 1.5; }

/* sending */
body.p-apply .form.is-busy button[type="submit"] { cursor: progress; }
body.p-apply .form.is-busy button[type="submit"]::before { transform: none; animation: fxPulse 1.4s var(--ease) infinite alternate; }
body.p-apply .form.is-busy button[type="submit"] { color: var(--on-accent); }
body.p-apply .fx-busy { flex-basis: 100%; display: flex; align-items: center; gap: 10px; font: 500 12px/1.4 var(--mono) !important; letter-spacing: .06em; text-transform: uppercase; color: var(--fg) !important; max-width: none !important; }
body.p-apply .fx-busy::before { content: ""; inline-size: 8px; block-size: 8px; background: var(--accent); animation: fxBlink 1s steps(2, start) infinite; flex: none; }
body.p-apply .fx-ts { margin: 4px 0 18px; min-height: 65px; }
@keyframes fxPulse { from { opacity: 1; } to { opacity: .72; } }
@keyframes fxBlink { to { visibility: hidden; } }

/* notes inside the confirmations (preview, spam folder) */
body.p-apply .fx-note { padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--soft); font-size: 17px; line-height: 1.5; max-width: 60ch; }
body.p-apply .fx-note a, body.p-apply .errsum p a { text-decoration: underline; text-underline-offset: 3px; }
body.p-apply .errsum p + p { margin-top: 8px; font-weight: 400; color: var(--fg); }

/* ---------- the add-to-calendar card ---------- */
body.p-apply .fx-cal { margin: 4px 0 2px; }
body.p-apply .cal { display: flex; flex-direction: column; border: 1px solid var(--fg); background: var(--bg); color: var(--fg); }
body.p-apply .cal__top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; padding: 14px 18px; background: var(--soft); border-bottom: 1px solid var(--fg); }
body.p-apply .cal__mark { inline-size: 28px; block-size: 30px; color: var(--fg); }
body.p-apply .cal__brand { display: flex; flex-direction: column; font: 700 14px/1.1 var(--sans); letter-spacing: -.005em; text-transform: uppercase; }
body.p-apply .cal__brand span { font: 500 12px/1.4 var(--mono); letter-spacing: .06em; color: var(--fg-2); }
body.p-apply .cal__lbl { justify-self: end; text-align: right; }

body.p-apply .cal__body { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px 22px; padding: 22px 18px 18px; }
body.p-apply .cal__date { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-right: 18px; border-right: 1px solid var(--hair); align-self: start; }
body.p-apply .cal__date span { font: 500 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); }
body.p-apply .cal__date b { font: 700 68px/.85 var(--sans); letter-spacing: -.05em; color: var(--accent-t); }
body.p-apply .cal__info { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
body.p-apply .cal__title { font: 700 clamp(20px, 1.7vw, 24px)/1.15 var(--sans); letter-spacing: -.01em; }
body.p-apply .cal__meta { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 0 12px; border-top: 1px solid var(--hair); }
body.p-apply .cal__meta div { display: contents; }
body.p-apply .cal__meta dt, body.p-apply .cal__meta dd { padding: 8px 0; border-bottom: 1px solid var(--hair); }
body.p-apply .cal__meta dt { font: 500 12px/1.9 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); }
body.p-apply .cal__meta dd { margin: 0; font-size: 17px; line-height: 1.45; min-width: 0; }
body.p-apply .cal__meta dd span { display: block; color: var(--fg-2); font-size: 15px; }
body.p-apply .cal__k { font: 500 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); margin-bottom: 6px; }
body.p-apply .cal__on ul { display: flex; flex-direction: column; }
body.p-apply .cal__on li { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding: 5px 0; font-size: 15px; line-height: 1.4; }
body.p-apply .cal__on li > span:only-child { grid-column: 1 / -1; }
body.p-apply .cal__on em { font: 500 12px/1.75 var(--mono); font-style: normal; color: var(--fg-2); }
body.p-apply .cal__note { margin: 0 18px 14px; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--soft); font-size: 15px; line-height: 1.45; }
body.p-apply .cal__rule { padding: 0 18px 16px; font: 500 12px/1.5 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-2); }

body.p-apply .cal__btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--fg); }
body.p-apply .cal__btns li { display: flex; border-bottom: 1px solid var(--hair); }
body.p-apply .cal__btns li:nth-child(odd) { border-right: 1px solid var(--hair); }
body.p-apply .cal__b { position: relative; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 0 18px; font: 500 12px/1.25 var(--mono); letter-spacing: .05em; text-transform: uppercase; overflow: hidden; isolation: isolate; transition: color .35s var(--ease); }
body.p-apply .cal__b::before { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateY(101%); transition: transform .45s var(--ease); z-index: -1; }
body.p-apply .cal__b:hover::before, body.p-apply .cal__b:focus-visible::before { transform: none; }
body.p-apply .cal__b:hover, body.p-apply .cal__b:focus-visible { color: var(--on-accent); }
body.p-apply .cal__b:focus-visible { outline: 2px solid var(--fg); outline-offset: -4px; }
body.p-apply .cal__b i { font-style: normal; font-size: 16px; transition: transform .4s var(--ease); }
body.p-apply .cal__b:hover i { transform: translate(2px, -2px); }
body.p-apply .cal__b[data-ics]:hover i { transform: translateY(3px); }

body.p-apply .cal__copy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 6px 18px; }
body.p-apply .cal__cp { min-height: 44px; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; color: var(--fg); }
body.p-apply .cal__cp:hover { color: var(--accent-t); }
body.p-apply .cal__cps { font-size: 15px; color: var(--fg-2); }
body.p-apply .cal__txt { display: block; margin: 0 18px 18px; inline-size: calc(100% - 36px); padding: 10px 12px; border: 1px solid var(--fg-3); background: var(--bg); color: var(--fg); font: 400 13px/1.5 var(--mono); resize: vertical; }
body.p-apply .cal__txt:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 720px) {
  body.p-apply .cal__top { grid-template-columns: auto minmax(0, 1fr); padding: 12px 14px; }
  body.p-apply .cal__lbl { grid-column: 1 / -1; justify-self: start; text-align: left; }
  body.p-apply .cal__body { grid-template-columns: 1fr; padding: 18px 14px 14px; }
  body.p-apply .cal__date { flex-direction: row; align-items: baseline; gap: 10px; padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--hair); width: 100%; }
  body.p-apply .cal__date b { font-size: 52px; }
  body.p-apply .cal__meta { grid-template-columns: 70px minmax(0, 1fr); }
  body.p-apply .cal__note { margin: 0 14px 14px; }
  body.p-apply .cal__rule { padding: 0 14px 14px; }
  body.p-apply .cal__btns { grid-template-columns: 1fr; }
  body.p-apply .cal__btns li:nth-child(odd) { border-right: 0; }
  body.p-apply .cal__b { padding: 0 14px; min-height: 54px; }
  body.p-apply .cal__copy { padding: 4px 14px; }
  body.p-apply .cal__txt { margin: 0 14px 14px; inline-size: calc(100% - 28px); }
}

/* ---------- several evenings: one branded box, one compact row per evening ---------- */
body.p-apply .cal--set .calc__list { display: flex; flex-direction: column; }
body.p-apply .calc { display: flex; flex-direction: column; border-bottom: 1px solid var(--fg); }
body.p-apply .calc__h { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px 18px; padding: 16px 18px 14px; }
body.p-apply .calc .cal__date { padding-right: 14px; }
body.p-apply .calc .cal__date b { font-size: 46px; }
body.p-apply .calc__x { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
body.p-apply .calc .cal__title { font-size: 19px; }
body.p-apply .calc__l { font-size: var(--t-small); line-height: 1.45; color: var(--fg-2); }
body.p-apply .calc__btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--hair); }
body.p-apply .calc__btns li { display: flex; border-right: 1px solid var(--hair); }
body.p-apply .calc__btns li:last-child { border-right: 0; }
body.p-apply .calc__btns .cal__b { min-height: 50px; padding: 0 12px; }
body.p-apply .cal--set .cal__rule { padding-top: 14px; }
/* preview only: what a calendar file button does on the live site */
body.p-apply .cal__note.cal__pv { margin-top: 14px; }
body.p-apply .cal__pv:empty { display: none; }
body.p-apply .rall .cal__note.cal__pv { margin: 12px 0 0; max-width: 60ch; }
@media (max-width: 720px) {
  body.p-apply .calc__h { grid-template-columns: 1fr; padding: 14px; }
  body.p-apply .calc .cal__date b { font-size: 40px; }
  body.p-apply .calc__btns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.p-apply .calc__btns li { border-bottom: 1px solid var(--hair); }
  body.p-apply .calc__btns li:nth-child(2n) { border-right: 0; }
  body.p-apply .calc__btns .cal__b { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  body.p-apply .cal__b, body.p-apply .cal__b::before, body.p-apply .cal__b i { transition: none; }
  body.p-apply .form.is-busy button[type="submit"]::before, body.p-apply .fx-busy::before { animation: none; }
}
@media (forced-colors: active) {
  body.p-apply .cal__b:focus-visible { outline: 2px solid CanvasText; }
  body.p-apply .fx-note, body.p-apply .cal__note { border-left-color: CanvasText; }
}
