/*
Theme Name: Modus Publications
Theme URI: https://example.com/modus-publications
Author: Modusventure Studio
Author URI: https://example.com
Description: Ebook catalog + publishing-services theme for Modus Publications, a Modusventure subsidiary. Built to match the original readdy.ai design (fonts, colors, layout, imagery) with content editable via WordPress.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: moduspublications
*/

:root {
  --ink: #0b0b0b;
  --muted: #5d5d5d;
  --muted-2: #8a8a8a;
  --paper: #ffffff;
  --paper-2: #fafafa;
  --paper-3: #f2f2f2;
  --border: #e6e6e6;
  --border-2: #dcdcdc;
  --red: #d4142b;
  --red-dark: #8d000e;
  --red-tint: #ffe6e6;
  --accent: #a84811;
  --accent-tint: #fdeee6;
  --radius: 6px;
  --font-heading: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --container: 1240px;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--paper);
  font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.wrap { width: 100%; max-width: 100%; overflow-x: hidden; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }

h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.01em; margin: 0; color: var(--ink); }
.eyebrow { font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); margin-bottom: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius); font-weight: 600; font-size: 0.875rem;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-outline { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.2); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.btn-outline:hover { background: rgba(255,255,255,0.2); }
.section .btn-outline { color: var(--ink); border-color: var(--border-2); }
.section .btn-outline:hover { background: var(--paper-3); }

