/* Reading Room — hub, passage pages and printable sheets. Builds on styles/main.css. */

.rd-btn { display: inline-block; padding: 8px 15px; border-radius: 20px; font: inherit; font-weight: bold; font-size: 0.92em; text-decoration: none; cursor: pointer; border: 2px solid #667eea; background: #667eea; color: white; transition: background 0.2s, border-color 0.2s; }
.rd-btn:hover { background: #556cd6; border-color: #556cd6; }
.rd-btn.ghost { background: white; color: #5a67d8; }
.rd-btn.ghost:hover { background: #f5f7ff; }
.rd-btn.hint { background: #fffbea; border-color: #d69e2e; color: #975a16; }
.rd-btn.hint:hover { background: #fefcbf; }
.rd-btn.show { background: #f0fff4; border-color: #38a169; color: #276749; }
.rd-btn.show:hover { background: #c6f6d5; }
.rd-btn.small { padding: 5px 12px; font-size: 0.85em; }

/* ── Hub ─────────────────────────────────────────────────────────────── */
.rd-level-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 34px 0 14px; border-bottom: 3px solid #e2e8f0; padding-bottom: 8px; }
.rd-level-head h2 { color: var(--lv); font-size: 1.6em; }
.rd-level-head span { color: #718096; font-weight: bold; }
.rd-level-head .rd-progress { margin-left: auto; font-size: 0.9em; }
.rd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.rd-card { position: relative; background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%); border: 3px solid #e2e8f0; border-top: 6px solid var(--lv); border-radius: 15px; padding: 16px 18px; display: flex; flex-direction: column; transition: transform 0.25s, box-shadow 0.25s; }
.rd-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(90, 103, 216, 0.2); }
.rd-card-top { display: flex; align-items: center; gap: 12px; }
.rd-card-icon { font-size: 2.1em; line-height: 1; }
.rd-card-num { font-size: 0.8em; font-weight: bold; color: var(--lv); text-transform: uppercase; letter-spacing: 0.05em; }
.rd-card h3 { color: #2d3748; font-size: 1.12em; line-height: 1.3; }
.rd-card p { color: #718096; font-size: 0.9em; margin: 8px 0 14px; flex: 1; }
.rd-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rd-done { position: absolute; top: 10px; right: 12px; font-size: 0.8em; font-weight: bold; color: #276749; background: #c6f6d5; border-radius: 12px; padding: 2px 9px; }
.rd-filter { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 4px 0 8px; }
.rd-filter button { font: inherit; font-size: 0.9em; padding: 6px 14px; border: 2px solid #ddd; border-radius: 20px; background: white; cursor: pointer; }
.rd-filter button.active { background: #667eea; border-color: #667eea; color: white; }

/* ── Passage page ────────────────────────────────────────────────────── */
.rd-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rd-nav a { color: #5a67d8; text-decoration: none; font-weight: bold; }
.rd-nav a:hover { text-decoration: underline; }
.rd-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.rd-chip { font-size: 0.85em; font-weight: bold; padding: 3px 12px; border-radius: 14px; background: #edf2f7; color: #4a5568; }
.rd-chip.lv { background: var(--lv); color: white; }
.rd-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.rd-article { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; background: #fffdf7; border: 2px solid #f6e7c1; border-radius: 14px; padding: 22px 26px; }
.rd-article h2 { color: #2d3748; font-size: 1.6em; margin-bottom: 12px; }
.rd-article p { display: flex; gap: 12px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.14em; line-height: 1.75; color: #1a202c; margin: 0 0 14px; }
.rd-article p .pn { flex: 0 0 1.6em; font-family: Arial, sans-serif; font-size: 0.72em; font-weight: bold; color: #b7791f; padding-top: 0.35em; text-align: right; }
.rd-article.poem p { font-style: italic; }
.rd-article em { font-style: normal; font-weight: bold; background: #fefcbf; padding: 0 3px; border-radius: 3px; }
.rd-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rd-questions h2 { color: #5a67d8; font-size: 1.4em; margin-bottom: 4px; }
.rd-questions > p.rd-howto { color: #718096; font-size: 0.92em; margin-bottom: 12px; }
.rd-q { background: white; border: 2px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; transition: border-color 0.2s; }
.rd-q.right { border-color: #38a169; background: #f7fffa; }
.rd-q.wrong { border-color: #e53e3e; }
.rd-q-text { font-weight: bold; color: #2d3748; display: flex; gap: 8px; line-height: 1.5; }
.rd-q-text .n { color: #5a67d8; flex: 0 0 auto; }
.rd-q-text em { font-style: italic; }
.rd-opts { display: grid; gap: 6px; margin: 10px 0 4px; }
.rd-opts.tf { grid-template-columns: 1fr 1fr; max-width: 320px; }
.rd-opts label { display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border: 2px solid #edf2f7; border-radius: 8px; cursor: pointer; line-height: 1.4; }
.rd-opts label:hover { border-color: #c3dafe; background: #f5f7ff; }
.rd-opts input { margin-top: 0.25em; accent-color: #667eea; }
.rd-opts label.sel { border-color: #667eea; background: #f5f7ff; }
.rd-opts label.is-answer { border-color: #38a169; background: #f0fff4; }
.rd-opts b { color: #5a67d8; }
.rd-q textarea { width: 100%; margin: 10px 0 4px; font: inherit; font-size: 1em; padding: 8px 10px; border: 2px solid #e2e8f0; border-radius: 8px; resize: vertical; min-height: 2.6em; }
.rd-q textarea:focus { outline: none; border-color: #667eea; }
.rd-q-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.rd-reveal { margin-top: 10px; padding: 9px 12px; border-radius: 8px; line-height: 1.5; font-size: 0.95em; }
.rd-reveal.hint { background: #fffbea; border-left: 4px solid #d69e2e; }
.rd-reveal.answer { background: #f0fff4; border-left: 4px solid #38a169; }
.rd-reveal.fb-good { background: #f0fff4; color: #276749; font-weight: bold; }
.rd-reveal.fb-bad { background: #fff5f5; color: #c53030; font-weight: bold; }
.rd-reveal.fb-note { background: #ebf8ff; color: #2c5282; }
.rd-score { position: sticky; bottom: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; background: #2d3748; color: white; border-radius: 12px; padding: 10px 16px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); }
.rd-score b { font-size: 1.15em; }
.rd-score .rd-btn { border-color: white; }

@media (max-width: 900px) {
    .rd-layout { grid-template-columns: 1fr; }
    .rd-article { position: static; max-height: none; }
}

/* ── Printable sheet (print.html → PDF) ─────────────────────────────── */
body.rd-print { background: #edf2f7; padding: 20px; font-family: Georgia, 'Times New Roman', serif; color: #111; }
.rd-print-bar { max-width: 8.5in; margin: 0 auto 14px; display: flex; gap: 10px; flex-wrap: wrap; font-family: Helvetica, Arial, sans-serif; }
.rd-sheet { max-width: 8.5in; margin: 0 auto; background: white; padding: 0.6in; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); font-size: 11.5pt; line-height: 1.5; }
.rd-sheet-head { border-bottom: 3px solid #333; padding-bottom: 6px; margin-bottom: 8px; display: flex; align-items: flex-end; gap: 12px; }
.rd-sheet-head .series { font-family: Helvetica, Arial, sans-serif; font-size: 9pt; letter-spacing: 0.12em; text-transform: uppercase; color: #555; }
.rd-sheet-head h1 { font-size: 20pt; color: #111; text-shadow: none; margin: 2px 0 0; }
.rd-sheet-head .icon { font-size: 30pt; line-height: 1; margin-left: auto; }
.rd-sheet-meta { display: flex; gap: 24px; margin: 10px 0 14px; font-family: Helvetica, Arial, sans-serif; font-size: 10pt; }
.rd-sheet-meta span { flex: 1; border-bottom: 1px solid #555; padding-bottom: 2px; }
.rd-sheet-meta span.narrow { flex: 0 0 1.4in; }
.rd-sheet-sub { font-family: Helvetica, Arial, sans-serif; font-size: 9.5pt; color: #444; margin-bottom: 10px; }
.rd-sheet-text p { display: flex; gap: 10px; margin: 0 0 9px; text-align: justify; }
.rd-sheet-text.poem p { text-align: left; font-style: italic; }
.rd-sheet-text p .pn { flex: 0 0 1.4em; font-family: Helvetica, Arial, sans-serif; font-size: 8pt; font-weight: bold; color: #777; padding-top: 0.3em; text-align: right; }
.rd-sheet-text p > span:last-child { flex: 1; }
.rd-sheet-text em { font-style: normal; font-weight: bold; }
.rd-sheet h2 { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; margin: 18px 0 8px; padding: 4px 10px; background: #e8e8e8; border-left: 5px solid #333; color: #111; break-after: avoid; }
.rd-sheet-q { break-inside: avoid; page-break-inside: avoid; margin: 0 0 12px; display: flex; gap: 6px; }
.rd-sheet-q .n { font-family: Helvetica, Arial, sans-serif; font-weight: bold; flex: 0 0 1.7em; }
.rd-sheet-q .body { flex: 1; }
.rd-sheet-q ol { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.rd-sheet-q ol.tf { grid-template-columns: auto auto; justify-content: start; gap: 2px 40px; }
.rd-sheet-q ol li { display: flex; gap: 6px; }
.rd-sheet-q ol li::before { content: '○'; font-family: Helvetica, Arial, sans-serif; }
.rd-sheet-q .line { border-bottom: 1px solid #888; height: 0.34in; }
.rd-key { break-before: page; page-break-before: always; }
.rd-key h2 { margin-top: 0; }
.rd-key-list { font-size: 10pt; line-height: 1.45; }
.rd-key-list .k { display: flex; gap: 6px; margin: 0 0 8px; break-inside: avoid; }
.rd-key-list .k .n { font-family: Helvetica, Arial, sans-serif; font-weight: bold; flex: 0 0 1.7em; }
.rd-key-list .k .a { font-weight: bold; }
.rd-key-list .k .s { color: #444; display: block; }

@page { size: letter; margin: 0.6in 0.65in 0.7in; @bottom-center { content: counter(page) " / " counter(pages); font-family: Helvetica, Arial, sans-serif; font-size: 8.5pt; color: #555; } }
@media print {
    body.rd-print { background: white; padding: 0; }
    .rd-print-bar { display: none; }
    .rd-sheet { box-shadow: none; padding: 0; max-width: none; }
}
