/* ──────────────────────────────────────────────────────────
   NGB header — embed from admin or default theme template
   ────────────────────────────────────────────────────────── */

/* Sticky header shell */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--Page-bg);
    border-bottom: 1px solid var(--Border);
    box-shadow: 0 3px 0 var(--Accent);
}

.site-header .header-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 18px;
}

/* Logo */
.site-header .brand,
.site-header .site-logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.site-header .brand img,
.site-header .site-logo img {
    width: min(100%, 294px);
    height: auto;
    display: block;
}

/* Desktop nav */
.site-header .topnav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-left: auto;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.site-header .topnav a {
    color: var(--Text-secondary);
    text-decoration: none;
    padding: 10px 10px;
    border-left: 1px solid var(--Border);
    white-space: nowrap;
    transition: background .2s, color .2s;
}

.site-header .topnav a:first-child {
    border-left: 0;
}

.site-header .topnav a:hover {
    background: var(--Accent);
    color: var(--Text-inverse);
}

/* Social icons in header */
.site-header .ngb-header-social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-header .ngb-header-social .tf-social {
    gap: 12px;
    font-size: 20px;
}

/* Mobile burger */
.site-header .ngb-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    color: var(--Text-secondary);
}

.site-header .ngb-burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.site-header .ngb-burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--Text-secondary);
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}

/* Mobile offcanvas */
.mobile-nav-wrap {
    background: var(--Panel-bg) !important;
    border-right: 1px solid var(--Border);
}

.mobile-nav-wrap .top-nav-mobile {
    background: var(--Panel-bg);
    border-bottom: 1px solid var(--Border);
    padding: 1rem;
}

.mobile-nav-wrap .inner-mobile-nav {
    padding: 1rem;
}

.mobile-nav-wrap .item-menu-mobile {
    display: block;
    padding: 12px 0;
    color: var(--Text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--Border);
    transition: color .2s;
}

.mobile-nav-wrap .item-menu-mobile:hover {
    color: var(--Accent);
}

.mobile-nav-wrap .btn-close-menu {
    background: none;
    border: none;
    color: var(--Text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

/* Responsive */
@media (max-width: 991.98px) {
    .site-header .ngb-mobile-toggle {
        display: flex;
        align-items: center;
    }
    .site-header .brand img,
    .site-header .site-logo img {
        width: min(100%, 200px);
    }
    .site-header .header-inner {
        padding: 10px 16px;
    }
}

@media (min-width: 992px) {
    .site-header .ngb-mobile-toggle {
        display: none !important;
    }
}

/* ──────────────────────────────────────────────────────────
   MIC-33: убрать поиск, рассылку, комментарии */
#canvasSearch,
.offcanvas-search,
a.btn-find[href="#canvasSearch"],
.footer-newsletter,
.section-newsletter,
.newsletter-item,
.comments-area,
#comments {
    display: none !important;
}

body.smi-theme-light-only .toggle-switch-mode,
body.smi-theme-light-only .btn-find {
    display: none !important;
}

/* SMI Drozy theme: align imagery with template proportions */
.hero-banner .img-thumbs img,
.page-title .img-thumbs img,
.thumbs-post img,
.feature-post-item .img-style > img,
.feature-post-item.style-small .img-style img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    display: block;
}

.feature-post-item.style-small .img-style {
    flex-shrink: 0;
}

.feature-post-item.style-small .img-style img {
    aspect-ratio: 4 / 3;
    max-width: 123px;
}

.feature-post-item.style-list .img-style > img,
.feature-post-item.style-list.v2 .img-style > img {
    aspect-ratio: 16 / 9;
}

.hero-banner .img-thumbs img {
    aspect-ratio: 1800 / 700;
    max-height: min(70vh, 700px);
}

.heading-post .thumbs-post img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    display: block;
}

/* Infinite scroll: следующая статья в том же виде, визуальный разделитель */
.smi-infinite-scroll-article {
    border-top: 2px solid var(--Line);
    margin-top: 4rem;
    padding-top: 4rem;
}

.smi-infinite-scroll-article .heading-post {
    padding-top: 0;
}

.section-cta h2 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
}

/* Меню из админки (menuHeaderHtml / menuFooterHtml) внутри темы */
.header-menu .smi-site-menu-html.navigation > ul,
.header-menu .smi-site-menu-html ul.navigation {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
}

