.news__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 20px;
}

.news-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px; /* Reduced margin */
  gap: 16px;
}

@media (max-width: 768px) {
  .news-header-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

.news-header-row .section-header h2 {
  margin-bottom: 0;
}

.news__title__container {
  display: flex;
  align-items: center;
}

.news__title {
  margin: 0;
  font-family: inherit !important;
  line-height: 1.1;
  font-weight: 500;
  font-size: 48px;
  color: var(--color-blue-200);
}

@media (max-width: 767px) {
  .news__header {
    margin-bottom: 20px;
    gap: 15px;
  }
  .news__title {
    font-size: 32px;
  }
}



.news__buttons__slider__container {
  display: flex;
  align-items: center;
  gap: 8px;
}





.news-filter-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 25px;
}

.news-categories-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  min-width: 0;
}

.news-categories-toggle {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: var(--color-text-heading);
  padding: 8px 0;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s, background-color 0.3s;
  flex-shrink: 0;
}

@media (hover: hover) {
  .news-categories-toggle:hover {
    color: var(--color-link);
  }
}

.news-categories-toggle svg {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news-categories-toggle.is-open svg {
  transform: rotate(180deg);
}

.news-categories-ribbon-wrapper {
  display: grid;
  grid-template-columns: 0fr;
  transition: grid-template-columns 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  flex: 1;
  min-width: 0;
}

.news-categories-ribbon-wrapper.is-open {
  grid-template-columns: 1fr;
}

.news-categories-ribbon-inner {
  overflow: hidden;
  min-width: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.news-categories-ribbon-wrapper.is-open .news-categories-ribbon-inner {
  opacity: 1;
  transition: opacity 0.4s ease 0.1s;
}

.news-categories-ribbon {
  display: flex;
  gap: 30px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 5px;
  cursor: grab;
  user-select: none;
}

.news-categories-ribbon:active {
  cursor: grabbing;
}

.news-categories-ribbon::-webkit-scrollbar {
  display: none;
}

.news-cat-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
  flex-shrink: 0;
  padding: 8px 0;
}

@media (hover: hover) {
  .news-cat-link:hover {
    color: var(--color-link);
  }
}

.news-cat-link._active {
  color: var(--color-text-heading);
}

.news-cat-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-blue-100);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.4s ease;
}

@media (hover: hover) {
  .news-cat-link:hover::after {
    transform: scaleX(1);
  }
}

.news-cat-link._active::after {
  transform: scaleX(1);
  background-color: var(--color-blue-200);
}

.news-filter-wrapper .news-more {
  flex-shrink: 0;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-heading);
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.news-filter-wrapper .news-more::before {
  content: '';
  display: block;
  width: 1px;
  height: 1.2em; 
  background-color: var(--color-grey-100);
  margin-right: 13px; 
}

@media (hover: hover) {
  .news-filter-wrapper .news-more:hover {
    color: var(--color-link);
  }
}

