/*
 * Gift a Bag (itk-community 2.0): a request, and comments under it. Colors come from the theme's tokens only, so a
 * palette change carries through. The ask box and the cards carry the one loud move (ink border, offset shadow);
 * everything else stays quiet. Prefix: gb-. Reduced motion respected at the bottom.
 */

.gb { --gb-gap: clamp(28px, 4vw, 56px); }
.gb [hidden] { display: none !important; }

/* ---------- shared bits ---------- */

.gb-av {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); font: 700 17px/1 var(--sans);
}
.gb-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gb-who__t { display: flex; flex-direction: column; min-width: 0; }
.gb-who__t strong { font-size: 16px; color: var(--ink); line-height: 1.25; }
.gb-who__t small { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.gb-chip-done {
  margin-left: auto; flex: none; padding: 3px 9px; border: 2px solid var(--green); color: var(--green);
  font: 600 12px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}

.gb-in {
  width: 100%; box-sizing: border-box; min-height: 48px; padding: 11px 13px;
  border: 1px solid var(--rule); border-radius: 0; background: var(--white); color: var(--ink); font: 500 16px/1.45 var(--sans);
}
textarea.gb-in { resize: vertical; min-height: 84px; }
.gb-in:hover { border-color: var(--ink); }
.gb-in:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--focus-ring); }
.gb-f { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; min-width: 0; }
.gb-f > span { font-size: 14px; font-weight: 700; color: var(--ink); }
.gb-f em { font-style: normal; font-weight: 400; color: var(--muted); }
.gb-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, .8fr); gap: 0 12px; }
.gb-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gb-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.gb-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--ink); border-radius: var(--btn-radius); background: var(--white); color: var(--ink);
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
}
.gb-btn:hover { background: var(--rule-lt); color: var(--ink); text-decoration: none; }
.gb-btn--primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.gb-btn--primary:hover { background: var(--blue-d); border-color: var(--blue-d); color: var(--on-blue); }
.gb-btn:focus-visible, .gb-link:focus-visible, .gb-act:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.gb-btn:disabled { opacity: .6; cursor: progress; }
.gb-link {
  padding: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.gb-link:hover { color: var(--ink); }

.gb-send { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.gb-fine { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.gb-msg { margin: 10px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--green); }
.gb-msg:empty { display: none; }
.gb-msg--bad { color: var(--red); }

/* The loud box: ink border and an offset shadow, like the label it used to be. */
.gb-box { position: relative; padding: 18px; background: var(--white); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.gb-box__h { margin: 0 0 12px; font: 800 22px/1.15 var(--display); color: var(--ink); }

/* ---------- board ---------- */

.k-section.gb-hero { padding-bottom: 0; }
.gb .gb-hero__h1 { margin-top: 22px; }
.gb-hero__lede { margin-top: 18px; max-width: 58ch; }
.gb-tally { margin: 16px 0 0; font-family: var(--mono); font-size: 13px; color: var(--muted); }

.gb-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: var(--gb-gap); align-items: start; }
.gb-feed { min-width: 0; max-width: 760px; padding-right: 6px; }

.gb-ask__more { display: none; margin-top: 14px; }
.gb-ask.is-open .gb-ask__more, .gb-ask:focus-within .gb-ask__more { display: block; }
.gb-ask__title { margin-bottom: 10px; font-weight: 700; }
.gb-ask__body { min-height: 110px; }
.gb-add em { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 4px; }

.gb-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.gb-photos:empty { display: none; }
.gb-photo { position: relative; margin: 0; width: 92px; height: 92px; border: 1px solid var(--rule); background: var(--panel); }
.gb-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gb-photo button { position: absolute; right: 3px; bottom: 3px; padding: 3px 7px; border: 0; background: var(--ink); color: var(--on-ink); font: 600 11.5px var(--sans); cursor: pointer; }
.gb-add { position: relative; display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 14px; padding: 0 14px; border: 1px dashed var(--ink); cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.gb-add:hover { background: var(--panel); }
.gb-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.gb-add:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }

.gb-mine__h, .gb-feed__h, .gb-side__h, .gb-thread__h {
  margin: 0 0 14px; font: 500 12.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
[data-gb-mine] { margin-bottom: 26px; }
.gb-mine { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--ink); background: var(--panel); color: var(--ink); text-decoration: none; }
.gb-mine span { font-weight: 700; font-size: 15.5px; }
.gb-mine small { font-size: 13.5px; color: var(--muted); }
.gb-mine:hover span { color: var(--blue); }

.gb-feed__h { margin-top: 44px; }
.gb-cards { display: flex; flex-direction: column; gap: 16px; }
.gb-empty { margin: 0; padding: 22px; border: 1px dashed var(--rule); color: var(--body); font-size: 16px; }

.gb-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; min-width: 0;
  background: var(--white); border: 1px solid var(--rule); color: var(--ink); text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.gb-card:hover { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); color: var(--ink); text-decoration: none; }
.gb-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.gb-card__title { font: 800 20px/1.2 var(--display); color: var(--ink); overflow-wrap: anywhere; }
.gb-card__body {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 16px; line-height: 1.55; color: var(--body-2);
}
.gb-card__img { display: block; width: 100%; height: 220px; object-fit: cover; border: 1px solid var(--rule-lt); }
.gb-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--rule-lt); font-size: 14.5px; }
.gb-card__n { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.gb-card__go { font-weight: 700; color: var(--blue); }
.gb-card__go::after { content: "\00a0\2192"; }
.gb-card.is-gifted { background: var(--panel); }
.gb-card.is-gifted .gb-card__go { color: var(--ink); }

.gb-side { position: sticky; top: 96px; }
.gb-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.gb-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.gb-steps__n {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); font-family: var(--mono); font-size: 12.5px; font-weight: 600;
}
.gb-steps strong { display: block; font-size: 16px; color: var(--ink); }
.gb-steps p { margin: 3px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--body); }
.gb-rule { margin: 18px 0 0; padding: 14px 16px; background: var(--panel); font-size: 14.5px; line-height: 1.55; color: var(--body); }
.gb-rule strong { color: var(--ink); }