.inner-mobile-nav .smi-site-menu-html ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.inner-mobile-nav .smi-site-menu-html a {
    text-decoration: none;
}

.smi-site-footer-menu .footer-menu-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: center;
}

@media (min-width: 768px) {
    .smi-site-footer-menu .footer-menu-list ul {
        justify-content: flex-start;
    }
}

/* MIC-32: типографика HTML из редактора (без классов на p/h2/ul в Trix) */
.smi-rich-content,
.smi-page-body {
    color: var(--On-surface);
    font-size: 18px;
    line-height: 30px;
    font-weight: 400;
}

.smi-rich-content > * + * {
    margin-top: 1.75rem;
}

/* Trix часто отдаёт <div> вместо <p> — те же правила, что у абзаца в single-post */
.smi-rich-content > div {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    font-weight: 400;
}

.smi-rich-content p {
    margin: 0 0 1.75rem;
}

.smi-rich-content p:last-child {
    margin-bottom: 0;
}

.smi-rich-content strong,
.smi-rich-content b {
    font-weight: 700;
}

.smi-rich-content h1,
.smi-rich-content h2,
.smi-rich-content h3,
.smi-rich-content h4,
.smi-rich-content h5,
.smi-rich-content h6 {
    font-family: inherit;
    font-weight: 700;
    color: var(--On-surface);
}

.smi-rich-content h1 {
    font-size: 30px;
    line-height: 42px;
    margin: 0 0 0.75rem;
}

.smi-rich-content h2 {
    font-size: 24px;
    line-height: 32px;
    margin: 0 0 12px;
}

.smi-rich-content h3 {
    font-size: 22px;
    line-height: 30px;
    margin: 0 0 12px;
}

.smi-rich-content h4,
.smi-rich-content h5,
.smi-rich-content h6 {
    font-size: 20px;
    line-height: 28px;
    margin: 0 0 12px;
}

.smi-rich-content ul,
.smi-rich-content ol {
    padding-left: 30px;
    margin-bottom: 1.75rem;
}

.smi-rich-content ul li {
    list-style: disc;
}

.smi-rich-content ol li {
    list-style: decimal;
}

.smi-rich-content li + li {
    margin-top: 0.35rem;
}

.smi-rich-content a,
.smi-rich-content a:link,
.smi-rich-content a:visited {
    text-decoration: underline;
    color: var(--Link);
}

.smi-rich-content a:hover {
    opacity: 0.85;
    color: var(--Link-hover);
}

.smi-rich-content img,
.smi-rich-content figure img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

.smi-rich-content figure {
    margin: 0 0 1.75rem;
}

.smi-rich-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--Secondary2);
}

.smi-rich-content blockquote {
    margin: 0 0 1.75rem;
    padding-left: 40px;
    border-left: 1px solid var(--On-surface);
    font-style: italic;
}

.smi-rich-content table {
    width: 100%;
    margin-bottom: 1.75rem;
}

.smi-rich-content pre,
.smi-rich-content code {
    font-size: 0.9em;
}

/* Page — project-detail / about: readable body type */
.project-detail .thumb-main img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 1920 / 800;
    max-height: min(50vh, 800px);
}

.project-detail .smi-rich-content,
.project-detail .smi-page-body,
.smi-page-detail .smi-rich-content,
.smi-page-detail .smi-page-body {
    font-size: 19px;
    line-height: 1.75;
}

.project-detail .smi-rich-content h2,
.smi-page-detail .smi-rich-content h2 {
    font-size: 28px;
    line-height: 1.3;
}

.project-detail .smi-rich-content h3,
.project-detail .smi-rich-content h4,
.smi-page-detail .smi-rich-content h3,
.smi-page-detail .smi-rich-content h4 {
    font-size: 22px;
    line-height: 1.35;
}

.smi-page-detail .heading-title .title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.2;
    font-weight: 700;
}

.smi-page-lead {
    font-size: 20px;
    line-height: 1.55;
}

.project-detail .tf-social.style-2 {
    gap: 0.75rem;
}

/* MIC-33: список авторов (team.html) */
.section-team .team-item .img-style {
    display: block;
    overflow: hidden;
    border-radius: 12px;
}

.section-team .team-item .img-style img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 368 / 490;
    transition: transform 0.35s ease;
}

.section-team .team-item.hover-image:hover .img-style img {
    transform: scale(1.05);
}

.section-team .team-item .info .name a {
    text-decoration: none;
}

.section-team .team-item .tf-social.style-1 {
    margin-top: 0.75rem;
}