/* ===== Header =====
   Fixed (not sticky) so it can float transparently over the homepage hero.
   .is-transparent (front page only, before scroll) = see-through with
   white nav text; the default/scrolled state is the frosted white bar.
   Because the header is fixed and out of flow, .wrap carries the matching
   top padding, and the hero pulls itself back up under it. */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(250,250,250,0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background-color .3s ease, border-color .3s ease, backdrop-filter .3s ease;
}
.site-header.is-transparent { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.wrap { padding-top: 80px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 80px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-mark-img { height: 38px; width: auto; border-radius: 4px; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.1875rem; color: var(--ink); transition: color .3s ease; }
.logo-sub { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.is-transparent .logo-title { color: #fff; }
.is-transparent .logo-sub { color: rgba(255,255,255,0.75); }

.desktop-nav { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 10px 16px; border-radius: var(--radius); font-weight: 500; font-size: 0.875rem; color: var(--muted); transition: color .15s ease, background-color .15s ease; border: none; background: none; font-family: inherit; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.nav-link:hover { color: var(--ink); background: var(--paper-3); }
.nav-link.active { color: var(--red); background: var(--red-tint); }
.is-transparent .nav-link { color: rgba(255,255,255,0.8); }
.is-transparent .nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.is-transparent .nav-link.active { color: #fff; background: rgba(255,255,255,0.15); }

.nav-item-dropdown { position: relative; }
.nav-chevron { font-size: 1rem; transition: transform .2s ease; }
.nav-item-dropdown.open .nav-chevron { transform: rotate(180deg); }
.nav-dropdown-panel {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px;
  width: 280px; background: var(--paper); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav-item-dropdown.open .nav-dropdown-panel { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-dropdown-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; font-size: 0.875rem; color: var(--ink); }
.nav-dropdown-item:hover { color: var(--red); background: var(--red-tint); }
.nav-dropdown-icon { flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--paper-3); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.nav-dropdown-viewall { margin-top: 6px; padding: 10px 12px 6px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: 0.875rem; font-weight: 600; color: var(--red); }
.nav-dropdown-viewall:hover { color: var(--red-dark); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn-plain { background: none; border: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); font-size: 1.125rem; color: var(--muted); }
.icon-btn-plain:hover { background: var(--paper-3); color: var(--ink); }
.is-transparent .icon-btn-plain { color: rgba(255,255,255,0.85); }
.is-transparent .icon-btn-plain:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Hamburger: a plain icon-swap (menu <-> close), no hand-drawn bars —
   matches the original's ri-menu-line / ri-close-line toggle exactly. */
.hamburger { display: none; background: none; border: none; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--radius); font-size: 1.25rem; color: var(--ink); }
.hamburger:hover { background: var(--paper-3); }
.is-transparent .hamburger { color: #fff; }
.is-transparent .hamburger:hover { background: rgba(255,255,255,0.1); }
.hamburger-icon-close { display: none; }
.hamburger[aria-expanded="true"] .hamburger-icon-open { display: none; }
.hamburger[aria-expanded="true"] .hamburger-icon-close { display: inline; }

/* Mobile menu: a compact dropdown directly under the header row (not a
   full-screen takeover) — solid white, auto height, scrolls internally if
   the expanded Services accordion makes it taller than the viewport. */
.mobile-menu { display: none; max-height: calc(100vh - 80px); overflow-y: auto; background: var(--paper-2); border-bottom: 1px solid var(--border); }
.mobile-menu.open { display: block; }
.mobile-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; }
.mobile-nav-link { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--radius); font-size: 0.875rem; font-weight: 500; color: var(--ink); background: none; border: none; font-family: inherit; cursor: pointer; }
.mobile-nav-link:hover { background: var(--paper-3); }
.mobile-nav-link.active { color: var(--red); background: var(--red-tint); }
.mobile-accordion-btn { display: flex; align-items: center; justify-content: space-between; }
.mobile-accordion.open .nav-chevron { transform: rotate(180deg); }
.mobile-accordion-panel { max-height: 0; overflow: hidden; padding: 0 4px; transition: max-height .2s ease; }
.mobile-accordion.open .mobile-accordion-panel { max-height: 600px; padding: 4px 4px 8px; }

/* ===== Hero =====
   Fixed height + centered flex (matches h-[520px] md:h-[680px]), a 3-stop
   dark gradient scrim over the photo, and its own narrow 768px column with
   16px side padding — kept separate from .container (32px padding) since
   stacking the two was quietly narrowing the text box enough to wrap the
   headline onto two lines instead of one. */
.hero { position: relative; height: 520px; margin-top: -80px; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.4), rgba(0,0,0,.3) 50%, rgba(0,0,0,.5)); }
.hero-inner { position: relative; z-index: 1; max-width: 768px; margin: 0 auto; padding: 0 16px; text-align: center; }
.hero h1 { color: #fff; font-size: 2.25rem; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 16px; }
.hero p { color: rgba(255,255,255,0.8); font-size: 1rem; line-height: 1.6; margin: 0 auto 32px; max-width: 560px; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; }
@media (min-width: 768px) {
  .hero { height: 680px; }
  .hero h1 { font-size: 3.75rem; }
  .hero p { font-size: 1.125rem; }
  .hero-actions { flex-direction: row; }
}
@media (min-width: 1280px) {
  .hero h1 { font-size: 4.5rem; }
}

/* ===== Sections ===== */
.section { padding: 88px 0; }
.section-muted { background: var(--paper-2); }
.section-dark { background: #141414; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: #a6a6a6; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 44px; flex-wrap: wrap; }
.section-head h2 { font-size: 2.25rem; line-height: 40px; }
.section-head-center { justify-content: center; text-align: center; }
.section-intro { color: var(--muted); font-size: 1.0625rem; margin: -24px 0 40px; max-width: 640px; }
.section-intro-inline { color: var(--muted); font-size: 0.9375rem; line-height: 1.6; max-width: 320px; margin: 0; text-align: right; }
.view-all { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-weight: 600; font-size: 0.9375rem; }

.page-head { padding: 48px 0; background: var(--paper-2); border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: 2.25rem; line-height: 1.15; margin-top: 4px; }
.page-head-copy { color: var(--muted); font-size: 1.0625rem; max-width: 640px; margin: 18px 0 0; }
.page-head-center { text-align: center; }
.page-head-center .page-head-copy { margin-left: auto; margin-right: auto; }

/* Services page only: a full-bleed dark photo hero instead of the plain
   light band Catalog/Contact use. */
.page-hero { position: relative; height: 420px; margin-top: -80px; display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; }
.page-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.page-hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,.4) 50%, rgba(0,0,0,.6)); }
.page-hero-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 0 24px; }
.page-hero .eyebrow { color: #f0a06e; }
.page-hero h1 { color: #fff; font-size: 3.75rem; line-height: 1.1; margin: 0 0 16px; }
.page-hero p { color: rgba(255,255,255,0.8); font-size: 1.125rem; line-height: 1.6; max-width: 560px; margin: 0 auto; }
@media (min-width: 768px) { .page-hero { height: 560px; } }

.cta-band { background: #141414; padding: 90px 0; text-align: center; }
.cta-inner { max-width: 620px; margin: 0 auto; }
.cta-band h2 { color: #fff; font-size: 2.25rem; }
.cta-band p { color: #a6a6a6; margin: 16px 0 32px; font-size: 1.0625rem; }

/* ===== Book grid / card ===== */
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.book-grid-narrow { grid-template-columns: repeat(2, 1fr); max-width: 620px; }
.book-card { display: block; background: var(--paper); }
.book-cover { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 2/3; background: var(--paper-3); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.book-card:hover .book-cover img { transform: scale(1.04); }
.book-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.mp-badge { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.01em; padding: 3px 9px; border-radius: 999px; text-transform: none; }
.mp-badge-bestseller { background: var(--red); color: #fff; }
.mp-badge-new { background: var(--accent); color: #fff; }
.mp-badge-sale { background: var(--ink); color: #fff; }
.mp-badge-category { background: var(--paper-3); color: var(--ink); border-radius: 4px; }
.book-info { padding-top: 16px; }
.book-info h3 { font-size: 1.125rem; line-height: 1.3; margin-bottom: 4px; }
.book-author { color: var(--muted); font-size: 0.875rem; margin: 0 0 8px; }
.book-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mp-stars { color: #d4a72c; font-size: 0.8125rem; letter-spacing: 1px; }
.mp-stars .ri-star-line { color: var(--border-2); }
.rating-count { color: var(--muted-2); font-size: 0.8125rem; }
.book-price { display: flex; align-items: baseline; gap: 8px; }
.price-now { color: var(--red); font-weight: 700; font-size: 1.0625rem; }
.price-was { color: var(--muted-2); text-decoration: line-through; font-size: 0.875rem; }

/* ===== Genres ===== */
.genre-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.genre-pill { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--paper); border: 1px solid var(--border-2); border-radius: 10px; font-weight: 500; font-size: 0.875rem; color: var(--muted); transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.genre-pill .ri-arrow-right-s-line { color: var(--muted-2); transition: color .15s ease; }
.genre-pill:hover { border-color: #ff8a82; background: var(--red-tint); color: var(--red-dark); }
.genre-pill:hover .ri-arrow-right-s-line { color: var(--red); }
@media (min-width: 640px) { .genre-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .genre-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

/* ===== Why cards ===== */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.why-card { text-align: left; }
.section-dark .why-card { background: #1c1c1c; padding: 28px; border-radius: var(--radius); }
.why-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius); background: var(--red-tint); color: var(--red); font-size: 1.375rem; margin-bottom: 16px; }
.section-dark .why-icon { background: rgba(212,20,43,0.15); }
.why-card h3 { font-size: 1.125rem; margin-bottom: 8px; }
.why-card p { font-size: 0.9375rem; margin: 0; }
.section:not(.section-dark) .why-card p, .section-muted .why-card p { color: var(--muted); }

/* ===== Catalog =====
   Search box lives in the page-head band, its own row under the H1;
   genre filters + sort share one row below (filters left, sort right). */
.catalog-search-row { position: relative; max-width: 576px; margin-top: 24px; }
.catalog-search-row .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 1rem; pointer-events: none; }
#catalog-search { width: 100%; padding: 13px 16px 13px 40px; border: 1px solid var(--border-2); border-radius: 8px; font-size: 0.875rem; font-family: inherit; background: var(--paper); }
#catalog-search:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }

.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-btn { padding: 7px 14px; border-radius: 999px; border: none; background: var(--paper-3); color: var(--muted); font-weight: 500; font-size: 0.8125rem; transition: background-color .15s ease, color .15s ease; }
.filter-btn:hover { background: var(--border-2); }
.filter-btn.active, .filter-btn.active:hover { background: var(--red); color: #fff; }
.catalog-sort-row { display: flex; align-items: center; gap: 8px; flex: none; }
.catalog-sort-label { font-size: 0.8125rem; color: var(--muted); }
#catalog-sort {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 7px 30px 7px 10px; border: 1px solid var(--border-2); border-radius: 6px;
  font-size: 0.8125rem; font-family: inherit; background-color: var(--paper-3); color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d5d5d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
.catalog-count { color: var(--muted); font-size: 0.875rem; margin: 0 0 24px; }
.catalog-empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 1rem; }

/* ===== Services page: 2-column offering cards, red/orange icon accent
   alternating by position ===== */
.service-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.service-card { display: flex; gap: 20px; padding: 28px; background: var(--paper-2); border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s ease; scroll-margin-top: 104px; }
.service-card:hover { border-color: #ff8a82; }
.service-icon { flex: none; width: 52px; height: 52px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.375rem; }
.service-icon-red { background: var(--red); }
.service-icon-orange { background: var(--accent); }
.service-body { flex: 1; min-width: 0; }
.service-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.service-row-head h3 { font-size: 1.25rem; }
.service-number { font-family: var(--font-heading); font-size: 0.875rem; font-weight: 700; flex: none; }
.service-number-red { color: var(--red); }
.service-number-orange { color: var(--accent); }
.service-tagline { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 10px; }
.service-body p { color: var(--muted); font-size: 0.875rem; line-height: 1.6; margin: 0 0 14px; }
.service-link { color: var(--red); font-weight: 600; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 768px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== Contact ===== */
.contact-narrow { max-width: 720px; margin: 0 auto; }
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 40px; }
.contact-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 20px; background: var(--paper); border: 1px solid var(--border); border-radius: 10px; }
.contact-card-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--red-tint); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 1.0625rem; margin-bottom: 8px; }
.contact-card-label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.contact-card-value { font-size: 0.75rem; color: var(--muted); }
a.contact-card-value:hover { color: var(--red); }
.contact-form { border: 1px solid var(--border); border-radius: 12px; padding: 32px; display: flex; flex-direction: column; gap: 20px; background: var(--paper); }
.form-field { display: flex; flex-direction: column; gap: 8px; font-size: 0.875rem; font-weight: 600; }
.form-field input, .form-field textarea { font-family: inherit; font-size: 0.9375rem; padding: 13px 16px; border: 1px solid var(--border-2); border-radius: var(--radius); font-weight: 400; resize: vertical; }
.form-hint { font-weight: 400; color: var(--muted-2); font-size: 0.75rem; }
.form-submit { width: 100%; }
.form-note { text-align: center; color: var(--red); font-weight: 600; font-size: 0.875rem; margin: 0; min-height: 1em; }

.mini-modal { position: fixed; inset: 0; background: rgba(10,10,10,.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.mini-modal.open { display: flex; }
.mini-modal-card { background: #fff; border-radius: 12px; padding: 40px; max-width: 380px; width: 100%; text-align: center; position: relative; }
.mini-modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; font-size: 1.375rem; color: var(--muted); }
.mini-modal-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--red-tint); color: var(--red); font-size: 1.75rem; margin-bottom: 16px; }
.mini-modal-card h3 { margin-bottom: 8px; }
.mini-modal-card p { color: var(--muted); margin: 0 0 24px; }

/* ===== Book detail ===== */
.breadcrumb { display: flex; align-items: center; gap: 10px; padding: 20px 32px; color: var(--muted-2); font-size: 0.8125rem; }
.breadcrumb a:hover { color: var(--red); }
.book-detail { padding-top: 32px; }
.book-detail-grid { display: grid; grid-template-columns: 420px 1fr; gap: 56px; }
.book-detail-cover { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,0.12); }
.book-meta-row { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.875rem; margin-bottom: 14px; }
.book-detail-info h1 { font-size: 2.5rem; }
.book-by { color: var(--muted); font-size: 1rem; margin: 10px 0 16px; }
.book-rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.rating-value { font-weight: 700; }
.book-price-row { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.book-price-row .price-now { font-size: 1.875rem; }
.book-price-row .price-was { font-size: 1.125rem; }
.book-about-heading { font-size: 1.25rem; margin-bottom: 12px; }
.book-about { color: var(--muted); font-size: 1rem; line-height: 1.7; max-width: 620px; }
.book-detail-actions { display: flex; gap: 14px; margin: 28px 0 36px; }
.book-fact-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); padding-top: 24px; }
.book-fact-grid .k { display: block; font-size: 0.75rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.book-fact-grid .v { font-weight: 600; }
.related-books { margin-top: 80px; padding-top: 56px; border-top: 1px solid var(--border); }
.related-books h2 { font-size: 1.5rem; margin-bottom: 28px; }

.page-generic { max-width: 760px; color: var(--muted); font-size: 0.9375rem; line-height: 1.8; }
.page-generic h2 { font-size: 1.375rem; margin: 36px 0 14px; color: var(--ink); }
.page-generic h2:first-child { margin-top: 0; }
.page-generic p { margin: 0 0 16px; }
.page-generic ul { margin: 0 0 16px; padding-left: 20px; }
.page-generic li { margin-bottom: 6px; }

/* ===== Footer (light-themed, matches the original: bg-background-100) ===== */
.site-footer { background: var(--paper-2); color: var(--muted); border-top: 1px solid var(--border); padding: 56px 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-logo img { height: 40px; width: auto; }
.footer-logo span { font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; margin: 0; max-width: 300px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col .heading { color: var(--ink); font-family: var(--font-heading); font-weight: 600; font-size: 1rem; margin-bottom: 8px; }
.footer-col a { font-size: 0.875rem; color: var(--muted); }
.footer-col a:not(.social-btn):hover { color: var(--red); }
.social-row { display: flex; gap: 10px; margin-top: 18px; }
.social-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--border); color: var(--muted); display: flex; align-items: center; justify-content: center; transition: background-color .15s ease, color .15s ease; }
.social-btn:hover { background: var(--red); color: #fff; }
.footer-bottom { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-bottom p { margin: 0; font-size: 0.8125rem; color: var(--muted-2); }
.footer-legal { display: flex; gap: 20px; font-size: 0.8125rem; }
.footer-legal a { color: var(--muted-2); }
.footer-legal a:hover { color: var(--red); }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
/* Nav switches to the hamburger below 768px — matches the original's own
   "hidden md:flex" / "md:hidden" cutoff exactly, so tablets in the 768–860px
   range (iPad included) get the real desktop nav, not the mobile menu. */
@media (max-width: 767px) {
  .desktop-nav, .icon-btn-plain { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 860px) {
  .book-detail-grid { grid-template-columns: 1fr; }
  .book-fact-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .contact-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .book-grid, .book-grid-narrow { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .why-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .catalog-toolbar { flex-direction: column; align-items: flex-start; }
  .catalog-sort-row { width: 100%; }
  #catalog-sort { flex: 1; }
  .service-row { flex-direction: column; }
}
