/* SS Book Showcase - front end. Everything is scoped under .ssb so the theme cannot leak in. */

.ssb {
	--ssb-ink: #1b2b34;
	--ssb-rain: #1f5c6b;
	--ssb-rain-dark: #17464f;
	--ssb-mist: #eef3f4;
	--ssb-gold: #e0a526;
	--ssb-line: #d5dee1;
	--ssb-muted: #55666e;
	--ssb-danger: #b3261e;
	--ssb-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif Devanagari", serif;

	box-sizing: border-box;
	color: var(--ssb-ink);
	font-size: 16px;
	line-height: 1.6;
	text-align: left;
}
.ssb *, .ssb *::before, .ssb *::after { box-sizing: border-box; }
.ssb [hidden] { display: none !important; }
.ssb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html.ssb-lock { overflow: hidden; }

.ssb-archive, .ssb-single { padding: 24px 0 64px; }
.ssb-embed { padding: 0; }

/* ---- breadcrumbs ---------------------------------------------------- */
.ssb .ssb-crumbs { font-size: 14px; color: var(--ssb-muted); margin: 0 0 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.ssb .ssb-crumbs a { color: var(--ssb-rain); text-decoration: none; }
.ssb .ssb-crumbs a:hover { text-decoration: underline; }

/* ---- headings ------------------------------------------------------- */
.ssb .ssb-title {
	font-family: var(--ssb-serif);
	font-weight: 600;
	font-size: clamp(32px, 5vw, 46px);
	line-height: 1.12;
	letter-spacing: -0.01em;
	color: var(--ssb-ink);
	margin: 0 0 12px;
	padding: 0;
}
.ssb .ssb-head { padding: 0 0 28px; margin: 0 0 32px; border-bottom: 1px solid var(--ssb-line); }
.ssb .ssb-intro { font-size: 18px; line-height: 1.6; max-width: 62ch; color: var(--ssb-muted); margin: 0; }

/* ---- tools (filter chips + search) ----------------------------------- */
.ssb .ssb-tools { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin: 0 0 32px; }
.ssb .ssb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ssb .ssb-chip {
	appearance: none; background: #fff; color: var(--ssb-ink); font: inherit; font-size: 15px; line-height: 1;
	border: 1px solid var(--ssb-line); border-radius: 999px; padding: 10px 16px; min-height: 40px; cursor: pointer;
}
.ssb .ssb-chip:hover { border-color: var(--ssb-rain); }
.ssb .ssb-chip.is-active { background: var(--ssb-ink); border-color: var(--ssb-ink); color: #fff; }
.ssb .ssb-search input {
	font: inherit; font-size: 16px; min-height: 44px; width: 260px; max-width: 100%;
	border: 1px solid #9fb0b6; border-radius: 6px; padding: 8px 12px; background: #fff; color: var(--ssb-ink);
}
.ssb .ssb-nomatch, .ssb .ssb-empty { color: var(--ssb-muted); padding: 24px 0; }

/* ---- the book cover: spine crease + shadow --------------------------- */
.ssb .ssb-cover {
	position: relative; display: block; width: 100%;
	border-radius: 2px 6px 6px 2px; overflow: hidden; background: var(--ssb-ink);
	box-shadow: 0 1px 1px rgba(27, 43, 52, .25), 0 14px 26px -12px rgba(27, 43, 52, .55);
}
.ssb .ssb-cover::before { content: ""; display: block; padding-top: 150%; }
.ssb .ssb-cover::after {
	content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 7%; pointer-events: none;
	background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .16) 45%, rgba(0, 0, 0, 0) 100%);
}
.ssb .ssb-cover img.ssb-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; margin: 0; }
.ssb .ssb-cover-fallback {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 22% 16% 22% 18%;
	text-align: center; color: #fff; font-family: var(--ssb-serif); font-size: clamp(18px, 2.2vw, 26px); line-height: 1.25;
	background: linear-gradient(160deg, var(--ssb-rain-dark), var(--ssb-ink));
}
.ssb .ssb-cover-fallback::after { content: ""; position: absolute; inset: 14px 14px 14px 18px; border: 1px solid rgba(224, 165, 38, .65); pointer-events: none; }
.ssb .ssb-badge {
	position: absolute; left: 0; bottom: 16px; z-index: 2; background: var(--ssb-gold); color: var(--ssb-ink);
	font-size: 13px; font-weight: 600; line-height: 1; padding: 7px 12px 7px 14px; border-radius: 0 3px 3px 0;
}

