/* host page: the form for adding an event, and the "what happens next" list */

.host {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  max-width: var(--max);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(3rem, 6vw, 5rem);
}
/* form on the left, the list on the right on bigger screens */
@media (min-width: 60em) {
  .host { grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); align-items: start; }
}

/* the numbered question labels: "01 what kind of thing?" */
.step { display: block; margin-bottom: 0.75rem; }
.step__number { margin-right: 0.5em; }
.step__optional { opacity: 0.7; }


/* ---- the four type cards (repair, swap, gather, share) ---- */

.types { margin: 0 0 2.25rem; padding: 0; border: 0; }
.types legend { padding: 0; }
.types__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
@media (min-width: 48em) {
  .types__grid { grid-template-columns: repeat(4, 1fr); }
}

.type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 8rem;
  padding: 1rem;
  border: var(--rule-thick);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
/* the real radio button is hidden, the whole card is the button */
.type-card input { position: absolute; left: 50%; bottom: 0.5rem; opacity: 0; pointer-events: none; }
.type-card:hover { background: var(--fg-soft); }
.type-card:has(input:checked) { background: var(--fg); color: var(--bg); }
.type-card:has(input:focus-visible) { outline: 3px solid var(--fg); outline-offset: 3px; }
.type-card__name {
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.type-card__examples { font-size: 0.85rem; font-weight: 600; line-height: 1.3; }


/* ---- text boxes and dropdowns ---- */

.field { margin-bottom: 2rem; }
.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0;
  border: 0;
  border-bottom: var(--rule-thick);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 6rem; resize: vertical; }
.field input[type="time"] { max-width: 9rem; }
.field ::placeholder { color: var(--fg); opacity: 0.55; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline: none; background-color: color-mix(in srgb, var(--pop) 22%, transparent); }

/* the little arrow on the dropdown, drawn in the text color so it works in high contrast too */
.field select {
  padding-right: 2rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg) 50%),
    linear-gradient(135deg, var(--fg) 50%, transparent 50%);
  background-position: calc(100% - 0.85rem) 55%, calc(100% - 0.45rem) 55%;
  background-size: 0.4rem 0.4rem;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field__hint { max-width: 46ch; margin: -0.25rem 0 0.75rem; font-size: 0.9rem; font-weight: 600; }
.field__small-label { display: block; margin-bottom: 0.25rem; font-size: 0.85rem; font-weight: 700; }

fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
fieldset.field legend { padding: 0; }

/* day and start time next to each other */
.field--when > div { margin-bottom: 0.75rem; }
@media (min-width: 36em) {
  .field--when { display: grid; grid-template-columns: 1fr auto auto; gap: 0 1.5rem; align-items: end; }
  .field--when legend { grid-column: 1 / -1; }
}


/* ---- checkboxes (access options and the ok box) ---- */

.checks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.55em 0.9em 0.55em 0.6em;
  border: 2px solid var(--fg);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
/* our own square box with a check mark, instead of the browser's */
.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.15em; height: 1.15em;
  margin: 0;
  border: 2px solid currentColor;
  background: none;
  color: inherit;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.check input::before {
  content: "";
  width: 0.6em; height: 0.35em;
  border: solid currentColor;
  border-width: 0 0 3px 3px;
  transform: translateY(-0.08em) rotate(-45deg) scale(0);
  transition: transform 0.12s;
}
.check input:checked::before { transform: translateY(-0.08em) rotate(-45deg) scale(1); }
.check:hover { background: var(--fg-soft); }
.check:has(input:checked) { background: var(--fg); color: var(--bg); }
.check:has(input:focus-visible) { outline: 3px solid var(--fg); outline-offset: 3px; }
.check input:focus-visible { outline: none; }

/* "i'm ok with this being shown publicly" is just a plain box, no border */
.check--plain { display: flex; margin: 0 0 1.75rem; border: 0; padding: 0; background: none !important; color: inherit !important; }
.check--plain span { max-width: 46ch; }


/* ---- under the button ---- */

.small-print { max-width: 46ch; margin: 1.5rem 0 0; font-size: 0.9rem; font-weight: 600; }
.small-print a { font-weight: 800; }


/* ---- "what happens next" ---- */

.next-steps { padding-top: 1rem; border-top: var(--rule-thick); }
.next-steps h2 { margin: 0 0 1rem; }
.next-steps ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.next-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  padding: 0.9rem 0;
  border-bottom: var(--rule);
  font-weight: 600;
}
.next-steps li::before {
  content: counter(step);
  font-stretch: 125%;
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.2;
}
