/* AA functions extracted CSS — стили вынесены из functions.php */

.ha-post-navigator {
    width: 100%;
    max-width: 1480px;
    margin: 22px auto 28px;
    padding: 0 18px;
    box-sizing: border-box;
}

.ha-post-navigator * {
    box-sizing: border-box;
}

.ha-post-navigator__grid {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 150px;
    align-items: center;
    gap: 22px;
    width: 100%;
}

.ha-post-navigator__prev,
.ha-post-navigator__next {
    min-width: 0;
}

.ha-post-navigator__next {
    text-align: right;
}

.ha-post-navigator__link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    color: #7b7f84;
    text-decoration: none;
    transition: color .18s ease, transform .18s ease;
}

.ha-post-navigator__link a:hover {
    color: #b00018;
    transform: translateY(-1px);
}

.ha-post-navigator__next a {
    justify-content: flex-end;
}

.ha-post-navigator__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    color: #8b9095;
}

.ha-post-navigator__arrow svg {
    width: 26px;
    height: 26px;
    display: block;
}

.ha-post-navigator__label {
    display: inline-block;
    color: #7b7f84;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .025em;
    white-space: nowrap;
}

.ha-post-navigator__center {
    min-width: 0;
    text-align: center;
}

.ha-post-navigator__title {
    display: block;
    max-width: 980px;
    margin: 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111;
    font-size: clamp(25px, 2vw, 34px);
    line-height: 1.12;
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.025em;
    text-shadow: none !important;
}

.ha-post-navigator__count {
    margin-top: 7px;
    color: #7b7f84;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 900px) {
    .ha-post-navigator__grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .ha-post-navigator__center {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .ha-post-navigator__prev {
        grid-column: 1;
        grid-row: 2;
    }

    .ha-post-navigator__next {
        grid-column: 2;
        grid-row: 2;
    }

    .ha-post-navigator__title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        white-space: normal;
        font-size: 24px;
        line-height: 1.16;
    }

    .ha-post-navigator__label {
        font-size: 11px;
        letter-spacing: .02em;
    }
}

@media (max-width: 768px) {
    .ha-post-navigator {
        margin: 18px auto 24px;
        padding: 0 12px;
    }

    .ha-post-navigator__count {
        margin-top: 6px;
        font-size: 12px;
    }

    .ha-post-navigator__arrow,
    .ha-post-navigator__arrow svg {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .ha-post-navigator__link a {
        gap: 6px;
    }
}

.subcategory-list-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
}

.subcategory-image {
    margin-right: 20px;
}

.subcategory-image img {
    height: auto;
    border-radius: 5px;
    display: block;
}

.subcategory-text {
    flex: 1;
}

.subcategory-text h3 {
    margin: 0;
}

.subcategory-text p {
    margin: 0;
}

.aa-related-posts-carousel {
    width: 100%;
    max-width: 1480px;
    margin: 40px auto;
    padding: 0 18px;
    box-sizing: border-box;
}

.aa-related-posts-carousel * {
    box-sizing: border-box;
}

.aa-related-posts-carousel .aa-related-posts-carousel__wrap {
    position: relative;
}

.aa-related-posts-carousel .aa-related-posts-carousel__track {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 4px 18px;
    scrollbar-width: thin;
}

.aa-related-posts-carousel .aa-related-posts-carousel__card {
    flex: 0 0 calc(33.333% - 15px);
    min-width: calc(33.333% - 15px);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    scroll-snap-align: start;
    box-shadow: 0 14px 32px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
}

.aa-related-posts-carousel .aa-related-posts-carousel__image {
    display: block;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #eee;
}

.aa-related-posts-carousel .aa-related-posts-carousel__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aa-related-posts-carousel .aa-related-posts-carousel__body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aa-related-posts-carousel .aa-related-posts-carousel__cat {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
    margin-bottom: 10px;
    padding: 5px 9px;
    border-radius: 5px;
    background: #e6e6e6;
    color: #555;
    font-size: 12px;
}

.aa-related-posts-carousel .aa-related-posts-carousel__title {
    display: block;
    margin-bottom: 10px;
    color: #111;
    font-size: 19px;
    line-height: 1.25;
    font-weight: 800;
    text-decoration: none;
}

.aa-related-posts-carousel .aa-related-posts-carousel__excerpt {
    color: #555;
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 16px;
}

.aa-related-posts-carousel .aa-related-posts-carousel__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    color: #777;
    font-size: 13px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(0,0,0,.10);
}

.aa-related-posts-carousel .aa-related-posts-carousel__author {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.aa-related-posts-carousel .aa-related-posts-carousel__author img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex: 0 0 28px;
    display: block;
}

.aa-related-posts-carousel .aa-related-posts-carousel__date {
    white-space: nowrap;
}

.aa-related-posts-carousel .aa-related-posts-carousel__car-name {
    margin-top: 10px;
    color: #333;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
}

.aa-related-posts-carousel .aa-related-posts-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 3px;
}

.aa-related-posts-carousel .aa-related-posts-carousel__arrow--prev {
    left: -16px;
}

.aa-related-posts-carousel .aa-related-posts-carousel__arrow--next {
    right: -16px;
}

@media (max-width: 900px) {
    .aa-related-posts-carousel .aa-related-posts-carousel__card {
        flex-basis: calc(50% - 12px);
        min-width: calc(50% - 12px);
    }
}

@media (max-width: 600px) {
    .aa-related-posts-carousel {
        padding: 0 12px;
    }

    .aa-related-posts-carousel .aa-related-posts-carousel__card {
        flex-basis: 86%;
        min-width: 86%;
    }

    .aa-related-posts-carousel .aa-related-posts-carousel__image {
        height: 190px;
    }

    .aa-related-posts-carousel .aa-related-posts-carousel__arrow {
        display: none;
    }
}
