/* =============================================================================
   booktalk.club — book club starter kit (/book-club-starter-kit/)

   Loaded after styles.css (colours, fonts, .btn, .stamp) and guide.css (top bar,
   Slack message drawing, FAQ, related links, footer).

   Sections in this file (search for the ==== headings):
     1. Page header
     2. The maker: form on the left, poster on the right
     3. Form fields & choice chips
     4. Poster preview (a scaled-down A4 / US Letter sheet)
     5. The poster itself (layout shared by all styles)
     6. Poster styles: library card, colourful, ink saver
     7. Message for the team chat
     8. Tips, FAQ & the closing note
     9. Printing (only the poster, at full size)
    10. Tablet & phone layouts
   ============================================================================= */


/* ==== 1. Page header ======================================================== */
.kit-head { max-width: 760px; padding: 32px 0 40px; }
.kit-head h1 { margin-top: 14px; font-family: var(--serif); font-weight: 500; font-size: 58px; line-height: 1.04; letter-spacing: -.015em; text-wrap: balance; }
.kit-head p.g-dek { max-width: 640px; }


/* ==== 2. The maker ========================================================== */
.kit { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 40px; align-items: start; }
.kit-form { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.kit-side { position: sticky; top: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }


/* ==== 3. Form fields & choice chips ========================================= */
.kit-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.kit-form fieldset + fieldset { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.kit-form legend { float: left; width: 100%; padding: 0; font-family: var(--serif); font-size: 22px; font-weight: 500; }   /* float: keeps the heading below the divider line, not on it */
.kit-form legend + * { clear: left; }
.kit-step { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; background: #f6f1fd; color: var(--purple); font: 600 13px var(--font-ui); vertical-align: 3px; }

.kit-field { display: block; margin-top: 16px; }
.kit-field > span { display: block; margin-bottom: 6px; font: 600 14px var(--font-ui); }
.kit-field > span em { font-style: normal; font-weight: 500; color: var(--muted); }
.kit-field input[type="text"], .kit-field input[type="url"], .kit-field input[type="email"], .kit-field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #dcdce4; border-radius: 10px; background: #fff;
  font: 400 16px/1.4 var(--font); color: var(--text);   /* 16px: iPhones don't zoom in on the box */
  transition: border-color .2s, box-shadow .2s;
}
.kit-field textarea { resize: vertical; min-height: 84px; }
.kit-field input:focus, .kit-field textarea:focus { outline: none; border-color: rgba(103, 48, 195, .5); box-shadow: 0 0 0 3px rgba(103, 48, 195, .12); }
.kit-field input::placeholder, .kit-field textarea::placeholder { color: #a5a7ae; }
.kit-points input + input { margin-top: 8px; }
.kit-hint { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.kit-hint.is-warn { color: #b3261e; }

/* Choice chips: radio buttons drawn as pills */
.kit-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.kit-chips label { position: relative; cursor: pointer; }
.kit-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kit-chips span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid #dcdce4; border-radius: 999px; background: #fff; font: 500 14px var(--font-ui); color: var(--text); transition: border-color .2s, background-color .2s; }
.kit-chips label:hover span { border-color: #c4c4d0; }
.kit-chips input:checked + span { border-color: var(--purple); background: #f6f1fd; color: #4b2391; box-shadow: inset 0 0 0 1px var(--purple); }
.kit-chips input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 2px; }
.kit-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }
.kit-swatch.card { background: #f4e6c1; box-shadow: inset 0 3px 0 #c8372b; }
.kit-swatch.bright { background: radial-gradient(circle at 30% 30%, #8aa2ff, #ff8fb8); }
.kit-swatch.plain { background: #fff; }

.kit-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 15px; line-height: 1.45; cursor: pointer; }
.kit-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--purple); flex: none; }

.kit-reset { margin-top: 24px; border: 0; background: none; padding: 0; cursor: pointer; font: 500 14px var(--font-ui); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.kit-reset:hover { color: var(--text); }


/* ==== 4. Poster preview ===================================================== */
/* The poster is laid out at real size (A4 = 794 × 1123 px) and shrunk to fit the column
   by kit.js, so the preview and the printout always match */
.kit-preview {
  position: relative; width: 100%;
  max-width: min(560px, calc((100svh - 150px) * .707));   /* the whole sheet fits on screen on computers */
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 20, 40, .08), 0 18px 40px -18px rgba(20, 20, 40, .35);
}
.kit-scale { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.kit-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.kit-actions .btn { height: 50px; padding: 0 26px; font-size: 16px; }
.kit-actions p { max-width: 420px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.kit-actions p.is-warn { color: #b3261e; }


/* ==== 5. The poster ========================================================= */
/* Sizes are multiplied by --k, which kit.js lowers a little when long text would not fit.
   --hs is the headline size, picked from the headline's length. */
.poster {
  --pw: 794px; --ph: 1123px; --k: 1; --hs: 128px;
  position: relative; display: flex; flex-direction: column;
  width: var(--pw); height: var(--ph); overflow: hidden;
  padding: 76px 76px 52px;
  background: var(--p-bg); color: var(--p-ink);
  font-family: var(--font);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;   /* keep the colours when printing */
}
.poster[data-paper="letter"] { --pw: 816px; --ph: 1056px; padding-top: 64px; }

.p-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--p-rule); }
.p-club { min-width: 0; font-family: var(--serif); font-size: calc(28px * var(--k)); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.p-stamp { flex: none; color: var(--p-accent); rotate: -6deg; font-size: 17px; padding: 9px 14px 8px; }

.p-headline {
  margin-top: calc(52px * var(--k));
  font-family: var(--serif); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 520;
  font-size: calc(var(--hs) * var(--k)); line-height: .98; letter-spacing: -.025em;
  color: var(--p-head); overflow-wrap: anywhere;
}
.p-about { margin-top: calc(30px * var(--k)); max-width: 610px; font-size: calc(27px * var(--k)); line-height: 1.45; overflow-wrap: anywhere; }

/* Printed lines with handwritten notes, like the member card */
.p-lines { list-style: none; margin: calc(34px * var(--k)) 0 0; padding: 0; border-top: 1px solid var(--p-rule); }
.p-lines li { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: end; gap: 12px; min-height: calc(62px * var(--k)); padding: 6px 0 7px; border-bottom: 1px solid var(--p-rule); }
.p-lines li[hidden] { display: none; }
.p-label { padding-bottom: 6px; font-family: var(--serif); font-size: calc(16px * var(--k)); opacity: .78; }
.p-note { font-family: var(--p-note-font); font-size: calc(var(--p-note-size) * var(--k)); line-height: 1.1; color: var(--p-note); overflow-wrap: anywhere; }

/* Bottom: the QR code and where it leads */
.p-join { display: flex; align-items: center; gap: 36px; margin-top: auto; padding-top: calc(36px * var(--k)); }
.p-qr { flex: none; width: calc(214px * var(--k)); height: calc(214px * var(--k)); padding: 16px; border-radius: 14px; background: #fff; color: #17120e; box-shadow: 0 0 0 1px var(--p-rule); }
.p-qr svg { display: block; width: 100%; height: 100%; }
.p-qr.is-empty { display: grid; place-items: center; background: transparent; box-shadow: none; border: 3px dashed var(--p-rule); text-align: center; font: 500 18px/1.3 var(--font-ui); color: var(--p-ink); opacity: .7; }
.p-join.no-qr .p-qr { display: none; }
.p-scan { font-family: var(--serif); font-weight: 500; font-size: calc(40px * var(--k)); line-height: 1.12; letter-spacing: -.01em; overflow-wrap: anywhere; }
.p-join.no-qr .p-scan { font-size: calc(48px * var(--k)); }
.p-arrow { display: block; margin-bottom: 8px; font-family: var(--p-note-font); font-size: 30px; line-height: 1; color: var(--p-note); }
.p-join.no-qr .p-arrow { display: none; }

.p-credit { margin-top: 30px; font-family: var(--font-ui); font-size: 13px; opacity: .55; text-align: right; }
.p-credit[hidden] { display: none; }


/* ==== 6. Poster styles ====================================================== */
/* Library card (default): old card stock, brown print, red stamp, blue-pen notes */
.poster[data-style="card"] {
  --p-bg: url("../img/grain.png") 0 0 / 64px 64px, #f4e6c1;
  --p-ink: #5b4630; --p-head: #4a3826; --p-rule: rgba(150, 105, 50, .34); --p-accent: #c8372b;
  --p-note: #2c3f9c; --p-note-font: "Nanum Pen Script", "Bradley Hand", cursive; --p-note-size: 40px;
  border-top: 18px solid #c8372b;
}

/* Colourful: the homepage's pink and blue glow */
.poster[data-style="bright"] {
  --p-bg: radial-gradient(70% 45% at 8% 4%, rgba(110, 140, 255, .55), transparent 70%),
          radial-gradient(70% 50% at 100% 60%, rgba(255, 105, 160, .45), transparent 70%),
          radial-gradient(60% 40% at 20% 100%, rgba(255, 170, 120, .40), transparent 70%), #fbe6ea;
  --p-ink: #1a1d21; --p-head: #1a1d21; --p-rule: rgba(26, 29, 33, .16); --p-accent: #6730c3;
  --p-note: #1a1d21; --p-note-font: "Satoshi", var(--font); --p-note-size: 25px;
}
.poster[data-style="bright"] .p-note { font-weight: 500; }

/* Ink saver: white paper, black ink, one thin purple line */
.poster[data-style="plain"] {
  --p-bg: #fff;
  --p-ink: #1a1d21; --p-head: #1a1d21; --p-rule: #cfd0d6; --p-accent: #1a1d21;
  --p-note: #1a1d21; --p-note-font: "Satoshi", var(--font); --p-note-size: 25px;
  border-top: 6px solid #6730c3;
}
.poster[data-style="plain"] .p-note { font-weight: 500; }


/* ==== 7. Message for the team chat ========================================== */
.kit-message { max-width: 760px; margin: 72px auto 0; }
.kit-message h2, .kit-tips h2, .kit-faq h2 { font-family: var(--serif); font-weight: 500; font-size: 36px; line-height: 1.15; letter-spacing: -.01em; }
.kit-message > p { margin-top: 12px; font-size: 18px; line-height: 1.6; color: var(--text); opacity: .85; }


/* ==== 8. Tips, FAQ & the closing note ======================================= */
.kit-tips { max-width: 1000px; margin: 88px auto 0; }
.kit-tips-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.kit-tip { padding: 24px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.kit-tip h3 { font-size: 18px; font-weight: 700; line-height: 1.35; }
.kit-tip p { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--text); opacity: .88; }
.kit-tip a { color: var(--purple); text-underline-offset: 3px; }

.kit-faq { max-width: 760px; margin: 88px auto 0; }
.kit-faq .g-faq { margin-top: 20px; }
.kit-faq .g-faq details p { font-size: 17px; line-height: 1.65; }

.kit-end { max-width: 760px; margin: 72px auto 64px; }
.kit-end .g-with { margin: 0; background: var(--bg); border: 1px solid var(--line); }
.kit-end .g-with a { color: var(--purple); text-underline-offset: 3px; }
.kit-end .g-related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.kit-end .g-related a { display: block; padding: 20px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); text-decoration: none; color: var(--text); transition: border-color .2s; }
.kit-end .g-related a:hover { border-color: rgba(103, 48, 195, .35); }
.kit-end .g-related small { display: block; font: 600 13px var(--font-ui); color: var(--purple); }
.kit-end .g-related span { display: block; margin-top: 4px; font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.3; }


/* ==== 9. Printing =========================================================== */
/* kit.js keeps a full-size copy of the poster in #print-root; only that copy is printed.
   The paper size (@page) is set by kit.js to match the A4 / US Letter choice. */
#print-root { display: none; }
@media print {
  body { background: #fff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  #print-root .poster { height: calc(var(--ph) - 4px); break-inside: avoid; }   /* a hair shorter than the page, so no blank second page */
}


/* ==== 10. Tablet & phone layouts ============================================ */
@media (max-width: 980px) {
  .kit { grid-template-columns: minmax(0, 1fr); }
  .kit-side { position: static; }
  .kit-preview { max-width: 520px; }
  .kit-tips-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .kit-head { padding: 16px 0 28px; }
  .kit-head h1 { font-size: 38px; }
  .kit-form { padding: 22px 18px; border-radius: 16px; }
  .kit-message h2, .kit-tips h2, .kit-faq h2 { font-size: 28px; }
  .kit-end .g-related { grid-template-columns: minmax(0, 1fr); }
}
