/* ========================
   Article Hero
======================== */
.article-hero {
  padding-top: 140px;
  padding-bottom: 0;
  background: var(--bg);
  overflow: hidden;
}

.article-hero__breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
  margin-bottom: 60px;
}

.article-hero__breadcrumb a:hover { opacity: 0.7; }
.article-hero__breadcrumb > span { opacity: 0.35; }

.article-hero__content {
  max-width: 860px;
  margin-bottom: 60px;
}

.article-hero__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.article-hero__cat {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  border: 1px solid rgba(243,156,18,0.35);
  border-radius: 999px;
  background: rgba(243,156,18,0.07);
  color: #b8860b;
}

.article-hero__date,
.article-hero__read {
  font-size: 13px;
  opacity: 0.45;
}

.article-hero__date::before {
  content: '—';
  margin-right: 10px;
  opacity: 0.4;
}

.article-hero__title {
  font-size: clamp(38px, 5vw, 72px);
  line-height: 1.05;
  font-weight: 400;
  margin-bottom: 28px;
}

.article-hero__lead {
  font-size: 20px;
  line-height: 1.65;
  opacity: 0.62;
  max-width: 680px;
  margin-bottom: 40px;
}

.article-hero__author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.article-hero__author-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.article-hero__author-name { font-size: 15px; font-weight: 500; }
.article-hero__author-role {
  font-size: 11px;
  opacity: 0.45;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.article-hero__cover {
  width: 100%;
  height: clamp(280px, 44vw, 600px);
  overflow: hidden;
  border-radius: 4px 4px 0 0;
}

.article-hero__img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: #e0e0de;
  transition: transform 0.9s ease;
}

.article-hero__cover:hover .article-hero__img { transform: scale(1.025); }

/* Мобильная обложка (скрыта по умолчанию для десктопа) */
.article-hero__cover--mobile {
  display: none;
}

/* ========================
   Article Layout
======================== */
.article-section { padding-top: 80px; }

.article-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 80px;
  align-items: start;
}

/* ========================
   TOC
======================== */
.article-toc {
  position: sticky;
  top: 110px;
}

.article-toc__inner {
  border-left: 2px solid var(--line);
  padding-left: 24px;
}

.article-toc__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.38;
  margin: 0 0 16px;
  font-weight: 500;
}

.article-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  counter-reset: toc-counter;
}

.article-toc__item { counter-increment: toc-counter; }

.article-toc__link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  opacity: 0.4;
  padding: 7px 0;
  text-decoration: none;
  transition: opacity 0.22s ease, color 0.22s ease;
}

.article-toc__link::before {
  content: counter(toc-counter, decimal-leading-zero);
  font-size: 10px;
  opacity: 0.55;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  transition: color 0.22s ease, opacity 0.22s ease;
}

.article-toc__link:hover { opacity: 0.75; }

.article-toc__link.active {
  opacity: 1;
  color: #b8860b;
  font-weight: 500;
}

.article-toc__link.active::before {
  color: #b8860b;
  opacity: 1;
}

/* ========================
   Article Body — типографика
======================== */
.article-body {
  max-width: 760px;
  font-size: 18px;
  line-height: 1.78;
  color: var(--text);
}

.article-body h2 {
  font-size: clamp(24px, 2.8vw, 36px);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
  margin-top: 72px;
  margin-bottom: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 110px;
}

.article-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-body h3 {
  font-size: 22px;
  font-weight: 500;
  margin-top: 44px;
  margin-bottom: 16px;
  scroll-margin-top: 110px;
}

.article-body p { margin-bottom: 22px; color: rgba(26,26,26,0.83); }
.article-body strong { font-weight: 600; color: var(--text); }
.article-body em { font-style: italic; font-family: var(--font-serif); }

/* ========================
   Блок «Важно»
======================== */
.important {
  position: relative;
  background: linear-gradient(135deg,
    rgba(243,156,18,0.08) 0%,
    rgba(244,208,63,0.04) 100%);
  border-left: 3px solid #f39c12;
  border-radius: 0 8px 8px 0;
  padding: 22px 28px 22px 36px;
  margin: 38px 0;
}

.important::before {
  content: '!';
  position: absolute;
  top: 20px;
  left: -15px;
  width: 28px;
  height: 28px;
  background: #f39c12;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
}

.important p {
  margin: 0 !important;
  font-size: 16px;
  line-height: 1.68;
  color: rgba(26,26,26,0.88);
}

.important p strong { color: #9a6b00; }

/* ========================
   Списки
======================== */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: ol-counter;
}

.article-list li {
  position: relative;
  padding-left: 28px;
  font-size: 18px;
  line-height: 1.62;
  color: rgba(26,26,26,0.82);
}

/* Маркер для ul */
.article-list:not(.article-list--ordered) li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 14px;
  height: 2px;
  background: linear-gradient(90deg, #f4d03f, #f39c12);
  border-radius: 1px;
}

