/* E-book store pages (books.php, book.php, ebook-get.php) — uses the site's design tokens from site.css */
.st-page { padding: 36px 0 80px; min-height: 60vh; }
.st-narrow { max-width: 860px; }
.st-head { margin-bottom: 30px; }
.st-head h1 { font: 500 clamp(34px, 4.4vw, 52px)/1.05 var(--serif); margin: 6px 0 10px; color: var(--ink); }
.st-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 28px; }
.st-center { text-align: center; padding: 48px 28px; } .st-center h1, .st-center h2 { font: 500 30px/1.15 var(--serif); margin: 0 0 10px; color: var(--ink); }
.st-muted { color: var(--muted); } .st-small { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 12px 0 0; }
.st-crumbs { margin: 0 0 18px; font-size: 14px; } .st-crumbs a { color: var(--muted); text-decoration: none; } .st-crumbs a:hover { color: var(--accent); }

.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.st-item { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; }
.st-item:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.st-item-cover { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; padding: 18px; }
.st-item-cover img { max-height: 100%; max-width: 70%; object-fit: contain; border-radius: 4px 8px 8px 4px; box-shadow: 8px 10px 24px -10px rgba(0,0,0,.45); }
.st-item-cover .st-cover-ph { height: 100%; aspect-ratio: 3 / 4; }
.st-item-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.st-item-body h2 { font: 500 22px/1.2 var(--serif); margin: 0; }
.st-by { margin: 0; font-size: 14px; }
.st-excerpt { margin: 4px 0 10px; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; flex: 1; }
.st-item-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.st-price { font: 600 22px var(--sans); color: var(--ink); }

.st-cover-ph { display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 3 / 4; width: 100%; max-width: 220px; padding: 16px 14px; border-radius: 4px 12px 12px 4px; background: linear-gradient(160deg, #23211e, #121110); color: #fff; position: relative; overflow: hidden; box-shadow: 10px 14px 30px -12px rgba(0,0,0,.55), inset 6px 0 0 rgba(255,255,255,.06); }
.st-cover-ph::after { content: ""; position: absolute; right: -50px; top: -50px; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(200,55,45,.85), transparent 70%); }
.st-cover-ph b { font: 500 20px/1.15 var(--serif); position: relative; z-index: 1; } .st-cover-ph small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; position: relative; z-index: 1; }
.st-cover-ph.big { max-width: 300px; margin: 0 auto; } .st-cover-ph.big b { font-size: 28px; }

.st-product { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr) minmax(0, 340px); gap: 36px; align-items: start; }
.st-product-cover img { width: 100%; border-radius: 4px 12px 12px 4px; box-shadow: 12px 16px 36px -14px rgba(0,0,0,.5); }
.st-product-info h1 { font: 500 clamp(32px, 3.6vw, 46px)/1.08 var(--serif); margin: 8px 0 6px; color: var(--ink); }
.st-desc { margin: 16px 0; color: var(--ink-2); font-size: 16px; line-height: 1.7; } .st-desc p { margin: 0 0 12px; }
.st-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--ink-2); font-size: 14.5px; }
.st-buy { position: sticky; top: 100px; padding: 24px; }
.st-buy-price { font: 600 34px var(--sans); color: var(--ink); margin-bottom: 14px; }
.st-buy label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; } .st-buy label span { font-weight: 400; color: var(--muted); }
.st-buy input { display: block; width: 100%; margin-top: 6px; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: 15px var(--sans); }
.st-buy input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.st-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; }
.st-buy-btn { width: 100%; justify-content: center; height: 50px; font-size: 16px; margin-top: 4px; }
.st-buy-btn:disabled { opacity: .7; cursor: wait; }
.st-msg { min-height: 1em; margin: 10px 0 0; font-size: 14px; line-height: 1.5; } .st-msg.bad { color: var(--accent); } .st-msg.ok { color: var(--ok, #2f7a4f); }
.st-lost { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; } .st-lost summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); } .st-lost form { margin-top: 12px; }

.st-get { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: center; }
.st-get h1 { font: 500 34px/1.12 var(--serif); margin: 6px 0 8px; color: var(--ink); }
.st-get-cover img { width: 100%; border-radius: 4px 10px 10px 4px; box-shadow: 10px 14px 30px -12px rgba(0,0,0,.5); }
.st-dl { margin-top: 12px; height: 52px; font-size: 16px; }
.st-dls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; } .st-dls .st-dl { margin-top: 0; }

/* prices: offer price + crossed-out original price */
.st-prices { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 16px; }
.st-prices .st-was, .st-prices .st-now { display: flex; flex-direction: column; gap: 3px; line-height: 1.1; }
.st-lbl { font: 600 10.5px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.st-was s { font: 500 18px var(--sans); color: var(--muted); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.st-now .st-price { color: var(--accent); }
.st-save { display: inline-block; align-self: center; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font: 700 12.5px/1.2 var(--sans); white-space: nowrap; }
.st-item-foot { flex-wrap: wrap; align-items: flex-end; row-gap: 14px; }
.st-buy-price .st-prices { gap: 8px 20px; }
.st-prices.big .st-price { font-size: 38px; }
.st-prices.big .st-was s { font-size: 24px; }
.st-prices.big .st-save { font-size: 13.5px; }

/* e-book popup in "available now" mode (js/site.js) */
.s-pop .st-prices { margin: 4px 0 18px; }
.s-pop .s-buy input[type="email"] { flex-basis: 100%; }
.s-pop .s-join-note a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .s-pop .st-prices { justify-content: center; margin-bottom: 14px; } .s-pop .st-prices.big .st-price { font-size: 32px; } .s-pop .st-prices.big .st-was s { font-size: 20px; } }

/* homepage e-books row */
.s-books-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-top: 26px; }

@media (max-width: 1100px) { .st-product { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); } .st-buy { grid-column: 1 / -1; position: static; } }
@media (max-width: 700px) { .st-product { grid-template-columns: 1fr; gap: 22px; } .st-product-cover { max-width: 240px; margin: 0 auto; } .st-get { grid-template-columns: 1fr; text-align: center; } .st-get-cover { max-width: 160px; margin: 0 auto; } .st-card { padding: 20px; } }
