/* ==========================================================================
   FEEDBACK — light section between Catering (brand-red) and the footer
   (dark). Single narrow column: intro block + the form. Submits straight
   to Supabase's `feedback` table via js/feedback.js (same CDN-client
   pattern as Events); no build step.
   Markup: section#feedback.section.feedback > .container
             > .feedback__inner
                 > .feedback__header (eyebrow, h2, lede)
                 > form.feedback__form[data-feedback-form]
                     > .feedback__field (x4: name, email, rating, message)
                     > .feedback__hp        (off-screen honeypot — bots only)
                     > .feedback__status    (error / success line)
                     > button[type=submit]
   ========================================================================== */

.feedback {
  background: var(--color-bg-primary);
}

.feedback__inner {
  max-width: 620px;
  margin-inline: auto;
}

/* ---- Intro ---------------------------------------------------------------- */
.feedback__header {
  margin-bottom: var(--space-lg);
}

.feedback__header h2 {
  margin-top: 0.25rem;
}

.feedback__lede {
  margin-top: var(--space-sm-lg);
  color: var(--color-text-muted);
  max-width: 46ch;
}

/* ---- Form --------------------------------------------------------------- */
.feedback__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.feedback__field {
  display: flex;
  flex-direction: column;
}

.feedback__label {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.feedback__required {
  color: var(--color-brand-red);
}

.feedback__input,
.feedback__textarea {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--color-text-primary);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-btn);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition-fast);
}

.feedback__input:focus-visible,
.feedback__textarea:focus-visible {
  border-color: var(--color-brand-red);
}

.feedback__textarea {
  min-height: 120px;
  resize: vertical;
  line-height: var(--lh-body-sm);
}

/* ---- Star rating -------------------------------------------------------- */
/* Inputs sit before their labels in the DOM in DESCENDING value order
   (5 → 1) and the row is reversed, so the general-sibling combinator can
   light up "this star and every lower one". Radios are visually hidden but
   stay in the tab order and focusable. */
.feedback__stars {
  position: relative;
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.15rem;
}

/* Radios stay in the DOM (so :checked ~ and keyboard nav work) but are
   pinned to 1px in the corner of the group and covered by the labels —
   position:relative on the parent keeps them from escaping to the page. */
.feedback__star-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.feedback__star {
  display: inline-flex;
  padding: 0.15rem;
  color: rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.feedback__star svg {
  width: 30px;
  height: 30px;
}

.feedback__star-input:checked ~ .feedback__star {
  color: var(--color-brand-red);
}

/* While hovering the group, ignore the checked state and preview the
   hovered value instead. */
.feedback__stars:hover .feedback__star {
  color: rgba(0, 0, 0, 0.16);
}

.feedback__star:hover,
.feedback__star:hover ~ .feedback__star {
  color: var(--color-brand-red);
}

.feedback__star-input:focus-visible + .feedback__star {
  outline: 2px solid var(--color-brand-red);
  outline-offset: 2px;
  border-radius: var(--radius-btn);
}

/* ---- Honeypot ---------------------------------------------------------- */
/* Off-screen rather than display:none / visibility:hidden — some bots skip
   fields hidden those ways but will still fill a plainly-labelled visible
   input. Real users never see or tab to it (aria-hidden + tabindex=-1 set
   on the markup). */
/* Truly off the canvas — NOT display:none / visibility:hidden / opacity:0,
   which some bots detect and skip. Real users never see it; aria-hidden +
   tabindex=-1 on the markup keep screen readers and keyboard nav out. */
.feedback__hp {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Status line ------------------------------------------------------- */
.feedback__status {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}

.feedback__status--error {
  color: var(--color-brand-red);
}

.feedback__status--success {
  color: #1c7c3f;
}

/* ---- Submit ----------------------------------------------------------- */
.feedback__submit {
  align-self: flex-start;
}

@media (max-width: 768px) {
  .feedback__submit {
    align-self: stretch;
  }
}
