/* Дополнения для WordPress: панель администратора, пагинация, блоки редактора в статьях. */

/* Панель администратора сверху */
.admin-bar { --dock-toolbar: 32px; }
.admin-bar .header, .admin-bar .progress { top: 32px; }
@media (max-width: 782px) {
  .admin-bar { --dock-toolbar: 46px; }
  .admin-bar .header, .admin-bar .progress { top: 46px; }
}
@media (max-width: 600px) { #wpadminbar { position: fixed; } }

/* Дата на карточке без картинки */
.post-date { color: var(--ink); }

/* Форма */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-fail { margin-top: 12px; font-size: 14px; color: #c0392b; }
.form-preview-note { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); }
.form.is-busy button[type="submit"] { opacity: .6; pointer-events: none; }

/* Кейсы без цифры: только заголовок, крупнее */
.case--plain h3 { margin-top: auto; padding-top: 36px; font-size: clamp(20px, 2vw, 26px); font-weight: 700; line-height: 1.25; color: #fff; letter-spacing: -.015em; }
.case--wide.case--plain h3 { font-size: clamp(26px, 3vw, 40px); line-height: 1.12; }
.case .num--text { font-size: clamp(34px, 3.6vw, 52px); letter-spacing: -.04em; white-space: normal; }

/* Заголовки страниц с длинным названием (рубрики, страницы) */
.page-head h1.h1--long { font-size: clamp(36px, 6vw, 84px); line-height: .98; letter-spacing: -.04em; max-width: 16em; }
.page-body { max-width: 820px; padding-bottom: clamp(64px, 8vw, 112px); }

/* Оглавление */
.toc-list[hidden] { display: none; }
.toc-list + .toc-cta { margin-top: 28px; }
.toc-cta:first-child { margin-top: 0; }

/* Пагинация paginate_links() */
.pager { flex-wrap: wrap; }
.pager .page-numbers { min-width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: 15px; padding: 0 12px; }
.pager a.page-numbers { background: #fff; }
.pager a.page-numbers:hover { background: var(--blue-l); }
.pager .page-numbers.current { background: var(--ink); color: #fff; }
.pager .page-numbers.dots { background: none; }

/* ---------- Текст статьи: блоки редактора ---------- */
.entry img { max-width: 100%; height: auto; border-radius: var(--r); }
.entry h2 > br:first-child, .entry h3 > br:first-child { display: none; }
.entry p:empty { display: none; }
.entry strong, .entry b { font-weight: 700; }
.entry hr, .entry .wp-block-separator { border: 0; height: 1px; background: var(--line); margin-block: 2em; }

.entry .wp-block-image, .entry .wp-caption { margin-block: 1.8em; }
.entry .wp-block-image img { display: block; }
.entry .wp-block-image figcaption, .entry .wp-caption-text { font-size: 14px; color: var(--muted); margin-top: 10px; text-align: left; }
.entry .aligncenter, .entry .wp-block-image .aligncenter { margin-inline: auto; text-align: center; }
.entry .aligncenter img { margin-inline: auto; }
.entry .alignleft { float: left; margin: .3em 1.6em 1em 0; max-width: 50%; }
.entry .alignright { float: right; margin: .3em 0 1em 1.6em; max-width: 50%; }
.entry::after { content: ""; display: table; clear: both; }
.entry .alignwide, .entry .alignfull { margin-inline: 0; }

/* Галереи */
.entry .wp-block-gallery, .entry .blocks-gallery-grid, .entry .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.entry .blocks-gallery-grid li, .entry .wp-block-gallery li { padding: 0; margin: 0; }
.entry .blocks-gallery-grid li::before, .entry .wp-block-gallery li::before { display: none; }
.entry .wp-block-gallery figure, .entry .gallery figure { margin: 0; }
.entry .wp-block-gallery img, .entry .gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Цитаты */
.entry .wp-block-quote, .entry .wp-block-pullquote { margin-inline: 0; }
.entry .wp-block-quote p + p { margin-top: .6em; }
.entry .wp-block-pullquote { border: 0; padding: 0; text-align: left; }

/* Таблицы */
.entry table { width: 100%; border-collapse: collapse; font-size: 16px; background: #fff; border-radius: var(--r); overflow: hidden; }
.entry .wp-block-table { overflow-x: auto; }
.entry th, .entry td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.entry th { font-weight: 700; background: var(--blue-xl); }

/* Файлы (PDF) */
.entry .wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; background: #fff; border-radius: 12px; padding: 14px 18px; font-size: 16px; }
.entry .wp-block-file a:not(.wp-block-file__button) { flex: 1 1 240px; }
.entry .wp-block-file__button, .entry .wp-block-button__link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 10px; background: var(--blue); color: #fff !important; text-decoration: none !important; font-weight: 600; font-size: 15px; }
.entry .wp-block-file__embed { width: 100%; height: 70vh; border: 0; border-radius: var(--r); margin-top: 12px; }
.entry .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

/* Видео и встраивания */
.entry iframe { max-width: 100%; border: 0; border-radius: var(--r); }
.entry .wp-block-embed__wrapper { position: relative; }
.entry .wp-has-aspect-ratio .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.entry .wp-has-aspect-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Выравнивание текста из редактора */
.entry .has-text-align-center { text-align: center; }
.entry .has-text-align-right { text-align: right; }

@media (max-width: 640px) {
  .entry .alignleft, .entry .alignright { float: none; margin: 1.4em 0; max-width: 100%; }
  .page-head h1.h1--long { font-size: clamp(32px, 9vw, 48px); }
}

/* Compact contact bar with room for the last line of the footer. */
@media (max-width: 900px) {
  body {
    --contact-button-height: 40px;
    --contact-bar-inset: max(3px, env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(var(--contact-button-height) + 4px + var(--contact-bar-inset));
  }
  .mbar.mbar--channels {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 3px max(8px, env(safe-area-inset-right, 0px)) var(--contact-bar-inset) max(8px, env(safe-area-inset-left, 0px));
  }
  .mbar.mbar--channels a {
    height: var(--contact-button-height);
    gap: 3px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }
  .mbar.mbar--channels a svg { flex: none; width: 13px; height: 13px; }
}
@media (max-width: 350px) {
  .mbar.mbar--channels a { gap: 2px; font-size: 10px; }
}
#contact-max { scroll-margin-top: 100px; }
