/* ================================
   BASE
================================ */

.blog-section {
    padding: 32px 0;
}

.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 640px) {
    .site-container {
        padding: 0 16px;
    }
}

/* ================================
   MASONRY GRID (CSS columns)
================================ */

.blog-grid {
    column-gap: 24px;
    width: 100%;
}

/* 1 колонка — мобила */
@media (max-width: 639px) {
    .blog-grid {
        column-count: 1;
    }
}

/* 2 колонки — планшет */
@media (min-width: 640px) and (max-width: 1023px) {
    .blog-grid {
        column-count: 2;
    }
}

/* 3 колонки — десктоп */
@media (min-width: 1024px) {
    .blog-grid {
        column-count: 3;
    }
}

/* ================================
   POST CARD
================================ */

.post-card {
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    display: inline-block;
    width: 100%;
    min-width: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

/* ================================
   IMAGE
================================ */

.post-thumb {
    width: 100%;
    overflow: hidden;
}

.post-thumb img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ================================
   CONTENT
================================ */

.post-content {
    padding: 16px;
    min-width: 0;
}

/* Заголовок */
.post-title {
    font-size: 1.125rem;
    line-height: 1.3;
    margin: 8px 0 10px;
    color: #111;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left; /* Выровняем заголовок по левому краю */
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    text-decoration: underline;
}

/* Gutenberg текст */
.post-content p,
.post-content li,
.post-content blockquote,
.post-content span,
.wp-block-paragraph,
.wp-block-heading,
.wp-block-list {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin: 0 0 10px;

    /* КЛЮЧЕВОЕ */
    word-break: normal;          /* не ломаем слова */
    overflow-wrap: break-word;   /* перенос только если совсем некуда */
    hyphens: auto;               /* слоги при необходимости */
    white-space: normal;
}

/* ================================
   RATING STARS
================================ */

.star {
    font-size: 1rem;
    color: #ddd;
    line-height: 1;
    display: inline-block;
}

.star.is-filled {
    color: #f5b301; /* золотой */
}

/* ================================
   FOOTER
================================ */

.post-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #777;
    min-width: 0;
}

.post-footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-footer-left img.post-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

.post-date {
    white-space: normal;
}

.post-footer-right a.read-more-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.post-footer-right a.read-more-link:hover {
    text-decoration: underline;
}

/* ================================
   SAFETY (ANTI-OVERFLOW)
================================ */

.post-card *,
.post-card *::before,
.post-card *::after {
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}