/* Rah Roshan brand (client-inputs/rahe roshan_brand book.pdf, A-25):
   primary #C35329, secondary #BF9140, background #FAF6F1, text #3B2E27, font Estedad (OFL, self-hosted).
   Mix guide from the brand book: background ~45 %, typography ~25 %, primary ~15 %, secondary ~10 %, accent ~5 %. */
@font-face { font-family: Estedad; src: url("../fonts/Estedad-Regular.a990a0f576ee.woff2") format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Estedad; src: url("../fonts/Estedad-Medium.6f8679d8a64c.woff2") format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Estedad; src: url("../fonts/Estedad-Bold.63bf046a4c89.woff2") format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #FAF6F1; --bg-2: #F5EDE2; --line: #EDE0CF; --line-strong: #DDC9AF;
  --card: #FFFFFF;
  --ink: #3B2E27; --ink-strong: #241914; --muted: #6F5646; --faint: #8F7A66;
  --primary: #C35329; --primary-dark: #A94425; --primary-soft: #F2B08F;
  --secondary: #BF9140; --secondary-soft: #F4D99A;
  --ok: #4D5E3E; --ok-bg: #E9EDE0; --err: #8F2D26; --err-bg: #F6E1DC;
  /* spacing scale (4/8) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(59, 46, 39, .06), 0 4px 14px rgba(59, 46, 39, .06);
  --shadow-lg: 0 2px 4px rgba(59, 46, 39, .08), 0 12px 32px rgba(59, 46, 39, .12);
  --t: .18s ease;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100dvh; display: flex; flex-direction: column;
  font: 15px/1.9 Estedad, Tahoma, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--primary-dark); text-underline-offset: 3px; transition: color var(--t); }
a:hover { color: var(--primary); }
h1, h2 { color: var(--ink-strong); font-weight: 700; line-height: 1.5; margin: 0 0 var(--s3); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 var(--s3); }
:focus-visible { outline: 3px solid var(--primary-soft); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: var(--s4); top: -60px; background: var(--ink-strong); color: #fff; padding: var(--s2) var(--s4);
  border-radius: var(--radius-sm); z-index: 100; transition: top var(--t); }
.skip:focus { top: var(--s2); color: #fff; }

/* header */
.top { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; justify-content: space-between;
  padding: var(--s3) var(--s5); background: var(--card); border-bottom: 3px solid var(--primary);
  position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: var(--s3); font-weight: 700; text-decoration: none; color: var(--ink-strong); }
.brand img { width: 44px; height: 44px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.top nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; }
.top nav a { text-decoration: none; color: var(--ink); font-weight: 500; padding: var(--s1) 0; border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t); }
.top nav a:hover { color: var(--primary); }
.top nav a[aria-current=page] { color: var(--primary-dark); border-bottom-color: var(--primary); }
.who { color: var(--muted); font-size: .9rem; }
.top nav a.cta { background: var(--primary); color: #fff; padding: var(--s2) var(--s4); border-radius: 99px; border-bottom: 0;
  min-height: 40px; display: inline-flex; align-items: center; transition: background var(--t), box-shadow var(--t); }
.top nav a.cta:hover { background: var(--primary-dark); color: #fff; box-shadow: var(--shadow); }
.top nav a.cta.ghost { background: transparent; color: var(--primary-dark); border: 1px solid var(--primary); }
.top nav a.cta.ghost:hover { background: #FBEDE6; box-shadow: none; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: var(--s5) var(--s4); border-top: 1px solid var(--line); background: var(--card); }

/* buttons, messages, cards */
.inline { display: inline; }
button { font: inherit; cursor: pointer; }
button.link { background: none; border: 0; color: var(--primary-dark); padding: var(--s1) 0; font-weight: 500; }
button.link:hover { color: var(--primary); text-decoration: underline; }
button.primary { background: var(--primary); color: #fff; border: 0; border-radius: var(--radius-sm); padding: var(--s3) var(--s5);
  min-height: 46px; font-weight: 700; transition: background var(--t), box-shadow var(--t), transform var(--t); }
button.primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
button.primary:active { transform: translateY(1px); }
button.primary.block { width: 100%; }
.msg { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); margin-bottom: var(--s4); background: var(--ok-bg); color: var(--ok); }
.msg.error { background: var(--err-bg); color: var(--err); }
.hint { color: var(--muted); font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); box-shadow: var(--shadow); }
.narrow { max-width: 440px; margin: var(--s6) auto; }

/* forms */
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); min-height: 44px;
  padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color var(--t), box-shadow var(--t); }
input:hover, select:hover, textarea:hover { border-color: var(--secondary); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(195, 83, 41, .18); }
label { font-weight: 500; color: var(--ink-strong); font-size: .92rem; }
.stack, .form { display: grid; gap: var(--s3); }
.stack p { display: grid; gap: var(--s1); margin: 0; }
.field { display: grid; gap: var(--s1); }
.field input, .field select, .field textarea, .stack input { width: 100%; }
.err { color: var(--err); font-size: .82rem; }
.ok { color: var(--ok); font-size: .82rem; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); padding: var(--s3); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters input[type=search] { flex: 1 1 280px; }
.filters select { flex: 1 1 170px; max-width: 240px; }

