/* ================================================================
   pdz/encyclopediya/encyclopediya.css
   Страница-хаб «Энциклопедия дебиторской задолженности»
   База: css/style.css + css/hub.css + pdz/pdz.css
   ================================================================ */


/* ================================================================
   HERO — шапка раздела
   ================================================================ */
.enc-hub-hero {
  background: var(--bg-dark);
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}

.enc-hub-hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198,40,41,.15) 0%, transparent 65%);
  pointer-events: none;
}

.enc-hub-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.3);
  margin-bottom: 32px;
}
.enc-hub-breadcrumb a {
  color: rgba(255,255,255,.4);
  text-decoration: none;
  transition: color .2s;
}
.enc-hub-breadcrumb a:hover { color: rgba(255,255,255,.8); }

.enc-hub-hero__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.enc-hub-hero__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.enc-hub-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--red);
}
.enc-hub-hero__eyebrow-line {
  width: 24px; height: 2px;
  background: var(--red);
  flex-shrink: 0;
}

.enc-hub-hero__h1 {
  font-family: 'PT Serif', Georgia, serif;
  font-size: clamp(28px, 3.5vw, 46px);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin: 0;
}

.enc-hub-hero__sub {
  font-size: 15px;
  color: rgba(255,255,255,.5);
  line-height: 1.7;
  margin: 0;
  max-width: 560px;
}

.enc-hub-hero__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.enc-hub-hero__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.4);
}
.enc-hub-hero__meta-item i { color: rgba(255,255,255,.25); font-size: 12px; }

/* Числа справа */
.enc-hub-hero__nums {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 160px;
}
.enc-hub-hero__num {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  gap: 3px;
  text-align: center;
}
.enc-hub-hero__num:last-child { border-bottom: none; }
.enc-hub-hero__num-val {
  font-family: 'PT Serif', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}
.enc-hub-hero__num-val sup { font-size: 14px; }
.enc-hub-hero__num-label {
  font-size: 11px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .enc-hub-hero__inner { grid-template-columns: 1fr; gap: 28px; }
  .enc-hub-hero__nums {
    flex-direction: row;
    min-width: unset;
  }
  .enc-hub-hero__num {
    flex: 1;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,.08);
    padding: 14px 12px;
  }
  .enc-hub-hero__num:last-child { border-right: none; }
}


/* ================================================================
   ФИЛЬТРЫ
   ================================================================ */
.enc-hub-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.enc-hub-filter {
  padding: 7px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.enc-hub-filter:hover {
  border-color: rgba(198,40,41,.35);
  color: var(--dark);
}
.enc-hub-filter--active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}


/* ================================================================
   СЕТКА СТАТЕЙ
   ================================================================ */

/*
  Раскладка:
  — первая карточка (featured) занимает всю первую строку (span 3)
  — остальные 9 — по 3 в ряд
*/
.enc-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Featured-карточка ── */
.enc-article--featured {
  grid-column: 1 / -1; /* на всю ширину */
}

.enc-article--featured .enc-article__link {
  display: block;
  text-decoration: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.enc-article--featured .enc-article__cover {
  aspect-ratio: 21/8;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.enc-article--featured .enc-article__cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.9) 0%,
    rgba(0,0,0,.5) 40%,
    rgba(0,0,0,.1) 100%
  );
  transition: opacity .3s;
}
.enc-article--featured:hover .enc-article__cover-overlay {
  opacity: .85;
}

.enc-article--featured .enc-article__cover-content {
  position: relative;
  z-index: 1;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 680px;
}

.enc-article__tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 100px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  width: fit-content;
}

.enc-article--featured .enc-article__title {
  font-family: 'PT Serif', Georgia, serif;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.25;
}

.enc-article--featured .enc-article__excerpt {
  font-size: 14px;
  color: rgba(255,255,255,.65);
  line-height: 1.65;
  margin: 0;
}

.enc-article--featured .enc-article__footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.enc-article__read {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255,255,255,.4);
}
.enc-article__read i { font-size: 11px; }

.enc-article__cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  transition: gap .2s;
}
.enc-article--featured:hover .enc-article__cta {
  text-decoration: underline;
}

/* ── Обычная карточка ── */
.enc-article {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.enc-article:not(.enc-article--featured):hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  transform: translateY(-3px);
  border-color: rgba(198,40,41,.2);
}

.enc-article:not(.enc-article--featured) .enc-article__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  height: 100%;
}

/* Обложка обычной карточки */
.enc-article:not(.enc-article--featured) .enc-article__cover {
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.enc-article:not(.enc-article--featured) .enc-article__cover-overlay {
  display: none; /* не нужен для маленьких */
}

.enc-article__tag--top {
  position: absolute;
  top: 12px;
  left: 12px;
}

/* Масштаб обложки при наведении */
.enc-article:not(.enc-article--featured) .enc-article__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.3) 0%, transparent 60%);
}
.enc-article:not(.enc-article--featured):hover .enc-article__cover {
  background-size: 105%;
}

/* Тело карточки */
.enc-article__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.enc-article__title-sm {
  font-family: 'PT Serif', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  line-height: 1.35;
}

.enc-article__excerpt-sm {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.enc-article__footer-sm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.enc-article__cta-sm {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
}

/* Скрытые при фильтрации */
.enc-article--hidden {
  display: none;
}

@media (max-width: 900px) {
  .enc-hub-grid { grid-template-columns: repeat(2, 1fr); }
  .enc-article--featured .enc-article__cover { aspect-ratio: 16/7; }
  .enc-article--featured .enc-article__cover-content { padding: 24px 28px; }
}

@media (max-width: 580px) {
  .enc-hub-grid { grid-template-columns: 1fr; }
  .enc-article--featured .enc-article__cover { aspect-ratio: 4/3; }
  .enc-article--featured .enc-article__cover-content { padding: 20px; }
  .enc-hub-filters { gap: 6px; }
  .enc-hub-filter { padding: 6px 14px; font-size: 12px; }
}


/* ================================================================
   БЛОК ВНИЗУ — ссылка назад
   ================================================================ */
.enc-hub-back {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.enc-hub-back__text {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  max-width: 460px;
}

.enc-hub-back__btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .enc-hub-back { flex-direction: column; align-items: flex-start; }
}
