/* Раздел /articles/: фильтр по темам, сетка карточек, список статей */

/* Шире стандартной колонки статьи — под две карточки в ряд */
.article-content--wide {
  max-width: 1040px;
}

.article-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.article-filter {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.article-filter:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.article-filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.article-filter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.article-list-item {
  margin: 0;
}

.article-list-item[hidden] {
  display: none;
}

.article-list-link {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.article-list-link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.article-list-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  background: #0f172a;
  display: block;
}

/* Обложка под тему: тёмная для тёмной темы, светлая для светлой */
.article-list-thumb-swap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
}

.article-list-thumb-swap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-list-thumb-swap .thumb-light {
  display: none;
}

[data-theme="light"] .article-list-thumb-swap {
  background: #eef3fa;
}

[data-theme="light"] .article-list-thumb-swap .thumb-dark {
  display: none;
}

[data-theme="light"] .article-list-thumb-swap .thumb-light {
  display: block;
}

.article-list-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.article-list-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-list-title {
  font-size: 1.14rem;
  font-weight: 600;
  line-height: 1.35;
}

.article-list-desc {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-list-badge {
  display: inline-block;
  margin-right: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* Карточка целиком — ссылка: заголовок не должен наследовать цвет ссылок из .article-content */
.article-content .article-list-link,
.article-content .article-list-link:hover {
  text-decoration: none;
}

.article-content .article-list-link .article-list-title {
  color: var(--text);
  text-decoration: none;
}

.article-content .article-list-link .article-list-desc,
.article-content .article-list-link .article-list-meta {
  color: var(--text-muted);
  text-decoration: none;
}

.article-content .article-list-link:hover .article-list-title {
  color: var(--accent);
}

/* Заглушка: статья ещё не опубликована */
.article-list-item--soon .article-list-link {
  cursor: default;
  opacity: 0.9;
}

.article-list-item--soon .article-list-thumb {
  filter: saturate(0.8);
}

.article-content .article-list-item--soon .article-list-link:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}

.article-content .article-list-item--soon .article-list-link:hover .article-list-title {
  color: var(--text);
}

/* Иллюстрации в тексте статьи */
.article-content .article-figure {
  margin: 2rem 0;
}

.article-content .article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.article-content .article-figure figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Кликабельные изображения и просмотр в полном размере */
.article-content .article-figure-link {
  display: block;
  border-radius: 12px;
  cursor: zoom-in;
}

.article-content .article-figure-link:focus-visible {
  outline: 2px solid var(--accent, #2f6fed);
  outline-offset: 3px;
}

.article-content .article-figure-link:hover img {
  opacity: 0.94;
}

.article-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: rgba(8, 12, 20, 0.93);
}

.article-lightbox.is-open {
  display: flex;
}

.article-lightbox img {
  max-width: min(1400px, 94vw);
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

.article-lightbox-caption {
  margin: 0;
  max-width: 860px;
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
  color: #dfe7f6;
}

.article-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.article-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

body.article-lightbox-open {
  overflow: hidden;
}

/* Подпись автора под статьёй */
.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.article-byline-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid var(--border);
}

.article-byline-text {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.article-byline-text a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.article-byline-text a:hover {
  text-decoration: underline;
}

/* Страница автора */
.author-page {
  padding: 48px 0 64px;
}

.author-hero {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.author-avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface, #1a1a1a);
}

.author-role {
  margin: 6px 0 14px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.author-bio p {
  margin: 0 0 14px;
  line-height: 1.7;
}

.author-facts {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.author-facts li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.author-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f6fed;
}

.author-articles {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.author-articles h2 {
  margin: 0 0 18px;
  font-size: 1.35rem;
}

.author-article-link {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.author-article-link:hover strong {
  text-decoration: underline;
}

.author-article-link span {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .author-hero {
    flex-direction: column;
    gap: 18px;
  }

  .author-avatar {
    width: 104px;
    height: 104px;
  }
}

@media (max-width: 860px) {
  .article-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .article-list-title {
    font-size: 1.08rem;
  }
}
