.flex {
    display: flex;
}

.flex-center {
    align-items: center;
    justify-items: center;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

.custom_link_header {
    font-family: var(--fontPrimary);
    font-weight: 800;
    font-style: ExtraBold;
    font-size: 16px;
    line-height: 22px;
    letter-spacing: 0px;
    color: var(--colorBlack);
    text-decoration: none;
}

.site-header {
    top: 0;
    background: #fff;
    position: relative;
}

.header__top {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
}

.custom-logo {
    max-height: 40px;
    width: auto;
    height: auto;
    display: block;
}

.brand__badge {
    font-size: 12px;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 8px;
}

.menu {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    gap: 20px;
}

.menu a {
    text-decoration: none;
    color: #222;
}

.menu--aux a {
    opacity: .8;
}

.header__aux {
    margin-left: auto;
}

.header__primary {
    position: absolute;
    left: 0;
    right: 0;
    top: 60px;
    width: 100vw;
    border-top: 1px solid #eee;
    padding: 18px;
    background: #fff;
    z-index: 20;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
}

.primary-menu-open .header__primary {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.menu--primary {
    flex-wrap: wrap;
}

.burger {
    display: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #0f172a;
    border-radius: 999px;
}

.burger:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.mobile-menu {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 200;
    padding: 18px 16px 32px;
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.mobile-menu__title {
    font-size: 18px;
    font-weight: 800;
}

.mobile-menu__close {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.mobile-menu__close span {
    position: absolute;
    width: 16px;
    height: 2px;
    background: #0f172a;
    border-radius: 999px;
}

.mobile-menu__close span:first-child {
    transform: rotate(45deg);
}

.mobile-menu__close span:last-child {
    transform: rotate(-45deg);
}

.mobile-menu__section {
    display: grid;
    gap: 12px;
}

.mobile-menu__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1.5px solid #111827;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-menu__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12);
}

.menu--mobile {
    width: 100%;
    margin: 0;
    padding: 0;
    flex-direction: column;
    gap: 6px;
}

.menu--mobile li {
    list-style: none;
}

.menu--mobile a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    border-bottom: 1px solid #e5e7eb;
}

.menu--mobile li:last-child a {
    border-bottom: none;
}

.menu-open .mobile-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

@media (min-width: 641px) {
    .mobile-menu {
        display: none;
    }
}

.header__search {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0 18px;
}

.header__tools {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
}

.sort-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 10px;
    z-index: 25;
}

.sort-dropdown__option {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #111;
    text-decoration: none;
    font-weight: 600;
}

.sort-dropdown__option:hover {
    background: #f3f4f6;
}

.sort-dropdown__option.is-active {
    background: #eef2ff;
    color: #1d4ed8;
}

.sort-open .sort-dropdown {
    display: block;
}

.search-header-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    border: 1.5px solid #016AFF
}

.search__label {
    position: absolute;
    left: -9999px;
}

.search__input {
    flex: 1;
    border: 0;
    background: transparent;
    outline: none;
    font-weight: 500;
    font-style: Medium;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: 0px;
    color: var(--colorBlack);
}

.search__input::placeholder {
    color: var(--colorBlack);
}

.search__btn,
.icon-btn {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #111;
}

.site-main {
    padding: 24px 0 48px;
    display: flex;
    background: #F7F7F7;
}

/* Для страницы записи фон белый и без flex, сетка управляется внутри */
body.single .site-main {
    background: #fff;
    display: block;
    padding: 0;
}

.site-footer {
    padding: 48px 0 0;
    border-top: none;
    background: transparent;
}

.footer-banner {
    background: #1f4f8d;
    color: #e8ecf4;
    border-radius: 32px;
    padding: 56px 64px;
    box-shadow: 0 22px 80px rgba(15, 35, 70, 0.35);
    position: relative;
    overflow: hidden;
}

.footer-banner__text {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 32px;
}

.footer-banner__title {
    font-size: 32px;
    font-weight: 700;
    color: #f3f5f8;
    margin-bottom: 12px;
}

.footer-banner__subtitle {
    font-size: 20px;
    font-weight: 400;
    color: #d6deeb;
    margin-bottom: 6px;
}

.footer-banner__link {
    font-size: 22px;
    font-weight: 500;
    color: #f3f5f8;
}

