/* === AssessWiki QA Card Page CSS === */
/* A standalone, printable long-tail Q&A card. Self-contained: no site      */
/* header, footer, or sidebar. Styled for screen and print.                  */

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: #f3f4f6; color: #202122; line-height: 1.6; }
a { color: #3366cc; text-decoration: none; }
::selection { background: #fef3c7; }
[data-fontsize="small"] { font-size: 14px; }
[data-fontsize="standard"] { font-size: 16px; }
[data-fontsize="large"] { font-size: 18px; }

/* === Page wrapper: centers the card === */
.card-page { min-height: 100vh; display: flex; justify-content: center; padding: 5vh 20px; background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%); }
.card { margin: auto; }

/* === The card === */
.card { width: 100%; max-width: 680px; background: #fff; border: 1px solid #e5e7eb; border-radius: 20px; box-shadow: 0 4px 24px rgba(0,0,0,0.06); padding: 40px 44px; }

.card-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.card-brand img { width: 24px; height: 24px; border-radius: 6px; display: block; }
.card-brand span { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 15px; color: #6b7280; }

.card-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #d97706; margin: 0 0 8px; }
.card h1 { font-family: Georgia, 'Times New Roman', serif; font-size: 1.85rem; font-weight: 700; color: #111827; line-height: 1.25; margin: 0 0 10px; }
.card-meta { font-size: 12px; color: #9ca3af; margin: 0 0 24px; }

/* === Direct-answer callout (snippet bait) === */
.direct-answer { background: linear-gradient(135deg, #fffdf5 0%, #f9fafb 100%); border: 1px solid #fde68a; border-left: 4px solid #f59e0b; border-radius: 12px; padding: 18px 20px; margin: 0 0 24px; }
.direct-answer .da-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #b45309; margin: 0 0 6px; }
.direct-answer p { font-size: 16px; line-height: 1.7; color: #1f2937; margin: 0; }

/* === Key facts strip === */
.key-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 28px; }
.fact { background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 10px; padding: 12px 8px; text-align: center; }
.fact-k { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #9ca3af; margin-bottom: 4px; }
.fact-v { display: block; font-family: Georgia, 'Times New Roman', serif; font-size: 15px; font-weight: 700; color: #111827; }

/* === Body sections === */
.card h2 { font-family: Georgia, 'Times New Roman', serif; font-size: 1.15rem; font-weight: 700; color: #111827; margin: 0 0 8px; }
.card p { font-size: 15px; line-height: 1.7; color: #374151; margin: 0 0 16px; }
.card p:last-child { margin-bottom: 0; }
.card strong { color: #111827; font-weight: 600; }

/* === Source line === */
.card-source { margin-top: 28px; padding-top: 20px; border-top: 1px solid #f3f4f6; font-size: 12px; color: #9ca3af; line-height: 1.6; }

/* === Dark mode (follows saved theme, no toggle) === */
[data-theme="dark"] body { background: #141414; color: #e5e7eb; }
[data-theme="dark"] .card-page { background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%); }
[data-theme="dark"] .card { background: #1a1a1a; border-color: #374151; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
[data-theme="dark"] .card h1, [data-theme="dark"] .card h2 { color: #e5e7eb; }
[data-theme="dark"] .card p { color: #b0b0b0; }
[data-theme="dark"] .card strong { color: #e5e7eb; }
[data-theme="dark"] .card-brand span { color: #9ca3af; }
[data-theme="dark"] .card-meta { color: #6b7280; }
[data-theme="dark"] .card-source { border-color: #2d2d2d; color: #6b7280; }
[data-theme="dark"] .direct-answer { background: linear-gradient(135deg, #2a2418 0%, #242424 100%); border-color: #5b4912; }
[data-theme="dark"] .direct-answer p { color: #e5e7eb; }
[data-theme="dark"] .direct-answer .da-label { color: #fbbf24; }
[data-theme="dark"] .fact { background: #242424; border-color: #2d2d2d; }
[data-theme="dark"] .fact-v { color: #e5e7eb; }
[data-theme="dark"] .fact-k { color: #6b7280; }

/* === Responsive === */
@media (max-width: 640px) {
    .card { padding: 28px 22px; border-radius: 16px; }
    .card h1 { font-size: 1.5rem; }
    .key-facts { grid-template-columns: repeat(2, 1fr); }
}

/* === Print: clean card on paper === */
@page { margin: 1.4cm; }
@media print {
    body { background: #fff !important; color: #000 !important; }
    .card-page { background: #fff !important; padding: 0 !important; min-height: auto !important; display: block !important; }
    .card { max-width: 100% !important; box-shadow: none !important; border: 1px solid #cbd5e1 !important; border-radius: 8px !important; padding: 0.6cm !important; margin: 0 !important; }
    .card h1, .card h2, .card strong { color: #000 !important; }
    .card p, .card-meta, .card-source { color: #333 !important; }
    .card-eyebrow { color: #b45309 !important; }
    .direct-answer { background: #fffbeb !important; border-color: #fcd34d !important; }
    .direct-answer p, .direct-answer .da-label { color: #000 !important; }
    .fact { background: #f9fafb !important; border-color: #e5e7eb !important; }
    .fact-v { color: #000 !important; }
    .fact-k { color: #6b7280 !important; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* === Recommended apps (small cards, 1-4 per row) === */
.rec-title { font-family: Georgia, 'Times New Roman', serif; font-size: 1.15rem; font-weight: 700; color: #111827; margin: 4px 0 12px; }
.rec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 8px; }
.rec-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rec-card:hover { border-color: #f59e0b; box-shadow: 0 4px 12px rgba(217,119,6,0.10); transform: translateY(-2px); }
.rec-icon { font-size: 20px; line-height: 1; margin-bottom: 2px; }
.rec-name { font-weight: 700; font-size: 14px; color: #111827; }
.rec-desc { font-size: 12px; color: #6b7280; line-height: 1.4; }
.rec-time { font-size: 11px; color: #9ca3af; margin-top: 2px; }

[data-theme="dark"] .rec-title { color: #e5e7eb; }
[data-theme="dark"] .rec-card { background: #242424; border-color: #2d2d2d; }
[data-theme="dark"] .rec-card:hover { border-color: #f59e0b; }
[data-theme="dark"] .rec-name { color: #e5e7eb; }
[data-theme="dark"] .rec-desc { color: #9ca3af; }
[data-theme="dark"] .rec-time { color: #6b7280; }

@media (max-width: 640px) { .rec-grid { grid-template-columns: repeat(2, 1fr); } }

@media print {
    .rec-title { color: #000 !important; }
    .rec-card { background: #f9fafb !important; border: 1px solid #cbd5e1 !important; box-shadow: none !important; transform: none !important; }
    .rec-name { color: #000 !important; }
    .rec-desc, .rec-time { color: #333 !important; }
}
