openfreebooks-bookgenerator/themes/openfreebooks/sass/_book.scss

577 lines
10 KiB
SCSS

.book-page {
padding: 48px 0 96px;
}
.book-breadcrumb {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
margin-bottom: 28px;
font-family: var(--mono);
font-size: 0.72rem;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.book-breadcrumb a {
color: var(--soft-ink);
text-decoration: none;
}
.book-breadcrumb a:hover,
.book-breadcrumb a:focus-visible {
color: var(--accent);
}
.book-breadcrumb__sep {
color: var(--muted);
}
.book-header {
max-width: var(--prose-width);
margin-bottom: 56px;
}
.book-subtitle {
margin: 12px 0 0;
font-family: var(--mono);
font-size: 0.85rem;
letter-spacing: 0.06em;
color: var(--accent);
}
.book-intro {
margin: 20px 0 0;
font-size: 1.05rem;
line-height: 1.65;
color: var(--soft-ink);
}
.book-strands {
display: grid;
gap: 40px;
}
.book-strand__title {
margin: 0 0 16px;
font-size: 1.5rem;
}
.book-chapter-list {
list-style: none;
margin: 0;
padding: 0;
display: grid;
gap: 10px;
}
.book-chapter-link {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 16px 20px;
border: 1px solid var(--card-border);
border-radius: 12px;
background: var(--card-bg);
text-decoration: none;
color: var(--ink);
transition: border-color 200ms ease, box-shadow 200ms ease;
}
a.book-chapter-link:hover,
a.book-chapter-link:focus-visible {
border-color: var(--accent);
box-shadow: 0 6px 20px var(--shadow-soft);
}
.book-chapter-link--disabled {
opacity: 0.72;
cursor: default;
}
.book-chapter-item--planned .book-chapter-link__title {
color: var(--soft-ink);
}
.book-chapter-link__title {
font-family: var(--font-heading);
font-size: 1.15rem;
}
.book-chapter-badge {
flex-shrink: 0;
font-family: var(--mono);
font-size: 0.65rem;
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
padding: 4px 10px;
border-radius: 999px;
}
.book-chapter-badge--live {
color: var(--accent);
background: rgba(154, 107, 46, 0.12);
}
.book-chapter-badge--planned {
color: var(--muted);
background: rgba(118, 118, 118, 0.12);
}
.book-chapter {
max-width: var(--prose-width);
}
.book-chapter__header {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: space-between;
gap: 16px 24px;
margin-bottom: 32px;
}
.book-chapter__header-main {
flex: 1 1 240px;
min-width: 0;
}
.book-chapter__actions {
flex: 0 0 auto;
}
.copy-page-button-wrap {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 6px;
}
.copy-page-button {
position: relative;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 9rem;
padding: 8px 10px 8px 34px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--card-bg);
color: var(--ink);
font-family: var(--sans);
font-size: 0.82rem;
font-weight: 600;
letter-spacing: 0.02em;
cursor: pointer;
transition:
border-color 160ms ease,
color 160ms ease,
background 160ms ease;
}
.copy-page-button:hover:not(:disabled) {
border-color: var(--accent);
color: var(--accent);
}
.copy-page-button:disabled {
cursor: wait;
opacity: 0.72;
}
.copy-page-button--copied,
.copy-page-button--copied:hover:not(:disabled) {
border-color: color-mix(in srgb, var(--success) 55%, var(--line));
color: var(--success);
}
.copy-page-button-wrap:has(.copy-page-button--copied) .copy-page-button__status {
color: var(--success);
}
.copy-page-button--error,
.copy-page-button--error:hover:not(:disabled) {
border-color: #b54a4a;
color: #b54a4a;
}
.copy-page-button__icon {
position: absolute;
left: 10px;
top: 50%;
flex-shrink: 0;
transform: translateY(-50%);
}
.copy-page-button__label {
display: block;
width: 100%;
text-align: center;
white-space: nowrap;
}
.copy-page-button__status {
margin: 0;
max-width: 220px;
font-size: 0.72rem;
line-height: 1.35;
color: var(--muted);
text-align: right;
}
.book-chapter__lead {
margin: 16px 0 0;
font-size: 1.05rem;
line-height: 1.65;
color: var(--soft-ink);
}
.book-prose {
font-size: 1rem;
line-height: 1.7;
color: var(--ink);
}
.book-prose > p {
margin: 0 0 1.1em;
}
.book-prose a {
color: var(--accent);
font-weight: 600;
text-decoration: none;
text-underline-offset: 3px;
}
.book-prose a:hover,
.book-prose a:focus-visible {
text-decoration: underline;
}
.book-prose__heading {
margin: 2em 0 0.6em;
}
.book-prose h2.book-prose__heading {
font-size: 1.35rem;
font-weight: 600;
letter-spacing: -0.01em;
}
.book-prose h3.book-prose__heading {
margin-top: 1.35em;
font-size: 1.1rem;
font-weight: 500;
color: var(--soft-ink);
}
.book-prose h2.book-prose__heading,
.book-prose h3.book-prose__heading {
scroll-margin-top: 96px;
}
.book-figure {
margin: 1.5em 0 1.75em;
max-width: 100%;
}
.book-figure__img {
display: block;
width: 100%;
height: auto;
border-radius: 10px;
border: 1px solid var(--line);
box-shadow: 0 8px 24px var(--shadow-soft);
}
.book-figure__caption {
margin: 0.65em 0 0;
font-size: 0.88rem;
line-height: 1.5;
color: var(--muted);
}
.book-formula {
margin: 0;
font-family: var(--mono);
font-size: 1.1rem;
letter-spacing: 0.02em;
}
.book-formula--inline {
font-size: 0.95rem;
}
.book-callout {
margin: 1.5em 0;
padding: 18px 20px;
border-left: 3px solid var(--accent);
border-radius: 0 10px 10px 0;
background: var(--card-bg);
}
.book-callout--formula {
text-align: center;
border-left: none;
border: 1px solid var(--card-border);
border-radius: 12px;
}
.book-callout--dse {
border-left-color: var(--muted);
}
.book-callout__label {
margin: 0 0 8px;
font-family: var(--mono);
font-size: 0.68rem;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--accent);
}
.book-table-wrap {
margin: 1.25em 0 1.5em;
overflow-x: auto;
}
.book-table {
width: 100%;
border-collapse: collapse;
font-size: 0.92rem;
border: 1px solid var(--line);
}
.book-table th,
.book-table td {
padding: 12px 14px;
text-align: left;
border: 1px solid var(--line);
vertical-align: top;
}
.book-table thead th {
font-family: var(--mono);
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--ink);
background: rgba(154, 107, 46, 0.08);
}
.book-table tbody td:first-child {
font-family: var(--mono);
font-size: 0.88rem;
}
.book-table tbody tr:nth-child(even) td {
background: rgba(154, 107, 46, 0.04);
}
.book-prose .katex {
font-size: 1.05em;
}
.book-formula .katex-display {
margin: 0;
}
.math-widget-mount {
margin-top: 40px;
max-width: 960px;
}
.book-question {
margin: 1rem 0;
border: 1px solid var(--card-border);
border-radius: 12px;
background: var(--card-bg);
}
.book-question__prompt {
position: relative;
padding: 14px 18px 14px 2.75rem;
font-weight: 500;
line-height: 1.55;
cursor: pointer;
list-style: none;
}
.book-question__prompt::-webkit-details-marker {
display: none;
}
.book-question__prompt::marker {
content: "";
}
.book-question__prompt::before {
content: "";
position: absolute;
left: 1.125rem;
top: 1.35em;
width: 0.45em;
height: 0.45em;
border-right: 2px solid var(--accent);
border-bottom: 2px solid var(--accent);
transform: rotate(-45deg);
transition: transform 200ms ease;
}
.book-question[open] .book-question__prompt::before {
top: 1.5em;
transform: rotate(45deg);
}
.book-question__prompt:hover::before,
.book-question__prompt:focus-visible::before {
border-color: var(--ink);
}
.book-question__solution {
padding: 0 18px 16px;
border-top: 1px solid var(--card-border);
font-size: 0.95rem;
color: var(--soft-ink);
}
.book-question__solution p {
margin: 0.75rem 0 0;
}
// Legacy/alternate markup — prefer book-question__solution in chapter HTML
.book-question__answer {
padding: 0 18px 16px;
border-top: 1px solid var(--card-border);
font-size: 0.95rem;
color: var(--soft-ink);
}
.book-question__answer p {
margin: 0.75rem 0 0;
}
.ratio-demo__bars {
display: flex;
width: 100%;
max-width: 400px;
height: 28px;
margin: 16px 0 20px;
border-radius: 8px;
overflow: hidden;
border: 1px solid var(--card-border);
}
.ratio-demo__bar--a {
background: var(--math-root, #2563eb);
}
.ratio-demo__bar--b {
background: var(--math-curve, #9a6b2e);
}
.book-chapter-footer {
margin-top: 3.5rem;
padding-top: 2rem;
border-top: 1px solid var(--line);
max-width: var(--prose-width);
}
.book-chapter-footer__catalog {
display: inline-block;
margin-bottom: 1.25rem;
font-family: var(--mono);
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
text-decoration: none;
color: var(--soft-ink);
}
.book-chapter-footer__catalog:hover,
.book-chapter-footer__catalog:focus-visible {
color: var(--accent);
}
.book-chapter-footer__adjacent {
display: grid;
gap: 12px;
}
@media (min-width: 640px) {
.book-chapter-footer__adjacent {
grid-template-columns: 1fr 1fr;
gap: 16px;
}
}
.book-chapter-footer__link {
display: flex;
flex-direction: column;
gap: 6px;
padding: 16px 18px;
border: 1px solid var(--card-border);
border-radius: 12px;
background: var(--card-bg);
text-decoration: none;
color: var(--ink);
transition: border-color 200ms ease, box-shadow 200ms ease;
}
.book-chapter-footer__link:hover,
.book-chapter-footer__link:focus-visible {
border-color: var(--accent);
box-shadow: 0 6px 20px var(--shadow-soft);
}
.book-chapter-footer__link--next {
text-align: right;
}
.book-chapter-footer__label {
font-family: var(--mono);
font-size: 0.65rem;
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--muted);
}
.book-chapter-footer__title {
font-family: var(--font-heading);
font-size: 1.05rem;
line-height: 1.35;
color: var(--ink);
}
.book-chapter-footer__spacer {
display: none;
}
@media (min-width: 640px) {
.book-chapter-footer__spacer {
display: block;
}
}
.book-page--chapter .book-callout--dse {
max-width: var(--prose-width);
margin-top: 2rem;
}
@media (min-width: 900px) {
.book-page--chapter .book-chapter {
max-width: none;
}
.book-prose {
max-width: var(--prose-width);
}
}