.footer-banner__contacts {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-contact {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #e9e5dc;
    color: #1c4d8e;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    padding: 14px 20px 14px 18px;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

.footer-contact__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f4eddc;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #f3f5f8;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.footer-brand__logo {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(140deg, #f1642c 0%, #fe9d33 30%, #00c2ff 100%);
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.footer-brand__logo::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 10px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0d223e 0%, #0f2f58 100%);
}

.footer-brand__text-accent {
    font-size: 16px;
    font-weight: 500;
    margin-left: 4px;
    opacity: 0.9;
}

@media (max-width: 1100px) {
    .footer-banner {
        padding: 48px 40px;
        border-radius: 28px;
    }

    .footer-banner__title {
        font-size: 28px;
    }

    .footer-banner__subtitle {
        font-size: 18px;
    }

    .footer-banner__link {
        font-size: 20px;
    }
}

@media (max-width: 720px) {
    .site-footer {
        padding: 32px 0 0;
    }

    .footer-banner {
        padding: 36px 24px;
    }

    .footer-banner__text {
        margin-bottom: 28px;
    }

    .footer-banner__title {
        font-size: 22px;
    }

    .footer-banner__subtitle {
        font-size: 16px;
    }

    .footer-banner__contacts {
        flex-direction: column;
        gap: 16px;
    }

    .footer-contact,
    .footer-brand {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

.button_default {
    opacity: 1;
    padding: 5px 37px;
    text-decoration: none;
    color: var(--colorBlack);
    border: 1.5px solid var(--colorBlack);
    border-radius: 25px;
}

.flex-to-left {
    margin-left: auto;
}


.gap-30 {
    gap: 30px;
}

/* простая адаптивность */
@media (max-width: 640px) {
    body.menu-open {
        overflow: hidden;
    }

    .custom_link_header {
        display: none;
    }

    .burger {
        display: inline-flex;
        margin-left: auto;
    }

    .mobile-menu {
        display: flex;
        flex-direction: column;
    }

    .mobile-menu .cats_column {
        margin: 0;
    }

    .mobile-menu .cats {
        gap: 12px;
    }

    .mobile-menu .cats__heading {
        font-size: 18px;
        font-weight: 800;
    }

    .mobile-menu .cats__link {
        align-items: center;
    }

    .mobile-menu .cats__name {
        font-weight: 600;
        font-size: 15px;
    }

    .site-main .cats_column {
        display: none;
    }

    .header__primary {
        display: none !important;
    }
}

@media (max-width: 920px) {
    .header__aux {
        display: none;
    }
}




/** СЛАЙДЕР В ШАПКЕ САЙТА **/


.featured {
    padding: 40px 0;
}

.swiper.featured__swiper {
    overflow: hidden;
    box-sizing: border-box;
    /* width: calc(100% - 120px); */
    /* margin: 0 auto; */
}

.swiper-wrapper {
    overflow: hidden;
}

.featured__item {
    background: var(--colorGray);
    border-radius: 12px;
    overflow: hidden;
}

.featured__thumb img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    display: block;
}

.featured__placeholder {
    height: 60px;
    background: #f3f4f6;
    color: #9ca3af;

    svg {
        margin: 15px;
    }
}

.featured__title {
    padding: 12px 16px;
    font-size: 1rem;
    line-height: 1.3;
    height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swiper-button-prev {
    /* left: -50px !important; */
}

.swiper-button-next {
    /* right: -50px !important; */
}

.swiper-button-prev,
.swiper-button-next {
    width: 25px !important;
    height: 25px !important;
    border-radius: 50%;
    color: #333;
    background-color: var(--colorGray);

    svg {
        color: #000;
        height: 15px !important;
    }
}

.featured__swiper .swiper-button-prev {
    left: 16px;
}

.featured__swiper .swiper-button-next {
    right: 16px;
}

@media (max-width: 768px) {
    .featured__swiper {
        padding: 0 32px;
    }

    .featured__swiper .swiper-button-prev {
        left: 8px;
    }

    .featured__swiper .swiper-button-next {
        right: 8px;
    }
}

.swiper-pagination-bullet-active {
    background: #111;
}

/** СЛАЙДЕР В ШАПКЕ САЙТА **/


/* ОСНОВНОЙ ЛЕЙАУТ */
.single-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 160px;
    grid-template-areas: "cats content sidebar";
    gap: 24px;
    align-items: start;
    margin: 24px 0 48px;
}

.single-layout__aside--cats {
    height: 100%;
    grid-area: cats;
    background: #f5f5f7;
    border-radius: 16px;
    padding: 20px 16px;
}

.single-layout__aside--cats .cats_column {
    margin: 0;
    width: 100%;
}

.single-layout__aside--cats h1 {
    margin: 0 0 12px;
}

.single-layout__aside--cats .cats__heading {
    margin: 0 0 12px;
}

.single-layout__content {
    grid-area: content;
    background: #fff;
    padding: 24px;
}

.single-layout__aside--right {
    grid-area: sidebar;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 0 0 1px #e5e5e5;
    &.third-col {
        margin: 0;
    }
}

.single-layout__aside--right .third-col {
    margin: 0;
    border: none;
    padding: 0;
    width: 100%;
    position: sticky;
    top: 48px;
}

@media (max-width: 1200px) {
    .single-layout {
        grid-template-columns: 220px minmax(0, 1fr) 260px;
    }
}

@media (max-width: 1080px) {
    .single-layout {
        grid-template-columns: 200px minmax(0, 1fr);
        grid-template-areas:
            "cats content"
            "cats sidebar";
    }
}

@media (max-width: 820px) {
    .single-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "cats"
            "content"
            "sidebar";
    }

    .single-layout__aside--right .third-col {
        position: static;
    }
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: .2s ease all;
}

.post-card__link {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.post-card--promo {
    border: 1px solid #e4e7ec;
    background: linear-gradient(140deg, #f7faff 0%, #fff 38%, #fff8e1 100%);
}

.post-card:hover {
    transition: .2s ease all;
    box-shadow: 0px 0px 10px -8px #111;
}

.post-card__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 6;
    overflow: hidden;
    border-radius: 12px;
}

.post-card--wide {
    grid-column: 1 / -1;
}

.post-card--wide .post-card__thumb {
    aspect-ratio: 16 / 5;
}

.post-card__thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 18px 14px;
    background: #fff;
}

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    opacity: .75;
    margin: 0 0 8px;
}

