/* ============================================================
   БЛОК "ПОКАЗАТЬ ЕЩЁ" — ОБЁРТКА НОВОСТЕЙ
   ============================================================ */

/* --- Базовые стили обёртки --- */
.custom-news-wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: clamp(10px, 1.875vw, 15px);
    width: 100%;
}

/* ============================================================
   СЕТКА КАРТОЧЕК (.shortstory)
   ============================================================ */

/* --- 4 колонки (по умолчанию, десктоп) --- */
@media (min-width: 992px) {
    .custom-news-wrapper .shortstory {
        width: calc((100% - clamp(30px, 5.625vw, 45px)) / 4) !important;
    }
}

/* --- 3 колонки (модификатор .three-in-row, десктоп) --- */
@media (min-width: 992px) {
    .custom-news-wrapper.three-in-row .shortstory {
        width: calc((100% - 2 * clamp(10px, 1.875vw, 15px)) / 3) !important;
    }
}

/* --- 2 колонки (планшет, 720px – 991px) --- */
@media (max-width: 991.98px) and (min-width: 720px) {
    .custom-news-wrapper .shortstory {
        width: calc((100% - clamp(20px, 3.75vw, 30px)) / 2) !important;
    }
    .custom-news-wrapper.three-in-row .shortstory {
        width: calc((100% - clamp(10px, 1.875vw, 15px)) / 2) !important;
    }
}

/* --- 1 колонка (мобильный, до 720px) --- */
@media (max-width: 719.98px) {
    .custom-news-wrapper .shortstory,
    .custom-news-wrapper.three-in-row .shortstory {
        width: calc(100% - clamp(10px, 1.875vw, 15px)) !important;
    }
}

/* ============================================================
   СКРЫТИЕ / ПОКАЗ НОВОСТЕЙ
   ============================================================ */

/* --- Блок с 8 видимыми новостями (по умолчанию) --- */
.custom-news-wrapper .shortstory:nth-child(n+9) {
    display: none !important;
}
.custom-news-wrapper.is-expanded .shortstory:nth-child(n+9) {
    display: flex !important;
}

/* --- Блок с 6 видимыми новостями (.visible-6) --- */
.custom-news-wrapper.visible-6 .shortstory:nth-child(n+7) {
    display: none !important;
}
.custom-news-wrapper.visible-6.is-expanded .shortstory:nth-child(n+7) {
    display: flex !important;
}

/* --- Блок с 6 видимыми + 3 колонки (.visible-6.three-in-row) --- */
.custom-news-wrapper.visible-6.three-in-row .shortstory:nth-child(n+7) {
    display: none !important;
}
.custom-news-wrapper.visible-6.three-in-row.is-expanded .shortstory:nth-child(n+7) {
    display: flex !important;
}

/* ============================================================
   КНОПКА "ПОКАЗАТЬ ЕЩЁ"
   ============================================================ */

.show-more-container {
    width: 100%;
    text-align: center;
    margin-top: 20px;
    padding: 10px 0;
}

.show-more-container.auto-hidden {
    display: none;
}

.show-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    min-width: 220px;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.show-more-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

.show-more-btn:active {
    transform: scale(0.98);
}

/* --- Иконка-стрелка --- */
.show-more-btn .arrow-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.show-more-btn .arrow-icon svg {
    width: 100%;
    height: 100%;
    stroke: #64748b;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Поворот стрелки при раскрытии --- */
.show-more-btn.is-expanded .arrow-icon {
    transform: rotate(180deg);
}