/* ---- grid + cards ---------------------------------------------------- */
.ssb .ssb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 44px 32px; }
.ssb .ssb-grid-fixed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .ssb .ssb-grid-fixed { grid-template-columns: repeat(var(--ssb-cols, 3), minmax(0, 1fr)); } }

.ssb .ssb-card { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ssb .ssb-card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ssb .ssb-card-title { font-family: var(--ssb-serif); font-weight: 600; font-size: 21px; line-height: 1.25; margin: 0 0 4px; padding: 0; letter-spacing: 0; }
.ssb .ssb-card-title a { color: var(--ssb-ink); text-decoration: none; }
.ssb .ssb-card-title a:hover { color: var(--ssb-rain); }
.ssb .ssb-card-sub { font-style: italic; color: var(--ssb-muted); margin: 0 0 6px; font-size: 15px; }
.ssb .ssb-card-meta { color: var(--ssb-rain); font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.ssb .ssb-card-meta a { color: inherit; text-decoration: none; }
.ssb .ssb-card-meta a:hover { text-decoration: underline; }
.ssb .ssb-card-desc { color: var(--ssb-muted); font-size: 15px; line-height: 1.55; margin: 0 0 16px; }

.ssb .ssb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.ssb .ssb-card .ssb-actions { flex-direction: column; align-items: stretch; }

@media (max-width: 559px) {
	.ssb .ssb-grid, .ssb .ssb-grid-fixed { grid-template-columns: 1fr; gap: 36px; }
	.ssb .ssb-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; }
	.ssb .ssb-card-title { font-size: 19px; }
	.ssb .ssb-card-desc { display: none; }
}

/* ---- buttons --------------------------------------------------------- */
.ssb .ssb-btn {
	appearance: none; display: inline-flex; align-items: center; justify-content: center; text-align: center;
	min-height: 44px; padding: 10px 20px; border: 2px solid transparent; border-radius: 6px;
	font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
.ssb .ssb-btn-primary, .ssb a.ssb-btn-primary { background: var(--ssb-rain); color: #fff; }
.ssb .ssb-btn-primary:hover, .ssb a.ssb-btn-primary:hover { background: var(--ssb-rain-dark); color: #fff; }
.ssb .ssb-btn-ghost, .ssb a.ssb-btn-ghost { background: transparent; border-color: var(--ssb-rain); color: var(--ssb-rain); }
.ssb .ssb-btn-ghost:hover, .ssb a.ssb-btn-ghost:hover { background: var(--ssb-rain); color: #fff; }
.ssb .ssb-btn-gold { background: var(--ssb-gold); color: var(--ssb-ink); }
.ssb .ssb-btn-gold:hover { background: #ecb53a; color: var(--ssb-ink); }
.ssb .ssb-btn:disabled { opacity: .6; cursor: default; }
.ssb .ssb-btn:focus-visible, .ssb .ssb-chip:focus-visible, .ssb .ssb-iconbtn:focus-visible, .ssb .ssb-x:focus-visible,
.ssb a:focus-visible, .ssb .ssb-stage:focus-visible { outline: 3px solid var(--ssb-gold); outline-offset: 2px; }

/* ---- pager ----------------------------------------------------------- */
.ssb .ssb-pager ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 48px 0 0; padding: 0; }
.ssb .ssb-pager li { margin: 0; padding: 0; }
.ssb .ssb-pager a, .ssb .ssb-pager span { display: inline-block; min-width: 40px; text-align: center; padding: 9px 14px; border: 1px solid var(--ssb-line); border-radius: 6px; color: var(--ssb-ink); text-decoration: none; }
.ssb .ssb-pager .current { background: var(--ssb-ink); border-color: var(--ssb-ink); color: #fff; }

/* ---- single book ----------------------------------------------------- */
.ssb .ssb-book { display: grid; grid-template-columns: minmax(200px, 340px) minmax(0, 1fr); gap: 56px; align-items: start; }
.ssb .ssb-book-cover { position: sticky; top: 24px; }
.ssb .ssb-subtitle { font-family: var(--ssb-serif); font-style: italic; font-size: 22px; line-height: 1.35; color: var(--ssb-muted); margin: 0 0 8px; }
.ssb .ssb-byline { font-size: 17px; margin: 0 0 24px; color: var(--ssb-ink); }
.ssb .ssb-actions-lg { margin: 0 0 32px; }
.ssb .ssb-synopsis { font-family: var(--ssb-serif); font-size: 18px; line-height: 1.75; max-width: 66ch; margin: 0 0 32px; }
.ssb .ssb-synopsis > :first-child { margin-top: 0; }
.ssb .ssb-synopsis p { margin: 0 0 1em; }
.ssb .ssb-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 28px; margin: 0; padding: 22px 0 0; border-top: 1px solid var(--ssb-line); }
.ssb .ssb-facts div { margin: 0; }
.ssb .ssb-facts dt { font-size: 14px; color: var(--ssb-muted); margin: 0 0 2px; font-weight: 400; }
.ssb .ssb-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 800px) {
	.ssb .ssb-book { grid-template-columns: 1fr; gap: 32px; }
	.ssb .ssb-book-cover { position: static; max-width: 240px; margin: 0 auto; }
}

/* ---- inline interest section ----------------------------------------- */
.ssb .ssb-interest { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; margin: 72px 0 0; padding: 40px; background: var(--ssb-mist); border-radius: 8px; scroll-margin-top: 24px; }
.ssb .ssb-interest h2 { font-family: var(--ssb-serif); font-weight: 600; font-size: 28px; line-height: 1.2; margin: 0 0 10px; padding: 0; color: var(--ssb-ink); }
.ssb .ssb-interest-copy p { color: var(--ssb-muted); margin: 0; }
.ssb .ssb-more { margin: 72px 0 0; }
.ssb .ssb-more h2 { font-family: var(--ssb-serif); font-weight: 600; font-size: 28px; margin: 0 0 28px; padding: 0; color: var(--ssb-ink); }
@media (max-width: 860px) { .ssb .ssb-interest { grid-template-columns: 1fr; padding: 24px 20px; gap: 20px; } }

/* ---- form ------------------------------------------------------------ */
.ssb .ssb-form { margin: 0; }
.ssb .ssb-form-book { font-family: var(--ssb-serif); font-style: italic; color: var(--ssb-muted); margin: 0 0 16px; }
.ssb .ssb-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 560px) { .ssb .ssb-row { grid-template-columns: 1fr; } }
.ssb .ssb-field { margin: 0 0 16px; }
.ssb .ssb-field label { display: block; font-size: 15px; font-weight: 600; margin: 0 0 6px; color: var(--ssb-ink); }
.ssb .ssb-field abbr { text-decoration: none; color: var(--ssb-danger); }
.ssb .ssb-field input[type="text"], .ssb .ssb-field input[type="email"], .ssb .ssb-field input[type="tel"], .ssb .ssb-field textarea {
	display: block; width: 100%; max-width: 100%; margin: 0; font: inherit; font-size: 16px; line-height: 1.4; color: var(--ssb-ink);
	background: #fff; border: 1px solid #8fa2a9; border-radius: 6px; padding: 11px 12px; min-height: 46px; box-shadow: none;
}
.ssb .ssb-field textarea { resize: vertical; min-height: 96px; }
.ssb .ssb-field input:focus, .ssb .ssb-field textarea:focus { outline: none; border-color: var(--ssb-rain); box-shadow: 0 0 0 3px rgba(224, 165, 38, .6); }
.ssb .ssb-field [aria-invalid="true"] { border-color: var(--ssb-danger); }
.ssb .ssb-err { display: block; color: var(--ssb-danger); font-size: 14px; margin-top: 4px; min-height: 0; }
.ssb .ssb-err:empty { display: none; }
.ssb .ssb-consent label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; line-height: 1.5; }
.ssb .ssb-consent input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ssb-rain); }
.ssb .ssb-form-foot { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.ssb .ssb-status { margin: 0; font-size: 15px; }
.ssb .ssb-status.is-error { color: var(--ssb-danger); }
.ssb .ssb-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.ssb .ssb-thanks { padding: 8px 0; }
.ssb .ssb-thanks:focus { outline: none; }
.ssb .ssb-thanks-title { font-family: var(--ssb-serif); font-size: 26px; font-weight: 600; margin: 0 0 8px; }
.ssb .ssb-thanks p:last-child { margin: 0; color: var(--ssb-muted); }

/* ---- modals ---------------------------------------------------------- */
.ssb-modal-root.ssb { font-size: 16px; }
.ssb .ssb-modal { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.ssb .ssb-modal.is-open { opacity: 1; }
.ssb .ssb-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 26, 32, .72); }
.ssb .ssb-modal-panel { position: relative; display: flex; flex-direction: column; width: 100%; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }

