/* ══════════════════════════════════════════
   Feedback Bubble — site-wide "Have a question
   or suggestion?" launcher + form modal.
   Self-contained; mirrors the .edit-modal pattern.
   ══════════════════════════════════════════ */

/* ── Launcher bubble ──
   Default placement: anchored to the lower-right of the page's title
   banner (.page-hero / .home-hero gets .fb-has-bubble). Falls back to a
   fixed bottom-right float on pages with no banner. */
.fb-has-bubble { position: relative; }

.fb-bubble {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 36px);
  padding: 10px 17px 10px 14px;
  background: var(--color-forest-900, #1f3d12);
  color: #fff;
  border: 1px solid rgba(245, 238, 220, 0.35);
  border-radius: 26px;
  font-family: var(--font-body, "Lora", serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* Fallback for pages without a title banner (e.g. the home page).
   Rendered 50% larger than the in-banner bubble. */
.fb-bubble--floating {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 8500;
  max-width: calc(100vw - 40px);
  gap: 12px;
  padding: 15px 26px 15px 21px;
  font-size: 21px;
  border-radius: 30px;
}
.fb-bubble--floating .fb-bubble__icon { font-size: 27px; }

.fb-bubble:hover,
.fb-bubble:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 9px 26px rgba(0, 0, 0, 0.34);
  background: #1a3a0a;
  outline: none;
}

.fb-bubble__icon { font-size: 18px; line-height: 1; }
.fb-bubble__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* On narrow screens collapse to a round icon-only bubble. */
@media (max-width: 560px) {
  .fb-bubble { padding: 0; width: 52px; height: 52px; justify-content: center; border-radius: 50%; }
  .fb-bubble__label { display: none; }
  .fb-bubble__icon { font-size: 22px; }
  /* Floating (home) bubble 50% larger on mobile too. */
  .fb-bubble--floating { width: 78px; height: 78px; }
  .fb-bubble--floating .fb-bubble__icon { font-size: 33px; }
}

/* ── Modal (mirrors .edit-modal) ── */
.fb-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9500;
  align-items: center;
  justify-content: center;
}
.fb-modal.open { display: flex; }

.fb-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.fb-modal__panel {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 26px 28px;
  max-width: 520px;
  width: 90vw;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  z-index: 1;
  max-height: 88vh;
  overflow-y: auto;
}

.fb-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
}
.fb-modal__close:hover { color: #444; }

.fb-modal__title {
  font-family: var(--font-display, "Playfair Display", serif);
  font-size: 20px;
  color: var(--surface-mid, #2d2d2d);
  margin: 0 0 4px;
}
.fb-modal__intro { font-size: 13px; color: var(--text-muted, #777); margin: 0 0 14px; }

/* Honeypot — kept in the layout but off-screen so bots fill it, people don't. */
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.fb-field { margin-top: 14px; }
.fb-field > label,
.fb-fieldset > legend {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.fb-fieldset { border: none; padding: 0; margin: 14px 0 0; }

/* Category chips */
.fb-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid #ccc;
  border-radius: 18px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.fb-cat input { margin: 0; accent-color: var(--color-forest-900, #1f3d12); }
.fb-cat.is-on {
  border-color: var(--color-forest-900, #1f3d12);
  background: #eef3e6;
  color: var(--color-forest-900, #1f3d12);
  font-weight: 600;
}

.fb-modal__panel select,
.fb-modal__panel input[type="text"],
.fb-modal__panel input[type="email"],
.fb-modal__panel textarea {
  width: 100%;
  font-family: var(--font-body, "Lora", serif);
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background: #fff;
}
.fb-modal__panel textarea { min-height: 110px; resize: vertical; }
.fb-modal__panel select:focus,
.fb-modal__panel input:focus,
.fb-modal__panel textarea:focus { outline: none; border-color: var(--color-forest-900, #1f3d12); }

.fb-row { display: flex; gap: 12px; }
.fb-row .fb-field { flex: 1; }

.fb-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
  align-items: center;
}
.fb-actions button {
  padding: 9px 22px;
  border-radius: 5px;
  font-size: 14px;
  font-family: var(--font-body, "Lora", serif);
  cursor: pointer;
}
.fb-btn-submit { background: var(--color-forest-900, #1f3d12); color: #fff; border: none; }
.fb-btn-submit:hover { background: #1a3a0a; }
.fb-btn-submit:disabled { opacity: 0.6; cursor: default; }
.fb-btn-cancel { background: none; border: 1px solid #ccc; color: #555; }

.fb-status { font-size: 13px; margin-right: auto; min-height: 18px; }
.fb-status--ok { color: #3a5e16; }
.fb-status--err { color: #b3261e; }

/* Success state replaces the form body */
.fb-done { text-align: center; padding: 22px 8px 8px; }
.fb-done__check { font-size: 40px; color: #3a5e16; line-height: 1; }
.fb-done__msg { font-size: 15px; color: var(--surface-mid, #2d2d2d); margin: 12px 0 4px; }
.fb-done__sub { font-size: 13px; color: var(--text-muted, #777); }
