/* Compo Press — brand styles
   Terracotta #c07060 · Sage #809070 · Soft pink #f0b0b0
   Cream #faf6ee · Ink #4a3f35 · Dark bg #2a2320 */

:root {
  --terracotta: #c07060;
  --terracotta-deep: #a5564a;
  --sage: #809070;
  --sage-deep: #66755a;
  --pink: #f0b0b0;
  --cream: #faf6ee;
  --cream-warm: #f4ecdd;
  --ink: #4a3f35;
  --ink-soft: #6b5f52;
  --card: #ffffff;
  --line: #e8dcc8;
  --shadow: 0 10px 30px rgba(74, 63, 53, 0.12);
  --radius: 18px;
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

[data-theme="dark"] {
  --cream: #2a2320;
  --cream-warm: #332a25;
  --ink: #f2e8d8;
  --ink-soft: #c9bba6;
  --card: #3a2f28;
  --line: #54463a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 0.6em;
  color: var(--ink);
}

h2.section-title {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  text-align: center;
}

h2.section-title .accent { color: var(--terracotta); }

.section-lead {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.2rem;
  color: var(--ink-soft);
}

.wrap { width: min(1120px, 92%); margin: 0 auto; }

section { padding: 4rem 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  width: min(1120px, 94%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
}

.brand img { width: 40px; height: 40px; }

.nav-links {
  display: flex;
  gap: 1.2rem;
  margin-left: auto;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.95rem;
}

.nav-links a:hover { color: var(--terracotta); }

.btn {
  display: inline-block;
  background: var(--terracotta);
  color: #fff !important;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
  font-family: var(--font-body);
}

.btn:hover { background: var(--terracotta-deep); transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--terracotta) !important;
  border: 2px solid var(--terracotta);
}

.btn-outline:hover { background: var(--terracotta); color: #fff !important; }

.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }

.theme-toggle {
  background: var(--cream-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.lang-toggle {
  background: var(--cream-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.lang-toggle:hover, .theme-toggle:hover { border-color: var(--terracotta); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 3.5rem 0 2.5rem;
  background:
    radial-gradient(600px 300px at 15% 10%, rgba(240, 176, 176, 0.25), transparent),
    radial-gradient(700px 350px at 85% 20%, rgba(128, 144, 112, 0.18), transparent);
}

.hero-logo { width: min(420px, 80%); margin: 0 auto 1.2rem; }

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 700;
}

.hero h1 em { font-style: italic; color: var(--terracotta); }

.hero .lead {
  max-width: 640px;
  margin: 0 auto 1.8rem;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.hero .lead strong { color: var(--terracotta); }

.tagline {
  font-family: var(--font-head);
  font-style: italic;
  color: var(--sage-deep);
  margin: 0 0 0.4rem;
}

[data-theme="dark"] .tagline { color: var(--sage); }

.descriptor {
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 1.8rem;
}

.hero-cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

.hero-banner {
  margin: 2.8rem auto 0;
  width: min(1000px, 100%);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0;
  margin: 0 auto;
  max-width: 760px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat b {
  display: block;
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--terracotta);
}

.stat span { font-size: 0.9rem; color: var(--ink-soft); font-weight: 700; }

/* ---------- Catalog ---------- */
.filters {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.2rem;
}

.filter-btn {
  background: var(--card);
  border: 2px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  font-family: var(--font-body);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover { border-color: var(--terracotta); color: var(--terracotta); }

.filter-btn.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}

.books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1.6rem;
}

.book-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, opacity 0.25s ease;
}

.book-card:hover { transform: translateY(-4px); }

.book-card.hidden { display: none; }

.book-cover { aspect-ratio: 3 / 4; overflow: hidden; background: var(--cream-warm); display: flex; align-items: center; justify-content: center; }

.book-cover img { width: 100%; height: 100%; object-fit: contain; }

.book-body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }

.book-badges { display: flex; gap: 0.45rem; flex-wrap: wrap; }

.badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--cream-warm);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.badge.hot { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }
.badge.sage { background: var(--sage); border-color: var(--sage); color: #fff; }
.badge.pink { background: var(--pink); border-color: var(--pink); color: var(--ink); }

.book-body h3 { font-size: 1.35rem; margin: 0; }

.book-body p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }

.book-body .btn { margin-top: auto; align-self: flex-start; }

.book-caption { font-size: 0.8rem; font-style: italic; color: var(--ink-soft); }

/* ---------- Free page ---------- */
.free-page {
  background: var(--cream-warm);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.free-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 760px) {
  .free-grid { grid-template-columns: 1fr 1fr; }
}

.free-grid figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: #fff;
}

