/* ============================================================
   article-page2.css — стили для шаблона отдельной статьи
   Подключается ВМЕСТЕ с styles2.css
   ============================================================ */

/* ============================================================
   КОНТЕЙНЕР СТАТЬИ
   ============================================================ */
.article-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 50px 24px 60px;
  position: relative;
}

/* ============================================================
   ШАПКА СТАТЬИ
   ============================================================ */
.article-header {
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
}

.article-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--primary-color) 50%,
    transparent 100%);
  opacity: 0.8;
}

/* Категория — лейбл */
.article-category {
  display: inline-block;
  padding: 5px 14px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-color);
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: 4px;
  font-weight: 700;
  margin-bottom: 18px;
}

.article-category::before {
  content: '◆ ';
  margin-right: 4px;
  opacity: 0.7;
}

/* Заголовок */
.article-title {
  font-size: 42px;
  font-weight: 800;
  margin: 0 0 18px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(var(--primary-rgb), 0.3);
  letter-spacing: -0.8px;
  line-height: 1.15;
}

/* Мета-информация (дата + время чтения) */
.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.article-date::before {
  content: '⏱ ';
  color: var(--primary-color);
  margin-right: 4px;
  opacity: 0.7;
}

.article-reading-time {
  color: var(--primary-color);
  opacity: 0.85;
}

.article-reading-time::before {
  content: '↪ ';
  margin-right: 2px;
  opacity: 0.7;
}

/* Главное изображение статьи */
.article-image-container {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(var(--primary-rgb), 0.15);
  position: relative;
}

.article-image-container::before,
.article-image-container::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--primary-color);
  border-style: solid;
  opacity: 0.7;
  pointer-events: none;
  z-index: 2;
}

.article-image-container::before {
  top: 8px; left: 8px;
  border-width: 2px 0 0 2px;
  border-radius: 4px 0 0 0;
}

.article-image-container::after {
  bottom: 8px; right: 8px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 4px 0;
}

.article-image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 460px;
  object-fit: cover;
}

/* ============================================================
   КОНТЕНТ СТАТЬИ
   ============================================================ */
.article-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  border-radius: 16px;
  padding: 40px 44px;
  position: relative;
}

/* Угловые скобки контейнера контента */
.article-content::before,
.article-content::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--primary-color);
  border-style: solid;
  opacity: 0.5;
  pointer-events: none;
}

.article-content::before {
  top: 10px; left: 10px;
  border-width: 2px 0 0 2px;
  border-radius: 4px 0 0 0;
}

.article-content::after {
  bottom: 10px; right: 10px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 4px 0;
}

/* ============================================================
   ЗАГОЛОВКИ ВНУТРИ СТАТЬИ
   ============================================================ */
.article-content h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 36px 0 18px;
  color: var(--text-primary);
  position: relative;
  padding-left: 18px;
  line-height: 1.3;
}

.article-content h2:first-child {
  margin-top: 0;
}

/* Зелёная вертикальная полоса слева у h2 */
.article-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  background: var(--gradient);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.4);
}

.article-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 28px 0 14px;
  color: var(--primary-color);
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.article-content h3::before {
  content: '// ';
  font-family: 'Courier New', monospace;
  opacity: 0.6;
  font-weight: 400;
}

.article-content h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--secondary-color);
  letter-spacing: 0.2px;
}

/* ============================================================
   ПАРАГРАФЫ И ТЕКСТ
   ============================================================ */
.article-content p {
  margin: 0 0 18px;
  color: var(--text-secondary);
}

.article-content p:last-child {
  margin-bottom: 0;
}

.article-content strong,
.article-content b {
  color: var(--text-primary);
  font-weight: 700;
  background: linear-gradient(180deg, transparent 60%, rgba(var(--primary-rgb), 0.12) 60%);
  padding: 0 2px;
}

.article-content em,
.article-content i {
  color: var(--secondary-color);
  font-style: italic;
}

.article-content a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px dashed rgba(var(--primary-rgb), 0.5);
  transition: all 0.2s;
  padding-bottom: 1px;
}

