/* ==========================================================================
   K-Life Hub: Ingredients Page Stylesheet
   ========================================================================== */

:root {
  --font-sans: "Segoe UI", Arial, sans-serif;
  --color-brand: #00b5ef;
  --color-brand-hover: #009ecc;
  --color-text-main: #333333;
  --color-text-muted: #666666;
  --color-border: #d0e2f3;

  --color-bg-body: #f7fafc;
  --color-bg-card: #f0f7ff;
  --color-bg-highlight: #e6f2ff;

  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.02);
  --radius-md: 14px;
  --radius-lg: 16px;
  --transition-smooth: all 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text-main);
  background-color: var(--color-bg-body);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background-color: var(--color-brand);
  width: 0%;
  z-index: 1100;
  transition: width 0.1s ease-out;
}

.deep-article-container,
.article {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  background-color: var(--color-bg-body);
}

.meta-info-bar,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.article-hero-title,
.article-header h1 {
  font-size: 2.375rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-text-main);
  margin: 0 0 16px 0;
  text-align: center;
  letter-spacing: -0.5px;
}

.article-intro-text,
.article-intro {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0 auto 32px auto;
  max-width: 820px;
  text-align: center;
}

.article-author {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  margin: 0 auto 40px auto;
  box-shadow: var(--shadow-card);
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

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

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

/* Стили блока картинки (как на странице HemoHIM) */
.article-hero {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 50px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  box-sizing: border-box;
  box-shadow: var(--shadow-card);
}

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

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

.table-of-contents,
.toc-sticky {
  background: var(--color-bg-card);
  border-left: 4px solid var(--color-brand);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin-bottom: 40px;
  box-shadow: var(--shadow-card);
}

.table-of-contents h3,
.toc-title {
  margin: 0 0 12px 0;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-main);
}

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

.table-of-contents li,
.article-toc li {
  margin-bottom: 6px;
}

.table-of-contents a,
.article-toc li a {
  display: block;
  padding: 4px 0 4px 14px;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: var(--transition-smooth);
}

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

.content-block,
.section-block {
  margin: 40px 0;
  background: var(--color-bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.content-block h2,
.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.content-block h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-main);
  margin: 28px 0 12px 0;
}

.content-block p,
.content-block ul,
.content-block ol,
.article-content p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.content-block ul,
.content-block ol {
  padding-left: 20px;
}

.content-block li {
  margin-bottom: 8px;
}

.info-box,
.callout-info {
  background: var(--color-bg-highlight);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-brand);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0;
  box-shadow: var(--shadow-card);
}

.info-box p:last-child,
.callout-body {
  margin-bottom: 0;
  color: var(--color-text-main);
}

.warning-box {
  background: #fff9db;
  border: 1px solid #fcc419;
  border-left: 4px solid #f59f00;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0;
  box-shadow: var(--shadow-card);
}

.warning-box p:last-child {
  margin-bottom: 0;
}

.comparison-grid,
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.comp-card,
.checklist-box,
.highlight-box,
.ingredient-card,
.step-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.comp-card:hover {
  transform: translateY(-2px);
}

.comp-card h4 {
  margin: 0 0 8px 0;
  color: var(--color-brand);
  font-size: 1.05rem;
  font-weight: 700;
}

.comp-card p,
.step-card p,
.ingredient-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.inci-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
}

.inci-table th,
.inci-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.inci-table th {
  background-color: var(--color-bg-highlight);
  font-weight: 700;
  color: var(--color-text-main);
}

.inci-table tr:last-child td {
  border-bottom: none;
}

.summary-card {
  background: var(--color-bg-highlight);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-brand);
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-top: 40px;
  box-shadow: var(--shadow-card);
}

.summary-card h2 {
  color: var(--color-brand) !important;
  border-bottom: none !important;
  margin-bottom: 12px !important;
}

.summary-text-override {
  color: var(--color-text-main);
  font-weight: 500;
  margin-bottom: 0;
  font-size: 1.1rem;
}

.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 {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

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

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

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

@media (max-width: 768px) {
  .deep-article-container,
  .article {
    padding: 24px 16px 60px;
  }
  .content-block,
  .section-block {
    padding: 20px;
  }
  .article-hero-title,
  .article-header h1 {
    font-size: 1.85rem;
  }
  .summary-card {
    padding: 24px;
  }
}
