/* ============================================================
   Global Voices — Our Discussion Blog

   The topic rail (seventeen SDG colours), post cards, the
   submission form and the moderation queue. Layered on
   css/styles.css and css/pages.css, which already provide
   .cons-head, .post, .reader and .pf-chip.
   ============================================================ */

/* ---------- 1. Policy line under the header ---------------- */

.blog__policy {
  margin: 1.1rem auto 0;
  max-width: 34rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 210, 122, 0.28);
  background: rgba(255, 210, 122, 0.07);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--gold);
}

/* ---------- 2. Topic rail ----------------------------------- */

.blog__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
}

/* Each chip borrows its session's SDG colour through --c, set
   inline by js/blog.js from the same SESSIONS data the course
   uses, so a colour can never drift from its goal. */
.blog__chip {
  --c: var(--orange);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}

.blog__chip-e { font-size: 0.95rem; line-height: 1; }

.blog__chip-t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 11rem;
}

.blog__chip-n {
  padding: 0.05rem 0.42rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.blog__chip:hover {
  color: #fff;
  border-color: color-mix(in srgb, var(--c) 70%, transparent);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  transform: translateY(-1px);
}

.blog__chip.is-on {
  color: #fff;
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 26%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent);
}

.blog__chip.is-on .blog__chip-n { background: rgba(0, 0, 0, 0.3); color: #fff; }

/* color-mix is well supported but not universal; these keep the
   chips legible where it is missing. */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .blog__chip:hover { border-color: var(--c); }
  .blog__chip.is-on { background: rgba(255, 138, 30, 0.24); border-color: var(--c); }
}

/* ---------- 3. Bar above the grid --------------------------- */

.blog__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.4rem;
}

.blog__write { flex: 0 0 auto; }

/* ---------- 4. Post cards ----------------------------------- */

.post { --c: var(--orange); }

.post--seed { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }

.post--seed::before {
  content: "";
  display: block;
  height: 3px;
  margin: -1.6rem -1.7rem 0.35rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--c);
}

.post__seed {
  padding: 0.16rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 210, 122, 0.35);
  background: rgba(255, 210, 122, 0.1);
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post__by {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}

.post__by span {
  display: block;
  font-weight: 400;
  color: var(--ink-faint);
}

.blog__empty { margin: 0; padding: 2.5rem 0; color: var(--ink-faint); line-height: 1.7; }
.blog__empty .post__go { margin: 0; padding: 0; }

/* ---------- 5. Moderation entry ----------------------------- */

.blog__modlink { margin: 2.5rem 0 0; text-align: center; }

.blog__modlink button {
  border: 0;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink-faint);
  font-family: inherit;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}

.blog__modlink button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }

/* ---------- 6. Reader additions ----------------------------- */

.reader__panel--wide { width: min(56rem, 100%); }

.reader__q {
  margin: 1.8rem 0 0;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 138, 30, 0.3);
  background: rgba(255, 138, 30, 0.08);
}

.reader__q h2 {
  margin: 0 0 0.4rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}

.reader__q p { margin: 0 !important; color: #fff !important; font-weight: 600; max-width: none !important; }

.reader__sign span { display: block; font-weight: 400; font-size: 0.85rem; color: var(--ink-faint) !important; }

.reader__foot {
  flex: 0 0 auto;
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-align: right;
}

/* ---------- 7. Submission form ------------------------------ */

.form__lede {
  margin: 0 0 1.6rem;
  max-width: 38rem;
  color: var(--ink-soft);
  line-height: 1.72;
}

.form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 1rem;
}

.form__field { display: block; margin-bottom: 1.1rem; }

.form__field > span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
}

.form__field > span em {
  font-style: normal;
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--orange);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form__field input,
.form__field select,
.form__field textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm, 0.6rem);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
}

.form__field textarea { resize: vertical; min-height: 9rem; }

.form__field input::placeholder,
.form__field textarea::placeholder { color: rgba(255, 255, 255, 0.32); }

.form__field input:focus-visible,
.form__field select:focus-visible,
.form__field textarea:focus-visible {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 138, 30, 0.22);
}

