/* AI-Pedia: журнал – список материалов и статья */
.journal { padding-bottom: var(--s-10); }
.journal__wrap { padding-top: 18px; }

.jcrumbs { margin: 0 0 14px; font-size: 13.5px; font-weight: 700; color: var(--text-soft); }
.jcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; min-width: 0; }
.jcrumbs li { display: inline-flex; align-items: center; min-width: 0; }
.jcrumbs li + li::before { content: "/"; margin: 0 8px; color: var(--text-3); }
.jcrumbs a { color: inherit; text-decoration: none; transition: color .2s; }
.jcrumbs a:hover { color: var(--text); }
.jcrumbs [aria-current] span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

/* ---------- Общий редакционный стиль журнала: список и статья ---------- */
.jhead { max-width: 820px; }
.jhead h1, .journal__title, .article__title {
  margin: 0; font-size: clamp(32px, 4.2vw, 48px); line-height: 1.1; letter-spacing: -0.028em; font-weight: 800;
}
.journal__page { color: var(--meta); font-weight: 700; }
.journal__lead, .article__lead { margin: 16px 0 0; font-size: var(--fs-lead); line-height: 1.55; color: var(--text-soft); }

/* Ярлык раздела – текст капителью, а не «пилюля» как в каталоге */
.jlabel {
  display: inline-block; position: relative; z-index: 1;
  font-size: 12.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--jc-ink, var(--lilac-ink)); text-decoration: none;
}
.jlabel:hover { text-decoration: underline; text-underline-offset: 3px; }
.jmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 13.5px; font-weight: 600; color: var(--meta); }
.jmeta > * + *::before { content: "·"; margin: 0 8px; }

/* Разделы – строка ссылок с подчёркиванием, а не фильтры-чипы каталога */
.journal__tabs {
  display: flex; flex-wrap: wrap; gap: 4px 28px;
  margin: 28px 0 36px; padding: 0; border-bottom: 1px solid var(--line);
}
.journal__tab {
  position: relative; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 12px 0 14px; font-size: 15.5px; font-weight: 700; color: var(--text-soft); text-decoration: none;
  transition: color .2s;
}
.journal__tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; transition: background .2s; }
.journal__tab:hover { color: var(--text); }
.journal__tab.is-active { color: var(--text); }
.journal__tab.is-active::after { background: var(--text); }
.journal__tab-n { font-size: 12.5px; font-weight: 700; color: var(--meta); }

/* Карточка статьи: без рамки и фона – обложка, ярлык, заголовок, анонс */
.journal__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 28px; }
.journal__feature { margin-bottom: 48px; padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.jcard { position: relative; display: flex; flex-direction: column; min-width: 0; }
.jcard__media {
  display: block; aspect-ratio: 16 / 10; border-radius: var(--r-md); overflow: hidden;
  background: var(--jc-soft);
}
.jcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.jcard:hover .jcard__media img { transform: scale(1.03); }
.jcard__ph {
  display: grid; place-items: end start; width: 100%; height: 100%; padding: 18px 20px;
  background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--jc-ink) 22%, transparent), transparent 60%), var(--jc-soft);
}
.jcard__ph span { font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--jc-ink); opacity: .8; }
.jcard__body { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; flex: 1; }
.jcard__title { margin: 2px 0 0; font-size: 21px; line-height: 1.3; letter-spacing: -0.012em; font-weight: 800; }
.jcard__title a { color: var(--text); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .3s var(--ease); }
.jcard:hover .jcard__title a { background-size: 100% 1.5px; }
.jcard__title a::after { content: ""; position: absolute; inset: 0; }
.jcard__excerpt { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.jcard .jmeta { margin-top: auto; padding-top: 4px; }

/* Главный материал: горизонтально, крупный заголовок */
.jcard--lg { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.jcard--lg .jcard__media { aspect-ratio: 16 / 10; }
.jcard--lg .jcard__body { padding-top: 0; gap: 12px; }
.jcard--lg .jcard__title { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.18; }
.jcard--lg .jcard__excerpt { font-size: 17px; -webkit-line-clamp: 4; }

.journal__pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: var(--s-8); }
.journal__pager .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  font-size: 14.5px; font-weight: 700; color: var(--text); text-decoration: none;
}
.journal__pager .page-numbers:hover { border-color: var(--line-strong); }
.journal__pager .page-numbers.current { border-color: var(--text); background: var(--text); color: var(--bg); }
.journal__pager .dots { border: 0; background: none; }

.journal__empty {
  max-width: 640px; margin: var(--s-4) auto 0; padding: 40px 32px; text-align: center;
  background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
}
.journal__empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: var(--lilac-soft); color: var(--lilac-ink); }
.journal__empty h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.3; }
.journal__empty p { margin: 0 auto; max-width: 48ch; font-size: 15.5px; line-height: 1.6; color: var(--text-soft); }
.journal__empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

