/* Pub.Cat Books — books.pub.cat
   Plain CSS, no build step, no framework.
   Palette: deep ink ground, parchment text, gold leaf accent. */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --ink:        #0d0c0b;
  --ink-raised: #161412;
  --ink-line:   #2b2621;
  --parchment:  #ece4d6;
  --parchment-dim: #a8a094;
  --gold:       #c9a227;
  --gold-dim:   #8a7220;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --measure: 34rem;
  --wide: 66rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 1.19rem;
  line-height: 1.66;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout ---------- */

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: var(--measure); }
main { display: block; }
section { padding: 4.5rem 0; border-top: 1px solid var(--ink-line); }
section:first-of-type { border-top: 0; }

/* ---------- Type ---------- */

h1, h2, h3 { font-weight: 500; line-height: 1.18; letter-spacing: -0.01em; margin: 0 0 0.75rem; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin-top: 0; }
h3 { font-size: 1.3rem; margin-top: 2.25rem; }
p { margin: 0 0 1.15rem; }
p + h3 { margin-top: 2.5rem; }

.lede { font-size: 1.35rem; color: var(--parchment); opacity: 0.92; }
.dim { color: var(--parchment-dim); }
.small { font-size: 0.95rem; line-height: 1.6; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.1rem;
  font-weight: 600;
}

a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--parchment); }

blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.4rem;
  border-left: 2px solid var(--gold-dim);
  font-style: italic;
  color: var(--parchment);
}
blockquote cite { display: block; font-style: normal; font-size: 0.92rem; color: var(--parchment-dim); margin-top: 0.6rem; }

.arabic { font-size: 1.35em; line-height: 1.9; direction: rtl; unicode-bidi: isolate; }

hr { border: 0; border-top: 1px solid var(--ink-line); margin: 3rem 0; }

/* ---------- Header ---------- */

