/* digitalniknigi.bg – основни стилове */
:root {
  --ink: #14213D;
  --ink-2: #3A4D7A;
  --muted: #4A5568;
  --line: #E2E6EC;
  --soft: #F1F4F8;
  --white: #FFFFFF;
  --accent: #F2A541;
  --accent-text: #B86B00;
  --night: #2B2A33;
  --night-card: #34333E;
  --night-line: #45434F;
  --night-text: #F2EEE6;
  --night-muted: #C9C4D6;
  --radius: 12px;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); }
a:hover { color: var(--ink-2); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.eyebrow {
  margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
h1, h2, h3 { margin: 0; line-height: 1.15; }
.display { font-family: var(--display); font-weight: 700; }

/* Бутони */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border-radius: 26px;
  font-family: var(--body); font-weight: 700; font-size: 16px;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
}
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { background: #E89423; color: var(--ink); }
.btn-night { background: var(--night); color: var(--night-text); }
.btn-night:hover { background: #3A3944; color: var(--night-text); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-sm { min-height: 44px; padding: 0 18px; border-radius: 22px; font-size: 14px; }

/* Хедър */
.site-header { border-bottom: 1px solid var(--line); background: var(--white); }
.site-header .container {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 18px; padding-bottom: 18px;
}
.logo { font-family: var(--display); font-weight: 700; font-size: 20px; text-decoration: none; }
.logo span { color: var(--accent-text); }
.main-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; font-weight: 500; font-size: 15px; }
.main-nav a { text-decoration: none; padding: 10px 0; }

/* Начало */
.hero {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 64px;
}
.hero-text { display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5vw, 56px); line-height: 1.1; }
.hero p.lead { margin: 0; font-size: 19px; color: var(--muted); max-width: 520px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { display: flex; justify-content: center; }
.stack { position: relative; width: 300px; height: 400px; }
.stack .cover { position: absolute; width: 240px; height: 340px; box-shadow: 0 18px 40px rgba(20,33,61,.2); }
.stack .back { left: 60px; top: 10px; transform: rotate(5deg); }
.stack .front { left: 0; top: 50px; }

/* Корици (рисувани, докато няма снимка) */
.cover {
  border-radius: 6px; padding: 24px; display: flex; flex-direction: column;
  justify-content: space-between; overflow: hidden;
}
.cover .cover-cat { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cover .cover-title { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.15; }
.cover .cover-brand { font-size: 12px; font-weight: 500; opacity: .85; }
.cover-img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

/* Библиотеки */
.library { padding: 72px 0; }
.library-know { background: var(--soft); }
.library-fun { background: var(--night); color: var(--night-text); }
.library-fun .eyebrow, .library-fun .intro { color: var(--night-muted); }
.library-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.library-head h2 { font-family: var(--display); font-size: 36px; }
.intro { margin: 0; font-size: 17px; color: var(--muted); max-width: 640px; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pill {
  min-height: 44px; padding: 0 18px; border-radius: 22px; font-family: var(--body);
  font-weight: 700; font-size: 14px; cursor: pointer;
  background: var(--white); color: var(--ink); border: 1.5px solid #B8C2D1;
}
.pill[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.library-fun .pill { background: transparent; color: var(--night-text); border-color: #8C879C; }
.library-fun .pill[aria-pressed="true"] { background: var(--night-text); color: var(--night); border-color: var(--night-text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.card > a { text-decoration: none; color: inherit; display: block; }
.card .cover { height: 220px; border-radius: 0; }
.card .cover-img { height: 220px; border-radius: 0; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.card-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.card-title a { text-decoration: none; }
.card-blurb { margin: 0; font-size: 15px; color: var(--muted); flex-grow: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.price { font-weight: 700; font-size: 18px; }
.badge {
  align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 12px; background: #E8ECF2; color: var(--ink);
}
.badge-available { background: #D7F0DC; color: #14532D; }
.library-fun .card { background: var(--night-card); border-color: var(--night-line); }
.library-fun .card-title a { color: var(--night-text); }
.library-fun .card-blurb { color: var(--night-muted); }
.library-fun .badge { background: #4A4858; color: var(--white); }
.library-fun .btn-outline { color: var(--night-text); border-color: var(--night-text); }
.empty { padding: 40px; text-align: center; border: 1px dashed #B8C2D1; border-radius: var(--radius); color: var(--muted); }

/* Как работи */
.steps { padding: 72px 24px; }
.steps h2 { font-family: var(--display); font-size: 32px; margin-bottom: 32px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.step-num { font-family: var(--display); font-size: 40px; font-weight: 700; color: var(--accent-text); }
.step h3 { font-size: 20px; margin: 8px 0; }
.step p { margin: 0; color: var(--muted); }

/* Абонамент */
.newsletter { background: var(--ink); color: var(--white); padding: 72px 0; }
.newsletter .container {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px 48px; align-items: center;
}
.newsletter h2 { font-family: var(--display); font-size: 32px; margin-bottom: 12px; }
.newsletter p { margin: 0; color: #C9D2E0; font-size: 17px; }
.nl-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.nl-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 240px; }
.nl-field label { font-size: 14px; color: #C9D2E0; }
.nl-field input {
  min-height: 52px; padding: 0 18px; border-radius: 26px; border: 1px solid var(--ink-2);
  background: #1E2D4F; color: var(--white); font-family: var(--body); font-size: 16px;
}
.nl-field input::placeholder { color: #9AA7BF; }
.nl-consent { flex-basis: 100%; font-size: 13px; color: #C9D2E0; display: flex; gap: 8px; align-items: flex-start; }
.nl-consent a { color: var(--white); }
.nl-msg { flex-basis: 100%; margin: 0; font-size: 15px; color: var(--accent); min-height: 1em; }

/* Футър */
.site-footer .container {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  padding-top: 40px; padding-bottom: 40px; font-size: 14px; color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Страница на книга */
.book-hero {
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 56px;
  padding-top: 56px; padding-bottom: 56px; align-items: start;
}
.book-hero .cover, .book-hero .cover-img { width: 100%; aspect-ratio: 3 / 4; height: auto; box-shadow: 0 18px 40px rgba(20,33,61,.18); }
.book-hero .cover .cover-title { font-size: 30px; }
.book-info { display: flex; flex-direction: column; gap: 20px; }
.book-info h1 { font-family: var(--display); font-size: clamp(30px, 4vw, 44px); }
.book-info .subtitle { margin: 0; font-size: 20px; color: var(--muted); }
.buy-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft);
}
.buy-box .price { font-size: 26px; }
.buy-note { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--muted); }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.book-section { padding: 48px 0; border-top: 1px solid var(--line); }
.book-section h2 { font-family: var(--display); font-size: 26px; margin-bottom: 20px; }
.prose { max-width: 720px; font-size: 17px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.excerpt {
  max-width: 720px; padding: 28px; border-radius: var(--radius); background: var(--soft);
  font-size: 17px; font-style: italic;
}
.reviewer { font-size: 15px; color: var(--muted); }

/* Правни страници */
.legal { padding-top: 56px; padding-bottom: 72px; }
.legal h1 { font-family: var(--display); font-size: 36px; margin-bottom: 12px; }
.legal h2 { font-size: 22px; margin: 32px 0 12px; }
.draft-note {
  max-width: 720px; padding: 16px 20px; border-radius: var(--radius);
  background: #FFF4E0; border: 1px solid #F2C98A; font-size: 15px; margin: 16px 0 24px;
}

@media (max-width: 760px) {
  .book-hero { grid-template-columns: 1fr; gap: 32px; }
  .book-hero .cover, .book-hero .cover-img { max-width: 300px; }
  .library-head h2 { font-size: 30px; }
  .hero { padding-top: 48px; }
}

/* --- Планери --- */
.library-plan { background: var(--white); border-top: 1px solid var(--line); }
.library-plan .card .cover-img { object-fit: cover; }
.pills[hidden] { display: none; }
.stack .cover-img { position: absolute; width: 240px; height: 340px; object-fit: cover; box-shadow: 0 18px 40px rgba(20,33,61,.2); }
.stack .front { z-index: 2; }