/* tables */
table.books { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
table.books th, table.books td { padding: var(--s3); border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
table.books th { font-weight: 500; color: var(--muted); font-size: .85rem; background: var(--bg-2); white-space: nowrap; }
table.books tbody tr { transition: background var(--t); }
table.books tbody tr:hover { background: #FDFAF6; }
table.books tr:last-child td { border-bottom: 0; }
table.books td a { font-weight: 500; text-decoration: none; color: var(--ink-strong); }
table.books td a:hover { color: var(--primary); text-decoration: underline; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.cover { width: 64px; }
td.cover img, td.cover .no-cover { width: 44px; height: 62px; object-fit: cover; border-radius: 4px; display: block;
  box-shadow: 0 1px 3px rgba(59, 46, 39, .2); }
.no-cover { background: var(--bg-2) url("../brand/logo-mark.8bbf5c6ae69f.png") center / 70% no-repeat;
  border: 1px solid var(--line); position: relative; }
.no-cover::after { content: ''; position: absolute; inset: 0; background: rgba(245, 237, 226, .55); border-radius: inherit; }
.no-cover.big-cover { display: block; height: 300px; }
.isbn, .cover-price { color: var(--faint); font-size: .8rem; }
.empty { color: var(--muted); text-align: center; padding: var(--s5); }
.qty { display: flex; gap: var(--s2); align-items: center; }
.qty input { width: 84px; min-height: 40px; text-align: center; }
.pager { display: flex; gap: var(--s4); justify-content: center; align-items: center; padding: var(--s4); }
.pager a { padding: var(--s2) var(--s4); border: 1px solid var(--line-strong); border-radius: 99px; text-decoration: none; background: var(--card); }
.pager a:hover { border-color: var(--primary); }
.totals { background: var(--card); border: 1px solid var(--line); padding: var(--s4) var(--s5); margin-top: var(--s4); border-radius: var(--radius); box-shadow: var(--shadow); }
.payable { font-weight: 700; font-size: 1.15rem; color: var(--primary-dark); margin-top: var(--s2); }
.submit { margin-top: var(--s4); display: grid; gap: var(--s3); max-width: 560px; }
.submit textarea { width: 100%; }
.status { font-size: .8rem; padding: 2px 12px; border-radius: 99px; background: var(--secondary-soft); color: var(--ink-strong); white-space: nowrap; }
.status.delivered, .status.confirmed { background: var(--ok-bg); color: var(--ok); }
.status.cancelled { background: var(--err-bg); color: var(--err); }
.history { color: var(--muted); }

/* book page */
.crumbs { display: flex; gap: var(--s2); align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: var(--s4); flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.book { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: var(--s6); align-items: start; margin-bottom: var(--s5); }
.book-media { position: sticky; top: 96px; }
.zoom { position: relative; overflow: hidden; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); background: var(--bg-2);
  cursor: zoom-in; line-height: 0; --zx: 50%; --zy: 50%; --zs: 2.4; touch-action: manipulation; }
.zoom img { width: 100%; height: auto; display: block; transform-origin: var(--zx) var(--zy); transition: transform .25s ease; will-change: transform; }
.zoom.is-zoomed { cursor: zoom-out; }
.zoom.is-zoomed img { transform: scale(var(--zs)); }
.big-cover { width: 100%; border-radius: var(--radius-sm); }
.byline { color: var(--muted); font-size: 1.02rem; margin-bottom: var(--s3); }
.byline span { color: var(--faint); }
.chips { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips li { background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); border-radius: 99px; padding: 0 var(--s3); font-size: .82rem; line-height: 28px; }
.book dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); margin: 0 0 var(--s4); padding: var(--s4) 0;
  border-block: 1px solid var(--line); }
.book dt { color: var(--muted); }
.book dd { margin: 0; font-weight: 500; }
.buybox { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s5); align-items: center; justify-content: space-between;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); }
.buy-price { font-size: 1.25rem; color: var(--primary-dark); display: flex; flex-direction: column; line-height: 1.6; }
.buy-price .label { font-size: .8rem; color: var(--muted); }
.summary { max-width: 860px; line-height: 2.1; }
.summary h2 { margin-top: 0; }

/* partnership page: form + picture */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; max-width: 980px; margin: var(--s4) auto; }
.split-form { padding: var(--s6); align-self: center; }
.split-art { position: relative; min-height: 420px; background: var(--bg-2); }
.split-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 820px) {
  .book { grid-template-columns: 1fr; gap: var(--s4); }
  .book-media { position: static; max-width: 260px; margin-inline: auto; }
  .split { grid-template-columns: 1fr; }
  .split-art { order: -1; min-height: 200px; max-height: 240px; }
  .split-form { padding: var(--s5); }
}
@media (max-width: 640px) {
  .top { padding: var(--s3) var(--s4); }
  main { padding-top: var(--s4); }
  table.books th:nth-child(3), table.books td:nth-child(3),
  table.books th:nth-child(4), table.books td:nth-child(4) { display: none; }
  table.books th, table.books td { padding: var(--s2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