/* Нумерация для ol */
.article-list--ordered li { counter-increment: ol-counter; }

.article-list--ordered li::before {
  content: counter(ol-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #f39c12;
  line-height: 1.8;
}

/* ========================
   Цитата
======================== */
.article-quote {
  position: relative;
  margin: 52px 0;
  padding: 0 0 0 44px;
}

.article-quote::before {
  content: '\\201C';
  position: absolute;
  left: 0;
  top: -14px;
  font-size: 90px;
  line-height: 1;
  font-family: var(--font-serif);
  color: rgba(243,156,18,0.28);
}

.article-quote p {
  font-size: clamp(20px, 2.4vw, 26px) !important;
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.5;
  color: var(--text) !important;
  margin-bottom: 14px !important;
}

.article-quote cite {
  font-size: 12px;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.45;
}

/* ========================
   Изображение в статье
======================== */
.article-figure { margin: 44px 0; }

.article-figure__img {
  width: 100%;
  height: clamp(220px, 34vw, 460px);
  background-size: cover;
  background-position: center;
  background-color: #e0e0de;
  border-radius: 4px;
  margin-bottom: 14px;
}

.article-figure figcaption {
  font-size: 13px;
  opacity: 0.45;
  text-align: center;
  line-height: 1.5;
}

/* ========================
   Теги
======================== */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.article-tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  opacity: 0.65;
  transition: background 0.25s ease, border-color 0.25s ease,
              color 0.25s ease, opacity 0.25s ease;
}

.article-tag:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  opacity: 1;
}

/* ========================
   Поделиться
======================== */
.article-share {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.article-share__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.38;
}

.article-share__link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  opacity: 0.65;
  transition: background 0.25s ease, border-color 0.25s ease,
              color 0.25s ease, opacity 0.25s ease;
}

.article-share__link:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  opacity: 1;
}

/* ========================
   Responsive
======================== */
@media (max-width: 1100px) {
  .article-layout {
    grid-template-columns: 210px 1fr;
    gap: 52px;
  }
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .article-toc {
    position: static;
    margin-bottom: 52px;
  }

  /* На мобильном — TOC горизонтальный как теги */
  .article-toc__inner {
    border-left: none;
    border-top: 2px solid var(--line);
    padding-left: 0;
    padding-top: 22px;
  }

  .article-toc__list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .article-toc__link {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    opacity: 0.65;
  }

  .article-toc__link::before { display: none; }

  .article-toc__link.active {
    background: rgba(243,156,18,0.09);
    border-color: rgba(243,156,18,0.4);
  }
}

@media (max-width: 768px) {
  .article-hero { padding-top: 100px; }
  .article-hero__breadcrumb { margin-bottom: 36px; }
  .article-hero__lead { font-size: 17px; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 24px; }
  .article-quote p { font-size: 20px !important; }
  
  .important {
    padding: 18px 20px 18px 24px;
  }
  
  .important::before { display: none; }
  
  /* Показываем мобильную обложку */
  .article-hero__cover--mobile {
    display: block;
    margin-bottom: 20px;
    height: 280px;
  }
  
  /* Скрываем оригинальную (десктопную) обложку на мобильных устройствах */
  .article-hero__cover--mobile + .article-hero__cover {
    display: none;
  }
}

/* ========================
   Article Gallery
======================== */
.article-gallery {
    position: relative;
    margin: 44px 0;
    border-radius: 4px;
    overflow: hidden;
    background: #e0e0de;
    cursor: zoom-in;
}

.article-gallery__track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: clamp(280px, 40vw, 500px);
    touch-action: pan-y; /* Разрешаем только вертикальный скролл (для свайпа) */
}

.article-gallery__slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.article-gallery__nav {
    position: absolute;
    bottom: 20px;
    right: 20px; /* Навигация справа */
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 8px 16px;
    border-radius: 999px;
    color: #fff;
    z-index: 2;
    pointer-events: auto; /* Останавливаем всплытие клика, чтобы не открывался Lightbox */
}

.article-gallery__nav * {
    pointer-events: auto;
}

.article-gallery__arrow {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}

.article-gallery__arrow:hover { opacity: 0.7; }
.article-gallery__arrow::after {
    content: '';
    width: 8px; height: 8px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}
.article-gallery__arrow--prev::after { transform: rotate(-135deg); }
.article-gallery__arrow--next::after { transform: rotate(45deg); }

.article-gallery__counter {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
}

.article-gallery__hint {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.article-gallery:hover .article-gallery__hint {
    opacity: 1;
    transform: translateY(0);
}

/* Адаптив галереи для мобилок */
@media (max-width: 500px) {
    .article-gallery__nav {
        bottom: 10px; right: 10px; padding: 6px 12px; gap: 10px;
    }
    .article-gallery__caption {
        bottom: 10px; left: 10px; font-size: 12px; max-width: calc(100% - 140px); padding: 6px 12px;
    }
}
