/* Ink Drip Comics — palette carried over from the original static site (__bak/css/style.css) */
:root {
  --bg: #0b0b0b;
  --bg2: #161616;
  --bg3: #202020;
  --line: #2e2e2e;
  --paper: #efe4c6;
  --red: #b20d0d;
  --red-dark: #6b0000;
  --green: #67b824;
  --gold: #d8c79a;
  --amber: #e0a526;
  --text: #d9d9d9;
  --muted: #9a9a9a;
  --radius: 6px;
  --container: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* The HTML `hidden` attribute must always win over component display rules (grid/flex) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; } /* smooth "Back to top" + in-page anchors */
/* Anchor targets land below the sticky header instead of under it */
[id] { scroll-margin-top: 9rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; } /* respect the OS "reduce motion" setting */
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Oswald', system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--paper); text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: 'Bebas Neue', 'Oswald', sans-serif; font-weight: 400; letter-spacing: .04em; color: var(--paper); line-height: 1.15; }
h1 { font-size: 2.6rem; margin-bottom: .5rem; }
h2 { font-size: 1.7rem; margin-bottom: .75rem; }
h3 { font-size: 1.3rem; }
code { background: var(--bg3); padding: .1em .35em; border-radius: 4px; font-size: .9em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 2rem; padding-bottom: 3rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ok { color: var(--green); }
.warn { color: var(--amber); }
.danger { color: #ff6b6b !important; }
.empty { padding: 2rem 0; color: var(--muted); }
section { margin-bottom: 2.5rem; }
.section-title { border-bottom: 1px solid var(--line); padding-bottom: .4rem; }

/* Impersonation banner */
.impersonation-bar { background: var(--amber); color: #1a1200; padding: .5rem 0; font-weight: 400; }
.impersonation-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.impersonation-bar .btn { background: #1a1200; }

/* Header */
.site-header { background: var(--bg2); border-bottom: 2px solid var(--red-dark); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 1rem; padding-top: .75rem; padding-bottom: .75rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; color: var(--paper); letter-spacing: .05em; }
.brand:hover { text-decoration: none; color: var(--white, #fff); }
.search { display: flex; flex: 1; min-width: 200px; max-width: 420px; }
.search input { flex: 1; border-radius: var(--radius) 0 0 var(--radius); }
.search button { border-radius: 0 var(--radius) var(--radius) 0; background: var(--red); color: #fff; border: 0; padding: 0 1rem; cursor: pointer; font-family: inherit; }
.nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--text); font-weight: 400; }
.nav a.active { color: var(--paper); border-bottom: 2px solid var(--red); }
.badge { background: var(--red); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .75rem; margin-left: .15rem; }

/* Search overlay */
.search { position: relative; }
.search-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; min-width: 300px;
  background: var(--bg2); border: 1px solid var(--line); border-top: 2px solid var(--red); border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0,0,0,.6); padding: .75rem;
}
.search-panel[hidden] { display: none; }
.search-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .5rem; }
.search-popular .chips { margin-bottom: 0; }
.search-hit { display: flex; gap: .75rem; align-items: center; padding: .4rem; border-radius: 4px; color: var(--text); }
.search-hit:hover, .search-hit:focus { background: var(--bg3); text-decoration: none; outline: none; }
.search-hit img { width: 40px; height: 60px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.search-hit-text { display: grid; line-height: 1.3; }
.search-hit-title { color: var(--paper); font-weight: 400; }
.search-hit-meta { color: var(--muted); font-size: .85rem; }
.search-all { display: block; padding: .5rem .4rem 0; border-top: 1px solid var(--line); margin-top: .4rem; }
.search-empty { color: var(--muted); padding: .25rem .4rem .75rem; }

/* Main navigation + mega menu */
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 40px; height: 36px; cursor: pointer; position: relative; }
.burger, .burger::before, .burger::after { position: absolute; left: 10px; width: 18px; height: 2px; background: var(--paper); content: ''; transition: transform .2s; }
.burger { top: 17px; } .burger::before { top: -6px; left: 0; } .burger::after { top: 6px; left: 0; }
.nav-toggle[aria-expanded="true"] .burger { background: transparent; }
.nav-toggle[aria-expanded="true"] .burger::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .burger::after { transform: translateY(-6px) rotate(-45deg); }

.main-nav { border-top: 1px solid var(--line); background: var(--bg); position: relative; }
.menu { list-style: none; display: flex; flex-wrap: wrap; gap: 0 .25rem; }
.menu > li { position: static; display: flex; align-items: center; }
.menu-link {
  display: block; padding: .65rem .9rem; color: var(--text); font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem;
  letter-spacing: .08em; border-bottom: 3px solid transparent;
}
.menu-link:hover, .menu-link.active { color: var(--paper); text-decoration: none; border-bottom-color: var(--red); }
.caret { font-family: 'Oswald', sans-serif; font-size: .75rem; color: var(--red); }
.mega-expand { display: none; }
.mega {
  display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 25;
  background: var(--bg2); border-top: 2px solid var(--red); border-bottom: 1px solid var(--line);
  box-shadow: 0 25px 50px rgba(0,0,0,.6); padding: 1.5rem 0;
}
.has-mega:hover > .mega, .has-mega:focus-within > .mega, .has-mega.expanded > .mega { display: block; }
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr) 1.3fr; gap: 2rem; }
.mega-col { display: grid; gap: .35rem; align-content: start; }
.mega-col a { color: var(--text); }
.mega-col a:hover { color: var(--paper); }
.mega-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.35rem; color: var(--paper); letter-spacing: .06em; border-bottom: 1px solid var(--line); padding-bottom: .25rem; margin-bottom: .25rem; }
.mega-promo {
  display: grid; align-content: end; gap: .25rem; min-height: 170px; padding: 1.25rem; border-radius: var(--radius);
  background: radial-gradient(circle at 80% 20%, rgba(178,13,13,.7), transparent 60%), var(--bg3); border: 1px solid var(--line);
}
.mega-promo:hover { text-decoration: none; border-color: var(--red); }
.mega-promo-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; color: var(--paper); line-height: 1; }
.active-filters { margin-top: -.5rem; }
.author-row { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Footer */
.site-footer { background: var(--bg2); border-top: 2px solid var(--red-dark); padding: 2.5rem 0 1.25rem; color: var(--muted); font-size: .9rem; }
.footer-cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2rem; margin-bottom: 2rem; }
.footer-cols nav { display: grid; gap: .4rem; align-content: start; }
.footer-cols h3 { font-size: 1.2rem; margin-bottom: .25rem; }
.footer-cols nav a { color: var(--text); }
.footer-brand .brand { margin-bottom: .5rem; }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Social links (footer + About page) */
.social { margin-top: 1rem; }
.social-heading { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; letter-spacing: .08em; color: var(--paper); margin-bottom: .4rem; }
.social-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.social-link {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--text); background: var(--bg2); transition: background .2s, color .2s, border-color .2s;
}
.social-link:hover, .social-link:focus-visible { background: var(--red); border-color: var(--red); color: #fff; text-decoration: none; }
.social-link .cut { fill: var(--bg2); transition: fill .2s; }
.social-link:hover .cut, .social-link:focus-visible .cut { fill: var(--red); }

/* Announcement bar */
.announce { background: var(--red); color: #fff; text-align: center; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; padding: .35rem 0; }

/* Forms & buttons */
input, select, textarea {
  background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .55rem .7rem; font: inherit; font-weight: 300; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
input[type="checkbox"], input[type="radio"] { width: auto; }
.btn {
  display: inline-block; background: var(--red); color: #fff; border: 0; border-radius: var(--radius);
  padding: .6rem 1.2rem; font: inherit; font-weight: 500; letter-spacing: .03em; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--red-dark); color: #fff; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .35rem .8rem; font-size: .9rem; }
.btn-block { display: block; width: 100%; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--bg3); }
.btn-danger { background: transparent; border: 1px solid #ff6b6b; color: #ff6b6b; }
.btn-danger:hover { background: rgba(255, 107, 107, .12); }
.link { background: none; border: 0; color: var(--gold); cursor: pointer; font: inherit; padding: 0; }
.link:hover { text-decoration: underline; }
form.inline { display: inline; }

.form { display: grid; gap: 1rem; max-width: 480px; }
.form-wide { max-width: 720px; }
.field { display: grid; gap: .3rem; align-content: start; } /* side-by-side fields keep inputs aligned even if one has a hint */
.field > span { font-weight: 400; color: var(--paper); font-size: .95rem; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: #ff6b6b; }
.error { color: #ff6b6b; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox, .radio { display: flex; align-items: center; gap: .5rem; }

/* Flash */
.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border-left: 4px solid; background: var(--bg2); }
.flash-success { border-color: var(--green); }
.flash-error { border-color: #ff6b6b; }
.flash-info { border-color: var(--gold); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--red-dark), var(--bg2)); border-radius: var(--radius); padding: 3rem 2rem; }
.hero h1 { font-size: 3.4rem; }
.hero p { max-width: 560px; margin-bottom: 1.5rem; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: .3rem .9rem; color: var(--text); text-transform: capitalize; }
.chip:hover, .chip.active { border-color: var(--red); color: var(--paper); text-decoration: none; }

/* Book grid / card */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.25rem; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-cover { aspect-ratio: 2 / 3; background: var(--bg3); display: block; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center; height: 100%; padding: 1rem;
  font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; color: var(--paper); line-height: 1.1;
  background: radial-gradient(circle at 30% 20%, var(--red-dark), var(--bg) 75%);
}
.cover-placeholder.large { font-size: 2.4rem; aspect-ratio: 2 / 3; border-radius: var(--radius); }
.card-body { padding: .8rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.card-title { font-size: 1.2rem; }
.card-title a { color: var(--paper); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .5rem; }
.price { color: var(--paper); font-weight: 500; }
.price.large { font-size: 1.8rem; margin: .5rem 0; }
.tag { font-size: .8rem; padding: .15rem .5rem; border-radius: 4px; display: inline-block; }
.tag-out { background: var(--bg3); color: var(--muted); }

/* Catalogue */
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.catalogue { display: grid; grid-template-columns: 200px 1fr; gap: 2rem; }
.filters ul { list-style: none; display: grid; gap: .3rem; }
.filters a { color: var(--text); }
.filters a.active { color: var(--paper); font-weight: 500; border-left: 3px solid var(--red); padding-left: .5rem; }
.toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toolbar label { display: flex; align-items: center; gap: .5rem; }
.toolbar select, .toolbar input { width: auto; }
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); }
.pagination .current { background: var(--red); border-color: var(--red); color: #fff; }

/* Book detail */
.crumbs { margin-bottom: 1rem; color: var(--muted); }
.book-detail { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; gap: 2.5rem; margin-bottom: 3rem; }
.book-cover img { border-radius: var(--radius); }
.gallery-main img { width: 100%; height: auto; box-shadow: 0 15px 35px rgba(0,0,0,.55); }
.gallery-thumbs { list-style: none; display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.gallery-thumbs a { display: block; border: 2px solid transparent; border-radius: 4px; opacity: .65; transition: opacity .2s, border-color .2s; }
.gallery-thumbs a:hover, .gallery-thumbs a.active { opacity: 1; border-color: var(--red); }
.gallery-thumbs img { width: 64px; height: 96px; object-fit: cover; border-radius: 2px; }
.admin-images { margin-top: 2.5rem; max-width: 720px; }
.admin-image-list { list-style: none; display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-image-list li { display: grid; gap: .25rem; text-align: center; color: var(--muted); }
.admin-image-list img { width: 120px; height: 180px; object-fit: cover; border-radius: 4px; }
.add-form { display: flex; gap: .75rem; align-items: center; margin: 1rem 0; }
.add-form label { display: flex; align-items: center; gap: .5rem; }
.add-form input { width: 80px; }
.description { margin: 1.5rem 0; max-width: 65ch; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; color: var(--muted); }
.meta dt { color: var(--paper); }

/* Tables */
.table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.table th, .table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-weight: 500; color: var(--paper); font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; }
.table .num { text-align: right; }
/* keep the cell a real table cell (display:flex here broke row alignment) */
.table .actions { white-space: nowrap; text-align: right; }
.table .actions > * + * { margin-left: .75rem; }
/* many buttons (admin Users): let them wrap instead of widening the table */
.table .actions-wrap { white-space: normal; }
.table .actions-wrap > * { display: inline-block; margin: .2rem 0 .2rem .5rem; }
.row-warn { background: rgba(224, 165, 38, .08); }
.qty-form { display: flex; gap: .4rem; align-items: center; }
.qty-form input { width: 70px; }

/* − qty + stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--red); border-radius: var(--radius); overflow: hidden; }
.stepper button {
  background: var(--red); color: #fff; border: 0; width: 2rem; height: 2rem; font: inherit; font-size: 1.1rem;
  line-height: 1; cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: var(--red-dark); }
.stepper button:disabled { background: var(--bg3); color: var(--muted); cursor: not-allowed; }
.stepper-qty { min-width: 2.2rem; text-align: center; color: var(--paper); font-weight: 500; }
.is-busy { opacity: .6; pointer-events: none; }

/* Toasts for in-place cart updates (public/js/cart.js) */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: .5rem; max-width: min(360px, calc(100vw - 32px)); }
.toast { margin: 0; box-shadow: 0 8px 24px rgba(0,0,0,.5); transition: opacity .4s, transform .4s; }
.toast.hide { opacity: 0; transform: translateY(8px); }

/* Cart summary / checkout */
.summary { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; max-width: 420px; margin-left: auto; display: grid; gap: .5rem; align-self: start; }
.summary p { display: flex; justify-content: space-between; gap: 1rem; }
.summary .total { font-size: 1.25rem; color: var(--paper); font-weight: 500; border-top: 1px solid var(--line); padding-top: .5rem; }
.checkout { display: grid; grid-template-columns: 1fr minmax(260px, 380px); gap: 2rem; margin-bottom: 1.5rem; }
.checkout .summary { margin-left: 0; max-width: none; }
.address { display: block !important; }

/* Status pills */
.status { text-transform: capitalize; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem; background: var(--bg3); }
.status-pending { color: var(--amber); }
.status-processing { color: var(--gold); }
.status-shipped { color: #6cb6ff; }
.status-delivered { color: var(--green); }
.status-cancelled { color: var(--muted); text-decoration: line-through; }
.status-on_hold { color: #f0c36b; }
.status-refunded { color: #c79bff; }

/* ================= Admin management screens (WooCommerce-style) ================= */
.admin-nav { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--line); margin: -1rem 0 1.5rem; }
.admin-nav a { padding: .55rem .9rem; color: var(--text); border-bottom: 3px solid transparent; font-weight: 400; }
.admin-nav a:hover { color: var(--paper); text-decoration: none; }
.admin-nav a.active { color: var(--paper); border-bottom-color: var(--red); }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.subsubsub { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: 1rem; font-size: .95rem; }
.subsubsub a { color: var(--gold); }
.subsubsub a.current { color: var(--paper); font-weight: 500; }
.subsubsub .count { color: var(--muted); }
.cap { text-transform: capitalize; }
.filters-bar .results { margin-left: auto; }
.inline-label { display: flex; align-items: center; gap: .4rem; color: var(--muted); }
.bulk-bar { margin-bottom: .5rem; }
.admin-table th a { color: var(--paper); }
.admin-table .check { width: 2rem; }
.admin-table .check input { width: 1rem; height: 1rem; }
.nowrap { white-space: nowrap; }
.stock-pill, .pay-pill { display: inline-block; font-size: .78rem; padding: .05rem .5rem; border-radius: 999px; background: var(--bg3); white-space: nowrap; }
.stock-in, .pay-paid { color: var(--green); }
.stock-low, .pay-unpaid { color: var(--amber); }
.stock-out, .pay-refunded { color: var(--muted); }
/* on/off switch (payment methods) */
.switch { width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg3); position: relative; cursor: pointer; vertical-align: middle; }
.switch span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch.on { background: var(--red-dark); border-color: var(--red); }
.switch.on span { transform: translateX(20px); background: #fff; }
.switch:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
/* order edit */
.order-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.order-col-title { font-family: 'Oswald', sans-serif; font-size: 1rem; font-weight: 500; color: var(--paper); text-transform: none; margin-bottom: .75rem; }
.field-static { display: grid; gap: .15rem; margin-bottom: .75rem; }
.field-static > span:first-child { color: var(--paper); font-size: .95rem; }
.order-columns section { display: grid; gap: .75rem; align-content: start; }
.totals { justify-items: end; }
.totals p { display: flex; justify-content: space-between; gap: 2rem; min-width: 280px; }
.totals .total { font-size: 1.15rem; color: var(--paper); font-weight: 500; border-top: 1px solid var(--line); padding-top: .4rem; }
.items-table { margin: 0; }
.refund-form { margin-top: 1rem; max-width: 420px; }
.order-notes { list-style: none; display: grid; gap: .6rem; max-height: 360px; overflow: auto; }
.order-notes li { background: var(--bg3); border-radius: var(--radius); padding: .6rem .7rem; border-left: 3px solid var(--line); }
.order-notes li.note-customer { border-left-color: var(--gold); }
.order-notes p { margin-bottom: .2rem; white-space: pre-line; }
.add-note { display: grid; gap: .5rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.add-note-row { display: flex; gap: .5rem; }
.add-note-row select { flex: 1; }
.taxonomy-layout { grid-template-columns: 300px minmax(0, 1fr); }
.inline-edit input, .admin-table td > input { min-width: 0; }
/* reports */
.kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kpis .stat small { font-size: .75rem; line-height: 1.3; }
.report-range .chips { margin: 0; }
.chart-card { padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.chart-head { margin-bottom: .5rem; }
.chart-title { font-family: 'Oswald', sans-serif; font-size: 1.1rem; font-weight: 500; color: var(--paper); text-transform: none; margin: 0; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: #2a2a2a; stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis { stroke: #3a3a3a; stroke-width: 1; shape-rendering: crispEdges; }
.chart-tick { fill: var(--muted); font-size: 12px; font-family: 'Oswald', sans-serif; }
.chart-bar { fill: #d23a2f; transition: fill .15s; } /* validated: >= 3:1 on #161616 (dataviz validate_palette.js) */
.chart-hit { fill: transparent; }
.chart-col { cursor: default; outline: none; }
.chart-col.is-active .chart-bar, .chart-col:focus-visible .chart-bar { fill: #ef5b4f; }
.chart-col:focus-visible .chart-hit { fill: rgba(255,255,255,.04); stroke: var(--gold); stroke-width: 1; }
.chart-tooltip { position: absolute; top: 0; pointer-events: none; display: grid; gap: .1rem; padding: .45rem .65rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 20px rgba(0,0,0,.5); font-size: .85rem; white-space: nowrap; z-index: 2; }
.chart-tooltip strong { color: var(--paper); font-size: 1rem; }
.chart-tooltip span { color: var(--muted); }
.chart-empty { padding: .5rem 0; }
.chart-table { margin-top: .75rem; }
.chart-table summary { cursor: pointer; color: var(--gold); }
.chart-table table { margin-top: .5rem; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 1rem; }
.report-grid .admin-table { margin: 0; }
/* customer-facing payment block */
.payment-options { display: grid; gap: .5rem; }
.payment-option { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; background: var(--bg2); display: grid; gap: .25rem; cursor: pointer; }
.payment-option:has(input:checked) { border-color: var(--red); }
.payment-option .radio { font-weight: 500; color: var(--paper); }
.payment-instructions { border: 1px solid var(--gold); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0 1.5rem; background: var(--bg2); }
.payment-instructions dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin-top: .5rem; }
.payment-instructions dt { color: var(--muted); }
.payment-instructions dd { color: var(--paper); font-weight: 500; word-break: break-all; }
.customer-notes { list-style: none; display: grid; gap: .5rem; margin-bottom: 1.5rem; }
.customer-notes li { background: var(--bg2); border-left: 3px solid var(--gold); padding: .6rem .8rem; border-radius: var(--radius); }

/* Admin stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-value { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; color: var(--paper); line-height: 1.1; }

/* Misc pages */
.auth-box { max-width: 480px; margin: 0 auto; }
.auth-box .form { margin: 1rem 0; }
.prose { max-width: 65ch; }
.prose p { margin-bottom: 1rem; }
.error-page { text-align: center; padding: 3rem 0; }
.error-code { font-family: 'Bebas Neue', sans-serif; font-size: 6rem; color: var(--red); line-height: 1; }
.error-page p { margin-bottom: 1.5rem; }

/* ================= Home page ================= */
body { overflow-x: clip; }
.full-bleed { width: 100vw; margin-left: calc(50% - 50vw); }
.btn-lg { padding: .8rem 1.6rem; font-size: 1.05rem; }
.section-heading { font-size: 2.2rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.row-head .section-heading { margin-bottom: .4rem; }
.row-link { font-weight: 400; white-space: nowrap; }

/* Hero */
.home-hero {
  position: relative; margin-top: -2rem; margin-bottom: 3rem; padding: 4rem 0 5rem; overflow: hidden;
  background:
    radial-gradient(circle at 75% 40%, rgba(178, 13, 13, .55), transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(107, 0, 0, .6), transparent 50%),
    var(--bg);
}
.home-hero::before { /* halftone dots */
  content: ''; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background-image: radial-gradient(var(--red) 1.4px, transparent 1.6px); background-size: 12px 12px;
  mask-image: linear-gradient(90deg, transparent 30%, #000 80%);
}
.home-hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.eyebrow { color: var(--red); text-transform: uppercase; letter-spacing: .2em; font-weight: 500; font-size: .85rem; margin-bottom: .5rem; }
.home-hero h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); line-height: .95; text-shadow: 0 4px 0 var(--red-dark); margin-bottom: .5rem; }
.hero-author { color: var(--gold); font-size: 1.15rem; margin-bottom: 1rem; }
.hero-blurb { max-width: 46ch; font-size: 1.1rem; margin-bottom: 1rem; }
.hero-price { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; color: var(--paper); margin-bottom: 1rem; }
.hero-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.home-hero-art { position: relative; display: block; height: 480px; }
.home-hero-art .fan { position: absolute; border-radius: 6px; box-shadow: 0 25px 50px rgba(0,0,0,.7); transition: transform .4s ease; }
.home-hero-art .fan-main { width: 300px; height: 450px; left: 50%; top: 0; transform: translateX(-50%); z-index: 3; object-fit: cover; }
.home-hero-art .fan-1 { width: 220px; height: 330px; left: 50%; top: 70px; transform: translateX(-120%) rotate(-10deg); z-index: 2; opacity: .85; }
.home-hero-art .fan-2 { width: 220px; height: 330px; left: 50%; top: 70px; transform: translateX(20%) rotate(10deg); z-index: 1; opacity: .85; }
.home-hero-art:hover .fan-main { transform: translateX(-50%) translateY(-8px) rotate(-1deg); }
.home-hero-art:hover .fan-1 { transform: translateX(-130%) rotate(-14deg); }
.home-hero-art:hover .fan-2 { transform: translateX(30%) rotate(14deg); }
.ink-edge { /* dripping ink bottom edge */
  position: absolute; left: 0; right: 0; bottom: -1px; height: 40px; background: var(--bg);
  -webkit-mask: radial-gradient(14px 18px at 50% 0, transparent 98%, #000) 0 0 / 40px 40px repeat-x;
  mask: radial-gradient(14px 18px at 50% 0, transparent 98%, #000) 0 0 / 40px 40px repeat-x;
}

/* Feature tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.tile { position: relative; display: block; height: 260px; border-radius: var(--radius); overflow: hidden; background: var(--bg3); border: 1px solid var(--line); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; filter: saturate(1.1); transition: transform .5s ease; }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.92)); }
.tile:hover img { transform: scale(1.06); }
.tile:hover { text-decoration: none; }
.tile-text { position: absolute; left: 1.25rem; right: 1.25rem; bottom: 1.1rem; z-index: 1; display: grid; }
.tile-title { font-family: 'Bebas Neue', sans-serif; font-size: 2.3rem; color: var(--paper); letter-spacing: .04em; line-height: 1; }
.tile-cta { color: var(--gold); font-weight: 400; }

/* Poster wall: mixed sizes */
.bento {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 230px);
  grid-template-areas: "xl xl wide wide" "xl xl sm1 sm2";
}
.bento-3 { grid-template-areas: "xl xl wide wide" "xl xl sm1 sm1"; }
.bento > .area-xl { grid-area: xl; }
.bento > .area-wide { grid-area: wide; }
.bento > .area-sm1 { grid-area: sm1; }
.bento > .area-sm2 { grid-area: sm2; }

.poster {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius);
  background: var(--bg3); border: 1px solid var(--line); min-height: 180px; isolation: isolate;
}
.poster:hover { text-decoration: none; border-color: var(--red); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s ease; }
.poster:hover img { transform: scale(1.05); }
.poster::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.9)); }
.poster-banner::after { background: linear-gradient(90deg, rgba(0,0,0,.75), transparent 65%); }
.poster-banner img { object-position: right center; }
.poster-xl img { object-position: center 20%; }
.poster-sm img { object-position: center 25%; }
.poster-text { position: absolute; left: 1.25rem; right: 1.25rem; bottom: 1.1rem; display: grid; gap: .1rem; }
.poster-banner .poster-text { top: 50%; bottom: auto; transform: translateY(-50%); max-width: 60%; }
.poster-eyebrow { color: var(--red); text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 500; }
.poster-title { font-family: 'Bebas Neue', sans-serif; color: var(--paper); line-height: .95; letter-spacing: .03em; font-size: 2rem; text-shadow: 0 3px 0 rgba(0,0,0,.6); }
.poster-xl .poster-title { font-size: clamp(2.6rem, 5vw, 4.2rem); }
.poster-wide .poster-title, .poster-half .poster-title { font-size: clamp(2.2rem, 3.5vw, 3rem); }
.poster-cta { color: var(--gold); font-weight: 400; }

/* Duo: two half-width banners */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
/* min-height:0 + min-width:0: with aspect-ratio, the base 180px min-height forced a 450px min width (overflowed phones) */
.duo .poster { aspect-ratio: 5 / 2; min-height: 0; min-width: 0; }

/* Spotlight: full-width cinematic banner */
.spotlight { position: relative; overflow: hidden; margin-bottom: 2.5rem; border-top: 2px solid var(--red-dark); border-bottom: 2px solid var(--red-dark); isolation: isolate; }
.spotlight-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; z-index: -1; }
.spotlight-inner { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; min-height: 420px; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.spotlight-copy { max-width: 560px; }
.spotlight h2 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: .95; text-shadow: 0 4px 0 var(--red-dark); margin-bottom: .25rem; }
.spotlight h2 a { color: var(--paper); }
.spotlight-blurb { margin-bottom: 1rem; max-width: 46ch; }
.spotlight .hero-price { margin: 0 .5rem 0 0; }
.spotlight-cover img { width: 200px; height: 300px; object-fit: cover; border-radius: 6px; box-shadow: 0 25px 50px rgba(0,0,0,.7); transform: rotate(3deg); transition: transform .4s; }
.spotlight-cover:hover img { transform: rotate(0) translateY(-6px); }

/* Benefits strip */
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; padding: 1.5rem; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); }
.benefit { display: flex; gap: 1rem; align-items: flex-start; }
.benefit svg { color: var(--red); flex-shrink: 0; }
.benefit strong { display: block; color: var(--paper); font-weight: 500; font-size: 1.05rem; }
.benefit span { color: var(--muted); font-size: .92rem; }

/* Genre row ("Choose your nightmare") */
.genre-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.genre-card { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--bg3); border: 1px solid var(--line); }
.genre-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, filter .3s; filter: grayscale(.35); }
.genre-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.9)); }
.genre-card:hover img { transform: scale(1.07); filter: none; }
.genre-card:hover { text-decoration: none; border-color: var(--red); }
.genre-name { position: absolute; left: .9rem; right: .9rem; bottom: 1.8rem; z-index: 1; font-family: 'Bebas Neue', sans-serif; font-size: 1.7rem; color: var(--paper); line-height: 1; text-transform: uppercase; }
.genre-count { position: absolute; left: .9rem; bottom: .6rem; z-index: 1; color: var(--gold); font-size: .85rem; }

