/* ============================================================
   Новости (листинг) — изолированные стили
   Префикс: nws- (всё под .nws-root)
   Токены, ресет и шрифт заданы на .nws-root (НЕ глобально),
   поэтому страница безопасно встраивается рядом с прод-шапкой/
   футером, у которых другие шрифты — взаимного перекрытия нет.
   Контейнер max-width 1327px − 2×15px = контент 1297px.
   ============================================================ */

/* UA-дефолт body (8px) — гасим только маржин; в прод уже задано боевым CSS. */
body { margin: 0; }

.nws-root {
  --nws-accent: #FE5D26;
  --nws-accent-hover: #D95427;
  --nws-black: #312D2B;
  --nws-text: #272F3D;
  --nws-bg: #F6F6F6;
  --nws-white: #FFFFFF;
  --nws-border: rgba(49, 45, 43, 0.1);
  --nws-card-shadow: 0 1px 4px 0 rgba(49, 45, 43, 0.08);
  --nws-transition: .25s ease;
  --nws-radius-md: 12px;
  --nws-radius-lg: 24px;

  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--nws-text);
  background-color: var(--nws-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.nws-root *,
.nws-root *::before,
.nws-root *::after {
  box-sizing: border-box;
}

.nws-root :where(h1, h2, h3, p) { margin: 0; }

.nws-root a {
  text-decoration: none;
  color: inherit;
}

.nws-root img {
  max-width: 100%;
  height: auto;
  display: block;
}

.nws-root button {
  font-family: inherit;
}

/* --- Контейнер --- */
.nws-container {
  max-width: 1327px; /* как .container шапки → контент 1297px (1327 − 2×15) */
  margin: 0 auto;
  padding: 24px 15px 0; /* верхний «воздух» крошкам после клиренса фикс-шапки (<main> margin-top:91px) */
}

/* --- Heading --- */
.nws-heading {
  padding: 24px 0 28px;
}

.nws-heading-title {
  font-size: 32px;
  font-weight: 500;
  line-height: 40px;
  color: var(--nws-black);
}

/* --- Filters --- */
.nws-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nws-filter-btn {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--nws-border);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--nws-text);
  cursor: pointer;
  transition: all var(--nws-transition);
  white-space: nowrap;
}

.nws-filter-btn:hover {
  border-color: var(--nws-accent);
  color: var(--nws-accent);
}

.nws-filter-btn--active {
  background: var(--nws-accent);
  border-color: var(--nws-accent);
  color: var(--nws-white);
}

.nws-filter-btn--active:hover {
  background: var(--nws-accent-hover);
  border-color: var(--nws-accent-hover);
  color: var(--nws-white);
}

/* --- Hot dates promo --- */
.nws-dates {
  padding: 0 0 32px;
}

.nws-dates-inner {
  background: var(--nws-white);
  border-radius: var(--nws-radius-lg);
  padding: 24px 28px;
  box-shadow: var(--nws-card-shadow);
}

.nws-dates-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.nws-dates-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  color: var(--nws-black);
}

.nws-dates-subtitle {
  font-size: 14px;
  color: var(--nws-text);
  opacity: 0.5;
}

.nws-dates-track {
  display: flex;
  gap: 12px;
}

.nws-date-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--nws-bg);
  border-radius: 16px;
  transition: transform var(--nws-transition), background var(--nws-transition);
}

.nws-date-card:hover {
  transform: translateY(-2px);
  background: rgba(254, 93, 38, 0.06);
}

.nws-date-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: var(--nws-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nws-date-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.nws-date-img {
  flex-shrink: 0;
  width: 80px;
  border-radius: 14px;
  overflow: hidden;
}

.nws-date-img img {
  width: 100%;
  height: auto;
  display: block;
}

.nws-date-link {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--nws-accent);
  transition: color var(--nws-transition);
}

.nws-date-card:hover .nws-date-link {
  color: var(--nws-accent-hover);
}

/* --- Listing grid --- */
.nws-listing {
  padding-bottom: 16px;
}

.nws-listing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.nws-listing-title {
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  color: var(--nws-black);
}

.nws-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Скрытая карточка при фильтрации */
.nws-card[hidden] {
  display: none;
}

/* --- Card --- */
.nws-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--nws-radius-lg);
  background: var(--nws-white);
  box-shadow: var(--nws-card-shadow);
  overflow: hidden;
  transition: transform var(--nws-transition), box-shadow var(--nws-transition);
}

.nws-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(49, 45, 43, 0.1);
}

.nws-card-img {
  position: relative;
  padding: 8px;
  overflow: hidden;
}

.nws-card-img img {
  width: 100%;
  aspect-ratio: 404 / 303;
  object-fit: cover;
  border-radius: 16px;
}