.news-filter-wrapper .news-more .news-more__label {
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

@media (hover: hover) {
  .news-filter-wrapper .news-more:hover .news-more__label {
    transform: translateX(4px);
  }
}

.news-filter-wrapper .news-more svg path {
  fill: currentColor;
}

@media (max-width: 899px) {
  .news-filter-wrapper {
    flex-wrap: nowrap;
    gap: 15px;
  }
  .news-categories-controls {
    gap: 10px;
  }
  .news-categories-toggle {
    display: none;
  }
  .news-categories-ribbon-wrapper {
    grid-template-columns: 1fr;
  }
  .news-categories-ribbon-inner {
    opacity: 1;
  }
  .news-categories-ribbon {
    width: auto;
    order: unset;
    gap: 15px;
  }
  .news-filter-wrapper .news-more {
    order: unset;
    margin-left: 0;
    padding: 8px 0;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .news-filter-wrapper .news-more::before {
    margin-right: 3px;
  }
}

.news-slider__item {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  font-family: Roboto, "Roboto Fallback", sans-serif !important;
  transition: transform 0.4s ease;
  position: relative;
}

.news-slider__img-box {
  position: relative;
  width: 100%;
  padding-top: 100%;
  height: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.news-slider__img-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.news-slider__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (hover: hover) {
  html:not(.v-mobile) .news-slider__item:hover .news-slider__img {
    transform: scale(1.02);
  }
}

.news-slider__badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  z-index: 2;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  will-change: opacity, transform;
}

@media (hover: hover) {
  html:not(.v-mobile) .news-slider__item:hover .news-slider__badge {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
  }
}

.news-slider__content {
  padding: 20px 0 10px 0;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

@media (max-width: 550px) {
  .news-slider__content {
    padding-left: var(--wrap-1);
    padding-right: var(--wrap-1);
  }
}

.news-slider__title {
  position: relative;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--color-text-primary);
  transition: color 0.3s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.4em;
  height: 2.4em;
}

.news-slider__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

@media (hover: hover) {
  html:not(.v-mobile) .news-slider__item:hover .news-slider__title a {
    color: var(--color-link);
  }
}

@media (max-width: 1199px) {
  .news-slider__title {
    font-size: 1.25rem;
  }
}

.news-slider__description {
  position: relative;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-grey-400);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  min-height: 6.4em;
  height: 6.4em;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  word-break: break-word;
  overflow-wrap: break-word;
}

.news-slider__item img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-select: none;
}

.news-slider.swiper {
  overscroll-behavior-x: none;
  overflow: hidden; /* Prevent FOUC layout shift */
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-slider .swiper-wrapper {
  will-change: transform;
  display: flex;
  align-items: stretch;
}

.news-slider .swiper-slide {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  height: auto;
  flex-shrink: 0;
}

/* Fallback widths before Swiper JS initializes */
.news-slider:not(.swiper-initialized) .swiper-slide { width: calc(100% / 1.5); margin-right: 12px; }
@media (min-width: 550px) { .news-slider:not(.swiper-initialized) .swiper-slide { width: calc(100% / 2); margin-right: 0; } }
@media (min-width: 899px) { .news-slider:not(.swiper-initialized) .swiper-slide { width: calc(100% / 3); } }
@media (min-width: 1100px) { .news-slider:not(.swiper-initialized) .swiper-slide { width: calc(100% / 4); } }
@media (min-width: 1180px) { .news-slider:not(.swiper-initialized) .swiper-slide { width: calc(100% / 5); } }


@media (max-width: 478px) {
  .news-slider__img-box {
    width: auto;
    margin-left: var(--wrap);
    margin-right: var(--wrap);
  }
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.news-slider.is-loading .news-slider__item {
  pointer-events: none;
}

.news-slider.is-loading .news-slider__img-box::after,
.news-slider.is-loading .news-slider__title::after,
.news-slider.is-loading .news-slider__description::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-grey-010) 25%, var(--color-grey-050) 50%, var(--color-grey-010) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite linear;
  z-index: 10;
}

.news-slider.is-loading .news-slider__badge {
  opacity: 0;
}

