/* The posting pages (ticket 04): role list, the two message tabs, name,
   flower colour, the notice above Send, and the thank-you. Builds on site.css. */

.posting-back {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-underline-offset: 0.25em;
}

.posting-back::before {
  content: "→ "; /* points back, towards the start of a right-to-left line */
}

.posting-lead {
  margin-bottom: 1rem;
}

.post-form legend {
  margin: 0 0 0.35rem;
}

.post-form .field-label {
  margin: 1rem 0 0.35rem;
}

.post-form .field-label,
.post-form legend {
  display: block;
  padding: 0;
  font-weight: 600;
  color: var(--cocoa);
}

.post-form > label:first-child {
  margin-top: 0;
}

.post-form select,
.post-form textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid var(--stone);
  border-radius: 0.85rem;
  background: #fff;
  color: var(--espresso);
  font: inherit;
  font-size: 1.05rem; /* 16px or more, so phones do not zoom in on focus */
}

.post-form textarea {
  line-height: 1.8;
  resize: vertical;
}

.post-form select:focus-visible,
.post-form textarea:focus-visible {
  outline: 3px solid var(--sand);
  outline-offset: 2px;
}

/* The two tabs */
.post-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 0.95rem;
  background: var(--ivory);
  border: 1px solid var(--stone);
}

.post-tabs button {
  flex: 1;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.3rem 0.5rem;
  border-radius: 0.7rem;
  background: transparent;
  color: var(--cocoa);
}

.post-tabs button[aria-selected="true"] {
  background: var(--cocoa);
  color: #fffdf9;
}

.post-panel {
  margin-top: 0.6rem;
}

/* Ready messages: one tappable row each */
.post-form .choice {
  position: relative;
  display: block;
  margin: 0 0 0.5rem;
  font-weight: 400;
  color: var(--espresso);
}

.post-form .choice input,
.post-form .swatch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.choice span {
  display: block;
  min-height: 3rem;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--stone);
  border-radius: 0.85rem;
  background: #fff;
  line-height: 1.7;
}

.choice input:checked + span {
  border-color: var(--cocoa);
  background: #f6efe6;
  box-shadow: inset 0 0 0 1px var(--cocoa);
}

.choice input:focus-visible + span,
.swatch input:focus-visible + .swatch-flower {
  outline: 3px solid var(--sand);
  outline-offset: 2px;
}

.post-counter {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--cocoa);
  text-align: end;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

/* Flower colour */
.post-colours {
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.3rem;
}

.post-form .swatch {
  position: relative;
  display: block;
  margin: 0;
}

.swatch-flower {
  display: block;
  padding: 0.3rem 0.2rem 0.1rem;
  border: 1.5px solid transparent;
  border-radius: 0.85rem;
}

.swatch input:checked + .swatch-flower {
  border-color: var(--cocoa);
  background: #f6efe6;
}

/* The colour's name is for screen readers; the flower shows it to the eye. */
.swatch-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Ticket 07: the honeypot field. People never see or reach it; a bot that fills it is refused. */
.post-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.post-notice {
  margin: 1.1rem 0 0;
  padding: 0.6rem 0.85rem;
  border-radius: 0.85rem;
  background: var(--ivory);
  border: 1px solid var(--stone);
  font-size: 0.9rem;
  color: var(--cocoa);
}

.post-form button[type="submit"] {
  margin-top: 0.75rem;
}

/* The thank-you */
.post-thanks {
  text-align: center;
}

.post-thanks[hidden],
.post-form[hidden] {
  display: none;
}

.post-thanks:focus {
  outline: none;
}

.post-thanks-flower {
  display: block;
  width: 5.5rem;
  margin: 0 auto 0.5rem;
}

/* The "try again" card, shown when Send cannot reach the server. */
.post-failed button {
  margin-top: 0.6rem;
}

.post-thanks .button-quiet {
  margin-top: 0.6rem;
  background: transparent;
  border: 1.5px solid var(--cocoa);
  color: var(--cocoa);
}