/* Tag badges */
.nws-card-tag {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--nws-white);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--nws-black);
  z-index: 1;
}

.nws-tag--events { background: var(--nws-accent); color: var(--nws-white); }
.nws-tag--holidays { background: #4454EB; color: var(--nws-white); }
.nws-tag--new { background: #16A34A; color: var(--nws-white); }
.nws-tag--equipment { background: #0891B2; color: var(--nws-white); }
.nws-tag--tips { background: #D97706; color: var(--nws-white); }
.nws-tag--interesting { background: #9333EA; color: var(--nws-white); }

/* Card meta */
.nws-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 16px;
  color: var(--nws-text);
  opacity: 0.5;
}

.nws-card-views::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M1.333 8s2.667-4.667 6.667-4.667S14.667 8 14.667 8s-2.667 4.667-6.667 4.667S1.333 8 1.333 8z' stroke='currentColor' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='8' cy='8' r='2' stroke='currentColor' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M1.333 8s2.667-4.667 6.667-4.667S14.667 8 14.667 8s-2.667 4.667-6.667 4.667S1.333 8 1.333 8z' stroke='currentColor' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='8' cy='8' r='2' stroke='currentColor' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.nws-card-read::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='6.667' stroke='currentColor' stroke-width='1.2'/%3E%3Cpath d='M8 4.667V8l2.333 1.333' stroke='currentColor' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='6.667' stroke='currentColor' stroke-width='1.2'/%3E%3Cpath d='M8 4.667V8l2.333 1.333' stroke='currentColor' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Hover icon */
.nws-card-hover {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nws-white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 1;
}

.nws-card:hover .nws-card-hover {
  top: 20px;
  right: 20px;
  opacity: 1;
}

/* Card content */
.nws-card-content {
  padding: 8px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.nws-card-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--nws-black);
  margin-bottom: 8px;
}

.nws-card-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--nws-black);
  opacity: 0.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Навигация листинга: «Показать ещё» + пагинация (порт шаблона 121) === */
.nws-navigation-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 0;
  padding-bottom: 64px; /* padding, не margin — иначе отступ «вытекает» из серого фона */
}

/* .nws-root перед классом — перебить сброс `.nws-root a { color: inherit }` */
.nws-root .nws-show-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--nws-white);
  box-shadow: var(--nws-card-shadow);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--nws-text);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nws-root .nws-show-more:hover {
  background-color: var(--nws-accent);
  color: var(--nws-white);
}

.nws-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.nws-root .nws-pagination-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--nws-white);
  box-shadow: var(--nws-card-shadow);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--nws-text);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nws-root .nws-pagination-link:hover {
  background-color: var(--nws-accent);
  color: var(--nws-white);
}

.nws-root .nws-pagination-link--active {
  background-color: var(--nws-accent);
  color: var(--nws-white);
  pointer-events: none;
}

.nws-pagination-arrow svg {
  display: block;
}

/* ========== Responsive ========== */
@media screen and (max-width: 991px) {
  .nws-dates-track {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }
  .nws-date-card {
    flex: 0 0 calc(33.333% - 8px);
    scroll-snap-align: start;
  }
  .nws-date-bottom { gap: 8px; }
  .nws-grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 768px) {
  .nws-heading { padding: 16px 0 20px; }
  .nws-heading-title { font-size: 24px; line-height: 32px; }
  .nws-dates-header { flex-direction: column; gap: 2px; }
  .nws-date-card { flex: 0 0 calc(50% - 6px); }
  .nws-date-img { width: 60px; border-radius: 12px; }
  .nws-dates-inner { padding: 20px; }
  .nws-grid { grid-template-columns: 1fr; gap: 12px; }
  .nws-listing { padding-bottom: 8px; }
  .nws-filter-btn { padding: 6px 14px; font-size: 13px; }

  .nws-navigation-block {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: 40px;
  }
  .nws-pagination { margin-left: 0; justify-content: center; }
}

@media screen and (max-width: 480px) {
  .nws-heading-title { font-size: 24px; line-height: 32px; }
  .nws-dates { padding: 0 0 24px; }
  .nws-dates-header { flex-direction: column; gap: 2px; }
  .nws-dates-title { font-size: 18px; line-height: 24px; }
  .nws-dates-track { gap: 10px; }
  .nws-date-card {
    flex: 0 0 calc(70% - 5px);
    padding: 12px 14px;
    gap: 2px;
    border-radius: 16px;
  }
  .nws-date-img { width: 50px; border-radius: 10px; }
  .nws-dates-inner { padding: 16px; border-radius: 20px; }
  .nws-date-name { font-size: 13px; }
  .nws-date-bottom { gap: 8px; margin-top: 8px; }
  .nws-card-content { padding: 8px 16px 20px; }
}
