feat: Multiple book improvements

- Format spell tables like they are in the book
- Add permalinks to headers
- Formatting
- Book-wide search
This commit is contained in:
2026-06-26 20:50:14 -04:00
parent 7f81f85735
commit 5327b524d2
30 changed files with 25674 additions and 21123 deletions

View File

@@ -205,3 +205,160 @@ li.active .page-num {
padding-bottom: 0.8em;
margin-bottom: 1.4em;
}
/* ── Search modal ── */
.search-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.55);
z-index: 1000;
display: flex;
align-items: flex-start;
justify-content: center;
padding-top: 10vh;
}
.search-modal {
width: 580px;
max-width: calc(100vw - 40px);
max-height: 70vh;
background: var(--surface2);
border: 1px solid var(--border-bright);
display: flex;
flex-direction: column;
overflow: hidden;
}
.search-input {
width: 100%;
padding: 14px 16px;
background: var(--surface);
border: none;
border-bottom: 1px solid var(--border-bright);
color: var(--text);
font-family: var(--font-body);
font-size: 1rem;
outline: none;
flex-shrink: 0;
}
.search-input::placeholder { color: var(--text-dim); }
.search-results {
overflow-y: auto;
flex: 1;
list-style: none;
padding: 0;
margin: 0;
}
.search-result {
padding: 10px 16px;
border-bottom: 1px solid var(--border);
cursor: pointer;
display: flex;
flex-direction: column;
gap: 3px;
transition: background 0.1s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover,
.search-result.active { background: var(--surface3); }
.search-result-meta {
display: flex;
justify-content: space-between;
align-items: baseline;
gap: 8px;
}
.search-result-heading {
font-family: var(--font-display);
font-size: 0.7rem;
letter-spacing: 0.08em;
color: var(--teal);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
}
.search-result-page {
font-family: var(--font-mono);
font-size: 0.7rem;
color: var(--text-dim);
white-space: nowrap;
flex-shrink: 0;
}
.search-result-snippet {
font-size: 0.85rem;
color: var(--text-dim);
line-height: 1.5;
}
.search-result-snippet mark {
background: none;
color: var(--gold);
font-weight: 600;
}
.search-empty {
padding: 24px 16px;
text-align: center;
color: var(--text-dim);
font-family: var(--font-mono);
font-size: 0.8rem;
}
.search-footer {
display: flex;
gap: 16px;
padding: 7px 14px;
border-top: 1px solid var(--border);
background: var(--surface3);
flex-shrink: 0;
}
.search-footer span {
font-family: var(--font-mono);
font-size: 0.68rem;
color: var(--text-dim);
}
/* ── Heading permalink buttons ── */
.page-section h1,
.page-section h2,
.page-section h3 {
position: relative;
scroll-margin-top: 60px;
}
.heading-link {
position: absolute;
left: -24px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
cursor: pointer;
color: var(--text-dim);
font-family: var(--font-mono);
font-size: 17px;
padding: 2px 4px;
line-height: 1;
transition: color 0.15s;
user-select: none;
}
/* h1 has padding-bottom: 0.3em — shift button up so it centers with the text line, not the full box */
.page-section h1 > .heading-link {
top: calc(50% - 5px);
}
.heading-link:hover,
.heading-link--copied {
color: var(--teal);
}