﻿/* =========== © 2026 Centroarts - https://m1r.ru =========== */

.book-nav-list { display: flex; align-items: center; gap: 24px; user-select: none; }
.book-nav-list > .btn { margin-left: -8px; margin-right: -12px; }
/* .book-nav-list > a:not(.btn):first-child { margin-left: -12px; } */

.book-nav .btn { order: -1; }

.book-nav a:not(.btn) {
  font-weight: bold; order: 2; height: inherit;
  transition: opacity .15s ease;
}
.book-nav a:not(.active) { opacity: .7; }
.book-nav a:not(.active):hover { opacity: 1; }

.book-nav a > span { display: block; padding: 12px 0; height: inherit; position: relative; z-index: 1; white-space: nowrap; }
.book-nav a.active > span::after {
  content: ""; position: absolute; z-index: -1; inset: 0; height: 2px; border-radius: 2px; background-color: hsl(var(--c-primary));
}

@media (max-width: 991px) {
  .book-nav + .article { margin-top: 24px; }
  .book-nav { margin-bottom: 24px; }

  .book-nav-in {
    display: flex; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .book-nav-in::-webkit-scrollbar { display: none; }

  .book-nav-list { flex: 1 1 auto; height: 48px; box-shadow: inset 0 -1px 0 0 var(--c-border); }
  .book-nav a.active > span::after { top: auto; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
}
/* @media (max-width: 575px) {
 .book-nav a.active { order: 1; }
} */
@media (min-width: 992px) {
  .book-nav + .article { margin-top: 12px; }
  .book-nav { margin-bottom: 12px; }

  .book-nav-list { height: var(--headbar-h); }
  .book-nav a > span { padding: 24px 0; }

  .book-nav a.active > span::after {
    bottom: auto; height: 4px; border-radius: 4px;
    border-top-left-radius: 0; border-top-right-radius: 0;
  }
}

.bookbox {
  --bookbox-pad: 24px;
  --bookbox-pad-inv: -24px;
  --bookbox-bg: var(--c-body-tone);
  --bookbox-bg-t: var(--c-body-tone-t);
  --bookbox-text-maxrow: 4;
  --bookbox-gap: 20px;
  --bookbox-img-w: 196px;

  padding: var(--bookbox-pad);
  border-radius: var(--rd-box);
  background-color: var(--bookbox-bg);
  position: relative; z-index: 1;
  user-select: none;
}

.bookbox-bg {
  position: absolute; z-index: -1; inset: 0;
  border-radius: inherit; overflow: hidden; pointer-events: none; user-select: none;
  display: flex; align-items: center;
}

.bookbox-bg .cover { 
  flex: 0 0 100%; max-width: 720px; margin-left: -20%; overflow: hidden;
  display: flex; flex-direction: column; flex-grow: 1;
}
.bookbox-bg .cover img {
  filter: blur(12px); opacity: .3;
  position: absolute; top: 0; left: 50%;
	transform: translateX(-50%);
}
.bookbox-bg .cover::before { content: ""; padding-top: 100%; }
.bookbox-bg .cover::after {
  content: ""; position: absolute; inset: 0; left: 50%; 
  background-image: linear-gradient(-90deg, var(--bookbox-bg) 0%, var(--bookbox-bg-t) 100%);
}

.bookbox-img { width: var(--bookbox-img-w); flex-shrink: 0; }
.bookbox-img .cover {
  border-radius: 8px;
  box-shadow: 0 8px 32px -6px rgba(0, 0, 0, 0.25);
}
/* .bookbox-img .cover.as34 { height: 262px; }
.bookbox-img .cover.as11 { height: 196px; } */

.bookbox-img .postid { position: absolute; left: 0; top: 0; }

.bookbox-spec { font-size: var(--fs-1); line-height: 20px; }
.bookbox-spec-list { display: flex; white-space: nowrap; }
.specs-item { padding: 0 8px; }
.spec-label { display: block; font-size: var(--fs-3); line-height: 16px; margin-bottom: 2px; color: var(--c-text-mute); }

.bookbox-text .text-clamp {
  --text-clamp-h: 24px;
  --text-clamp-rows: var(--bookbox-text-maxrow);
  --text-clamp-maxh: calc(var(--text-clamp-h) * var(--text-clamp-rows));
}
.bookbox-text .text-clamp * { color: inherit !important; }

.bookbox-tools { display: flex; gap: 8px; }
.bookbox-tools > *:not(.tools-addon) { min-width: 134px; }

.book-title { font-size: var(--fs-heading-second); line-height: var(--lh-heading-second); margin-bottom: .5em; }

.bookbox-audio { text-align: center; }
.bookbox-audio .bookbox-img { margin-left: auto; margin-right: auto; }
.bookbox-audio .bookbox-tools { justify-content: center; margin: var(--bookbox-gap) 0; }
.btn-book-play.playnow .im-play, .btn-book-play:not(.playnow) .im-pause { display: none; }

.bookbox-audio .bookbox-spec { display: flex; justify-content: center; margin-top: var(--bookbox-gap); }
.bookbox-audio .bookbox-spec .specs-item { flex: 1; }

.bookbox-audio .bookbox-text { margin-top: var(--bookbox-gap); }
.bookbox-audio .bookbox-text::before { display: none; }

.bookbox-audio .tools-addon { position: absolute; right: 10px; top: 12px; } 
.bookbox-audio .bookbox-bg { justify-content: center; align-items: start; }
.bookbox-audio .bookbox-bg .cover { margin-left: 0; margin-top: -30%; }

.bookbox-audio .bookbox-bg .cover::after {
  left: 0; background-image: radial-gradient(closest-side, var(--bookbox-bg-t) 50%, var(--bookbox-bg) 100%);
}

@media (max-width: 767px) {
  .bookbox {
    padding: var(--g-sect) var(--bookbox-pad);
    margin-left: var(--wrp-p-inv); margin-right: var(--wrp-p-inv);
    border-radius: var(--rd-big); border-bottom-left-radius: 0; border-bottom-right-radius: 0;
    margin-bottom: var(--g-sect);
  }
  .bookbox + .sepwave { display: none; }
  .bookbox-read { text-align: center; }
  .bookbox-read .bookbox-img { margin-left: auto; margin-right: auto; }
  .bookbox-read .bookbox-tools { justify-content: center; margin: var(--bookbox-gap) 0; }
  .bookbox-read .bookbox-tools .tools-addon { position: absolute; right: 10px; top: 12px; }
  .bookbox-read .bookbox-text { margin-top: var(--bookbox-gap); }

  .bookbox-read .bookbox-bg { justify-content: center; align-items: start; }
  .bookbox-read .bookbox-bg .cover { margin-left: 0; margin-top: -30%; }
  .bookbox-read .bookbox-bg .cover::after {
    left: 0; background-image: radial-gradient(closest-side, var(--bookbox-bg-t) 50%, var(--bookbox-bg) 100%);
  }
  .bookbox-spec .specs-item { flex: 1; }
  .bookbox-spec {
    display: flex;
    margin-top: var(--bookbox-gap);
    margin-left: var(--bookbox-pad-inv);
    margin-right: var(--bookbox-pad-inv);
    color: var(--c-text-mute);
  }
  .bookbox-spec-list { flex: 1 1 auto; }
  .spec-icon.im { display: block; width: var(--i-size); margin: 0 auto; margin-bottom: 4px; opacity: .5; }
}
@media (max-width: 575px) {
  .bookbox-img { width: auto; }
  .bookbox-img .cover { height: 240px; margin-left: auto; margin-right: auto; }
}
@media (min-width: 768px) {
  .bookbox-read .bookbox-cont { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--bookbox-gap); }
  .bookbox-read {
    display: flex; gap: var(--bookbox-pad);
  }
  .bookbox-text { flex: 1 1 auto; }
  .bookbox-text::before {
    content: attr(title); display: block; user-select: none; pointer-events: none;
    font-size: var(--fs-1); line-height: 20px; margin-bottom: 8px;
    opacity: .7;
  }
  .bookbox-read .bookbox-spec-list { margin-left: -20px; }

  .specs-item { padding: 0 20px; min-width: 128px; }
  .specs-item:not(:first-child) { border-left: 1px solid var(--c-border); }
  .spec-label { font-size: var(--fs-2); }
  .spec-icon { display: none; }
  .bookbox-tools { order: 13; }
}
@media (min-width: 992px) {
  .bookbox-audio { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
}

/* -- Book Toc -- */
.book-toc { font-size: var(--fs-3); line-height: var(--lh); margin: 12px 0 0 0; }
@media (min-width: 768px) {
  .book-toc { margin-top: 20px; }
}
.book-toc-label { font-weight: bold; font-size: var(--fs); font-weight: bold; }
.book-toc ul.book-toc-list { --atext-gap: .5em; border-left: 1px solid var(--c-border); margin-left: 6px; padding-left: 12px; list-style: none; }
.book-toc ul.book-toc-list li { margin: 0; }
.book-toc:not(.open) ul.book-toc-list li:not(:nth-child(-n + 3)) { display: none; }
.book-toc-list a { text-decoration: none !important; display: block; padding: .25em 0; }

.book-toc .book-toc-foot { display: flex; }
.book-toc-foot .btn { margin: calc(var(--btn-pad-y)/-1) calc(var(--btn-pad-x)/-1); --btn-fs: inherit; font-weight: bold; }
.book-toc-foot .btn .btn-cont { text-decoration: none; padding: 0; }

/* -- ReadPanel -- */
.read-panel-wrp { height: 0; position: sticky; top: 12px; z-index: 100; pointer-events: none; }

html.mp-open .read-panel { visibility: hidden; }
.read-panel {
  --readpanel-bg: hsla(var(--c-body-light),0.9);
  --readpanel-c-text: hsl(var(--c-text));
  --readpanel-sw: 0 4px 20px -4px hsla(0,0%,0%,.25), inset 0 0 0 1px hsl(var(--c-body-light));

  position: relative; z-index: 1; pointer-events: auto;
  background-color: var(--readpanel-bg);
  color: var(--readpanel-c-text);
  border-radius: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 4px; box-shadow: var(--readpanel-sw);
  margin-left: 40px; margin-right: 40px;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  opacity: 0; visibility: hidden;
  transform: translateY(-12px); transition: transform 0.2s ease-in-out, visibility 0.2s ease-in-out, opacity 0.2s ease-in-out;
}
.read-panel-progress {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; border-radius: inherit;
}
.read-panel-progress::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--readpanel-bg);
}
.read-panel-progress::after {
  content: ""; display: block; height: 100%; width: var(--readprogress);
  background-color: hsla(var(--c-primary), 0.2);
}
.read-panel a { text-decoration: none !important; }
.read-panel .btn {
  --btn-h: 36px;
  --btn-pad: 6px;
}
.panel-toc-lines {
  height: inherit; width: 24px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.panel-toc-lines i { width: 4px; height: 1px; background-color: currentColor; }
.panel-toc-lines i:first-child, .panel-toc-lines i:last-child { opacity: .7; }
.panel-toc-lines i.rnow { height: 2px; width: 12px; background-color: hsl(var(--c-primary)); }

.read-panel button.panel-toc-btn { position: static; --btn-pad: 0; margin-left: 4px; margin-right: -4px; }
.panel-toc-btn::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.read-panel.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.panel-left { display: flex; align-items: center; flex-grow: 1; cursor: pointer; min-width: 0; position: relative; }
.panel-info { white-space: nowrap; padding-left: 12px; min-width: 0; }

.panel-title { font-size: 14px; font-weight: bold; line-height: 16px; overflow: hidden; text-overflow: ellipsis; }
.panel-progress-text { font-size: 12px; opacity: .6; line-height: 14px; margin-top: 2px; }

.panel-right { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.panel-right .btn {
  --btn-sw: inset 0 0 0 1px hsla(var(--c-primary),0.4);
}
.panel-right .btn:hover {
  --btn-sw: inset 0 0 0 1.5px hsla(var(--c-primary),0.6);
}
.panel-right .btn:active {
  --btn-sw: inset 0 0 0 2px hsla(var(--c-primary),0.8);
}

.readpanel-menu .dropdown-box { right: 0; margin-top: 8px; }

@media (min-width: 500px) {
  .readpanel-menu .dropdown-box { left: auto; }
}
@media (max-width: 499px) {
  .read-panel .dropdown { position: static; }
}