/* Inner pages (question/, books/): built from the tokens in site.css */

.page-first { padding-top: calc(var(--nav-h) + clamp(32px, 6vw, 72px)); border-top: 0; }
.page .sec-head h1 { margin-top: 12px; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.35; text-wrap: balance; }

/* ---------- Questions ---------- */

.qa [hidden] { display: none !important; }
.qa a:not(.btn) { border-bottom: 1px solid var(--line-2); transition: border-color .15s, color .15s; }
.qa a:not(.btn):hover { border-color: var(--signal); color: var(--signal); }

.qa-form { max-width: 760px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.qa-row { margin-bottom: 18px; }
.qa-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.qa-form label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 15px; }
.qa-hint { font-weight: 400; color: var(--ink-3); font-size: 13.5px; }
.qa-form input[type=text], .qa-form input[type=email], .qa-form textarea, .qa-tools input {
  display: block; width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper); color: var(--ink);
  font: inherit; font-size: 16px; transition: border-color .15s;
}
.qa-form textarea { min-height: 190px; resize: vertical; line-height: 1.7; }
.qa-form input:hover, .qa-form textarea:hover, .qa-tools input:hover { border-color: var(--ink-3); }
.qa-form input:focus, .qa-form textarea:focus, .qa-tools input:focus { outline: 2px solid var(--signal); outline-offset: 1px; border-color: var(--signal); }
.qa-form [aria-invalid=true] { border-color: var(--signal); background: var(--signal-soft); }
.qa-submit { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.qa-submit .qa-row { margin-bottom: 0; }
.qa-submit input[type=text] { width: 110px; text-align: center; }
/* kept in place and clipped: an off-screen offset would widen an RTL page */
.qa-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.qa-notice { max-width: 760px; margin-bottom: 16px; padding: 14px 18px; border: 1px solid var(--line-2); border-inline-start: 3px solid var(--ink); border-radius: 12px; background: var(--card); font-weight: 500; }
.qa-err { border-color: var(--signal); background: var(--signal-soft); }
.qa-err ul { margin-top: 6px; padding-inline-start: 20px; list-style: disc; font-weight: 400; font-size: 15px; }

.qa-tools { max-width: 760px; margin-bottom: 14px; }
.qa-tools input { background: var(--card); }

.qa-thread { max-width: 760px; margin-bottom: 14px; padding: clamp(16px, 2.6vw, 22px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.qa-pinned { border-color: var(--line-2); border-inline-start: 3px solid var(--signal); }
.qa-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.qa-name { font-family: var(--f-display); font-weight: 650; font-size: 1.08rem; line-height: 1.5; overflow-wrap: anywhere; }
.qa-date { font-size: 13.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qa-text { white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: start; color: var(--ink-2); font-size: 16px; line-height: 1.85; }
.qa-reply { margin-top: 16px; padding: 14px 16px; border-inline-start: 2px solid var(--signal); border-radius: 0 10px 10px 0; background: var(--paper); }
[dir="rtl"] .qa-reply { border-radius: 10px 0 0 10px; }
.qa-reply .qa-name { font-size: 1rem; color: var(--signal); }
.qa-reply .qa-text { color: var(--ink); }
.qa-empty { max-width: 760px; padding: 24px 0; color: var(--ink-3); text-align: center; }
.qa .more-btn { max-width: 760px; }

@media (max-width: 680px) {
  .qa-two { grid-template-columns: minmax(0, 1fr); }
  .qa-submit .btn { flex: 1 1 auto; }
}
/* ---------- Books ---------- */

.bk .sec-head h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem) !important; line-height: 1.5 !important; }
.bk-sign { margin-top: 1.4em; font-family: var(--f-display); font-weight: 650; color: var(--ink-2); }
.bk-note { max-width: 62ch; margin-top: 20px; padding: 12px 16px; border-inline-start: 2px solid var(--signal); border-radius: 0 10px 10px 0; background: var(--card); color: var(--ink-2); font-size: 15px; }
[dir="rtl"] .bk-note { border-radius: 10px 0 0 10px; }
.bk-toc { max-width: 760px; columns: 2; column-gap: 28px; padding-inline-start: 1.6em; list-style: decimal; }
.bk-toc li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid var(--line); }
.bk-toc li::marker { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.bk-actions .btn { min-height: 52px; }
.bk-size { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; opacity: .7; }
.bk-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.bk-covers a { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; transition: border-color .15s, transform .15s; }
.bk-covers a:hover { border-color: var(--ink); transform: translateY(-2px); }
.bk-covers img { width: 100%; height: auto; }

@media (max-width: 680px) {
  .bk-toc { columns: 1; }
  .bk-actions .btn { flex: 1 1 100%; }
}