.post-card__cat,
.post-card__date {
    font-weight: 400;
    font-size: 10px;
    text-transform: uppercase;
    text-decoration: none;
    color: #00000033;
}

.post-card__dot {
    font-size: 14px;
    color: #00000033;
}

.post-card__date {
    font-size: 12px;
}

.post-card__title {
    margin: 0 0 8px;
    line-height: 1.3;
}

.post-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff0c2;
    color: #8a6100;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.post-card__excerpt {
    margin: 0 0 12px;
    line-height: 1.6;
}

.clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__stats {
    display: flex;
    gap: 16px;
    font-size: 10px;
    opacity: .85;
    margin-top: auto;
    color: #00000033;
}

.search-results {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.search-results__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-results__title {
    margin: 0;
}

.search-results__meta {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.search-empty {
    padding: 32px;
    background: #fff;
    border-radius: 12px;
    text-align: center;
    display: grid;
    gap: 20px;
}

.search-empty .search {
    max-width: 400px;
    margin: 0 auto;
}

.post-card--flexible-wrapper {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    font-weight: 400;
    font-size: 10px;
    text-transform: lowercase;

}

.post-card__copy {
    cursor: pointer;
    border: none;
    background: transparent;
}

.post-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #016AFF;
    margin-top: auto;
}

/* (опционально) ховеры */
.post-card__link:hover .post-card__title {
    text-decoration: underline;
}

/* Адаптив: на планшете можно оставить две колонки, на мобиле — одну */
@media (max-width: 1024px) {
    .blog-grid {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .post-card--wide {
        grid-column: auto;
    }

}

.load-more {
    margin: 24px auto 0;
    min-height: 32px;
    text-align: center;
    color: #016AFF;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
}

.load-more.is-loading {
    opacity: 1;
}

.load-more.is-error {
    opacity: 1;
    color: #d92d20;
}

/* ОСНОВНОЙ ЛЕЙАУТ */


/*ВИДЖЕТ СПРАВА КОЛОНКА*/
.third-col {
    min-width: 160px;
    height: fit-content;
    padding: 0 0 15px;
    width: 100%;
    margin: 0 30px;
    border-radius: 15px;
    border: 1px solid white;
    overflow: hidden;
    position: sticky;
    top: 48px;
}

/*ВИДЖЕТ СПРАВА КОЛОНКА*/