@keyframes ajaxFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-slider__item.ajax-fade-in {
  opacity: 0;
  animation: ajaxFadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  will-change: transform, opacity;
}
@media (max-width: 768px) {
  .news-slider__content {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .news-slider__badge {
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 11px;
  }
}

/* Isolated Section Padding & Spacing */
.pk-news-section {
  --wrap: 16px;
}
/* FORCE SPECIFICITY AGAINST PK SITE GLOBAL TYPOGRAPHY */
.pk-news-section .news-slider__title {
  position: relative !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  margin-bottom: 12px !important;
  font-family: "Roboto", "Roboto Fallback", sans-serif !important;
  color: #000000 !important;
  transition: color 0.3s !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-height: 2.4em !important;
  height: 2.4em !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-align: left !important;
}
@media (max-width: 1199px) {
  .pk-news-section .news-slider__title {
    font-size: 1.25rem !important;
  }
}
.pk-news-section .news-slider__title a {
  color: inherit !important;
  font-weight: 400 !important;
  text-decoration: none !important;
  transition: color 0.3s ease !important;
}
@media (hover: hover) {
  html:not(.v-mobile) .pk-news-section .news-slider__item:hover .news-slider__title a {
    color: var(--color-link) !important;
  }
}
.pk-news-section .news-slider__description {
  position: relative !important;
  font-family: "Roboto", "Roboto Fallback", sans-serif !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  color: #464646 !important;
  margin-bottom: 20px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 4 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
  min-height: 6.4em !important;
  height: 6.4em !important;
  -webkit-hyphens: auto !important;
  -ms-hyphens: auto !important;
  hyphens: auto !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-align: left !important;
}

/* FIX TEXT AND IMAGE BLURRINESS ON WINDOWS */
.pk-news-section .news-slider .swiper-wrapper {
  will-change: auto !important;
}
.pk-news-section .news-slider .swiper-slide {
  transform: none !important;
  -webkit-transform: none !important;
  backface-visibility: visible !important;
  -webkit-backface-visibility: visible !important;
}

/* Decorative Separator */
/* The section has no bottom padding: the next section's own top padding is the gap
   below the line, so it sits midway instead of far from the next block. */
.pk-news-section {
  padding-bottom: 0;
}

.news-section-separator {
  width: 100%;
  height: 1px;
  margin: 56px 0 0;
  background: linear-gradient(90deg, transparent, rgba(22, 41, 91, 0.15) 15%, rgba(22, 41, 91, 0.15) 85%, transparent);
}

@media (max-width: 768px) {
  .news-section-separator {
    margin: 28px 0 0;
  }
}

/* Slider Controls */
.news__buttons__slider__container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.news-slider-prev,
.news-slider-next {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0;
  cursor: pointer;
  background-color: transparent;
}
.news-slider-prev svg,
.news-slider-next svg {
  width: 31px;
  height: 16px;
  transition: transform 0.3s ease;
}
@media (hover: hover) {
  html:not(.v-mobile) .news-slider-prev:hover:not(.swiper-button-disabled) svg {
    transform: translateX(-4px);
  }
}
@media (hover: hover) {
  html:not(.v-mobile) .news-slider-next:hover:not(.swiper-button-disabled) svg {
    transform: translateX(4px);
  }
}
.news-slider-prev.swiper-button-disabled,
.news-slider-next.swiper-button-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Header Links */
.news-header-right {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 6px; /* Visually align with h2 cap-height */
}
.news-header-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.news-header-link {
  color: var(--color-grey-400);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
  display: flex;
  align-items: center;
  height: 44px; /* matches arrow buttons */
  transition: color 0.3s ease;
}
@media (hover: hover) {
  html:not(.v-mobile) .news-header-link:hover {
    color: var(--color-blue-200);
  }
}
@media (max-width: 768px) {
  .news-header-right {
    gap: 24px;
    width: 100%;
    justify-content: space-between;
    margin-bottom: 0;
  }
  .news-header-links {
    gap: 16px;
  }
  .news-header-link {
    font-size: 12px;
  }
}
@media (max-width: 480px) {
  .news-header-right {
    gap: 16px;
  }
  .news-header-links {
    gap: 12px;
  }
  .news-header-link {
    font-size: 11px;
  }
}

/* Final View All Card in Slider */
.news-more-card-text {
  transition: color 0.3s ease;
}
@media (hover: hover) {
  .news-more-card-link:hover .news-more-card-text {
    color: var(--color-blue-100, #265AA6);
  }
}
/* Раніше робилось inline-обробниками onmouseover/onmouseout */
.news-more-card-link:hover,
.news-more-card-link:focus-visible {
  background: #f6f6f6 !important;
}
@media (max-width: 768px) {
  .news-more-card-link {
    padding: 15px !important;
  }
  .news-more-card-text {
    font-size: 0.9rem !important;
  }
}

/* OVERRIDE MAIN SITE SLIDE PADDING */
.pk-news-section .news-slider__content { padding-left: 0 !important; padding-right: 0 !important; }
.pk-news-section .news-slider__img-box { margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; }

/* A card's type follows the card's own width, not the window's: from ~220px cards
   (phones, five on a laptop) to ~330px ones (five on a wide screen). The slide is
   the container; cqi is a hundredth of its width. */
.pk-news-section .swiper-slide {
  container-type: inline-size;
}
.pk-news-section .swiper-slide .news-slider__content {
  padding-top: clamp(12px, 6cqi, 20px);
}
.pk-news-section .swiper-slide .news-slider__title {
  font-size: clamp(15px, 6.8cqi, 22px) !important;
  margin-bottom: clamp(8px, 3.6cqi, 12px) !important;
}
.pk-news-section .swiper-slide .news-slider__description {
  font-size: clamp(12.5px, 4.6cqi, 15px) !important;
  line-height: 1.55 !important;
  margin-bottom: clamp(14px, 6cqi, 20px) !important;
  height: 6.2em !important;
  min-height: 6.2em !important;
}
.pk-news-section .swiper-slide .news-slider__badge {
  top: clamp(8px, 4.5cqi, 15px);
  left: clamp(8px, 4.5cqi, 15px);
  padding: clamp(3px, 1.8cqi, 6px) clamp(7px, 3.6cqi, 12px);
  font-size: clamp(10px, 3.8cqi, 12px);
}
/* Narrow cards keep three lines of description instead of four. */
@container (max-width: 260px) {
  .pk-news-section .swiper-slide .news-slider__description {
    -webkit-line-clamp: 3 !important;
    height: 4.65em !important;
    min-height: 4.65em !important;
  }
}

/* ---------- Dark on phones and tablets ----------
   Below 1024px the hero ends with light link tiles, so the news turn dark blue to keep
   the front page alternating light and dark blocks. On desktops the hero ends with its
   dark strip, and the news stay white. On the coloured block the bottom line is not
   needed: the block's own edge ends it, with the same padding below as above. */
@media (max-width: 1024px) {
  .pk-news-section {
    padding-bottom: clamp(1rem, 1rem + 2vw, 6rem);
    background-color: var(--color-blue-200);
    color: var(--color-white);
  }

  .pk-news-section .news-section-separator {
    display: none;
  }

  /* the same faint university arms as on the other dark blocks (front-page/global.css) */
  .pk-news-section {
    position: relative;
    isolation: isolate;
  }

  .pk-news-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("../../img/bg/gerb-watermark.webp") center / min(80%, 800px) no-repeat;
    opacity: 0.05;
    pointer-events: none;
  }

  .pk-news-section .section-header h2,
  .pk-news-section .news-slider__title {
    color: var(--color-white) !important;
  }

  .pk-news-section .news-slider__description {
    color: rgba(255, 255, 255, 0.72) !important;
  }

  .pk-news-section .news-header-link {
    color: rgba(255, 255, 255, 0.7);
  }

  .pk-news-section .news-slider-prev,
  .pk-news-section .news-slider-next {
    color: var(--color-white);
  }

  /* The Telegram channel card is dark blue itself: a thin light frame keeps it apart. */
  .pk-news-section .tg-promo {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  }
}

@media (max-width: 1024px) and (hover: hover) {
  html:not(.v-mobile) .pk-news-section .news-slider__item:hover .news-slider__title a {
    color: var(--color-highlight) !important;
  }

  html:not(.v-mobile) .pk-news-section .news-header-link:hover {
    color: var(--color-white);
  }
}

/* Press feedback for the slider arrows: on phones there is no hover to answer. */
.news-slider-prev:active:not(.swiper-button-disabled) svg,
.news-slider-next:active:not(.swiper-button-disabled) svg {
  transform: scale(0.9);
  transition-duration: 80ms;
}