/* Last chance */
.last-chance .row-head { border-color: var(--amber); }
.last-chance .section-heading { color: var(--amber); }

/* Newsletter */
.newsletter { background: linear-gradient(120deg, var(--red-dark), #200000 60%, var(--bg)); padding: 3rem 0; margin-bottom: -3rem; border-top: 2px solid var(--red); }
.newsletter-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.newsletter h2 { font-size: 2.4rem; text-transform: uppercase; margin-bottom: .25rem; }
.newsletter-form { display: flex; gap: .5rem; }
.newsletter-form input { flex: 1; }

/* ================= Admin book editor (WooCommerce-style) ================= */
.hint { color: var(--muted); font-size: .82rem; }
.counter { color: var(--muted); font-size: .8rem; justify-self: end; }
.counter.warn { color: var(--amber); }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.field-label { color: var(--paper); font-size: .95rem; margin: .25rem 0 -.5rem; }
.wc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.wc-main { display: grid; gap: 1.25rem; min-width: 0; }
.wc-side { display: grid; gap: 1rem; position: sticky; top: 9rem; }
.wc-title input { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; letter-spacing: .03em; padding: .5rem .8rem; }
.wc-permalink { margin-top: -1rem; }
.wc-box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); }
.wc-box-title { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 1rem; letter-spacing: .02em; text-transform: none; padding: .7rem 1rem; border-bottom: 1px solid var(--line); margin: 0; }
.wc-box-body { padding: 1rem; display: grid; gap: .65rem; }
.wc-box-body input[type="text"] { width: 100%; }
.wc-publish-actions { display: flex; justify-content: space-between; gap: .5rem; }
.wc-publish-main { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .25rem; }
.wc-checklist { display: grid; gap: .3rem; max-height: 210px; overflow: auto; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.wc-add-cat summary { cursor: pointer; color: var(--gold); }
.wc-add-cat input { margin-top: .5rem; }
.wc-file { position: relative; overflow: hidden; justify-self: start; }
.wc-file input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.wc-file:focus-within { outline: 2px solid var(--red); }
.wc-featured-preview img { width: 100%; max-width: 200px; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.wc-gallery { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.wc-gallery:empty { display: none; }
.wc-gallery li { position: relative; display: grid; gap: .2rem; justify-items: center; cursor: grab; }
.wc-gallery li.dragging { opacity: .4; }
.wc-gallery li.is-new img { outline: 2px dashed var(--gold); }
.wc-gallery img { width: 64px; height: 96px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
.wc-gallery-generated li { cursor: default; }
.wc-gallery-generated img { width: 48px; height: 72px; opacity: .8; }
.wc-remove { font-size: .72rem; color: var(--muted); display: flex; gap: .2rem; align-items: center; }
.wc-remove input { width: auto; }
.wc-generated-label { margin-top: .25rem; }
/* Book data panel */
.wc-data-body { display: grid; grid-template-columns: 170px minmax(0, 1fr); }
.wc-tabs { list-style: none; border-right: 1px solid var(--line); background: var(--bg); }
.wc-tabs button {
  width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text);
  padding: .65rem .9rem; font: inherit; cursor: pointer;
}
.wc-tabs button[aria-selected="true"] { background: var(--bg2); color: var(--paper); border-left: 3px solid var(--red); }
.wc-panels { padding: 1rem; min-width: 0; }
.wc-panel { border: 0; display: grid; gap: 1rem; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.wc-panel legend { font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem; color: var(--paper); margin-bottom: .5rem; }
.has-tabs .wc-panel { margin-bottom: 0; }
.has-tabs .wc-panel legend { display: none; }
.wc-data-body:not(:has(.wc-tabs:not([hidden]))) { grid-template-columns: 1fr; }
.wc-schedule-toggle { margin-top: -.5rem; }
.serp { background: #fff; color: #202124; border-radius: var(--radius); padding: .9rem 1rem; font-family: Arial, sans-serif; }
.serp-label { color: #5f6368 !important; margin-bottom: .3rem; }
.serp-url { color: #188038; font-size: .85rem; word-break: break-all; }
.serp-title { color: #1a0dab; font-size: 1.15rem; line-height: 1.3; margin: .15rem 0; }
.serp-desc { color: #4d5156; font-size: .9rem; line-height: 1.45; }
/* Admin books list */
.admin-thumb { width: 40px; height: 60px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); display: block; }
.star-btn { background: none; border: 0; cursor: pointer; font-size: 1.2rem; color: var(--muted); padding: 0 .25rem; line-height: 1; }
.star-btn.on { color: var(--amber); }
.badge-draft { background: var(--bg3); color: var(--amber); border-radius: 4px; padding: 0 .4rem; font-size: .8rem; }

/* Home-page book cards: hover/focus -> card grows and the cover turns into the comic poster */
.card-cover { overflow: hidden; }
.card-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.12); pointer-events: none;
}
.card-hover .card-cover::after { /* halftone comic dots over the poster */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background-image: radial-gradient(rgba(0,0,0,.35) 1px, transparent 1.4px); background-size: 6px 6px;
}
.card-burst {
  position: absolute; top: .6rem; right: .5rem; z-index: 2; pointer-events: none;
  background: var(--amber); color: #1a1200;
  font-family: 'Bebas Neue', sans-serif; font-size: 1.05rem; letter-spacing: .04em; line-height: 1;
  clip-path: polygon(50% 0, 61% 18%, 82% 10%, 78% 32%, 100% 38%, 82% 52%, 96% 72%, 72% 70%, 66% 94%, 50% 78%, 34% 94%, 28% 70%, 4% 72%, 18% 52%, 0 38%, 22% 32%, 18% 10%, 39% 18%);
  padding: 1rem .95rem; opacity: 0; transform: scale(.3) rotate(-25deg);
}
.card-hover:hover .card-poster, .card-hover:focus-within .card-poster { opacity: 1; transform: scale(1); }
.card-hover:hover .card-cover::after, .card-hover:focus-within .card-cover::after { opacity: .55; }
.card-hover:hover .card-burst, .card-hover:focus-within .card-burst { opacity: 1; transform: scale(1) rotate(-8deg); }
.card-hover:hover .card-cover-img, .card-hover:focus-within .card-cover-img { opacity: 0; }
.card-cover-img { transition: opacity .35s ease; }
.card-poster, .card-burst, .card-hover .card-cover::after { transition: opacity .35s ease, transform .4s cubic-bezier(.2, .8, .3, 1.3); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card-hover { position: relative; transition: transform .35s cubic-bezier(.2, .8, .3, 1.2), box-shadow .35s ease, border-color .35s ease; }
  .card-hover:hover, .card-hover:focus-within {
    transform: translateY(-8px) scale(1.08) rotate(-1deg); z-index: 5;
    border-color: var(--red); box-shadow: 0 22px 45px rgba(0,0,0,.75), 0 0 0 1px var(--red), 0 0 28px rgba(178,13,13,.45);
  }
}
@media (prefers-reduced-motion: reduce) {
  .card-poster, .card-burst, .card-cover-img, .card-hover .card-cover::after { transition: opacity .2s linear; transform: none !important; }
}

/* Sale prices (shop) */
.price-regular { color: var(--muted); text-decoration: line-through; font-weight: 300; margin-right: .35rem; font-size: .9em; }
.price-sale { color: #ff6b6b; }
.tag-sale { background: var(--red); color: #fff; border-radius: 4px; padding: .05rem .45rem; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; margin-left: .35rem; vertical-align: middle; }
.card-cover { position: relative; }
.card-cover .tag-sale { position: absolute; top: .5rem; left: .5rem; margin: 0; z-index: 1; }
.short-description { font-size: 1.05rem; margin: .75rem 0; max-width: 60ch; }
.book-tags { margin-top: 1rem; }
.details-table { margin-top: 1.5rem; }

/* FAQ */
.faq { max-width: 860px; }
.faq-intro { margin-bottom: 1.25rem; }
.faq-tools { display: grid; gap: .75rem; margin-bottom: 1.5rem; }
.faq-tools input[type="search"] { max-width: 520px; }
.faq-group { margin-bottom: 2rem; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); margin-bottom: .6rem; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: .9rem 2.75rem .9rem 1rem; position: relative; color: var(--paper); font-weight: 400;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--red); font-size: 1.4rem; line-height: 1; }
.faq-item[open] summary::after { content: '−'; }
.faq-item[open] summary { border-bottom: 1px solid var(--line); }
.faq-item summary:hover, .faq-item summary:focus-visible { color: #fff; outline: none; background: var(--bg3); }
.faq-answer { padding: .9rem 1rem 1rem; max-width: 70ch; }
.faq-contact { background: linear-gradient(120deg, var(--red-dark), var(--bg2) 70%); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: .6rem; justify-items: start; }
.faq-contact h2 { font-size: 1.8rem; margin: 0; }

/* Legal pages */
.legal { max-width: 75ch; }
.legal h2 { font-size: 1.6rem; margin-top: 2rem; }
.legal ul, .legal ol { padding-left: 1.4rem; margin-bottom: 1rem; display: grid; gap: .4rem; }
.legal-toc { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.legal-toc-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; color: var(--paper); margin-bottom: .4rem; }
.newsletter a { color: var(--paper); text-decoration: underline; }

/* Responsive */
@media (max-width: 800px) {
  /* Mobile menu: hamburger opens the main nav; mega menu becomes an inline accordion */
  .nav-toggle { display: inline-block; }
  .js .main-nav { display: none; }
  .js .main-nav.open { display: block; }
  .menu { flex-direction: column; padding: .25rem 0 .75rem; }
  .menu > li { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .menu-link { flex: 1; border-bottom: 0; }
  .menu-link.active { border-left: 3px solid var(--red); }
  .mega-expand {
    display: block; width: 44px; height: 40px; background: none; border: 0; color: var(--paper); cursor: pointer; position: relative;
  }
  .mega-expand::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.4rem; }
  .mega-expand[aria-expanded="true"]::after { content: '−'; }
  .caret { display: none; }
  .has-mega:hover > .mega, .has-mega:focus-within > .mega { display: none; }
  .has-mega.expanded > .mega, .no-js .has-mega > .mega { display: block; }
  .mega { position: static; flex-basis: 100%; box-shadow: none; border: 0; padding: .5rem 0 1rem; background: var(--bg); }
  .mega-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .mega-promo { grid-column: 1 / -1; min-height: 110px; }
  .search-panel { min-width: 0; }
  .wc-layout, .taxonomy-layout, .order-columns { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .filters-bar .results { margin-left: 0; }
  .totals p { min-width: 0; width: 100%; }
  .wc-side { position: static; }
  .wc-data-body { grid-template-columns: 1fr; }
  .wc-tabs { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .wc-tabs li { flex: 0 0 auto; }
  .wc-tabs button { border-bottom: 0; white-space: nowrap; }
  .wc-tabs button[aria-selected="true"] { border-left: 0; border-bottom: 3px solid var(--red); }
  .row-3 { grid-template-columns: 1fr 1fr; }
  .catalogue, .book-detail, .checkout { grid-template-columns: 1fr; }
  .filters ul { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
  .book-detail .book-cover { max-width: 260px; }
  .summary { max-width: none; margin-left: 0; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .nav { gap: .75rem; }
  h1 { font-size: 2rem; }
  .hero { padding: 2rem 1.25rem; }
  .hero h1 { font-size: 2.4rem; }
  .home-hero { padding: 2.5rem 0 4rem; }
  .home-hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .home-hero-art { height: 380px; order: -1; }
  .home-hero-art .fan-main { width: 230px; height: 345px; }
  .home-hero-art .fan-1, .home-hero-art .fan-2 { width: 170px; height: 255px; top: 55px; }
  .tiles, .benefits, .newsletter-inner { grid-template-columns: 1fr; }
  .bento, .bento-3 {
    grid-template-columns: 1fr 1fr; grid-template-rows: 340px 170px 190px;
    grid-template-areas: "xl xl" "wide wide" "sm1 sm2";
  }
  .bento-3 { grid-template-areas: "xl xl" "wide wide" "sm1 sm1"; }
  .poster-banner .poster-text { max-width: 75%; }
  .duo { grid-template-columns: 1fr; }
  .spotlight-inner { grid-template-columns: 1fr; min-height: 0; }
  .spotlight-bg { object-position: 75% center; opacity: .6; }
  .spotlight-cover { display: none; }
  .tile { height: 200px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  /* Genre / author cards: two per row instead of one huge card */
  .genre-row, .author-row { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .genre-name { font-size: 1.35rem; bottom: 1.6rem; }
  /* Book cards: price above a full-width button / stepper */
  .card-foot { flex-direction: column; align-items: stretch; gap: .4rem; }
  .card-foot .btn, .card-foot form:not(.stepper) { width: 100%; }
  .card-foot .stepper { align-self: flex-start; }
  .duo .poster { aspect-ratio: 2 / 1; }
  .row-2 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  /* Stack tables into labelled cards */
  .table thead { display: none; }
  .table tr { display: block; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; padding: .5rem; }
  .table td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .25rem; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); text-align: left; }
  .table .actions { justify-content: flex-end; gap: .75rem; }
  .table .actions > * + * { margin-left: 0; }
  .table .actions-wrap { flex-wrap: wrap; gap: .5rem; }
  .table .actions-wrap > * { margin: 0; }
}

/* Account page */
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-bottom: 2rem; }
.account-section { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; min-width: 0; }
.account-section h2 { margin-top: 0; }
.account-section h3 { margin: 1rem 0 .25rem; }
.account-section .form { max-width: none; }
@media (max-width: 800px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }
