/* Черновой шаблон страницы главы. */

body.bookPage .chapterIntro{
  padding:42px 20px 48px;
  border-top:1px solid rgba(15,23,42,.06);
  border-bottom:1px solid rgba(15,23,42,.08);
  background:
    radial-gradient(circle at 84% 12%, rgba(37,99,235,.09), transparent 32%),
    linear-gradient(180deg, #fff 0%, #f7f9fd 100%);
}

body.bookPage .chapterIntroInner{
  width:min(880px, 100%);
  margin:0 auto;
}

body.bookPage .chapterBookLink{
  display:inline-flex;
  margin-bottom:24px;
  color:var(--text-muted);
  font-size:14px;
  font-weight:700;
  text-decoration:none;
}

body.bookPage .chapterBookLink:hover{
  color:var(--primary);
}

body.bookPage .chapterIntro h1{
  max-width:820px;
  margin:10px 0 20px;
  font-size:clamp(34px, 5vw, 58px);
  line-height:1.06;
  letter-spacing:-.035em;
}

body.bookPage .chapterDeck{
  max-width:780px;
  color:rgba(31,41,55,.86);
  font-size:18px;
  line-height:1.65;
}

body.bookPage .chapterDeck p{
  margin:0;
}

body.bookPage .chapterDeck p + p{
  margin-top:10px;
}

body.bookPage .chapterIntroActions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:24px;
}

body.bookPage .chapterReadingSection{
  padding:52px 0 64px;
}

body.bookPage .chapterLayout{
  display:grid;
  grid-template-columns:minmax(230px, 280px) minmax(0, 760px);
  justify-content:center;
  align-items:start;
  gap:44px;
}

body.bookPage .chapterSidebar{
  position:sticky;
  top:88px;
  max-height:calc(100vh - 112px);
  overflow:auto;
  scrollbar-width:thin;
}

body.bookPage .chapterContents{
  border:1px solid rgba(10,46,116,.12);
  border-radius:16px;
  background:#f8fafc;
}

body.bookPage .chapterContents summary{
  padding:15px 16px;
  color:var(--text);
  font-size:15px;
  font-weight:800;
  cursor:pointer;
}

body.bookPage .chapterContents nav{
  padding:0 16px 16px;
}

body.bookPage .chapterContents ul{
  margin:0;
  padding:0;
  list-style:none;
}

body.bookPage .chapterContents ul ul{
  margin:7px 0 2px 11px;
  padding-left:11px;
  border-left:1px solid rgba(10,46,116,.14);
}

body.bookPage .chapterContents li + li{
  margin-top:7px;
}

body.bookPage .chapterContents a{
  display:block;
  color:rgba(31,41,55,.76);
  font-size:13px;
  line-height:1.35;
  text-decoration:none;
}

body.bookPage .chapterContents a:hover{
  color:var(--primary);
}

body.bookPage .chapterText{
  overflow-wrap:anywhere;
  min-width:0;
  color:#222b3a;
  font-family:Georgia, "Times New Roman", serif;
  font-size:18px;
  line-height:1.78;
}

body.bookPage .chapterText > :first-child{
  margin-top:0;
}

body.bookPage .chapterText p{
  margin:0 0 1.15em;
}

body.bookPage .chapterText h2,
body.bookPage .chapterText h3{
  scroll-margin-top:92px;
  color:var(--text);
  font-family:Inter, Arial, sans-serif;
  letter-spacing:-.02em;
}

body.bookPage .chapterText h2{
  margin:2.25em 0 .72em;
  font-size:30px;
  line-height:1.18;
}

body.bookPage .chapterText h3{
  margin:1.9em 0 .65em;
  font-size:23px;
  line-height:1.25;
}

body.bookPage .chapterText ul,
body.bookPage .chapterText ol{
  margin:0 0 1.3em;
  padding-left:1.4em;
}

body.bookPage .chapterText li + li{
  margin-top:.42em;
}

body.bookPage .chapterText a{
  color:var(--primary);
  text-decoration-thickness:1px;
  text-underline-offset:3px;
}

body.bookPage .chapterText blockquote,
body.bookPage .chapterText .imp{
  margin:1.6em 0;
  padding:16px 20px;
  border-left:4px solid #2563eb;
  border-radius:0 12px 12px 0;
  background:#f2f6ff;
  color:#1e2b43;
}

body.bookPage .chapterText hr{
  margin:2.2em 0;
  border:0;
  border-top:1px solid rgba(15,23,42,.1);
}

body.bookPage .chapterTableScroll{
  width:100%;
  max-width:100%;
  min-width:0;
  margin:1.6em 0;
  overflow-x:auto;
  contain:inline-size;
  border:1px solid rgba(15,23,42,.12);
  border-radius:12px;
  background:#fff;
  box-shadow:0 8px 24px rgba(15,23,42,.06);
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
}

body.bookPage .chapterTableScroll:focus-visible{
  outline:3px solid rgba(37,99,235,.28);
  outline-offset:3px;
}

body.bookPage .chapterTableScroll table{
  min-width:700px;
  margin:0;
  border-collapse:collapse;
}

@media (max-width: 1100px){
  body.chapter5Page .chapterLayout{
    grid-template-columns:minmax(0, 760px);
    gap:26px;
  }

  body.chapter5Page .chapterContents{
    position:static;
    max-height:none;
  }
}

body.bookPage .chapterText figure,
body.bookPage .chapterText .chapterFigure{
  display:block;
  margin:30px 0 34px;
}

body.bookPage .chapterText figure img,
body.bookPage .chapterText .chapterFigure img{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  margin:0 auto;
  border:1px solid rgba(15,23,42,.1);
  border-radius:12px;
  background:#fff;
  box-shadow:0 12px 32px rgba(15,23,42,.09);
}

body.bookPage .chapterFigureZoom{
  position:relative;
  display:block;
  width:100%;
  padding:0;
  border:0;
  border-radius:12px;
  background:transparent;
  cursor:zoom-in;
}

body.bookPage .chapterFigureAction{
  position:absolute;
  right:10px;
  bottom:10px;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(7,24,56,.88);
  color:#fff;
  font-family:Inter, Arial, sans-serif;
  font-size:12px;
  font-weight:800;
  line-height:1;
  box-shadow:0 4px 14px rgba(15,23,42,.22);
}

body.bookPage .chapterFigureZoom:hover .chapterFigureAction,
body.bookPage .chapterFigureZoom:focus-visible .chapterFigureAction{
  background:var(--brand-blue);
}

body.bookPage .chapterLightbox .bookLightboxDialog{
  width:min(96vw, 1700px);
  max-width:none;
  max-height:96vh;
  margin:2vh auto;
  overflow:auto;
}

body.bookPage .chapterLightbox #bookLightboxImage{
  width:100%;
  max-width:none;
  max-height:none;
  height:auto;
  border-radius:10px;
}

body.bookPage .chapterText figcaption{
  max-width:620px;
  margin:10px auto 0;
  color:var(--text-muted);
  font-family:Inter, Arial, sans-serif;
  font-size:13px;
  line-height:1.45;
  text-align:center;
}

body.bookPage .chapterText .chapterCaption{
  display:block;
  max-width:620px;
  margin:10px auto 0;
  color:var(--text-muted);
  font-family:Inter, Arial, sans-serif;
  font-size:13px;
  line-height:1.45;
  text-align:center;
}

body.bookPage .chapterFigureDraftNote{
  width:max-content;
  max-width:100%;
  margin:8px auto 0;
  padding:5px 9px;
  border:1px solid rgba(180,83,9,.18);
  border-radius:999px;
  background:#fff7ed;
  color:#9a5711;
  font-family:Inter, Arial, sans-serif;
  font-size:11px;
  font-weight:700;
  line-height:1.3;
  text-align:center;
}

body.bookPage .chapterPager{
  padding:30px 0 54px;
  border-top:1px solid rgba(15,23,42,.08);
  background:#f8fafc;
}

body.bookPage .chapterPagerInner{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:12px;
  align-items:center;
}

body.bookPage .chapterPagerInner .btn:first-child{
  justify-self:start;
}

body.bookPage .chapterPagerInner .btn:last-child{
  justify-self:end;
}

@media (max-width: 920px){
  body.bookPage .chapterLayout{
    grid-template-columns:minmax(0, 760px);
    gap:26px;
  }

  body.bookPage .chapterSidebar{
    position:static;
    max-height:none;
    overflow:visible;
  }

  body.bookPage .chapterContents:not([open]) nav{
    display:none;
  }
}

@media (max-width: 640px){
  body.bookPage .chapterIntro{
    padding:28px 16px 34px;
  }

  body.bookPage .chapterBookLink{
    margin-bottom:18px;
  }

  body.bookPage .chapterIntro h1{
    margin-bottom:16px;
    font-size:34px;
  }

  body.bookPage .chapterDeck,
  body.bookPage .chapterText{
    font-size:17px;
  }

  body.bookPage .chapterIntroActions .btn{
    flex:1 1 100%;
    min-height:44px;
  }

  body.bookPage .chapterReadingSection{
    padding:30px 0 42px;
  }

  body.bookPage .chapterText h2{
    font-size:25px;
  }

  body.bookPage .chapterText h3{
    font-size:21px;
  }

  body.bookPage .chapterText blockquote,
  body.bookPage .chapterText .imp{
    padding:14px 15px;
  }

  body.bookPage .chapterFigureAction{
    right:7px;
    bottom:7px;
    padding:7px 9px;
    font-size:11px;
  }

  body.bookPage .chapterLightbox .bookLightboxDialog{
    width:96vw;
    height:90vh;
    margin:3vh auto;
    padding:44px 10px 12px;
  }

  body.bookPage .chapterLightbox #bookLightboxImage{
    width:900px;
  }

  body.bookPage .chapterPagerInner{
    grid-template-columns:1fr;
  }

  body.bookPage .chapterPagerInner .btn,
  body.bookPage .chapterPagerInner .btn:first-child,
  body.bookPage .chapterPagerInner .btn:last-child{
    width:100%;
    min-height:44px;
    justify-self:stretch;
  }
}
