/* ——— Новости: слайдер карточек ———
   Стрелки сбоку от заголовка с описанием, на телефоне — под слайдером */
.news__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "head   nav"
    "slider slider";
  align-items: end;
  column-gap: 40px;
}

.news__inner .section-head {
  grid-area: head;
}

.news__nav {
  grid-area: nav;
  display: flex;
  gap: 12px;
}

.news__slider {
  grid-area: slider;
  width: 100%;
  margin-top: 40px;
}

/* Слайды одной высоты — карточка тянется на всю */
.news__slider .swiper-slide {
  height: auto;
}


/* ——— Стрелки — в стиле крестика модалки ——— */
.news__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid color-mix(in srgb, var(--text-heading) 25%, transparent);
  border-radius: 10px;
  color: var(--text-heading);
  cursor: pointer;
  transition: background-color 180ms ease-out, transform 100ms ease-out;
}

.news__arrow svg {
  width: 24px;
  height: 24px;
}

.news__arrow--prev svg {
  transform: rotate(180deg);
}

@media (hover: hover) {
  .news__arrow:not(.is-disabled):hover {
    background: var(--bg-card);
  }
}

.news__arrow:not(.is-disabled):active {
  transform: scale(.98);
}

.news__arrow:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 4px;
}

/* Крайний слайд — стрелка в эту сторону недоступна (класс ставит Swiper) */
.news__arrow.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Все новости помещаются — стрелки не нужны (Swiper ставит класс при watchOverflow) */
.news__arrow.swiper-button-lock {
  display: none;
}


/* ——— Карточка новости (template-parts/news-card.php) ——— */
.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

/* Фокус ссылки «Перейти» — кольцо по краю всей карточки (внутрь: снаружи его обрезал бы overflow слайдера) */
.news-card:has(.news-card__link:focus-visible) {
  outline: 2px solid var(--accent-green);
  outline-offset: -2px;
}

.news-card__media {
  aspect-ratio: 384 / 240;
    width: 100%;
    height: 240px;
  background: var(--bg-muted);
}

.news-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}

.news-card__date {
  color: var(--text-tip);
}

.news-card__title {
  margin-top: 12px;
  color: var(--text-heading);
}

.news-card__text {
  margin-top: 12px;
  color: var(--text-desc);
 display: -webkit-box;
  -webkit-line-clamp: 3; /* Количество строк */
  -webkit-box-orient: vertical;  
  overflow: hidden;
}

/* Ссылка прижата к низу карточки и растянута на всю карточку — кликается вся */
.news-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
  font-weight: 600;
  color: var(--accent-green);
  outline: none;
}

.news-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.news-card__link svg {
  width: 20px;
  height: 20px;
  transition: transform 180ms ease-out;
}

@media (hover: hover) {
  .news-card:hover .news-card__link svg {
    transform: translateX(4px);
  }

  .news-card:hover .news-card__title {
    color: var(--accent-green);
  }
}

.news-card__title {
  transition: color 180ms ease-out;
}


@media (max-width: 768px) {
  .news__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "slider"
      "nav";
  }

  .news__slider {
    margin-top: 24px;
  }

  .news__nav {
    margin-top: 20px;
  }

  .news__arrow {
    width: 44px;
    height: 44px;
  }

  .news-card__body {
    padding: 20px;
  }
}