.article-content a:hover {
  color: var(--secondary-color);
  border-bottom-color: var(--secondary-color);
  text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.5);
}

/* ============================================================
   СПИСКИ
   ============================================================ */
.article-content ul,
.article-content ol {
  margin: 0 0 22px;
  padding-left: 8px;
}

.article-content li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  list-style: none;
}

/* Маркер ▸ для ul */
.article-content ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(var(--primary-rgb), 0.4);
}

/* Нумерация для ol */
.article-content ol {
  counter-reset: ol-counter;
}

.article-content ol li {
  counter-increment: ol-counter;
}

.article-content ol li::before {
  content: counter(ol-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.5px;
}

.article-content li ul,
.article-content li ol {
  margin: 8px 0 4px;
}

/* ============================================================
   ЦИТАТЫ
   ============================================================ */
.article-content blockquote {
  position: relative;
  margin: 28px 0;
  padding: 22px 26px 22px 50px;
  background: rgba(var(--primary-rgb), 0.05);
  border-left: 3px solid var(--primary-color);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.article-content blockquote::before {
  content: '"';
  position: absolute;
  left: 14px;
  top: 8px;
  font-size: 56px;
  color: var(--primary-color);
  opacity: 0.4;
  font-family: Georgia, serif;
  line-height: 1;
  text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.4);
}

/* ============================================================
   КОД И ПРОМПТЫ
   ============================================================ */
.article-content code,
.article-content tt {
  font-family: 'Courier New', monospace;
  font-size: 0.92em;
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary-color);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.code-block {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-radius: 12px;
  padding: 36px 20px 18px; /* верхний отступ под лейбл */
  margin: 24px 0;
  overflow: hidden; /* контейнер не режет лейбл */
  box-shadow: inset 0 0 30px rgba(var(--primary-rgb), 0.04);
}

/* Лейбл "PROMPT" сверху — внутри блока, не выходит за пределы */
.code-block::before {
  content: '// PROMPT';
  position: absolute;
  top: 10px;
  left: 16px;
  background: rgba(var(--primary-rgb), 0.12);
  padding: 3px 10px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--primary-color);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  z-index: 2;
}

@keyframes code-blink {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* Внутренняя прокрутка содержимого */
.code-block pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
}

.code-block code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  font-family: 'Courier New', monospace;
}

/* Скроллбар внутри код-блока */
.code-block::-webkit-scrollbar {
  height: 6px;
}
.code-block::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
  opacity: 0.5;
}

/* ============================================================
   ИЗОБРАЖЕНИЯ ВНУТРИ СТАТЬИ
   ============================================================ */
.article-image-example {
  margin: 28px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  background: rgba(0, 0, 0, 0.3);
}

.article-image-example img {
  width: 100%;
  height: auto;
  display: block;
}

.image-caption {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 16px !important;
  margin: 0 !important;
  background: rgba(var(--primary-rgb), 0.04);
  border-top: 1px solid rgba(var(--primary-rgb), 0.12);
  font-style: italic;
}

.image-caption::before {
  content: '◆ ';
  color: var(--primary-color);
  font-style: normal;
  margin-right: 4px;
  opacity: 0.7;
}

/* Просто img в тексте — лёгкая обёртка */
.article-content > img,
.article-content p > img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 20px auto;
  display: block;
  border: 1px solid rgba(var(--primary-rgb), 0.15);
}

/* ============================================================
   ТАБЛИЦЫ
   ============================================================ */
.article-content table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.1);
}

.article-content th {
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary-color);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

.article-content tr:last-child td {
  border-bottom: none;
}

.article-content tr:hover td {
  background: rgba(var(--primary-rgb), 0.04);
}

/* ============================================================
   HR — разделитель
   ============================================================ */
.article-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(var(--primary-rgb), 0.3) 50%,
    transparent 100%);
  margin: 32px 0;
  position: relative;
}

