/* =========================
   Last Publications (component)
   ========================= */
.last-publications {
    padding-top: 72px;
    padding-bottom: 72px;
    gap: 24px;
}

.last-publications__header {
    justify-content: space-between;
}

.last-publications__header__button img,
.last-publications__footer__button img {
    width: 16px;
    height: 16px;
}

.last-publications__content { gap: 16px; }
.blog-hash-filter-tabs { gap: 12px; }

.last-publications__content__tabs {
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--container-left-right-paddings);
}

.last-publications__content__tabs::-webkit-scrollbar {
    display: none;
}

.last-publications__content__tab {
    flex-shrink: 0;
    padding: 15px;
    min-width: 109px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 0;
    border-radius: 999px;
    background: #F3F3F3;
    color: #8A8A8A;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    font-family: var(--font-onest);
    transition: all 0.4s;
    cursor: pointer;
    scroll-snap-align: start;
}

.last-publications__content__tab:hover,
.last-publications__content__tab.active {
    background: var(--black);
    color: var(--bg);
}

.blog-empty {
    text-align: center;
    padding: 40px 24px;
    background: #f3f4f6;
    border-radius: 12px;
    color: #6b7280;
    font-size: 16px;
    font-family: var(--font-onest), system-ui, -apple-system, sans-serif;
    margin: 20px 0;
}

.blog-empty p {
    margin: 0;
}

.blog-hash-filter-tabs {
    gap: 12px;
}

.last-publications__content__mobile { display: none; }

/* ---------- SLIDER MODE ---------- */
.last-publications--slider .last-publications__cards-block {
    position: relative;
    height: auto;
    transition: height .25s ease;
}

.last-publications--slider .last-publications__cards.cards-swiper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: max-content;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all .7s ease;
}

.last-publications--slider .last-publications__cards.cards-swiper.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.last-publications--slider .last-publications__cards .cards-swiper__wrapper::after,
.last-publications--slider .last-publications__cards .cards-swiper__wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    width: 226px;
    height: 100%;
    transition: all 0.4s;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(-90deg, #FFFFFF 26.45%, rgba(255,255,255,0) 100%);
}

.last-publications--slider .last-publications__cards .cards-swiper__wrapper::before {
    right: auto;
    left: -1px;
    background: linear-gradient(90deg, #FFFFFF 26.45%, rgba(255,255,255,0) 100%);
}

.last-publications--slider .last-publications__cards.cards-swiper.is-end .cards-swiper__wrapper::after,
.last-publications--slider .last-publications__cards.cards-swiper.is-beginning .cards-swiper__wrapper::before {
    visibility: hidden;
    opacity: 0;
}

.last-publications--slider .last-publications__cards.cards-swiper.not-shadow .cards-swiper__wrapper::after,
.last-publications--slider .last-publications__cards.cards-swiper.not-shadow .cards-swiper__wrapper::before {
    display: none;
}

/* ---------- GRID MODE ---------- */
.last-publications--grid .last-publications__grid-block,
.last-publications--author .last-publications__grid-block { 
    position: relative;
    opacity: 1;
    transition: opacity .4s ease;
}

.last-publications--grid .last-publications__grid-block.disabled,
.last-publications--author .last-publications__grid-block.disabled { 
    opacity: 0.4;
    pointer-events: none;
}

.last-publications--grid .last-publications__grid,
.last-publications--author .last-publications__grid {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.last-publications--grid .last-publications__grid.active,
.last-publications--author .last-publications__grid.active { display: grid; }

.last-publications--grid .last-publications__grid.last-publications__grid--mobile,
.last-publications--author .last-publications__grid.last-publications__grid--mobile { display: none; }

.last-publications--author .title-section { font-size: 28px; }

@media (max-width: 1024px) {
    .last-publications--grid .last-publications__grid,
    .last-publications--author .last-publications__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .last-publications--grid .last-publications__grid,
    .last-publications--author .last-publications__grid {
        grid-template-columns: 1fr;
    }

    .last-publications--grid .last-publications__grid:not(.last-publications__grid--mobile),
    .last-publications--author .last-publications__grid:not(.last-publications__grid--mobile) {
        display: none !important;
    }

    .last-publications--grid .last-publications__grid.last-publications__grid--mobile,
    .last-publications--author .last-publications__grid.last-publications__grid--mobile { display: grid; }
}

/* ---------- RESPONSIVE COMMON ---------- */

@media (max-width: 768px) {
    .last-publications {
        padding-top: 32px;
        padding-bottom: 32px;
        gap: 8px;
    }

    .last-publications__header__button { display: none; }
    .last-publications__header { justify-content: center; }
    .last-publications__title { text-align: center; }

    .last-publications__content {
        gap: 18px;
        padding-bottom: 10px;
    }

    .last-publications__content__tabs { gap: 8px; width: calc(100vw); padding: 0 16px; margin-left: -16px; }
    .last-publications__content__tab { padding: 10px; min-width: 83px; }
    .last-publications__content__mobile { display: flex; }
    .last-publications__footer__button { width: 100%; }

    .last-publications--slider .last-publications__cards .cards-swiper__wrapper::after,
    .last-publications--slider .last-publications__cards .cards-swiper__wrapper::before {
        display: none;
    }
}
