/* blog */
/* Blog post item container */
.blog-post-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Post content wrapper */
.post-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 20px;
}

/* Entry header */
.entry-header {
    margin-bottom: 15px;
}

/* Entry summary - will expand to push footer to bottom */
.entry-summary {
    flex-grow: 1;
    margin-bottom: 15px;
    line-height: 1.5;
    color: #555;
}

/* Entry footer - will stick to bottom */
.entry-footer {
    margin-top: auto;
    padding-top: 15px;
    text-align: right;
}

/* Similar posts: две колонки в ряд, каждая не шире половины строки (остальные .wp-block-columns на сайте не затрагиваются) */
.similar-posts-section .wp-block-columns.is-layout-flex {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 1.25rem;
}

.similar-posts-section .wp-block-columns.is-layout-flex > .wp-block-column {
    flex: 1 1 calc((100% - 1.25rem) / 2);
    max-width: calc((100% - 1.25rem) / 2);
    min-width: 0;
    box-sizing: border-box;
}

.similar-posts-section .wp-block-columns.is-layout-flex > .wp-block-column:only-child {
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767px) {
    .similar-posts-section .wp-block-columns.is-layout-flex > .wp-block-column {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .similar-posts-section .wp-block-columns.is-layout-flex > .wp-block-column:only-child {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Similar posts section */
.similar-posts-section .category-box {
    margin-top: 20px;
    padding: 25px;
    border-top: 1px solid #eee;
    clear: both;
    /* Очищаем обтекания от элементов поста */
}

/* Similar posts content layout */
.similar-posts-section .similar-post-content {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Similar post link wrapper */
.similar-posts-section .similar-post-link {
    display: block;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.similar-posts-section .similar-post-link:hover {
    transform: translateY(-5px);
}

/* Similar post image container */
.similar-posts-section .similar-post-image .wp-block-image {
    flex-shrink: 0;
    margin: 0;
}

.similar-posts-section .similar-post-image .wp-block-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50px;
}

/* Similar post text container */
.similar-posts-section .similar-post-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Similar post heading: максимум 2 строки + многоточие, фиксированная высота под 2 строки */
.similar-posts-section .similar-post-text .wp-block-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: #fff !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: break-word;
    min-height: calc(1.1rem * 1.3 * 2);
}

.similar-posts-section .similar-post-text .wp-block-heading a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.similar-posts-section .similar-post-text .wp-block-heading a:hover {
    color: var(--first-theme-color);
}

/* Similar post excerpt with 2 line limit */
.similar-posts-section .similar-post-excerpt {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #fff !important;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 3em;
    /* 2 lines × 1.5 line height */
}

/* Similar posts button */
.similar-posts-section .about-button-box {
    margin-top: auto;
    padding-bottom: 0;
}

/* Responsive design for similar posts */
@media (max-width: 767px) {
    .similar-posts-section .similar-post-content {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .similar-posts-section .similar-post-image {
        align-self: center;
    }

    .similar-posts-section .similar-post-text {
        gap: 8px;
        text-align: center;
    }
}

@keyframes shine {
    100% {
        left: 125%;
    }
}

.blog-image-box:hover .blog-category {
    /* display: block; */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.blog-category {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    font: 400 14px / 20px var(--pri-font);
    color: #fff;
    width: fit-content;
    margin: auto;
    padding: 12px 40px;
    border-radius: 50px;
    opacity: 0;
    z-index: 2;
    -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
    transition: opacity 0.35s, transform 0.35s;
    -webkit-transform: translate3d(-40px, 0, 0);
    transform: translate3d(-40px, 0, 0);
}

a.cat-item {
    font: 400 14px / 20px var(--pri-font);
    color: #fff;
}

/* Blog content text with line clamp */
.blog-content-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.5em;
    /* fallback for non-WebKit browsers */
    line-height: 1.5em;
    margin-bottom: 1.5rem;
}

.blog-contents-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#blog .owl-carousel .blog-image-box {
    margin: 0px 10px;
}

.blog-contents-box h4 a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 3.6em;
    /* 3 lines × 1.2em line height */
    line-height: 1.2em;
    /* Ensures consistent height */
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-contents-box h4 a:hover {
    color: #fff;
}

.blog-img-box .post-img,
.post-thumb>a,
.post-thumbnail>a {
    width: 100%;
    height: 230px;
    border-radius: 350px;
    position: relative;
    overflow: hidden;
    display: block;
}

.blog-image-box:hover img,
.post-thumb:hover img,
.post-thumbnail:hover img {
    opacity: 0.5;
    -webkit-transform: translate3d(0, 0, 0) scale(1);
    transform: translate3d(0, 0, 0) scale(1);
}

.blog-img-box .post-img img,
.post-thumb>a img,
.post-thumbnail>a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 350px;
    max-width: none;
    width: -webkit-calc(100% + 60px);
    width: 100%;
    opacity: 1;
    -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
    transition: opacity 0.35s, transform 0.35s;
    -webkit-transform: translate3d(-30px, 0, 0) scale(1.12);
    transform: translate3d(-30px, 0, 0) scale(1.12);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.blog-image-box:hover img,
.post-thumb:hover img,
.post-thumbnail:hover img {
    opacity: 0.5;
    -webkit-transform: translate3d(0, 0, 0) scale(1);
    transform: translate3d(0, 0, 0) scale(1);
}

.blog-img-box .post-img:after,
.post-thumb a:after,
.post-thumbnail>a:after {
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    right: 0;
    border-radius: 350px;
    z-index: 1;
    padding: 2px;
    background: linear-gradient(92.28deg, var(--first-theme-color) 0%, #1D1D1D 50.5%, var(--second-theme-color) 100%);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
}

.blog-image-box:hover .post-img,
.post-thumb>a,
.post-thumbnail>a {
    box-shadow: 0px 0px 5px 0px var(--second-theme-color);
}