.article-content hr::after {
  content: '◆';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-darker);
  padding: 0 10px;
  color: var(--primary-color);
  font-size: 10px;
  opacity: 0.6;
}

/* ============================================================
   ФУТЕР СТАТЬИ — теги и кнопки
   ============================================================ */
.article-footer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid rgba(var(--primary-rgb), 0.15);
  position: relative;
}

.article-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--primary-color) 50%,
    transparent 100%);
  opacity: 0.8;
}

/* Теги */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 30px;
}

.article-tags .tag {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: 18px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  font-weight: 600;
  transition: all 0.25s;
  cursor: pointer;
}

.article-tags .tag::before {
  content: '#';
  opacity: 0.6;
  margin-right: 2px;
}

.article-tags .tag:hover {
  background: rgba(var(--primary-rgb), 0.2);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.3);
  transform: translateY(-1px);
}

/* Кнопки действий внизу */
.article-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.article-actions .btn {
  padding: 13px 28px;
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 26px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.article-actions .btn-primary {
  background: var(--gradient);
  color: white;
  position: relative;
  overflow: hidden;
}

.article-actions .btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.article-actions .btn-primary:hover::before { left: 100%; }

.article-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(var(--primary-rgb), 0.4);
}

.article-actions .btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.article-actions .btn-secondary:hover {
  background: rgba(var(--primary-rgb), 0.1);
  box-shadow: 0 0 18px rgba(var(--primary-rgb), 0.25);
  transform: translateY(-2px);
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */
@media (max-width: 768px) {
  .article-page {
    padding: 20px 14px 40px;
  }

  .article-title {
    font-size: 28px;
    letter-spacing: -0.3px;
  }

  .article-content {

    font-size: 15px;
    line-height: 1.7;
  }

  .article-content h2 {
    font-size: 22px;
    margin: 28px 0 14px;
  }

  .article-content h3 {
    font-size: 18px;
  }

  .article-content blockquote {
    padding: 18px 18px 18px 40px;
    font-size: 15px;
  }

  .article-content blockquote::before {
    font-size: 42px;
    left: 10px;
  }

  .code-block {
    font-size: 13px;
  }

  .code-block code {
    font-size: 12px;
  }

  .article-image-container::before,
  .article-image-container::after {
    width: 16px;
    height: 16px;
  }

  .article-content::before,
  .article-content::after {
    display: none;
  }

  .article-meta {
    gap: 10px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .article-title {
    font-size: 22px;
  }

  .article-content {
    padding: 20px 14px;
  }

  .article-actions .btn {
    width: 100%;
    max-width: 280px;
  }

  .article-image-container::before,
  .article-image-container::after {
    display: none;
  }
}


/* ============================================================
   CANVAS-ФОН — переопределение поверх styles2.css
   Делаем body прозрачным, фон уезжает на html, canvas виден
   ============================================================ */

html {
  background: var(--bg-gradient) !important;
}

body {
  background: transparent !important;
}

#canvas-bg {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  opacity: 0.55 !important;
  pointer-events: none !important;
}

.bg-orbs {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  animation: article-orb-float 18s infinite ease-in-out alternate;
}

.orb-1 {
  width: 480px; height: 480px;
  background: var(--primary-color);
  top: -120px; left: -120px;
}
.orb-2 {
  width: 560px; height: 560px;
  background: var(--secondary-color);
  bottom: -180px; right: -140px;
  animation-delay: -6s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: var(--secondary-color);
  top: 40%; left: 45%;
  opacity: 0.1;
  animation-delay: -12s;
}

@keyframes article-orb-float {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 50px) scale(1.15); }
}

/* Контент над canvas */
.header,
.main-container-article,
.footer,
.burger-menu {
  z-index: 1;
}

.header { z-index: 1000 !important; }

/* Floating элементы */
.modal,
.modal-overlay,
.notifications-modal,
#page-loader {
  z-index: 1500;
}

.modal { z-index: 1500 !important; }
.notifications-modal { z-index: 1600 !important; }
#page-loader { z-index: 9998 !important; }
