/* Posts Slider Block Styles */

.posts-slider-block {
    width: 100%;
    background: #FFFFFF;
    padding: 36px;
    border-radius: 25px;
    overflow: visible;
    position: relative;
    margin-top: 24px;
    margin-bottom: 24px;
}

/* Hide on mobile if needed */
.posts-slider-block--hide-mobile {
    display: block;
}

.posts-slider-container {
    max-width: 100%;
    position: relative;
}

/* Title */
.posts-slider-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 36px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #34363D;
    margin-bottom: 20px;
}

/* Navigation Buttons */
.posts-slider-navigation {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.posts-nav-btn {
    width: 40px;
    height: 40px;
    background: #EFF8EE;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.posts-nav-btn svg {
    width: 20px;
    height: 20px;
    color: #34363D;
    transition: color 0.3s ease;
}

.posts-nav-btn:hover {
    background: #5db24c;
}

.posts-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Posts Grid */
.posts-slider-grid {
    display: flex;
    transition: transform 0.3s ease-in-out;
    gap: 16px;
}

/* Post Card */
.post-slider-card {
    background: #FFFFFF;
    border-radius: 25px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Badge */
.post-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 11px 16px;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    z-index: 2;
    line-height: 135%;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Badge Icons */
.post-badge::before {
    content: '';
    width: 12px;
    height: 12px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.post-badge.new {
    background: #FFFFFF;
    color: #34363D;
}

.post-badge.new::before {
    content: '⚡';
    font-size: 16px;
    width: auto;
    height: auto;
}

.post-badge.popular {
    background: #FFFFFF;
    color: #34363D;
}

.post-badge.popular::before {
    content: '🔥';
    font-size: 16px;
    width: auto;
    height: auto;
}

.post-badge.top {
    background: #FFFFFF;
    color: #34363D;
}

.post-badge.top::before {
    content: '👑';
    font-size: 12px;
    width: auto;
    height: auto;
}

/* Image */
.post-slider-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    border-radius: 25px 25px 0 0;
}

.post-slider-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.post-slider-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Content */
.post-slider-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    background-color: #F8F8F8;
}

.post-slider-date {
    font-size: 12px;
    line-height: 140%;
    color: #9CA3AF;
    display: block;
    margin-bottom: 4px;
}

.post-slider-title-text {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 20px !important;
    line-height: 135% !important;
    letter-spacing: 1% !important;
    color: #34363D !important;
    margin: 0 0 8px 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Переопределяем стили для ссылки внутри заголовка */
.posts-slider-block .post-slider-card .post-slider-title-text a,
.posts-slider-block .post-slider-content h3 a {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 20px !important;
    line-height: 135% !important;
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.posts-slider-block .post-slider-card .post-slider-title-text a:hover,
.posts-slider-block .post-slider-content h3 a:hover {
    color: #000000 !important;
}

.post-slider-excerpt {
    font-family: 'Inter', sans-serif !important;
    font-weight: 400 !important;
    font-size: 16px !important;
    line-height: 135% !important;
    letter-spacing: 1% !important;
    color: #676770 !important;
    margin-bottom: 24px;
}

.post-slider-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Inter', sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 140% !important;
    color: #34363D !important;
    text-decoration: none;
    transition: gap 0.2s ease;
    margin-top: auto;
}

.post-slider-link:after {
    content: '→';
    font-size: 16px;
}

.post-slider-link:hover {
    gap: 8px;
}

/* Grid container for overflow */
.posts-slider-block .posts-slider-container {
    overflow: hidden;
    margin-top: 0;
}

/* Desktop: 3 posts visible */
@media (max-width: 1400px) {
    .posts-slider-block {
        padding: 16px;
    }
}

@media (min-width: 769px) {
    /* Основной контейнер - показываем только 3 поста */
    .posts-slider-block .posts-slider-container {
        width: 100%;
    }
    
    /* Grid: каждый пост = 33.333% от видимой области */
    .post-slider-card {
        flex: 0 0 calc((100% - 32px) / 3);
        max-width: calc((100% - 32px) / 3);
    }
}

/* Mobile: 1 post visible */
@media (max-width: 768px) {
    .post-slider-card {
        flex: 0 0 calc(100% - 16px);
        max-width: calc(100% - 16px);
    }
    
    /* Оставляем навигацию справа сверху на мобильных */
    .posts-slider-navigation {
        top: 26px;
        right: 0;
    }
    .posts-slider-title {
        font-size: 28px;
        margin-top: 0 !important;
        margin-bottom: 14px !important;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .posts-slider-block {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .posts-slider-block {
        padding: 20px;
    }
    
    .post-slider-image {
        height: 180px;
    }
    
    .post-slider-content {
        padding: 16px;
    }
    
    .posts-nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .posts-nav-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 640px) {
    .post-slider-image {
        height: 160px;
    }
    
    .posts-nav-btn {
        width: 32px;
        height: 32px;
    }
    
    .posts-nav-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .posts-slider-title {
        font-size: 22px;
        margin-top: 0 !important;
        margin-bottom: 42px !important;
    }
}
