/* cn3-plus / ui */

/* ---- «Аа» и «Поделиться» в строке с датой ---- */
.cn3x-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-left: 1rem;
}
.cn3x-toolbtn {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  margin: 0;
  padding: 3px 10px;
  border: 1px solid var(--borderColor, rgba(128, 128, 128, .4));
  border-radius: 6px;
  background: transparent;
  color: var(--cn3Muted, var(--greyColor));
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}
.cn3x-toolbtn:hover { color: var(--hoverColor); border-color: currentColor; }
.cn3x-toolbtn span:first-child { font-size: 11px; }
.cn3x-toolbtn span:last-child { font-size: 16px; }

/* размер текста статьи */
html[data-cn3x-fs="lg"] body.single .post-content { font-size: 1.15em; }
html[data-cn3x-fs="xl"] body.single .post-content { font-size: 1.3em; }

/* ---- Индикатор чтения ---- */
.cn3x-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 3px;
  background: var(--cn3Accent, #8c4a3c);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---- Оглавление ---- */
.cn3x-toc {
  margin: 0 0 2rem;
  padding: 1rem 1.4rem;
  border-left: 3px solid var(--mainColor);
  border-radius: 0 10px 10px 0;
  background: rgba(128, 128, 128, .08);
}
.cn3x-toc__title { display: block; margin-bottom: .5rem; font-weight: var(--bold, 600); }
.cn3x-toc ol { margin: 0; padding-left: 1.2rem; }
.cn3x-toc a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(128, 128, 128, .4);
}
.cn3x-toc a:hover { color: var(--hoverColor); border-bottom-color: currentColor; text-decoration: none; }
.cn3x-toc a.is-active { font-weight: var(--bold, 600); border-bottom-color: currentColor; }
body.single .post-content h2 { scroll-margin-top: 90px; }

/* ---- Карточка «Читать дальше»: слева, чтобы не накрывать кнопку «наверх» ---- */
.cn3x-nextup {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 80;
  width: 300px;
  max-width: calc(100vw - 48px);
  padding: 10px 12px;
  border: 1px solid var(--borderColor, rgba(128, 128, 128, .3));
  border-radius: 14px;
  background: var(--lightColor, #fff);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .2);
  opacity: 0;
  transform: translateY(24px);
  transition: transform .3s ease, opacity .3s ease;
}
.cn3x-nextup[hidden] { display: none; }
.cn3x-nextup.is-visible { opacity: 1; transform: none; }
.cn3x-nextup__link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.cn3x-nextup__link:hover { text-decoration: none; }
.cn3x-nextup__img { flex: 0 0 auto; width: 72px; height: 48px; object-fit: cover; border-radius: 8px; }
.cn3x-nextup__text { display: flex; flex-direction: column; gap: 2px; }
.cn3x-nextup__label {
  font-size: var(--fs-xs, .75rem);
  font-weight: var(--bold, 600);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cn3Muted, var(--greyColor));
}
.cn3x-nextup__title {
  display: -webkit-box;
  -webkit-line-clamp: 2; /* не больше двух строк */
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .9rem;
  font-weight: var(--bold, 600);
  line-height: 1.3;
}
.cn3x-nextup__close {
  position: absolute;
  top: 2px;
  right: 6px;
  border: 0;
  background: none;
  color: var(--cn3Muted, var(--greyColor));
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 899px) { .cn3x-nextup { display: none; } } /* на телефоне внизу есть панель навигации */

/* ---- Нижняя панель навигации: только на телефонах ---- */
.cn3x-bottombar { display: none; }
@media (max-width: 768px) {
  .cn3x-bottombar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    justify-content: space-around;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--borderColor, rgba(128, 128, 128, .25));
    background: var(--lightColor, #fff);
  }
  .cn3x-bottombar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 56px;
    min-height: 44px;
    font-size: 11px;
    color: var(--cn3Muted, var(--greyColor));
    text-decoration: none;
  }
  .cn3x-bottombar__item:hover { color: var(--hoverColor); text-decoration: none; }
  .cn3x-bottombar__icon { font-size: 20px; line-height: 1; }
  /* кнопка «наверх» и подвал не прячутся под панелью */
  body { padding-bottom: 56px; }
  .back-to-top { bottom: 72px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .cn3x-bottombar { display: none; }
  body { padding-bottom: 0; }
  .back-to-top { bottom: 16px; }
}

/* ---- Подписка ---- */
.cn3x-subscribe {
  margin: 32px 0;
  padding: 20px;
  border-radius: 12px;
  background: rgba(128, 128, 128, .08);
}
.cn3x-subscribe__title { display: block; margin-bottom: 12px; font-weight: var(--bold, 600); }
.cn3x-subscribe__row { display: flex; flex-wrap: wrap; gap: 8px; }
.cn3x-subscribe__row input[type="email"] {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--borderColor, rgba(128, 128, 128, .4));
  border-radius: 8px;
  font: inherit;
}
.cn3x-subscribe__row button {
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--mainColor);
  color: var(--lightColor, #fff);
  font: inherit;
  cursor: pointer;
}
.cn3x-subscribe__agree { display: block; margin-top: 8px; font-size: var(--fs-xs, .75rem); color: var(--cn3Muted, var(--greyColor)); }
