/* ==========================================================================
   Oakbend Publishing — book printing / publishing house
   ========================================================================== */

:root {
  --ink:        #16181d;
  --ink-soft:   #3d424d;
  --muted:      #6f7681;
  --line:       #e6e8ec;
  --bg:         #ffffff;
  --bg-alt:     #f6f7f9;
  --accent:     #e2452f;
  --accent-dk:  #c2361f;
  --peach:      #f9d7c4;
  --mint:       #e9f2da;

  --shell:      1200px;
  --radius:     4px;
  --shadow:     0 18px 40px -22px rgba(16, 18, 23, .45);

  --sans: "Inter", "Segoe UI", "Helvetica Neue", "PingFang SC",
          "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease,
              transform .18s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--dark   { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; }

.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dk); }

.btn--ghost  { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

.btn--light  { background: #fff; color: var(--ink); }

/* --- top strip ---------------------------------------------------------- */

.topbar {
  background: var(--ink);
  color: #cfd3da;
  font-size: 12.5px;
}
.topbar .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
}
.topbar a { color: #fff; }
.topbar a:hover { color: var(--accent); }
.topbar__right { display: flex; align-items: center; gap: 18px; }
.topbar__sep { color: #4a4f59; }

/* --- header ------------------------------------------------------------- */

.masthead {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
}
.masthead .shell {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 74px;
}

.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand__mark {
  width: 40px; height: 40px;
  flex: none;
  object-fit: contain;
}
.brand__name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.brand__sub {
  display: block;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: 30px; }
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 26px 0;
  position: relative;
}
.nav a:hover,
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 20px;
  height: 2px;
  background: var(--accent);
}

.tools { display: flex; align-items: center; gap: 18px; }
.tools button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  position: relative;
}
.tools button:hover { color: var(--accent); }
.tools .badge {
  position: absolute;
  top: -6px; right: -8px;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.burger { display: none; }

/* --- hero --------------------------------------------------------------- */

.hero {
  background: linear-gradient(100deg, var(--peach) 0%, #fdf0e6 42%, #f2f7ea 70%, var(--mint) 100%);
  overflow: hidden;
}
.hero .shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 48px;
  padding-top: 76px;
  padding-bottom: 76px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.6vw, 54px);
  margin-bottom: 18px;
}
.hero p {
  max-width: 460px;
  color: #5a6069;
  margin: 0 0 30px;
}
.hero__eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* book collage */
.collage {
  position: relative;
  height: 340px;
}
.collage .book { position: absolute; }
.collage .b1 { width: 132px; left: 0;    top: 4px;   transform: rotate(-7deg); }
.collage .b2 { width: 148px; left: 8px;  top: 152px; transform: rotate(4deg); }
.collage .b3 { width: 168px; left: 168px; top: 24px;  transform: rotate(-2deg); }
.collage .b4 { width: 178px; left: 352px; top: 0;     transform: rotate(3deg); }
.collage .pen {
  position: absolute;
  right: -6px; top: 96px;
  width: 14px; height: 190px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f0b429, #d99b12 70%, #6b4a05);
  transform: rotate(14deg);
  box-shadow: var(--shadow);
}

/* generic CSS book cover */
.book {
  aspect-ratio: 3 / 4.3;
  border-radius: 3px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  color: #fff;
  box-shadow: 0 16px 30px -14px rgba(20, 22, 28, .55);
  position: relative;
  overflow: hidden;
}
.book::before {           /* spine */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
  background: rgba(0, 0, 0, .22);
}
.book__kicker {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .78;
}
.book__title {
  margin-top: auto;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
}
.book__author {
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .8;
  margin-top: 6px;
}