/* ---------- one request ---------- */

.gb-one > * { max-width: 820px; }
.gb-back { display: inline-block; margin-bottom: 22px; font-size: 15px; font-weight: 600; color: var(--blue); }
.gb-back::before { content: "\2190\00a0"; }

.gb-banner { margin: 0 0 18px; padding: 12px 16px; border: 2px solid var(--rule); font-size: 15.5px; line-height: 1.5; color: var(--body-2); }
.gb-banner--done { border-color: var(--green); color: var(--green); font-weight: 600; }
.gb-banner--wait { border-color: var(--ink); background: var(--panel); color: var(--ink); }
.gb-banner--bad { border-color: var(--red); color: var(--red); }

.gb-post { padding: 22px; background: var(--white); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.gb-who--lg .gb-av { width: 52px; height: 52px; font-size: 22px; }
.gb .gb-post__title { margin: 18px 0 0; font: 800 clamp(26px, 3.4vw, 40px)/1.1 var(--display); color: var(--ink); overflow-wrap: anywhere; }
.gb-who--lg .gb-who__t strong { font-size: 17px; }
.gb-post__body { margin-top: 18px; font-size: 17.5px; line-height: 1.65; color: var(--body-2); overflow-wrap: anywhere; }
.gb-post__body p { margin: 0 0 .9em; }
.gb-post__body p:last-child { margin-bottom: 0; }
.gb-pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 18px; }
.gb-pics--1 { grid-template-columns: minmax(0, 1fr); }
.gb-pics a { display: block; background: var(--panel); }
.gb-pics img { display: block; width: 100%; height: 100%; max-height: 520px; aspect-ratio: 4 / 3; object-fit: cover; }
.gb-pics--1 img { aspect-ratio: auto; object-fit: contain; }