/* Статья */
.article__head .jlabel { margin-bottom: 14px; }
.article__meta { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.article__cover { margin: var(--s-8) 0 0; border-radius: var(--r-lg); overflow: hidden; background: var(--jc-soft); }
.article__cover img { width: 100%; height: auto; max-height: 560px; object-fit: cover; display: block; }

.article__layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; margin-top: var(--s-8); }
.article__aside { position: sticky; top: calc(var(--header-h, 72px) + 20px); display: grid; gap: 16px; }
.article__toc { padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.article__toc-title { margin: 0 0 10px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--meta); }
.article__toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.article__toc a { display: block; padding: 6px 0 6px 12px; border-left: 2px solid var(--line); font-size: 14.5px; line-height: 1.4; font-weight: 600; color: var(--text-soft); text-decoration: none; transition: color .2s, border-color .2s; }
.article__toc a:hover { color: var(--text); }
.article__toc a.is-active { border-color: var(--jc-ink); color: var(--text); }
.article__catalog { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--r-md); background: var(--jc-soft); color: var(--text); text-decoration: none; }
.article__catalog strong { font-size: 15.5px; }
.article__catalog span { font-size: 13.5px; line-height: 1.5; color: var(--text-soft); }

.prose { max-width: 760px; font-size: 17px; line-height: 1.75; color: var(--text); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { margin: 1.8em 0 .6em; font-size: 26px; line-height: 1.25; letter-spacing: -0.015em; scroll-margin-top: calc(var(--header-h, 72px) + 16px); }
.prose h3 { margin: 1.5em 0 .5em; font-size: 20px; line-height: 1.3; scroll-margin-top: calc(var(--header-h, 72px) + 16px); }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin: .4em 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { font-weight: 800; }
.prose img { max-width: 100%; height: auto; border-radius: var(--r-sm); }
.prose figure { margin: 1.6em 0; }
.prose figcaption { margin-top: 8px; font-size: 14px; color: var(--meta); text-align: center; }
.prose blockquote { margin: 1.5em 0; padding: 16px 20px; border-left: 4px solid var(--jc-ink); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--jc-soft); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { padding: 2px 6px; border-radius: 6px; background: var(--bg-soft); font-size: .9em; }
.prose pre { position: relative; margin: 1.5em 0; padding: 18px 20px; padding-top: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-soft); overflow-x: auto; font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.prose pre code { padding: 0; background: none; font-size: inherit; }
.prose table { width: 100%; margin: 1.5em 0; border-collapse: collapse; font-size: 15.5px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--bg-soft); font-weight: 800; }
.prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }

.copy-btn {
  position: absolute; top: 8px; right: 8px; height: 30px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  font: inherit; font-size: 13px; font-weight: 700; color: var(--text-soft); cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--line-strong); }
.copy-btn.is-done { color: var(--mint-ink); border-color: var(--mint-ink); }

.article__tags { display: flex; flex-wrap: wrap; gap: 8px; max-width: 760px; margin-top: var(--s-6); }
.article__tags a { font-size: 14px; font-weight: 700; color: var(--text-soft); text-decoration: none; }
.article__tags a:hover { color: var(--text); }
.article__related { margin-top: var(--s-10); padding-top: var(--s-8); border-top: 1px solid var(--line); }
.article__related-title { margin: 0 0 var(--s-5); font-size: 26px; }
.article__comments { max-width: 760px; margin-top: var(--s-10); }

@media (max-width: 1100px) {
  .journal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article__layout { grid-template-columns: minmax(0, 1fr); }
  .article__aside { position: static; order: -1; }
  .article__catalog { display: none; }
}
@media (max-width: 760px) {
  .jcard--lg { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .jcard--lg .jcard__title { font-size: 24px; }
}
@media (max-width: 700px) {
  .journal__wrap { padding-top: 12px; }
  .journal__title, .article__title { font-size: 30px; }
  .journal__lead, .article__lead { font-size: 16.5px; }
  .journal__tabs { flex-wrap: nowrap; gap: 22px; overflow-x: auto; scrollbar-width: none; margin: 20px calc(var(--pad) * -1) 28px; padding-inline: var(--pad); }
  .journal__tabs::-webkit-scrollbar { display: none; }
  .journal__tab { flex: none; }
  .journal__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .journal__feature { margin-bottom: 36px; padding-bottom: 36px; }
  .jcard__title { font-size: 20px; }
  .prose { font-size: 16.5px; }
  .prose h2 { font-size: 22px; }
  .article__cover { margin-inline: calc(var(--pad) * -1); border-radius: 0; }
}
