/* The field kit: the free things we make (parts/kit.py). Used on field-kit.html, the homepage
   strip and the "Free for …" strip on the trade and job pages. */

/* ---------- what is under every pamphlet ---------- */
/* a report: the cover whole, standing on a sunk panel */

.kit-card__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 500 11px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kit-kind { color: var(--carmine); }
.kit-date { letter-spacing: .04em; }
.kit-new { padding: 4px 8px; border-radius: var(--radius-pill); background: var(--carmine); color: var(--on-carmine); }
.kit-card__p { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.kit-card__who { margin-top: 12px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.kit-card__go { margin-top: auto; padding-top: var(--space-4); font-style: normal; font-size: 15px; font-weight: 500; }
.kit-book .mb-arrow, .kit-strip__all .mb-arrow { display: inline-block; transition: transform .2s ease; }
.kit-book:hover .mb-arrow, .kit-strip__all:hover .mb-arrow { transform: translateX(3px); }
[dir=rtl] .kit-book:hover .mb-arrow, [dir=rtl] .kit-strip__all:hover .mb-arrow { transform: translateX(-3px); }

/* ---------- the field kit page ---------- */
.kit-hero { padding: var(--space-24) 0 0; }
.kit-hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-12); align-items: end; margin-top: var(--space-6); }
.kit-hero__grid .lead { padding-bottom: 10px; }

.kit-all { padding-top: var(--space-16); }
.kit-all .kit-chips { margin-bottom: var(--space-12); }
.kit-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-chip { appearance: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); font: 500 14px/1 var(--font-sans); cursor: pointer; transition: border-color .2s ease, background .2s ease, color .2s ease; }
.kit-chip span { font: 500 12px/1 var(--font-mono); color: var(--muted); }
.kit-chip:hover { border-color: var(--ink); color: var(--ink); }
.kit-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.kit-chip[aria-pressed="true"] span { color: inherit; opacity: .7; }
.kit-chip:focus-visible { outline: 2px solid var(--carmine); outline-offset: 2px; }
.kit-empty { color: var(--muted); }
.kit-empty[hidden] { display: none; }

.kit-next { padding-top: 0; }
.kit-next__in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-8); align-items: center; padding: var(--space-8); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.kit-next__k { margin: 0; font: 500 11px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--carmine); }
.kit-next__t { margin: 0; font-size: 18px; line-height: 1.45; color: var(--ink); text-wrap: pretty; }

/* ---------- the shelf: every one a pamphlet (field-kit.html) ---------- */
/* The cover is sized in its own width (cqi), so a longer title in another language shrinks with the book. */
.kit-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-16) var(--space-8); }
.kit-shelf > li[hidden] { display: none; }
.kit-book { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.kit-book:focus-visible { outline: none; }
.kit-book:focus-visible .kb { outline: 2px solid var(--carmine); outline-offset: 6px; }

.kb { position: relative; display: block; aspect-ratio: 5 / 7; container-type: inline-size; background: var(--kb-bg); color: var(--kb-ink);
  border-radius: 3px 8px 8px 3px;
  /* the pages under the cover, then the shadow on the table */
  box-shadow: 2px 2px 0 -1px #fbfaf6, 2px 2px 0 0 rgba(18,18,17,.12), 4px 4px 0 -1px #f3f1ea, 4px 4px 0 0 rgba(18,18,17,.12),
              0 24px 34px -18px rgba(18,18,17,.45), 0 4px 10px -6px rgba(18,18,17,.25);
  transform-origin: 30% 100%; transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s ease; }
/* the fold of the spine */
.kb::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6.5cqi; border-radius: 3px 0 0 3px; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.26), rgba(0,0,0,.06) 45%, rgba(255,255,255,.18) 60%, rgba(0,0,0,.04) 100%); }
/* a little light across the paper */
.kb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.10), rgba(255,255,255,0) 40%, rgba(0,0,0,.06)); }
.kit-book:hover .kb { transform: translateY(-8px) rotate(-1.2deg);
  box-shadow: 2px 2px 0 -1px #fbfaf6, 2px 2px 0 0 rgba(18,18,17,.12), 4px 4px 0 -1px #f3f1ea, 4px 4px 0 0 rgba(18,18,17,.12),
              0 40px 46px -22px rgba(18,18,17,.5), 0 6px 14px -8px rgba(18,18,17,.3); }

.kb__in { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 8cqi 8cqi 7cqi 12cqi; }
.kb__top, .kb__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 3cqi; font: 500 3.5cqi/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.kb__top { padding-bottom: 3.2cqi; border-bottom: 1px solid color-mix(in srgb, currentColor 28%, transparent); opacity: .85; }
.kb__kind { margin-top: 8cqi; font: 500 3.6cqi/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--kb-accent); }
.kb__t { margin-top: 2.6cqi; font-size: 12.5cqi; line-height: .96; font-weight: 600; letter-spacing: -0.04em; text-wrap: balance; overflow-wrap: anywhere; hyphens: auto; }
.kb__sub { margin-top: 3cqi; font-size: 4.6cqi; line-height: 1.3; opacity: .78; text-wrap: balance; }
.kb__art { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; margin: 3cqi -2cqi 3cqi -4cqi; }
.kb__art svg { display: block; width: 100%; height: 100%; max-height: 100%; }
.kb__pic { display: block; width: 116%; max-width: none; height: auto; max-height: 100%; object-fit: contain; }
.kb__foot { padding-top: 3.2cqi; border-top: 1px solid color-mix(in srgb, currentColor 28%, transparent); text-transform: none; letter-spacing: .02em; font-size: 3.4cqi; }
.kb__foot > span:first-child { opacity: .85; min-width: 0; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.kb__mark { font: 600 4.6cqi/1 var(--font-sans); letter-spacing: -0.02em; white-space: nowrap; }
.kb__mark i { font-style: normal; color: var(--kb-accent); }

.kit-book__body { display: flex; flex-direction: column; flex: 1; padding-top: var(--space-6); }
.kit-book__t { margin-top: 8px; font-size: 19px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.kit-book .kit-card__p { font-size: 14.5px; }
.kit-book .kit-card__who { font-size: 12.5px; }

/* ---------- on the trade and job pages ---------- */
.kit-shelf--small { grid-template-columns: repeat(auto-fill, minmax(190px, 230px)); gap: var(--space-12) var(--space-8); }
.kit-shelf--small .kit-card__p { display: none; }
.kit-shelf--small .kit-book__t { font-size: 17px; }
.kit-strip__head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-8); }
.kit-strip__head .mb-eyebrow { margin-bottom: var(--space-4); }
.kit-strip__head .title { margin: 0; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.025em; }
.kit-strip__all { font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 1040px) {
  .kit-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kit-hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .kit-hero { padding: var(--space-16) 0 var(--space-12); }
}
@media (max-width: 720px) {
  .kit-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12) var(--space-6); }
  .kit-book .kit-card__p { display: none; }
  .kit-next { padding-top: 0; }
.kit-next__in { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding: var(--space-6); }
}
@media (max-width: 480px) {
  .kit-shelf, .kit-shelf--small { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
  .kit-book { display: grid; grid-template-columns: 42% minmax(0, 1fr); gap: var(--space-6); align-items: start; }
  .kit-book__body { padding-top: 2px; }
  .kit-book .kit-card__p { display: block; font-size: 14px; }
  .kit-shelf--small .kit-book { grid-template-columns: 36% minmax(0, 1fr); }
  .kit-shelf--small .kit-card__p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .kit-book:hover .kb { transform: none; }
  .kit-book .mb-arrow, .kb { transition: none; }
}
