/* ==========================================================================
   books.librorus.com — shared stylesheet
   Layout, spacing and components live here and are the same for every title.
   Each book page overrides the palette and fonts in its own <style> block,
   so Nomads can be blue and Boogaloo while Stars is something else entirely.
   ========================================================================== */

:root {
  /* Defaults — a book page overrides these */
  --surface-100: #fdfcfa;
  --surface-200: #f3f7f9;
  --surface-card: #ffffff;
  --border: #dfe9ee;
  --ink: #1c2024;
  --ink-muted: #54626c;
  --accent-100: #d3ecf6;
  --accent-500: #0d779e;
  --accent-700: #0a5f80;
  --dark-band: #233c6e;

  --shadow-card: 0 1px 2px rgba(28, 32, 36, 0.06), 0 8px 20px rgba(28, 32, 36, 0.08);
  --radius-card: 16px;
  --radius-lg: 24px;

  --font-display: Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface-100);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent-700); }

a:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--accent-700);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  z-index: 10;
}
.skip-link:focus { left: 0; }

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

.section { padding: 96px 32px; }
.section--hero { padding: 72px 32px; background: var(--accent-100); }
.section--alt { background: var(--surface-200); }
.section--wash { background: var(--accent-100); }
.section--dark { background: var(--dark-band); padding: 80px 32px; }

.wrap { max-width: 1120px; margin: 0 auto; }

.wrap--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.wrap--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stack > * + * { margin-top: 16px; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0;
}

h1 { font-size: 88px; line-height: 84px; }
h2 { font-size: 56px; line-height: 54px; }
h3 { font-size: 26px; line-height: 28px; }

.h-sub { font-size: 36px; line-height: 40px; color: var(--accent-700); }

p { margin: 0; }

.eyebrow {
  margin: 0 0 8px 0;
  font-size: 13px;
  line-height: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-700);
}

.lede { font-size: 18px; line-height: 28px; font-weight: 600; color: var(--ink-muted); }
.lede--strong { font-weight: 700; color: var(--ink); }
.lede--light { color: #ffffff; }

.body { font-size: 15px; line-height: 24px; font-weight: 700; color: var(--ink); }
.body--regular { font-weight: 400; color: var(--ink-muted); }

.caption { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); }

/* ---------- Button ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--accent-500);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 20px;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 160ms ease, opacity 160ms ease;
}
.btn:hover { background: var(--accent-700); }

.btn--onDark { background: #ffffff; color: var(--dark-band); }
.btn--onDark:hover { background: #ffffff; opacity: 0.88; }

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

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
  text-align: left;
  width: 100%;
}

.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.card img { height: 96px; width: auto; object-fit: contain; margin-bottom: 16px; }
.card h3 { margin-bottom: 8px; }
.card p + p { margin-top: 8px; }

/* ---------- Culture tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
  width: 100%;
}

.tile {
  background: var(--surface-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.section--wash .tile { background: var(--surface-card); }
.tile img { height: 200px; width: auto; object-fit: contain; }

.tag {
  font-size: 13px;
  line-height: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

/* ---------- Sample spreads ---------- */

.spreads {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-top: 48px;
  width: 100%;
  text-align: left;
}

.spread { margin: 0; }

.spread__frame {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.spread__frame img { border-radius: var(--radius-card); width: 100%; }
.spread figcaption { margin-top: 12px; }

/* ---------- Specialist panel ---------- */

.panel {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: center;
  text-align: left;
}
.panel img { max-height: 280px; width: auto; margin: 0 auto; }

.meta {
  margin: 0;
  display: grid;
  grid-template-columns: 200px 1fr;
  row-gap: 8px;
  column-gap: 24px;
}
.meta dt { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); }
.meta dd { margin: 0; font-size: 15px; line-height: 18px; font-weight: 700; color: var(--ink); }

/* ---------- Catalogue index ---------- */

.catalogue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 48px;
  width: 100%;
  text-align: left;
}

.catalogue__item {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.catalogue__item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(28, 32, 36, 0.08), 0 14px 28px rgba(28, 32, 36, 0.12);
}
.catalogue__item img { width: 100%; background: var(--accent-100); }
.catalogue__text { padding: 20px 24px 24px; }
.catalogue__text h3 { margin-bottom: 6px; }

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

.site-footer { padding: 40px 32px; background: var(--surface-100); }
.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer a { font-weight: 800; text-decoration: none; font-size: 15px; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .section, .section--hero, .section--dark { padding: 64px 24px; }
  .wrap--split { grid-template-columns: 1fr; gap: 40px; }
  .cards { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { grid-template-columns: 1fr; padding: 32px; gap: 24px; }
  .meta { grid-template-columns: 1fr; row-gap: 2px; }
  .meta dd { margin-bottom: 8px; }
  h1 { font-size: 64px; line-height: 62px; }
  h2 { font-size: 40px; line-height: 40px; }
  .h-sub { font-size: 28px; line-height: 32px; }
}

@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  h1 { font-size: 52px; line-height: 50px; }
  h2 { font-size: 32px; line-height: 34px; }
}

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