/* ==========================================================================
   K-Life Hub: Единая система стилей статей (article.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ И БАЗОВЫЕ НАСТРОЙКИ
   -------------------------------------------------------------------------- */
:root {
  /* Цветовая палитра */
  --primary-color: #00b5ef; /* Основной акцентный голубой */
  --bg-card: #f0f7ff; /* Голубоватый фон для карточек и блоков */
  --bg-highlight: #e6f2ff; /* Насыщенный голубой для выделений */
  --border-color: #d0e2f3; /* Мягкая голубоватая рамка */
  --text-main: #333333; /* Основной цвет текста */
  --text-muted: #666666; /* Вторичный (мутный) цвет текста */

  /* Спецэффекты и скругления */
  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.02);
  --radius-md: 14px;
  --radius-lg: 16px;
}

/* Сброс размеров блоков для корректного расчета отступов */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Общие стили страницы */
body {
  margin: 0;
  padding: 0;
  background-color: #f7fafc;
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Главный контейнер статьи */
.article {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* Индикатор прогресса чтения вверху страницы */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  width: 0%;
  height: 3px;
  background-color: var(--primary-color);
  transition: width 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   2. ШАПКА СТАТЬИ И МЕТАДАННЫЕ
   -------------------------------------------------------------------------- */
.article-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 40px;
  text-align: center;
}

/* Строка с категорией, временем чтения и датой */
.article-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 16px;
}

/* Метка категории */
.article-category {
  padding: 6px 14px;
  background: var(--bg-highlight);
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Разделительная точка между метаданными */
.meta-separator {
  font-size: 12px;
  color: #cbd5e0;
}

/* Время чтения и дата публикации */
.article-read-time,
.article-date {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Главный заголовок H1 */
.article-header h1 {
  width: 100%;
  margin: 0 0 16px 0;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: var(--text-main);
  text-align: center;
}

/* Вводный абзац под заголовком */
.article-intro {
  width: 100%;
  margin: 0 0 24px 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

/* Блок автора статьи */
.article-author {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}

/* Аватар автора */
.author-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--primary-color);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

/* Текстовая информация об авторе */
.author-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.author-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.author-role {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   3. ГЛАВНОЕ ИЗОБРАЖЕНИЕ (HERO)
   -------------------------------------------------------------------------- */
.article-hero {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 50px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.article-hero img {
  display: block;
  max-height: 360px;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 12px;
  object-fit: contain;
}

.hero-caption {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   4. ДВУХКОЛОНОЧНЫЙ МАКЕТ И СОДЕРЖАНИЕ (TOC)
   -------------------------------------------------------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  position: relative;
}

/* Контейнер бокового меню */
.article-toc {
  align-self: start;
  width: 240px;
}

/* Липкий блок содержания */
.toc-sticky {
  position: sticky;
  top: 20px;
  z-index: 90;
  max-height: calc(100vh - 40px);
  padding: 20px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.toc-title {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.article-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--border-color);
}

.article-toc li a {
  display: block;
  padding: 6px 0 6px 14px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.article-toc li a:hover {
  margin-left: -2px;
  border-left: 2px solid var(--primary-color);
  font-weight: 600;
  color: var(--primary-color);
}

/* Основная контентная область */
.article-content {
  width: 100%;
  min-width: 0;
}

.article-content h2 {
  margin: 32px 0 20px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  scroll-margin-top: 100px;
}

.article-content p {
  margin-bottom: 20px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
}

.section-block {
  margin: 40px 0;
}

/* --------------------------------------------------------------------------
   5. ДВУХКОЛОНОЧНЫЕ И МЕДИЙНЫЕ БЛОКИ
   -------------------------------------------------------------------------- */
.content-media-row,
#developer,
#composition {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 32px;
  margin: 40px 0;
  scroll-margin-top: 100px;
}

.content-media-row .text-side,
#developer .text-side,
#composition .text-side {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.content-media-row .text-side .highlight-box,
#developer .text-side .highlight-box,
#composition .text-side .highlight-box {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  margin: 0;
}

.media-side {
  display: flex;
  align-self: stretch;
  flex-shrink: 0;
  width: 280px;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 16px;
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
}

/* --------------------------------------------------------------------------
   6. КАРТОЧКИ, ВЫДЕЛЕНИЯ И СЕТКИ (GRID)
   -------------------------------------------------------------------------- */
.status-block-wrapper {
  margin: 40px 0;
  scroll-margin-top: 100px;
}

.status-grid {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 32px;
  margin-top: 20px;
}

.status-grid .checklist-box {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  margin: 0;
}

/* Блок внимания / Уведомление */
.callout {
  display: flex;
  gap: 16px;
  margin: 32px 0;
  padding: 20px;
  border-radius: var(--radius-md);
}

.callout-info {
  background: var(--bg-highlight);
  border: 1px solid #91d5ff;
  box-shadow: var(--shadow-card);
}

.callout-icon {
  font-size: 20px;
}

.callout-body {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
}

/* Сетка ингредиентов */
.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.ingredient-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* Сетка 6 ступеней ухода */
.steps-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.step-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.step-card.highlight-step {
  background: var(--bg-highlight);
  border-color: #91d5ff;
}

.step-card.highlight-step .step-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  padding: 4px 14px;
  background: var(--primary-color);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

/* Интерактивные ссылки-карточки (Полный сброс подчеркиваний для всех внутренних элементов) */
a.step-card,
a.step-card *,
a.step-card h1,
a.step-card h2,
a.step-card h3,
a.step-card h4,
a.step-card h5,
a.step-card h6,
a.step-card p,
a.step-card span,
a.step-card div {
  text-decoration: none !important;
  color: inherit;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

a.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 6px 16px rgba(0, 181, 239, 0.15);
}

/* Карточки общего назначения */
.checklist-box,
.highlight-box {
  margin: 20px 0;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* Блок итогов редакции */
.summary-card {
  margin-top: 48px;
  padding: 32px;
  background: var(--bg-highlight);
  border: 1px solid #91d5ff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.summary-card h2 {
  color: var(--primary-color) !important;
}

/* Блок источников */
.sources-box {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.styled-list {
  margin: 12px 0 0 0;
  padding-left: 20px;
}

.styled-list li {
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   7. МОДАЛЬНОЕ ОКНО ПРОСМОТРА ИЗОБРАЖЕНИЙ
   -------------------------------------------------------------------------- */
.zoomable-image {
  cursor: zoom-in;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.zoomable-image:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 40px;
  background-color: rgba(0, 0, 0, 0.85);
}

.modal-wrapper {
  position: relative;
  max-width: 95%;
  max-height: 95vh;
}

.modal-content {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  object-fit: contain;
}

.modal-close {
  position: absolute;
  top: -15px;
  right: -15px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-size: 28px;
  font-weight: bold;
  color: #333333;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}

.modal-close:hover {
  background-color: var(--primary-color);
  color: #ffffff;
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   8. АДАПТИВНОСТЬ (MEDIA QUERIES)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-toc {
    display: none;
  }

  .content-media-row,
  #developer,
  #composition,
  .status-grid,
  .ingredient-grid,
  .steps-timeline {
    flex-direction: column;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .media-side {
    align-self: auto;
    width: 100%;
    height: auto;
  }
}
