/* ==========================================================================
   Hayfolk Hotline — theme
   Plain CSS. Three colors: white background, green (#0e874f) chrome,
   yellow (#f5cb4d) for the logo, accepted answers, and focus accents.
   ========================================================================== */

:root {
  --green: #0e874f;
  --green-dark: #0a6b3e;
  --green-soft: #e7f3ec;
  --yellow: #f5cb4d;
  --yellow-soft: #fdf6dd;
  --ink: #1c2b26;
  --muted: #64766f;
  --border: #dfe6e2;
  --bg: #ffffff;
  --danger: #b3261e;
  --content-width: 760px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 30, 0.06), 0 4px 14px rgba(16, 40, 30, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
  color: var(--green-dark);
}

h1, h2, h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  background: var(--green);
  min-height: 90px;
  display: flex;
  align-items: center;
}

.site-header__inner {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand__logo {
  display: block;
  height: 52px;
  width: auto;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav__link {
  color: #eaf6ef;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav__link:hover,
.site-nav__link--active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* --- Layout ------------------------------------------------------------- */

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head__title {
  margin: 0;
  font-size: 1.6rem;
  flex: 1;
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.spacer { flex: 1; }

/* --- Flash -------------------------------------------------------------- */

.flash {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-weight: 500;
}

.flash--notice {
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid #c7e3d4;
}

.flash--alert {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f4c7c3;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  background: #eef2f0;
  color: var(--ink);
  line-height: 1.2;
}

.btn:hover { background: #e2e8e5; }

.btn--primary {
  background: var(--green);
  color: #fff;
}

.btn--primary:hover { background: var(--green-dark); }

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.btn--ghost:hover { background: #f4f7f5; }

.btn--danger {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
  padding-left: 8px;
  padding-right: 8px;
}

.btn--danger:hover { background: #fdecea; }

.btn--small { padding: 6px 12px; font-size: 0.85rem; }

.btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Cards & lists ------------------------------------------------------ */

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.question-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.question-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.question-item__main { flex: 1; min-width: 0; }

.question-item__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.question-item__title a { color: var(--ink); text-decoration: none; }
.question-item__title a:hover { color: var(--green-dark); text-decoration: underline; }

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.meta__sep { color: var(--border); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
}

.badge--answered {
  background: var(--yellow);
  color: #5a4600;
}

/* --- Avatars ------------------------------------------------------------ */

.avatar {
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.avatar--initials {
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* --- Question / answer body -------------------------------------------- */

.question__title {
  font-size: 1.7rem;
  margin: 0 0 10px;
}

.question__body,
.answer__body {
  margin-top: 14px;
}

.answer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  background: #fff;
}

.answer--accepted {
  border-color: var(--yellow);
  background: var(--yellow-soft);
  box-shadow: inset 4px 0 0 var(--yellow);
}

.answer__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 6px;
}

.answer__accepted-label {
  color: #5a4600;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.answer__accepted-label::before {
  content: "★";
  color: var(--yellow);
  -webkit-text-stroke: 0.5px #b99000;
}

.answer__actions { margin-left: auto; }

.answers-heading {
  font-size: 1.1rem;
  margin: 28px 0 12px;
}

.answers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 28px 0 12px;
}

.answers-head .answers-heading { margin: 0; }

.answer-form { margin-top: 24px; }

/* --- Tags (Lexxy `?`/`!` chips) ---------------------------------------- */

.tag-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tag-chip:hover { background: #d6ebdf; }

.tag-chip__icon {
  color: var(--green);
  font-weight: 800;
}

/* --- Forms -------------------------------------------------------------- */

.form-field { margin-bottom: 18px; }

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.input,
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  background: #fff;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  outline: 2px solid var(--yellow);
  outline-offset: 0;
}

.hint { color: var(--muted); font-size: 0.82rem; margin-top: 5px; }

.errors {
  background: #fdecea;
  border: 1px solid #f4c7c3;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  color: var(--danger);
}

.errors ul { margin: 6px 0 0; padding-left: 18px; }

/* Lexxy editor sizing */
lexxy-editor {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 140px;
}

lexxy-editor:focus-within {
  border-color: var(--green);
  outline: 2px solid var(--yellow);
}

/* --- Pagination (Pagy) -------------------------------------------------- */

.pagy {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 28px 0 0;
  font-size: 0.9rem;
}

.pagy a,
.pagy span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--border);
}

.pagy a:hover { background: #f4f7f5; }

.pagy [aria-current="page"],
.pagy .current {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 700;
}

.pagy .gap { border: none; }

/* --- Invitations -------------------------------------------------------- */

.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.pill--pending { background: var(--green-soft); color: var(--green-dark); }
.pill--accepted { background: var(--yellow); color: #5a4600; }
.pill--expired { background: #f1f1ef; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; }
.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

/* On phones a table turns into one card per row, each cell labeled by its
   column via data-label. */
@media (max-width: 560px) {
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 6px 0;
  }

  .table td {
    border-bottom: none;
    padding: 6px 14px;
  }

  .table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 2px;
  }
}

/* --- Avatar menu (details/summary) ------------------------------------- */

.menu { position: relative; }

.menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  border-radius: 50%;
}

.menu > summary::-webkit-details-marker { display: none; }

.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 190px;
  z-index: 20;
  display: grid;
}

.menu__panel a,
.menu__panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: none;
  font: inherit;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
}

.menu__panel a:hover,
.menu__panel button:hover { background: #f4f7f5; }

.menu__name {
  padding: 8px 12px 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Misc --------------------------------------------------------------- */

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.auth-card {
  max-width: 420px;
  margin: 24px auto;
}

.stack > * + * { margin-top: 14px; }

/* --- Settings avatar field --------------------------------------------- */

.avatar-field {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --- Lexxy prompt menu items ------------------------------------------- */

.prompt-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.prompt-item__icon {
  color: var(--green);
  font-weight: 800;
}

.prompt-item__hint { color: var(--muted); font-size: 0.85em; }

@media (max-width: 560px) {
  .brand__logo { height: 40px; }
  .site-header { min-height: 74px; }
  .site-nav__link { padding: 8px 9px; }
}