.form__field small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.form__field small.is-short { color: var(--orange); }

/* The honeypot. Off-screen rather than display:none, because some
   bots skip hidden fields but not positioned ones. */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__errors {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 94, 126, 0.45);
  background: rgba(255, 94, 126, 0.1);
  color: #ffc2cf;
  font-size: 0.9rem;
  line-height: 1.6;
}

.form__errors[hidden] { display: none !important; }

.form__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.4rem; }

.form__done { max-width: 34rem; }
.form__done[hidden] { display: none !important; }
.form__done-mark { margin: 0 0 0.6rem; font-size: 2.4rem; line-height: 1; }

.form__done h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 900;
  color: #fff;
}

.form__done p { margin: 0 0 1.4rem; color: var(--ink-soft); line-height: 1.75; }

/* ---------- 8. Moderation queue ----------------------------- */

.mod__signout {
  margin-left: auto;
  border: 1px solid var(--line);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink-faint);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
}

.mod__signout:hover { color: #fff; border-color: rgba(255, 138, 30, 0.5); }
.mod__signout[hidden] { display: none !important; }

.mod__tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.3rem; }

.mod__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
}

.mod__tab.is-on { background: var(--grad-btn); border-color: transparent; color: #fff; }

.mod__list { display: grid; gap: 0.9rem; }

.mod__item {
  padding: 1.2rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  border-left-width: 3px;
}

.mod__item--pending  { border-left-color: var(--orange); }
.mod__item--approved { border-left-color: #4bd07a; }
.mod__item--declined { border-left-color: rgba(255, 255, 255, 0.2); opacity: 0.72; }

.mod__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin: 0 0 0.5rem;
  font-size: 0.76rem;
  color: var(--ink-faint);
}

.mod__status {
  padding: 0.14rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.65rem;
}

.mod__item--pending  .mod__status { color: var(--orange); }
.mod__item--approved .mod__status { color: #6fe09a; }

.mod__title { margin: 0 0 0.3rem; font-size: 1.1rem; font-weight: 800; color: #fff; line-height: 1.3; }

.mod__by { margin: 0 0 0.5rem; font-size: 0.82rem; color: var(--ink-faint); }
.mod__by a { color: var(--ink-soft); }

.mod__stand { margin: 0; font-size: 0.9rem; line-height: 1.65; color: var(--ink-soft); }

.mod__full { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.mod__full[hidden] { display: none !important; }
.mod__full p { margin: 0 0 0.8rem; font-size: 0.92rem; line-height: 1.75; color: var(--ink-soft); }
.mod__q { color: var(--gold) !important; }

.mod__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.mod__btn {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.mod__btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.mod__btn:disabled { opacity: 0.6; }

.mod__btn--yes {
  border-color: rgba(75, 208, 122, 0.5);
  background: rgba(75, 208, 122, 0.14);
  color: #8fe9b0;
}

.mod__btn--yes:hover { background: rgba(75, 208, 122, 0.26); color: #fff; border-color: #4bd07a; }

.mod__btn--no {
  border-color: rgba(255, 94, 126, 0.45);
  background: rgba(255, 94, 126, 0.1);
  color: #ffc2cf;
}

.mod__btn--no:hover { background: rgba(255, 94, 126, 0.24); color: #fff; }

.mod__live { font-size: 0.78rem; font-weight: 700; color: #6fe09a; }

/* ---------- 9. Responsive ----------------------------------- */

@media (max-width: 640px) {
  .blog__bar { display: block; }
  .blog__write { width: 100%; margin-top: 0.8rem; }
  .blog__chip-t { max-width: 8.5rem; }
  .reader__foot { text-align: stretch; }
  .reader__foot .btn { width: 100%; }
  .form__actions .btn { width: 100%; }
  .mod__actions .mod__btn { flex: 1 1 auto; }
}

/* ---------- 10. Reduced motion ------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .blog__chip, .blog__modlink button, .mod__btn { transition: none; }
  .blog__chip:hover { transform: none; }
}