.ssb .ssb-modal-reader .ssb-modal-panel { max-width: 980px; height: min(94vh, 960px); background: var(--ssb-ink); }
.ssb .ssb-reader-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 20px; background: var(--ssb-ink); color: #fff; }
.ssb .ssb-reader-title { margin: 0; font-family: var(--ssb-serif); font-size: 19px; line-height: 1.3; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssb .ssb-x { appearance: none; flex: none; width: 44px; height: 44px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 32px; line-height: 1; cursor: pointer; }
.ssb .ssb-x:hover { background: rgba(255, 255, 255, .14); }
.ssb .ssb-head-light { background: #fff; color: var(--ssb-ink); border-bottom: 1px solid var(--ssb-line); }
.ssb .ssb-head-light .ssb-x:hover { background: var(--ssb-mist); }
.ssb .ssb-form-title { margin: 0; font-family: var(--ssb-serif); font-weight: 600; font-size: 22px; line-height: 1.25; color: var(--ssb-ink); }

.ssb .ssb-stage { position: relative; flex: 1; min-height: 0; overflow: auto; background: #2a3b44; padding: 20px 16px; -webkit-overflow-scrolling: touch; }
.ssb .ssb-stage canvas.ssb-page { display: block; margin: 0 auto; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); max-width: none; }
.ssb .ssb-stage-msg { margin: 0; padding: 48px 16px; text-align: center; color: #d3dde1; }
.ssb .ssb-stage-msg a { color: var(--ssb-gold); font-weight: 600; }
.ssb .ssb-fallback { display: block; width: 100%; height: calc(100% - 56px); min-height: 360px; border: 0; background: #fff; }
.ssb .is-fallback .ssb-stage { padding: 0; }
.ssb .is-fallback .ssb-stage-msg { padding: 14px 16px; background: var(--ssb-ink); }

.ssb .ssb-reader-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--ssb-ink); border-top: 1px solid rgba(255, 255, 255, .12); }
.ssb .ssb-nav { display: flex; align-items: center; gap: 6px; color: #fff; }
.ssb .ssb-iconbtn { appearance: none; min-width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 6px; background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.ssb .ssb-iconbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.ssb .ssb-iconbtn:disabled { opacity: .35; cursor: default; }
.ssb .ssb-pageinfo { min-width: 104px; text-align: center; font-size: 15px; font-variant-numeric: tabular-nums; }
.ssb .ssb-sep { width: 1px; height: 24px; background: rgba(255, 255, 255, .25); margin: 0 6px; }
.ssb .is-fallback .ssb-nav { visibility: hidden; }

.ssb .ssb-modal-panel-form { max-width: 640px; max-height: 94vh; }
.ssb .ssb-modal-body { padding: 22px 22px 8px; overflow: auto; }

@media (max-width: 640px) {
	.ssb .ssb-modal { padding: 0; align-items: stretch; }
	.ssb .ssb-modal-panel, .ssb .ssb-modal-reader .ssb-modal-panel { max-width: none; height: 100%; max-height: none; border-radius: 0; }
	.ssb .ssb-modal-panel-form { height: auto; align-self: flex-end; max-height: 96%; border-radius: 12px 12px 0 0; }
	.ssb .ssb-reader-bar { justify-content: center; }
	.ssb .ssb-reader-bar .ssb-btn { width: 100%; }
	.ssb .ssb-stage { padding: 12px 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.ssb .ssb-modal, .ssb .ssb-btn { transition: none; }
}