/* MIC-33: контакты (contact.html без карты и формы) */
.smi-page-contact .map-box,
.smi-page-contact #map,
.smi-page-contact .form-contact {
    display: none !important;
}

.smi-page-contact .list-info .item h5 {
    margin-bottom: 0.75rem;
}

.smi-page-contact .smi-rich-content > * + * {
    margin-top: 1.25rem;
}

/* Material — post-details / single-post-1 (passage, mb_28) */
.post-details.smi-material-body > .smi-rich-content {
    margin-top: 0;
}

/* Подзаголовки в теле — как h5.title в .passage (single-post-1) */
.post-details .smi-rich-content > h2,
.post-details .smi-rich-content > h3 {
    font-size: 24px;
    line-height: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--On-surface);
}

.post-details .smi-rich-content > h2:not(:first-child),
.post-details .smi-rich-content > h3:not(:first-child) {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--Line);
}

.post-details .smi-rich-content a,
.post-details .smi-rich-content a:link,
.post-details .smi-rich-content a:visited {
    color: var(--Link);
    text-decoration: underline;
}

.post-details .smi-rich-content ul,
.post-details .smi-rich-content ol {
    font-size: 18px;
    line-height: 30px;
}

.post-details .smi-rich-content ul + div,
.post-details .smi-rich-content ol + div,
.post-details .smi-rich-content > div + ul {
    margin-top: 1.25rem;
}

@media (max-width: 991.98px) {
    .smi-rich-content {
        font-size: 16px;
        line-height: 28px;
    }

    .project-detail .smi-rich-content,
    .project-detail .smi-page-body,
    .smi-page-detail .smi-rich-content,
    .smi-page-detail .smi-page-body {
        font-size: 17px;
        line-height: 1.7;
    }
}

.single-post .share-bar.sticky-top {
    top: 120px;
}