.site-head {
  border-bottom: 1px solid var(--ink-line);
  position: sticky; top: 0; z-index: 20;
  background: rgba(13,12,11,0.94);
  backdrop-filter: blur(8px);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { font-size: 1.12rem; letter-spacing: 0.02em; text-decoration: none; color: var(--parchment); white-space: nowrap; }
.brand b { font-weight: 600; color: var(--gold); }
.site-nav { display: flex; gap: 1.4rem; font-family: var(--sans); font-size: 0.85rem; flex-wrap: wrap; }
.site-nav a { color: var(--parchment-dim); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.7rem;
  border-radius: 2px;
  text-decoration: none;
  border: 1px solid var(--gold);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: #e0b62d; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--gold); }
.btn-ghost:hover { background: rgba(201,162,39,0.12); color: var(--gold); }
.btn-row { display: flex; gap: 0.9rem; flex-wrap: wrap; margin: 1.8rem 0 0.9rem; }

/* ---------- Magic square motif ---------- */

.wafq {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 13rem; height: 13rem;
  border: 1px solid var(--gold-dim);
  font-family: var(--serif);
  flex: none;
}
.wafq span {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(138,114,32,0.4);
  font-size: 1.28rem;
  color: var(--gold);
}
.wafq.sm { width: 8.5rem; height: 8.5rem; }
.wafq.sm span { font-size: 1rem; }

/* ---------- Hero ---------- */

.hero { padding: 5.5rem 0 4.5rem; }
.hero-grid { display: flex; gap: 3.5rem; align-items: center; flex-wrap: wrap; }
.hero-copy { flex: 1 1 22rem; min-width: 0; }

/* ---------- Cards ---------- */

.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  padding: 1.6rem;
  border-radius: 2px;
}
.card h3 { margin-top: 0; font-size: 1.15rem; }
.card p:last-child { margin-bottom: 0; }
.card a.card-link { text-decoration: none; }

/* ---------- Buy box ---------- */

.buybox {
  background: var(--ink-raised);
  border: 1px solid var(--gold-dim);
  padding: 1.8rem;
  border-radius: 2px;
}
.buybox h3 { margin-top: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.price { font-size: 1.6rem; color: var(--gold); white-space: nowrap; }
.price s { color: var(--parchment-dim); font-size: 1rem; margin-right: 0.4rem; }
.buybox ul { margin: 0.5rem 0 1.4rem; padding-left: 1.1rem; }
.buybox li { margin-bottom: 0.35rem; }
.buybox .btn { width: 100%; text-align: center; }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; margin: 1.8rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; min-width: 34rem; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--ink-line); vertical-align: top; }
th { font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
tr.ours td { background: rgba(201,162,39,0.07); }

/* ---------- Details / FAQ ---------- */

details { border-bottom: 1px solid var(--ink-line); padding: 1.15rem 0; }
details summary { cursor: pointer; font-size: 1.15rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; color: var(--gold); font-size: 1.4rem; line-height: 1; flex: none; }
details[open] summary::after { content: '\2212'; }
details > *:not(summary) { margin-top: 1rem; }
details p:last-child { margin-bottom: 0; }

/* ---------- Email capture ---------- */

.capture { background: var(--ink-raised); border: 1px solid var(--ink-line); padding: 2.2rem; border-radius: 2px; }
.capture form { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.3rem; }
.capture input[type="email"] {
  flex: 1 1 15rem;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 1.05rem;
  padding: 0.9rem 1rem;
  border-radius: 2px;
  min-width: 0;
}
.capture input[type="email"]:focus { outline: 2px solid var(--gold-dim); outline-offset: 1px; }
.capture button { flex: none; cursor: pointer; }

/* ---------- Notice ---------- */

.notice {
  border-left: 2px solid var(--gold-dim);
  background: rgba(201,162,39,0.06);
  padding: 1.1rem 1.3rem;
  margin: 2rem 0;
  font-size: 1.02rem;
}
.notice p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-foot { border-top: 1px solid var(--ink-line); padding: 3rem 0 4rem; font-size: 0.95rem; color: var(--parchment-dim); }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin-bottom: 2.5rem; }
.foot-grid h4 { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.9rem; font-weight: 600; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 0.5rem; }
.foot-grid a { color: var(--parchment-dim); text-decoration: none; }
.foot-grid a:hover { color: var(--gold); }
.foot-legal { border-top: 1px solid var(--ink-line); padding-top: 1.8rem; font-size: 0.88rem; }

/* ---------- Skip link + a11y ---------- */

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; position: fixed; z-index: 50; background: var(--gold); color: var(--ink); padding: 0.7rem 1.1rem; border-radius: 2px; }

img { max-width: 100%; height: auto; display: block; }

@media (max-width: 40rem) {
  body { font-size: 1.12rem; }
  section { padding: 3.25rem 0; }
  .hero { padding: 3rem 0; }
  .hero-grid { gap: 2.25rem; }
  .site-head .wrap { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .site-nav { gap: 1rem; }
  .wafq { width: 100%; max-width: 13rem; height: auto; aspect-ratio: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-head, .site-foot, .btn-row, .capture { display: none; }
}

/* Consent bar — only rendered when an advertising pixel is configured. */
.consent-bar{position:fixed;left:0;right:0;bottom:0;z-index:60;background:#12100e;
  color:#efe9dd;border-top:1px solid rgba(201,162,74,.4);box-shadow:0 -6px 24px rgba(0,0,0,.35)}
.consent-inner{max-width:64rem;margin:0 auto;padding:1rem 1.25rem;display:flex;
  gap:1.25rem;align-items:center;flex-wrap:wrap}
.consent-inner p{margin:0;flex:1 1 22rem;font-size:.9rem;line-height:1.5}
.consent-inner a{color:#c9a24a}
.consent-actions{display:flex;gap:.6rem;flex:0 0 auto}
.consent-bar .btn{padding:.5rem 1rem;font-size:.9rem}
@media (max-width:36rem){.consent-inner{padding:.9rem 1rem}.consent-actions{width:100%}
  .consent-actions .btn{flex:1}}