.gb-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 18px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--ink); }
.gb-owner__t { flex: 1 1 260px; font-size: 14.5px; line-height: 1.5; color: var(--body-2); }
.gb-owner .gb-btn { min-height: 42px; padding: 0 16px; font-size: 14.5px; }

.gb-thread { margin-top: 40px; }
.gb-thread__h span:not(:empty)::before { content: "\00b7\00a0"; }
.gb-cs { list-style: none; margin: 0 0 18px; padding: 0; }
.gb-c { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--rule); }
.gb-c:last-child { border-bottom: 1px solid var(--rule); }
.gb-c__main { flex: 1; min-width: 0; }
.gb-c__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.gb-c__head strong { font-size: 15.5px; color: var(--ink); }
.gb-c__head time, .gb-c--note time { font-size: 13px; color: var(--muted); }
.gb-c__body { margin-top: 4px; font-size: 16px; line-height: 1.55; color: var(--body-2); overflow-wrap: anywhere; }
.gb-c--owner { margin: 0 -14px; padding-left: 14px; padding-right: 14px; background: var(--panel); }
.gb-c--owner .gb-av { background: var(--blue); color: var(--on-blue); }
.gb-badge { padding: 2px 7px; background: var(--ink); color: var(--on-ink); font: 600 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.gb-c--note { align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--body); }
.gb-c__note::before { content: "\2709\00a0"; }
.gb-c.is-new { animation: gb-in .5s ease; }
@keyframes gb-in { from { background: var(--focus-ring); } }

.gb-c__acts:empty { display: none; }
.gb-c__acts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.gb-act { padding: 0; border: 0; background: none; font: 600 13.5px var(--sans); color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.gb-act:hover { color: var(--ink); }
.gb-act--go { padding: 7px 12px; background: var(--blue); color: var(--on-blue); text-decoration: none; }
.gb-act--go:hover { background: var(--blue-d); color: var(--on-blue); }

.gb-first { margin: 0 0 18px; color: var(--body); font-size: 15.5px; }
.gb-say .gb-in { min-height: 0; }
.gb-say textarea { margin-bottom: 12px; }
.gb-say .gb-fine { margin: -4px 0 14px; }
.gb-as { margin: 0 0 14px !important; }

.gb-pop { margin: 10px 0 6px; padding: 14px; border: 1px solid var(--ink); background: var(--white); }
.gb-c .gb-pop { margin-top: 12px; }
.gb-pop__h { margin: 0 0 4px; font-weight: 700; font-size: 16px; color: var(--ink); }
.gb-pop > .gb-fine { margin-bottom: 14px; }
.gb-report-wrap { margin: 26px 0 0; }

/* ---------- homepage band ---------- */

.gb-home__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.gb-doors { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
@media (min-width: 701px) {
  .gb-home__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; padding: 0 6px 6px 0; overflow: visible; }
}
.gb-home__cards .gb-card__img { height: 150px; }
.gb-home__cards .gb-card__title { font: 800 20px/1.2 var(--display); color: var(--ink); overflow-wrap: anywhere; }
.gb-card__body { -webkit-line-clamp: 3; }

/* ---------- small screens ---------- */

@media (max-width: 960px) {
  .gb-layout, .gb-home__grid { grid-template-columns: minmax(0, 1fr); }
  .gb-side { position: static; }
  .gb-feed { max-width: none; }
}
@media (max-width: 700px) {
  .gb-row, .gb-row--2 { grid-template-columns: minmax(0, 1fr); }
  .gb-box, .gb-post { padding: 16px; box-shadow: 4px 4px 0 var(--ink); }
  .gb-post__body { font-size: 16.5px; }
  .gb-c .gb-pop { margin-left: -52px; }
  .gb-home__cards > .gb-card { margin-right: 6px; }
  .gb-ask .gb-send .gb-btn, .gb-say .gb-send .gb-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .gb-card, .gb-card:hover { transition: none; transform: none; }
  .gb-c.is-new { animation: none; }
}
.gb-home__cards .gb-card__title { font-size: 17px; }