.cover--crimson { background: linear-gradient(155deg, #c0392b, #7d1d13); }
.cover--indigo  { background: linear-gradient(155deg, #2f3b6b, #151c38); }
.cover--teal    { background: linear-gradient(155deg, #17a2a2, #0b5c5c); }
.cover--sand    { background: linear-gradient(155deg, #d8b26a, #9a7524); }
.cover--olive   { background: linear-gradient(155deg, #6f7f3f, #38431c); }
.cover--plum    { background: linear-gradient(155deg, #6d3b6b, #331631); }
.cover--slate   { background: linear-gradient(155deg, #4b5560, #22282f); }
.cover--rust    { background: linear-gradient(155deg, #c9613a, #7d3418); }
.cover--paper   { background: linear-gradient(155deg, #f3efe4, #ddd5c1); color: #2a2620; }
.cover--paper::before { background: rgba(0, 0, 0, .1); }
.cover--night   { background: linear-gradient(155deg, #1c1f26, #05070b); }

/* --- section furniture -------------------------------------------------- */

.section { padding: 78px 0; }
.section--alt { background: var(--bg-alt); }

.sec-head { text-align: center; margin-bottom: 44px; }
.sec-head h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 34px);
  display: inline-block;
  padding-bottom: 12px;
  position: relative;
}
.sec-head h2::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 62px; height: 2px;
  background: var(--accent);
}
.sec-head p {
  max-width: 560px;
  margin: 14px auto 0;
  color: var(--muted);
}

.sec-head--left { text-align: left; }
.sec-head--left h2::after { left: 0; transform: none; }
.sec-head--left p { margin-left: 0; }

/* --- product grid ------------------------------------------------------- */

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}

.product { position: relative; }
.product__media {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.product:hover .product__media {
  border-color: #d3d7de;
  box-shadow: var(--shadow);
}
.product__media .book {
  width: 100%;
  max-width: 150px;
  transition: transform .3s ease;
}
.product:hover .product__media .book { transform: translateY(-6px); }

.product__tag {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 2px;
}
.product__tag--muted { background: var(--ink); }

.product__cart {
  position: absolute;
  left: 16px; right: 16px; bottom: 16px;
  padding: 11px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease;
}
.product:hover .product__cart { opacity: 1; transform: translateY(0); }
.product__cart:hover { background: var(--accent); }

.product__body { padding-top: 16px; }
.product__name {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}
.product__name:hover { color: var(--accent); }
.product__meta { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.product__price { font-size: 15px; font-weight: 700; color: var(--ink); }
.product__price s { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 13px; }
.stars { color: #e8a33d; font-size: 12px; letter-spacing: 1px; }

/* --- services ----------------------------------------------------------- */

.service {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.service:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: transparent;
}
.service__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--mint);
  color: var(--ink);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.service:nth-child(2) .service__icon { background: var(--peach); }
.service:nth-child(3) .service__icon { background: #e2e9f7; }
.service:nth-child(4) .service__icon { background: #f6e6f2; }
.service h3 { font-size: 17px; margin-bottom: 8px; }
.service p { margin: 0; font-size: 14px; color: var(--muted); }

/* --- split / about ------------------------------------------------------ */

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 60px;
  align-items: center;
}
.split ul { margin: 22px 0 28px; padding: 0; list-style: none; }
.split li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  color: var(--ink-soft);
}
.split li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.stack .book { width: 100%; }
.stack > div:nth-child(2) { transform: translateY(28px); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.stat__num {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.stat__label {
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

/* --- authors ------------------------------------------------------------ */

.author { text-align: center; }
.author__photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  max-width: 180px;
  margin-inline: auto;
  box-shadow: var(--shadow);
}
.author h3 { font-size: 17px; margin-bottom: 2px; }
.author span { font-size: 13px; color: var(--muted); }
.author p { font-size: 13.5px; color: var(--muted); margin-top: 10px; }

/* --- quote banner ------------------------------------------------------- */

.banner {
  background: var(--ink);
  color: #dfe2e7;
  padding: 66px 0;
  text-align: center;
}
.banner h2 {
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 36px);
  max-width: 720px;
  margin: 0 auto 14px;
}
.banner p { max-width: 560px; margin: 0 auto 28px; color: #a7adb8; }

/* --- testimonials ------------------------------------------------------- */

.quote {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
}
.quote p { margin: 0 0 20px; font-size: 14.5px; }
.quote__who { display: flex; align-items: center; gap: 12px; }
.quote__av {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
}
.quote__who strong { display: block; color: var(--ink); font-size: 14px; }
.quote__who span { font-size: 12.5px; color: var(--muted); }

/* --- blog --------------------------------------------------------------- */

.post {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.post:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post__media {
  height: 190px;
  display: grid;
  place-items: center;
  position: relative;
}
.post__media .book { width: 92px; }
.post__date {
  position: absolute;
  left: 14px; bottom: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 2px;
}
.post__body { padding: 22px 24px 26px; }
.post__cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.post h3 { font-size: 17.5px; margin: 8px 0 10px; line-height: 1.35; }
.post h3:hover { color: var(--accent); }
.post p { margin: 0; font-size: 14px; color: var(--muted); }

.tint-1 { background: var(--peach); }
.tint-2 { background: var(--mint); }
.tint-3 { background: #e2e9f7; }
.tint-4 { background: #f6e6f2; }

/* --- newsletter --------------------------------------------------------- */

.newsletter {
  background: linear-gradient(100deg, var(--peach), #fdf0e6 45%, var(--mint));
  padding: 60px 0;
}
.newsletter .shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.newsletter h2 { font-family: var(--serif); font-size: 30px; margin-bottom: 8px; }
.newsletter p { margin: 0; color: #5a6069; }
.subscribe { display: flex; gap: 10px; }
.subscribe input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(22, 24, 29, .14);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 14px;
}
.subscribe input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

/* --- page banner (inner pages) ------------------------------------------ */

.pagehead {
  background: linear-gradient(100deg, var(--peach), #fdf0e6 50%, var(--mint));
  padding: 56px 0;
}
.pagehead h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 44px); }
.crumbs { font-size: 13px; color: #6a7079; margin-top: 8px; }
.crumbs a:hover { color: var(--accent); }

/* --- forms -------------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 7px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

.info-row { display: flex; gap: 14px; margin-bottom: 22px; }
.info-row .service__icon { margin: 0; flex: none; width: 42px; height: 42px; }
.info-row strong { display: block; color: var(--ink); font-size: 14.5px; }
.info-row span { font-size: 14px; color: var(--muted); }

/* --- shop toolbar / filters --------------------------------------------- */

.shop-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.filter { margin-bottom: 30px; }
.filter h4 {
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.filter ul { list-style: none; margin: 0; padding: 0; }
.filter li { padding: 5px 0; font-size: 14px; }
.filter li a:hover { color: var(--accent); }
.filter li span { color: var(--muted); float: right; font-size: 12.5px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}
.toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 13.5px;
  background: #fff;
}

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 44px; }
.pager a {
  min-width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  padding: 0 10px;
}
.pager a:hover, .pager a.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* --- footer ------------------------------------------------------------- */

.footer {
  background: #101216;
  color: #9aa1ac;
  padding: 64px 0 0;
  font-size: 14px;
}
.footer h4 {
  color: #fff;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.footer a:hover { color: #fff; }
.footer .brand__name { color: #fff; }
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: 40px;
  padding-bottom: 48px;
}
.footer__grid ul { list-style: none; margin: 0; padding: 0; }
.footer__grid li { margin-bottom: 9px; }
.footer__about p { margin: 16px 0 20px; max-width: 300px; }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 34px; height: 34px;
  border: 1px solid #2a2e36;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #cfd3da;
}
.socials a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.footer__bar {
  border-top: 1px solid #22262d;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

/* ==========================================================================
   Product detail (PDP)
   ========================================================================== */

.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* --- gallery ------------------------------------------------------------ */

.gallery__stage {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 470px;
  display: grid;
  place-items: center;
  padding: 48px;
  position: relative;
}
.gallery__stage .product__tag { top: 16px; left: 16px; }

.view { display: none; width: 100%; max-width: 250px; }
.view.is-active { display: flex; }

/* back cover: blurb lines + barcode */
.view--back .book__blurb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0 auto;
}
.view--back .book__blurb i {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: currentColor;
  opacity: .3;
}
.view--back .book__blurb i:nth-child(3) { width: 82%; }
.view--back .book__blurb i:nth-child(6) { width: 64%; }
.barcode {
  height: 34px;
  width: 74px;
  margin-top: 12px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(90deg,
      #16181d 0 2px, #fff 2px 4px, #16181d 4px 5px, #fff 5px 8px,
      #16181d 8px 11px, #fff 11px 12px);
  border: 3px solid #fff;
}

/* spine view */
.view--spine {
  max-width: 66px;
  aspect-ratio: 66 / 358;
}
.view--spine .book__title {
  writing-mode: vertical-rl;
  margin: auto;
  font-size: 15px;
  white-space: nowrap;
}
.view--spine .book__kicker,
.view--spine .book__author { display: none; }

/* open spread view */
.view--spread {
  max-width: 340px;
  aspect-ratio: 340 / 250;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.view--spread::before { display: none; }
.view--spread .page {
  padding: 26px 20px;
  background:
    repeating-linear-gradient(180deg, transparent 0 11px, #dfe3e8 11px 12px);
}
.view--spread .page:first-child { border-right: 1px solid var(--line); }

.gallery__thumbs {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}
.gallery__thumbs button {
  flex: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 8px 8px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: border-color .18s ease, color .18s ease;
}
.gallery__thumbs button:hover { border-color: #c9ced6; }
.gallery__thumbs button.is-active { border-color: var(--ink); color: var(--ink); }
.gallery__thumbs .chip {
  width: 30px;
  height: 42px;
  border-radius: 2px;
}
.gallery__thumbs .chip--spread {
  background: #fff;
  border: 1px solid var(--line);
  background-image: linear-gradient(90deg, transparent 49%, var(--line) 49% 51%, transparent 51%);
}

/* --- buy box ------------------------------------------------------------ */

.buybox__cat {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.buybox h1 {
  font-family: var(--serif);
  font-size: clamp(27px, 3.2vw, 38px);
  margin: 10px 0 8px;
}
.buybox__author { font-size: 15px; color: var(--muted); margin: 0 0 14px; }
.buybox__author a { color: var(--ink); font-weight: 600; }
.buybox__author a:hover { color: var(--accent); }

.rating {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.buybox__price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.buybox__price b {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--ink);
}
.buybox__price s { color: var(--muted); font-size: 17px; }
.buybox__price .save {
  background: #eaf5ea;
  color: #2c6b34;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 2px;
}
.instock {
  font-size: 13px;
  color: #2c6b34;
  font-weight: 600;
  margin: 0 0 18px;
}
.instock::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3d9150;
  margin-right: 7px;
  vertical-align: middle;
}
.buybox__desc { margin: 0 0 24px; }

.opt { margin-bottom: 20px; }
.opt > span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 9px;
}
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: left;
  line-height: 1.35;
  transition: border-color .18s ease, background .18s ease;
}
.swatch b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.swatch small { color: var(--muted); font-size: 12.5px; }
.swatch:hover { border-color: #c9ced6; }
.swatch.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.buyrow { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty button {
  width: 40px;
  align-self: stretch;
  border: 0;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  line-height: 1;
}
.qty button:hover { background: var(--bg-alt); }
.qty input {
  width: 46px;
  border: 0;
  border-inline: 1px solid var(--line);
  text-align: center;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  padding: 12px 0;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buyrow .btn { flex: 1 1 180px; justify-content: center; }
.btn--icon { flex: 0 0 46px; padding: 0; justify-content: center; }

.assurance {
  display: grid;
  gap: 12px;
  margin: 26px 0;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  font-size: 13.5px;
}
.assurance div { display: flex; gap: 10px; align-items: flex-start; }
.assurance svg { flex: none; margin-top: 2px; color: var(--ink); }

.meta-list {
  list-style: none;
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}
.meta-list b { color: var(--ink); font-weight: 600; }

/* --- tabs --------------------------------------------------------------- */

.tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.tabs__nav button {
  background: none;
  border: 0;
  padding: 0 0 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}
.tabs__nav button:hover { color: var(--ink); }
.tabs__nav button.is-active { color: var(--ink); }
.tabs__nav button.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.tabs__nav .count { color: var(--muted); font-weight: 500; }

.tabs__panel { display: none; max-width: 820px; }
.tabs__panel.is-active { display: block; }
.tabs__panel h3 { font-size: 18px; margin: 26px 0 10px; }
.tabs__panel h3:first-child { margin-top: 0; }
.tabs__panel p { margin: 0 0 14px; }

.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.spec th, .spec td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec th {
  width: 210px;
  color: var(--ink);
  font-weight: 600;
  background: var(--bg-alt);
}

.review {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
}
.review:last-of-type { border-bottom: 0; }
.review .quote__av { width: 46px; height: 46px; }
.review strong { color: var(--ink); }
.review .when { font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.review p { margin: 8px 0 0; }

/* ==========================================================================
   Article detail
   ========================================================================== */

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  align-items: start;
}

.article__hero {
  height: 320px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  margin-bottom: 34px;
}
.article__hero .book { width: 140px; }

.article { font-size: 16px; line-height: 1.78; }
.article > p { margin: 0 0 20px; }
.article > p:first-of-type { font-size: 17.5px; color: var(--ink-soft); }
.article h2 {
  font-family: var(--serif);
  font-size: 25px;
  margin: 38px 0 14px;
}
.article h3 { font-size: 18.5px; margin: 28px 0 10px; }
.article ul, .article ol { margin: 0 0 20px; padding-left: 22px; }
.article li { margin-bottom: 8px; }
.article blockquote {
  margin: 30px 0;
  padding: 4px 0 4px 26px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
}
.article figure {
  margin: 30px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.article figure .fig-body {
  height: 240px;
  display: grid;
  grid-auto-flow: column;
  place-content: center;
  gap: 26px;
  padding: 30px;
}
.article figure .fig-body .book { width: 104px; }
.article figcaption {
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--muted);
  background: #fff;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 12px;
}

.article__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a {
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  color: var(--muted);
}
.tags a:hover { border-color: var(--ink); color: var(--ink); }

.authorbox {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin-top: 34px;
  padding: 26px;
  background: var(--bg-alt);
  border-radius: var(--radius);
}
.authorbox .author__photo { width: 74px; max-width: none; margin: 0; font-size: 24px; }
.authorbox h4 { font-size: 16px; margin-bottom: 4px; }
.authorbox p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

.prevnext {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 34px;
}
.prevnext a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color .18s ease;
}
.prevnext a:hover { border-color: var(--ink); }
.prevnext span {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.prevnext strong { display: block; color: var(--ink); margin-top: 6px; font-size: 15px; line-height: 1.4; }
.prevnext .next { text-align: right; }

/* --- article sidebar ---------------------------------------------------- */

.side { position: sticky; top: 96px; }
.side__block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.side__block h4 {
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.side__search { display: flex; gap: 8px; }
.side__search input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
}
.side__search button {
  border: 0;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 0 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.side__search button:hover { background: var(--accent); }

.recent { display: grid; gap: 16px; }
.recent a { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 14px; align-items: center; }
.recent .book { width: 54px; }
.recent strong { display: block; color: var(--ink); font-size: 14px; line-height: 1.4; font-weight: 600; }
.recent a:hover strong { color: var(--accent); }
.recent span { font-size: 12.5px; color: var(--muted); }

.side .filter { margin-bottom: 0; }
.side .filter h4 { border-bottom: 0; padding-bottom: 0; }

/* --- utilities ---------------------------------------------------------- */

.mt-0 { margin-top: 0; }
.center { text-align: center; }
.lead { font-size: 16px; }

/* --- responsive --------------------------------------------------------- */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
  .shop-layout { grid-template-columns: 1fr; }
  .collage { height: 300px; transform: scale(.86); transform-origin: left center; }
}

@media (max-width: 860px) {
  .burger {
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--ink);
  }
  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 8px 24px 16px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a.is-active::after { display: none; }
  .masthead .shell { position: relative; }

  .hero .shell { grid-template-columns: 1fr; padding-top: 54px; padding-bottom: 54px; }
  .collage { transform: scale(.78); transform-origin: left top; height: 290px; }
  .split, .grid-3, .grid-2, .newsletter .shell { grid-template-columns: 1fr; gap: 34px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .topbar__left { display: none; }
  .topbar .shell { justify-content: center; }
  .section { padding: 56px 0; }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .subscribe { flex-direction: column; }
  .footer__bar { flex-direction: column; text-align: center; }
  .collage { transform: scale(.62); height: 240px; }
}

/* --- responsive: detail pages ------------------------------------------- */

@media (max-width: 1024px) {
  .pdp { gap: 40px; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; }
}

@media (max-width: 860px) {
  .pdp,
  .article-layout { grid-template-columns: 1fr; gap: 34px; }
  .gallery__stage { min-height: 380px; padding: 34px; }
  .side { position: static; }
  .article figure .fig-body { grid-auto-flow: row; height: auto; justify-items: center; }
  .article figure .fig-body .book { width: 120px; }
}

@media (max-width: 560px) {
  .meta-list { grid-template-columns: 1fr; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext .next { text-align: left; }
  .buyrow .btn { flex-basis: 100%; }
  .tabs__nav { gap: 20px; }
  .spec th { width: 130px; }
  .authorbox { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

/* ==========================================================================
   Shopping cart — slide-out drawer, toast, and cart.html page
   ========================================================================== */

.cart-overlay {
  position: fixed; inset: 0; background: rgba(16,18,23,.5);
  z-index: 900; animation: cartFade .25s ease;
}
@keyframes cartFade { from { opacity: 0; } to { opacity: 1; } }

.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 400px; max-width: 92vw;
  background: var(--bg); z-index: 901; display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .3s ease;
  box-shadow: -20px 0 50px -25px rgba(16,18,23,.55);
}
.cart-drawer.is-open { transform: translateX(0); }
body.cart-open { overflow: hidden; }

.cart-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--line);
}
.cart-drawer__head h3 { font-family: var(--serif); font-size: 22px; }
.cart-drawer__close {
  border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer;
  color: var(--muted); padding: 0 4px;
}
.cart-drawer__close:hover { color: var(--ink); }

.cart-drawer__items { flex: 1; overflow-y: auto; padding: 8px 22px; }
.cart-drawer__foot { padding: 18px 22px; border-top: 1px solid var(--line); }

.cart-line {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.cart-thumb {
  width: 56px; height: 74px; border-radius: var(--radius);
  background: var(--bg-alt); display: grid; place-items: center;
  font-family: var(--serif); font-size: 22px; color: var(--ink); overflow: hidden;
}
.cart-thumb.cover--rust   { background: #b8451f; color: #fff; }
.cart-thumb.cover--slate  { background: #47566b; color: #fff; }
.cart-thumb.cover--indigo { background: #2f3b6b; color: #fff; }
.cart-thumb.cover--night  { background: #1d2330; color: #fff; }
.cart-thumb.cover--sand   { background: #d8b271; color: #16181d; }

.cart-line__title { margin: 0 0 2px; font-weight: 600; color: var(--ink); font-size: 14px; line-height: 1.35; }
.cart-line__price { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.cart-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); }
.cart-qty button {
  width: 28px; height: 28px; border: 0; background: none; cursor: pointer;
  font-size: 16px; color: var(--ink); line-height: 1;
}
.cart-qty button:hover { background: var(--bg-alt); }
.cart-qty span { min-width: 26px; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink); }
.cart-line__end { text-align: right; display: flex; flex-direction: column; justify-content: space-between; }
.cart-line__sub { margin: 0; font-weight: 700; color: var(--ink); }
.cart-line__rm { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; }
.cart-line__rm:hover { color: var(--accent); }

.cart-ship-hint { margin: 0 0 12px; font-size: 13px; color: var(--accent-dk); }
.cart-ship-hint.is-ok { color: #2e7d4f; }
.cart-sub { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; font-size: 15px; }
.cart-sub b { font-size: 20px; color: var(--ink); }
.cart-w { width: 100%; margin-top: 8px; }
.cart-drawer__foot .btn { display: block; text-align: center; }

.cart-empty { text-align: center; padding: 50px 10px; color: var(--muted); }
.cart-empty p { margin-bottom: 18px; }

/* toast */
.cart-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 40px;
  font-size: 14px; font-weight: 600; z-index: 950; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.cart-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* cart.html page */
.cart-page { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.cart-page__list { border-top: 1px solid var(--line); }
.cart-page__list .cart-line { grid-template-columns: 64px 1fr auto; }
.cart-page__list .cart-thumb { width: 64px; height: 84px; }
.cart-page__actions { display: flex; justify-content: space-between; padding-top: 22px; gap: 12px; flex-wrap: wrap; }
.cart-page__summary {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; position: sticky; top: 24px;
}
.cart-page__summary h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 18px; }
.cart-sum-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.cart-sum-row b { color: var(--ink); }
.cart-sum-row--total { border-bottom: 0; padding-top: 16px; font-size: 18px; }
.cart-sum-row--total b { font-size: 24px; }
.cart-secure { margin: 14px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.cart-page-empty { text-align: center; padding: 70px 20px; }
.cart-page-empty h2 { font-family: var(--serif); font-size: 30px; margin-bottom: 10px; }
.cart-page-empty p { color: var(--muted); margin-bottom: 22px; }

@media (max-width: 820px) {
  .cart-page { grid-template-columns: 1fr; }
  .cart-page__summary { position: static; }
}
/* shop filter — active state + empty message */
.filter a.is-active { color: var(--accent); font-weight: 700; }
.filter a.is-active span { color: var(--accent); }
.shop-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px 0; font-size: 15px; }
/* pager — disabled + ellipsis states */
.pager a.is-disabled { opacity: .4; pointer-events: none; }
.pager a.is-gap { pointer-events: none; border-color: transparent; }
.pager a.is-gap:hover { background: none; color: inherit; }
/* footer logo — white tile so the dark-green mark reads on the dark footer */
.footer .brand__mark { background: #fff; border-radius: 7px; padding: 4px; }