/* Мобильный шеринг под текстом: эталон с lg-hide иначе скрыт на <992px (см. styles.css темы) */
@media (max-width: 991.98px) {
    .single-post .d-lg-none .share-bar,
    .single-post .smi-sharing-material .share-bar.lg-hide {
        display: block !important;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .single-post .d-lg-none .share-bar.sticky-top {
        position: static;
        top: auto;
    }

    /* Кнопки в одну линию (на desktop в col-lg-3 остаётся вертикальная колонка) */
    .single-post .d-lg-none .share-bar ul {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .single-post .d-lg-none .share-bar ul > li {
        margin: 0;
        padding: 0;
    }

    .single-post .d-lg-none .share-bar .social-item {
        max-width: none;
        height: 44px;
        padding: 0 14px;
        white-space: nowrap;
    }
}

/* Страница автора (author-detail-1) */
.smi-author-biography p:last-child {
    margin-bottom: 0;
}

.smi-author-materials-grid .smi-ad-slot {
    grid-column: 1 / -1;
}

/* MIC-42: рекламные слоты */
.smi-list-feed-col .smi-ad-slot {
    width: 100%;
    margin: 1.5rem 0;
}

.smi-list-feed-col .smi-ad-slot .adsense-placeholder {
    margin: 0;
}

.smi-material-ad-before-related {
    margin-top: 10px;
    margin-bottom: 7px;
}

.smi-material-ad-before-related .smi-ad-slot,
.smi-material-ad-before-related .adsense-placeholder {
    width: 100%;
    margin: 0;
}

.smi-home-ad-slot-1,
.smi-home-ad-slot-2 {
    margin-bottom: 1.5rem;
}

.smi-home-ad-slot-1 .smi-ad-slot,
.smi-home-ad-slot-2 .smi-ad-slot,
.smi-home-ad-slot-1 .adsense-placeholder,
.smi-home-ad-slot-2 .adsense-placeholder {
    width: 100%;
    margin: 0;
}

.thumbs-post.smi-material-lead-figure figcaption {
    margin-top: 0.5rem;
    text-align: center;
    color: var(--Secondary2);
}

.post-details .smi-material-lead {
    margin-bottom: 1.75rem;
}

.post-details .smi-material-lead strong {
    font-weight: 700;
}

/* MIC-48: хлебные крошки — компактно, слева, перенос на мобиле */
ul.breadcrumb.breadcrumb--smi-sep {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem 0.5rem;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 0.75rem 0;
    list-style: none;
}

ul.breadcrumb.breadcrumb--smi-sep > li {
    flex: 0 1 auto;
    max-width: 100%;
}

ul.breadcrumb.breadcrumb--smi-sep .breadcrumb__sep {
    flex: 0 0 auto;
    opacity: 0.65;
}

/* MIC-48: цитаты как h4 */
.smi-rich-content blockquote {
    margin: 0 0 1rem;
    padding-left: 0;
    border-left: none;
    font-style: italic;
    font-size: 20px;
    line-height: 28px;
    font-weight: 700;
    color: var(--On-surface);
}

.smi-rich-content blockquote p {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;
}

.share-bar .share-bar__label {
    display: block;
}

.heading-post .avatar img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
}

/* MIC-48: мобильная шапка */
@media (max-width: 991.98px) {
    header .topbar-inner {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    header .topbar-inner .site-logo {
        order: 2;
        flex: 1 1 auto;
        text-align: center;
    }

    header .topbar-inner .mobile-button {
        order: 1;
    }

    header .topbar-inner > .d-flex.justify-content-end {
        order: 3;
        width: 100%;
        justify-content: center !important;
    }

    header .header-menu.style-default + .header-menu.style-default {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .smi-author-materials-grid {
        margin-bottom: 2rem;
    }
}

@media (max-width: 575.98px) {
    .single-post .d-lg-none .share-bar ul {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 4px;
    }

    .single-post .d-lg-none .share-bar .social-item {
        flex-shrink: 0;
        padding: 0 12px;
        font-size: 0.8125rem;
    }
}

/* Dark-only NGB palette; search/newsletter/theme switch remain disabled. */
html {
    color-scheme: dark;
}

.toggle-switch-mode,
#canvasSearch,
.offcanvas-search,
.footer-newsletter,
.header-menu a[data-bs-target="#canvasSearch"],
.header-menu .icon-search {
    display: none !important;
}

.smi-page-conversation-cta {
    background: var(--Surface);
    margin-top: 3rem;
}

.tf-social a.smi-social-vk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    border-radius: 50%;
}

/* ──────────────────────────────────────────────────────────
   NGB footer — embed from admin or default theme template
   ────────────────────────────────────────────────────────── */

.footer {
    margin-top: 54px;
    border-top: 4px solid var(--Page-bg);
    background: var(--Panel-bg);
    box-shadow: inset 0 3px 0 var(--Accent);
}

.footer .footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 18px 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

/* Section headings */
.footer .footer-inner section > h2,
.footer .footer-heading {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--Text-primary);
    margin: 0 0 14px;
    padding: 0;
    border: none;
}

/* About text */
.footer .footer-inner section > p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--Text-muted);
    margin: 0 0 16px;
}

/* Footer nav links list */
.footer .footer-inner section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.footer .footer-inner section ul li a {
    font-size: 13px;
    color: var(--Text-muted);
    text-decoration: none;
    transition: color .2s;
}

.footer .footer-inner section ul li a:hover {
    color: var(--Text-primary);
}

/* Social icons */
.footer .tf-social.d-flex {
    gap: 14px;
    font-size: 20px;
    margin: 0 0 16px;
}

.footer .tf-social a {
    color: var(--Text-muted);
    transition: color .2s;
}

.footer .tf-social a:hover {
    color: var(--Accent);
}

/* Copyright line */
.footer .ngb-footer-copy {
    font-size: 12px;
    color: var(--Text-muted);
    margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .footer .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer .footer-inner section:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .footer .footer-inner {
        grid-template-columns: 1fr;
        padding: 24px 16px 32px;
    }
}

/* ──────────────────────────────────────────────────────────
   Accent surfaces: badges + primary buttons
   ────────────────────────────────────────────────────────── */

.smi-article-count-badge,
.heading-title .tag.text_white-light,
.project-detail .heading-title .tag,
.page-title.style-default .tag {
    background: var(--Accent) !important;
    color: var(--Text-inverse) !important;
    border: 0;
}

.tf-btn {
    background-color: var(--Accent);
    color: var(--Text-inverse);
}

.tf-btn:hover {
    background-color: color-mix(in srgb, var(--Accent) 88%, #000);
    color: var(--Text-inverse);
}

.tf-btn.btn-white {
    background-color: var(--Panel-bg);
    color: var(--Text-primary);
    border: 1px solid var(--Border);
}

.smi-page-conversation-cta .tf-btn {
    background-color: var(--Accent);
    color: var(--Text-inverse);
}
