/* History Inside — страница примера книги.
   Страница книги квадратная (20 × 20 см), размеры внутри считаются от её ширины. */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.example { padding: 44px 0 60px; }
.example-head { max-width: 720px; margin-bottom: 30px; }
.example-head h1 { font: 500 clamp(34px, 3.6vw, 52px)/1.04 var(--serif); letter-spacing: -.05em; margin: 10px 0 12px; }
.example-lead { font: 500 19px/1.4 var(--serif); color: var(--clay); }
.example-desc { margin-top: 12px; color: var(--muted); max-width: 560px; }

/* ------------------------------------------------------------ книга --- */

.book-viewer { margin: 0 0 52px; }

.book-frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 1.6vw, 22px);
}

.book-stage {
  background: #faf4e9;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 22px 60px rgba(44, 37, 36, .13);
  overflow: hidden;
  min-width: 0;
}

.flip {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--paper); color: var(--ink);
  font-size: 17px; line-height: 1;
  transition: border-color .15s ease, color .15s ease;
}
.flip:hover:not(:disabled) { border-color: var(--clay); color: var(--clay); }
.flip:disabled { opacity: .32; cursor: default; }

/* разворот: две страницы рядом */
.ex-spread { display: grid; grid-template-columns: 1fr 1fr; }
.ex-spread.single { grid-template-columns: 1fr; }
.ex-spread > .ex-page + .ex-page { border-left: 1px solid #e8ddd2; }

/* страница */
.ex-page {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 2.6%;
  padding: 5.2% 5.4% 4.6%;
  min-width: 0; min-height: 0;
}
.ex-page-top {
  display: flex; justify-content: space-between; gap: 8px;
  color: var(--clay); font-size: max(9px, 2.5cqw); font-weight: 800;
  letter-spacing: .11em; text-transform: uppercase; white-space: nowrap;
}
.ex-page-top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

.ex-grid { display: grid; gap: 2cqw; min-height: 0; min-width: 0; }
.ex-grid.grid-1 { grid-template-columns: minmax(0, 1fr); }
.ex-grid.grid-2 { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.ex-grid.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1.15fr .85fr; }
.ex-grid.grid-3 > :first-child { grid-column: span 2; }
.ex-grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }

.ex-slot { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.ex-slot img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; border-radius: 1px; }
.ex-slot p {
  padding-top: 1.1cqw; color: var(--muted);
  font: 650 max(8px, 2.1cqw)/1.28 var(--sans);
  overflow-wrap: anywhere;
}
.ex-slot.empty { background: var(--linen); }

/* обложка: закрытая книга 20 × 20 */
.book-stage.is-cover { max-width: 520px; width: 100%; margin-inline: auto; }
.ex-cover {
  container-type: inline-size;
  aspect-ratio: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #f6efe4;
}
.ex-cover-photo { min-height: 0; overflow: hidden; }
.ex-cover-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-cover-plate {
  display: grid; gap: 1.6cqw; text-align: center;
  padding: 4.6cqw 5cqw 4.2cqw;
}
.ex-cover-year { color: var(--clay); font: 800 max(9px, 2cqw)/1 var(--sans); letter-spacing: .14em; }
.ex-cover h3 { font: 500 clamp(19px, 5cqw, 34px)/1.06 var(--serif); letter-spacing: -.03em; }
.ex-cover-sign { color: var(--muted); font: 800 max(8px, 1.6cqw)/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }

/* полоса под книгой */
.book-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin-top: 18px; flex-wrap: wrap;
}
.book-counter { font-size: 13px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.book-dots { display: flex; gap: 7px; }
.book-dots button {
  width: 26px; height: 26px; padding: 0; border: 0; background: none;
  display: grid; place-items: center;
}
.book-dots button::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--line); transition: background .15s ease, transform .15s ease;
}
.book-dots button[aria-current="true"]::before { background: var(--clay); transform: scale(1.35); }

/* --------------------------------------------------------- два пути --- */

.example-choice { border-top: 1px solid var(--line); padding: 40px 0 44px; }
.section-intro { color: var(--muted); max-width: 620px; margin-top: 12px; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
.choice {
  display: flex; flex-direction: column; gap: 12px;
  padding: 26px 26px 24px;
  border: 1px solid var(--line); border-radius: 6px;
}
.choice h3 { font: 500 23px/1.15 var(--serif); letter-spacing: -.02em; }
.choice p { color: var(--muted); font-size: 15px; }
.choice .button { align-self: flex-start; margin-top: 4px; }
.choice-note { font-size: 13px; color: var(--muted); margin-top: 2px; }

.choice-facts {
  display: grid; gap: 12px; align-content: start;
  padding: 26px 26px 24px; background: var(--linen); border-radius: 6px;
}
.choice-facts p { font-size: 15px; color: var(--muted); }
.choice-facts b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------- другие примеры --- */

.other-examples { border-top: 1px solid var(--line); padding: 36px 0 8px; }
.other-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.other-card { display: block; text-decoration: none; }
.other-card img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.other-card h3 { font: 500 19px/1.2 var(--serif); margin-top: 10px; }
.other-card p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.other-card:hover h3 { color: var(--clay); }

/* ------------------------------------------------------------ адаптив - */

@media (max-width: 980px) {
  .book-frame { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .flip { display: none; }
  .choice-grid { grid-template-columns: 1fr; }
  .other-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .other-card h3 { font-size: 16px; }
}

@media (max-width: 700px) {
  .example { padding: 26px 0 40px; }
  .example-head { margin-bottom: 22px; }
  .example-lead { font-size: 16px; }
  .book-viewer { margin-bottom: 38px; }
  .book-stage { box-shadow: 0 12px 30px rgba(44, 37, 36, .12); }
  .ex-cover { aspect-ratio: auto; padding: 7cqw 8cqw 5cqw; }
  .ex-cover-photo { aspect-ratio: 4 / 3; }
  .choice { padding: 20px 18px; }
  .other-grid { grid-template-columns: 1fr 1fr; }
}
