/* Formula Sheets / Study Hub — additive stylesheet. Uses existing WINRAAZ tokens from style.css. */

/* Study Hub cards: reuse .chapter-card, add a distinguishing accent per option */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; padding-bottom: 20px; }
.hub-card { --hub-accent: var(--green); }
.hub-card.hub-trend { --hub-accent: var(--ochre); }
.hub-card.hub-formula { --hub-accent: #2F5D8C; }
[data-theme="dark"] .hub-card.hub-formula { --hub-accent: #7FAEDB; }
.hub-card { border-top: 4px solid var(--hub-accent); }
.hub-card .chapter-icon { color: var(--hub-accent); width: 40px; height: 40px; }
.hub-card:hover { border-color: var(--hub-accent); }
.hub-card .chapter-tag { color: var(--hub-accent); background: color-mix(in srgb, var(--hub-accent) 12%, transparent); }
.hub-card .chapter-card-meta .arrow { color: var(--hub-accent); }

/* Compact chapter list */
.fs-list { list-style: none; margin: 0; padding: 0 0 24px; display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 720px) { .fs-list { grid-template-columns: 1fr 1fr; gap: 10px 14px; } }
.fs-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 8px 14px;
  background: var(--surface-strong); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
a.fs-item:hover, a.fs-item:focus-visible { transform: translateY(-1px); box-shadow: var(--shadow-card); border-color: var(--green); }
.fs-num { flex: none; min-width: 34px; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--ochre); background: var(--ochre-tint); border-radius: 6px; padding: 4px 7px; text-align: center; }
.fs-title { flex: 1; min-width: 0; font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.fs-cls { display: block; font-weight: 500; font-size: 0.72rem; color: var(--ink-soft); margin-top: 1px; }
.fs-go { flex: none; font-size: 0.8rem; color: var(--green); font-weight: 600; white-space: nowrap; }
.fs-item.is-soon { background: transparent; border-style: dashed; cursor: default; }
.fs-item.is-soon .fs-title { color: var(--ink-soft); font-weight: 500; }
.fs-item.is-soon .fs-num { filter: grayscale(0.6); opacity: 0.75; }
.fs-soon { flex: none; font-size: 0.7rem; font-family: var(--font-mono); letter-spacing: 0.05em; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.fs-group { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--ink-soft); margin: 18px 0 8px; grid-column: 1 / -1; list-style: none; }
.fs-note { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 14px; }

/* PDF reader */
.pr-bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft); }
.pr-bar-inner { max-width: 960px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-back { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: border-color var(--transition); }
.pr-back:hover { border-color: var(--green); }
.pr-spacer { flex: 1; }
.pr-pageind { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); min-width: 64px; text-align: center; }
.pr-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 1.05rem; cursor: pointer; }
.pr-btn:hover { border-color: var(--green); }
.pr-btn.pr-fit { width: auto; padding: 0 10px; font-size: 0.78rem; font-weight: 600; }
.pr-stage { max-width: 960px; margin: 0 auto; padding: 16px 12px 40px; }
.pr-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pr-page { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-card); overflow: hidden; max-width: 100%; }
.pr-page canvas { display: block; width: 100%; height: 100%; }
.pr-page::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(127,127,127,0.12), transparent); background-size: 200% 100%; animation: pr-shimmer 1.4s infinite; }
.pr-page.is-ready::after { display: none; }
@keyframes pr-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pr-state { text-align: center; padding: 56px 16px; color: var(--ink-soft); }
.pr-state h2 { font-family: var(--font-display); color: var(--ink); margin: 0 0 8px; font-size: 1.3rem; }
.pr-spinner { width: 34px; height: 34px; margin: 0 auto 14px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: pr-spin 0.8s linear infinite; }
@keyframes pr-spin { to { transform: rotate(360deg); } }
.pr-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pr-actions a, .pr-actions button { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 0.88rem; text-decoration: none; cursor: pointer; }
.pr-actions .primary { background: var(--green); color: #fff; border-color: var(--green); }
.pr-meta { color: var(--ink-soft); font-size: 0.9rem; margin: 6px 0 0; }
@media (prefers-reduced-motion: reduce) { .pr-spinner, .pr-page::after { animation: none; } .fs-item, .hub-card { transition: none; } }

/* polish: live chapters stand out from "soon" ones; note spacing */
a.fs-item { background: var(--surface); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.fs-note { margin-top: 18px; }
