/* ─── BLOG SECTION ─── */
#blog {
    background: var(--cream);
    padding: clamp(64px, 10vh, 120px) clamp(24px, 5vw, 80px);
    scroll-snap-align: start;
}

.blog-inner {
    max-width: 1440px;
    margin: 0 auto;
}

.blog-header {
    margin-bottom: 56px;
}

.blog-label {
    display: inline-block;
    background: var(--olive);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.blog-title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 900;
    color: var(--olive-dark);
    line-height: 1.1;
    letter-spacing: -1.5px;
}

/* Category Tabs */
.blog-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 48px;
    align-items: center;
}

.blog-tab {
    padding: 10px 24px;
    border-radius: 50px;
    border: 2px solid var(--olive);
    background: transparent;
    color: var(--olive);
    font-family: 'Museo', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.blog-tab:hover {
    background: rgba(110, 124, 44, 0.05);
}

.blog-tab.active {
    background: var(--olive);
    color: #fff;
}

/* "Весь путь" — без плашки, просто ссылка */
.blog-tab.tab-all {
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 15px;
    color: var(--olive);
    opacity: 0.7;
}

.blog-tab.tab-all:hover {
    background: transparent;
    opacity: 1;
}

.blog-tab.tab-all.active {
    background: transparent;
    color: var(--olive);
    opacity: 1;
    font-weight: 900;
    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* 🔥 Жизнь — оранжевая огненная кнопка */
.blog-tab.tab-fire {
    border-color: #e8611a;
    color: #e8611a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-tab.tab-fire .tab-icon {
    font-size: 13px;
    line-height: 1;
}

.blog-tab.tab-fire:hover {
    background: rgba(232, 97, 26, 0.06);
}

.blog-tab.tab-fire.active {
    background: #e8611a;
    color: #fff;
    box-shadow: 0 4px 16px rgba(232, 97, 26, 0.35);
}

/* ✨ Чем горжусь — золотисто-фиолетовая кнопка */
.blog-tab.tab-proud {
    border-color: #8b5cf6;
    color: #8b5cf6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(139,92,246,0.04), rgba(245,158,11,0.04));
}

.blog-tab.tab-proud .tab-icon {
    font-size: 13px;
    line-height: 1;
}

.blog-tab.tab-proud:hover {
    background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(245,158,11,0.06));
}

.blog-tab.tab-proud.active {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-color: #8b5cf6;
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

/* Post Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.post-card {
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 24px rgba(0,0,0,0.03);
    cursor: pointer;
    position: relative;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(110, 124, 44, 0.12);
}

.post-card.large {
    grid-column: span 2;
    grid-row: span 2;
}

.post-card.wide {
    grid-column: span 2;
}

.post-img-wrap {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
}

.post-fallback-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 22px;
    background:
        radial-gradient(circle at 84% 18%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 18%),
        linear-gradient(135deg, rgba(110, 124, 44, 0.18) 0%, rgba(110, 124, 44, 0.05) 56%, rgba(255,255,255,1) 100%);
}

.post-fallback-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(110, 124, 44, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 124, 44, 0.08) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.32;
}

.post-fallback-kicker,
.post-fallback-mark {
    position: relative;
    z-index: 1;
}

.post-fallback-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(110, 124, 44, 0.16);
    color: var(--olive-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.post-fallback-mark {
    position: absolute;
    right: 22px;
    bottom: 18px;
    font-size: 54px;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.08em;
    color: rgba(110, 124, 44, 0.18);
}

.large .post-img-wrap {
    aspect-ratio: 1/1;
}

.post-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover .post-img-wrap img {
    transform: scale(1.05);
}

.post-card.media-contain .post-img-wrap {
    background:
        linear-gradient(135deg, rgba(110, 124, 44, 0.16), rgba(253, 252, 248, 0.92));
}

.post-card.media-contain .post-img-wrap::before {
    content: "";
    position: absolute;
    inset: -18px;
    background-image: var(--post-preview-image);
    background-position: center;
    background-size: cover;
    filter: blur(18px);
    opacity: 0.32;
    transform: scale(1.08);
}

.post-card.media-contain .post-img-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(253, 252, 248, 0.34);
}

.post-card.media-contain .post-img-wrap img {
    position: relative;
    z-index: 1;
    object-fit: contain;
    padding: 10px;
    transform: none;
}

.post-card.media-contain:hover .post-img-wrap img {
    transform: none;
}

.post-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card.no-photo .post-content {
    background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, #fff 100%);
}

.post-meta {
    font-size: 12px;
    font-weight: 700;
    color: var(--olive);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.post-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--olive-dark);
    line-height: 1.25;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.large .post-title {
    font-size: 28px;
}

.post-desc {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-more {
    font-weight: 700;
    font-size: 13px;
    color: var(--olive);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-more::after {
    content: '→';
    transition: transform 0.2s;
}

.post-card:hover .post-more::after {
    transform: translateX(4px);
}

/* Post Modal (REBUILT FOR MAXIMUM AIR) */
.post-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(15px);
    z-index: 1000;
    display: none;
    overflow-y: auto; /* Позволяем всему оверлею скроллиться */
    padding: 100px 20px; /* Большой отступ от краев экрана */
}

.post-modal.active {
    display: block; /* Используем блок вместо флекса для надежности скролла */
}

.post-modal-content {
    background: var(--cream);
    width: fit-content;
    min-width: 320px;
    max-width: 900px;
    margin: 0 auto; /* Центрируем плашку */
    border-radius: 48px;
    position: relative;
    box-shadow: 0 50px 150px rgba(0,0,0,0.7);
}

.post-modal-close {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 100;
    width: 48px;
    height: 48px;
    background: var(--olive);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.post-modal-close:hover { 
    transform: rotate(90deg) scale(1.1);
    background: var(--olive-dark);
}

.post-modal-body {
    padding: 100px 80px 80px !important; /* ГАРАНТИРОВАННЫЙ ВОЗДУХ */
}

.post-modal-gallery {
    margin-top: 60px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.post-modal-img {
    width: 100%;
    border-radius: 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.post-modal-title {
    font-size: 38px; /* Чуть меньше, чтобы не "давило" */
    font-weight: 900;
    color: var(--olive-dark);
    margin-bottom: 32px;
    line-height: 1.15;
    letter-spacing: -1.5px;
}

.post-modal-text {
    font-size: 20px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
}

/* Reactions */
.post-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.reaction-tag {
    background: #fff;
    padding: 10px 20px;
    border-radius: 16px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Mobile Blog */
@media (max-width: 1024px) {
    #blog {
        padding: 40px 24px 88px;
    }

    .blog-header {
        margin-bottom: 36px;
    }

    .blog-tabs {
        gap: 10px;
        margin-bottom: 28px;
    }

    .blog-tab {
        padding: 9px 18px;
        font-size: 13px;
    }

    .blog-grid {
        gap: 20px;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-card.large,
    .post-card.wide {
        grid-column: span 1;
        grid-row: span 1;
    }

    .large .post-img-wrap {
        aspect-ratio: 16/10;
    }

    .post-content {
        padding: 22px;
    }

    .post-title,
    .large .post-title {
        font-size: 24px;
        line-height: 1.18;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .post-desc {
        font-size: 16px;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .post-fallback-visual {
        padding: 18px;
    }

    .post-fallback-mark {
        right: 18px;
        bottom: 14px;
        font-size: 44px;
    }
}

@media (max-width: 640px) {
    #blog {
        padding: 24px 16px 80px;
    }
    .blog-header {
        margin-bottom: 24px;
    }
    .blog-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        margin-bottom: 16px;
        padding: 0 24px 6px 0;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
    }
    .blog-tabs::-webkit-scrollbar { display: none; }
    .blog-tab {
        padding: 8px 16px;
        font-size: 13px;
        flex-shrink: 0;
        white-space: nowrap;
        scroll-snap-align: start;
    }
    .blog-tab.tab-all {
        padding: 8px 12px;
        font-size: 13px;
    }
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .post-content {
        padding: 20px 18px 18px;
    }
    .post-card.large,
    .post-card.wide {
        grid-column: span 1;
        grid-row: span 1;
    }
    .large .post-img-wrap {
        aspect-ratio: 16/10;
    }
    .large .post-title {
        font-size: 20px;
    }
    .post-fallback-visual {
        aspect-ratio: 14/9;
        padding: 16px;
    }
    .post-fallback-mark {
        right: 16px;
        bottom: 12px;
        font-size: 38px;
    }
    .post-modal {
        padding: 16px 10px 24px;
    }
    .post-modal-content {
        max-width: 100%;
        min-width: 0;
        width: 100%;
        border-radius: 28px;
    }
    .post-modal-body {
        padding: 72px 18px 32px !important;
    }
    .post-modal-gallery {
        margin-top: 28px;
        gap: 16px;
    }
    .post-modal-title {
        font-size: 24px;
    }
    .post-modal-text {
        font-size: 16px;
        line-height: 1.65;
    }
    .post-modal-close {
        top: 18px;
        right: 18px;
        width: 40px;
        height: 40px;
    }
    .load-more-container {
        margin-top: 40px;
    }
}

/* Load More */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 60px;
}

.load-more-btn {
    padding: 16px 40px;
    background: var(--olive);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: 'Museo', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(110, 124, 44, 0.2);
}

.load-more-btn:hover {
    background: var(--olive-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(110, 124, 44, 0.3);
}

.posts-counter {
    font-size: 14px;
    font-weight: 700;
    color: var(--olive);
    opacity: 0.7;
    letter-spacing: 0.5px;
}