/* ---------- Blog ---------- */
.post {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.post summary {
  list-style: none;
  cursor: pointer;
  padding: 1.3rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.post summary::-webkit-details-marker { display: none; }

.post-meta {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  width: 100%;
}

.post summary h3 { margin: 0; font-size: 1.25rem; flex: 1; }

.post summary .more {
  color: var(--terracotta);
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.post[open] summary .more { visibility: hidden; }

.post-body { padding: 0 1.5rem 1.6rem; color: var(--ink-soft); }

.post-body p { margin: 0 0 1rem; }

.post-body figure {
  margin: 1.2rem 0 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 760px) {
  .about-grid { grid-template-columns: 280px 1fr; }
}

.about-badge img {
  width: min(320px, 80%);
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about-text p { color: var(--ink-soft); }

.about-text strong { color: var(--ink); }

/* ---------- Shop / contact ---------- */
.shop {
  background: var(--sage);
  color: #fff;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.shop h2 { color: #fff; }

.shop p { max-width: 620px; margin: 0 auto 1.4rem; color: #f4f1e8; }

.shop .btn { background: #fff; color: #3f4a35 !important; }

.shop .btn:hover { background: var(--cream); }

.shopify-note {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.95rem;
}

.shopify-note .soon {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.social-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

.social-row a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.social-row a:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

footer .foot-logo { width: 220px; margin: 0 auto 1rem; }

footer nav { margin-bottom: 1rem; }

footer nav a {
  color: var(--ink-soft);
  text-decoration: none;
  margin: 0 0.7rem;
  font-weight: 700;
}

footer nav a:hover { color: var(--terracotta); }

footer .socials a {
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 800;
  margin: 0 0.5rem;
}

/* ---------- Mobile nav ---------- */
@media (max-width: 720px) {
  .nav-links a:not(.btn):not(.theme-toggle) { display: none; }
  .nav-links .btn { font-size: 0.8rem; padding: 0.5rem 0.9rem; }
  section { padding: 2.8rem 0; }
  .stats { grid-template-columns: 1fr; max-width: 320px; }
}

/* Peek-inside lightbox */
.btn-ghost {
  background: transparent;
  border: 2px solid var(--terra);
  color: var(--terra);
  margin-top: 0.5rem;
}
.btn-ghost:hover { background: var(--terra-soft); }
.book-body .btn-ghost { width: 100%; }

.peek-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .25s ease;
}
.peek-lightbox.open { opacity: 1; visibility: visible; }
.peek-backdrop { position: absolute; inset: 0; background: rgba(30, 20, 15, .85); }
.peek-box {
  position: relative; max-width: min(92vw, 760px); max-height: 88vh;
  display: flex; align-items: center; justify-content: center;
}
.peek-img {
  max-width: 100%; max-height: 82vh; object-fit: contain;
  border-radius: var(--radius); box-shadow: var(--shadow);
  background: #fff;
}
.peek-close {
  position: absolute; top: -2.6rem; right: 0;
  background: none; border: none; color: #fff;
  font-size: 1.6rem; cursor: pointer; padding: .3rem .6rem;
}
.peek-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.92); border: none;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  font-size: 1.5rem; cursor: pointer; color: var(--ink);
  box-shadow: var(--shadow);
}
.peek-prev { left: -3.2rem; }
.peek-next { right: -3.2rem; }
.peek-counter {
  position: absolute; bottom: -2.2rem; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: .9rem; font-weight: 600;
}
@media (max-width: 820px) {
  .peek-prev { left: .4rem; }
  .peek-next { right: .4rem; }
}
