/* =========================================================
   Библиотека заболеваний — карточка заболевания (detail)
   Клиника доктора Сонина
   Reuses tokens from styles.css + spec-card from priem-styles.css
   ========================================================= */

/* ---------- Заголовок и подзаголовок-теги ---------- */
.dz-head { padding: 14px 0 0; text-align: center; }
.dz-head .page-title { margin-top: 0; }

.dz-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 4px;
}
.dz-tab {
  appearance: none;
  border: 0;
  background: var(--violet-pill, #ECE5FB);
  color: var(--violet, #6D5BD0);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.dz-tab:hover { background: var(--violet, #6D5BD0); color: #fff; transform: translateY(-1px); }
/* No permanent dark state — dark violet appears only on hover */
.dz-tab.is-active { background: var(--violet-pill, #ECE5FB); color: var(--violet, #6D5BD0); }
.dz-tab.is-active:hover { background: var(--violet, #6D5BD0); color: #fff; }

/* ---------- Двухколоночный макет ---------- */
.dz-section { padding: 40px 0 0; }
.dz-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* ---------- Сайдбар ---------- */
.dz-aside {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dz-nav {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 12px;
  box-shadow: var(--shadow-card);
}
.dz-nav ul { list-style: none; margin: 0; padding: 0; }
.dz-nav a {
  position: relative;
  display: block;
  padding: 11px 16px 11px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.3;
  transition: color .22s ease, background .22s ease;
}
.dz-nav a::before {
  content: "";
  position: absolute;
  left: 6px; top: 50%;
  width: 3px; height: 0;
  border-radius: 3px;
  background: var(--violet);
  transform: translateY(-50%);
  transition: height .28s cubic-bezier(.22,1,.36,1);
}
.dz-nav a:hover { color: var(--violet); background: color-mix(in srgb, var(--violet) 5%, transparent); }
.dz-nav a.is-active {
  color: var(--violet);
  background: var(--violet-soft);
}
.dz-nav a.is-active::before { height: 20px; }

/* Карточка «Нужна помощь?» */
.dz-help {
  background: linear-gradient(150deg, #6F62C4 0%, #8678D4 52%, #9D8FDE 100%);
  border-radius: var(--r-xl);
  padding: 24px 22px 26px;
  color: #fff;
  box-shadow: 0 18px 40px rgba(58, 46, 128, .22);
}
.dz-help h3 { margin: 0 0 10px; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.dz-help p { margin: 0 0 18px; font-size: 14.5px; line-height: 1.5; color: rgba(255,255,255,.86); }
.dz-help .btn {
  width: 100%;
  justify-content: center;
  background: #fff;
  color: var(--violet);
}
.dz-help .btn:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.18); }

/* ---------- Контент ---------- */
.dz-content { display: flex; flex-direction: column; gap: 24px; }
.dz-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: clamp(26px, 3vw, 44px);
  box-shadow: var(--shadow-card);
}
.dz-block { scroll-margin-top: 24px; }
.dz-block + .dz-block { margin-top: 36px; }

.dz-h2 {
  margin: 0 0 16px;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}
.dz-h3 {
  margin: 32px 0 16px;
  font-size: clamp(17px, 1.6vw, 19px);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.dz-p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.66;
  color: #3E3E47;
  text-wrap: pretty;
}
.dz-p:last-child { margin-bottom: 0; }
.dz-p strong { color: var(--text); font-weight: 700; }
.dz-p a {
  color: var(--violet);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-thickness .2s ease;
}
.dz-p a:hover {
  color: var(--violet-hover);
  text-decoration-thickness: 2px;
}
.dz-p a:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}
.dz-p p { margin: 0 0 14px; }
.dz-p h2,
.dz-p h3,
.dz-p h4 {
  margin: 28px 0 12px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
}
.dz-p h2 { font-size: 22px; }
.dz-p h3 { font-size: 19px; }
.dz-p h4 { font-size: 17px; }
.dz-p > :first-child { margin-top: 0; }
.dz-p > :last-child { margin-bottom: 0; }
.dz-p ul,
.dz-p ol { margin: 10px 0 18px; padding-left: 24px; }
.dz-p ul { list-style: disc; }
.dz-p ol { list-style: decimal; }
.dz-p li { margin: 7px 0; }
.dz-p li > p { margin: 0; }
.dz-p blockquote {
  margin: 22px 0;
  padding-left: 18px;
  border-left: 3px solid var(--violet);
  color: var(--text-muted);
  font-style: italic;
}
.dz-p hr { margin: 26px 0; border: 0; border-top: 1px solid var(--border); }
.dz-p mark { padding: .08em .2em; border-radius: 4px; background: #fff0ad; }
.dz-p small { font-size: .82em; color: var(--text-muted); }
.dz-p .lead { font-size: 19px; line-height: 1.55; font-weight: 500; }
.dz-p img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}
.dz-p .tableWrapper,
.dz-p table {
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.dz-p table {
  display: block;
  width: 100%;
  border-collapse: collapse;
}
.dz-p .tableWrapper table { display: table; min-width: 480px; margin: 0; border: 0; border-radius: 0; }
.dz-p th,
.dz-p td { padding: 11px 13px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: left; }
.dz-p th:last-child,
.dz-p td:last-child { border-right: 0; }
.dz-p tr:last-child td { border-bottom: 0; }
.dz-p th { background: var(--bg-soft); color: var(--text); font-weight: 700; }
.dz-p th p,
.dz-p td p { margin: 0; }

/* ---------- Сетка-пилюли (симптомы / осложнения) ---------- */
.dz-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 6px;
}
.dz-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  transition: transform .25s var(--ease-out, ease), box-shadow .25s ease;
}
.dz-pill::before {
  content: "";
  flex: 0 0 auto;
  width: 9px; height: 9px;
  border-radius: 50%;
}
.dz-pill:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }

.dz-pill--symptom { background: var(--green-pill); }
.dz-pill--symptom::before { background: var(--green); }
.dz-pill--risk { background: var(--coral-soft); }
.dz-pill--risk::before { background: var(--coral); }

/* ---------- Врачи (reuse spec-card) ---------- */
.dz-doctors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 6px;
}
.dz-doctors .spec-card { cursor: pointer; }

/* ---------- Карточки услуг / анализов ---------- */
.dz-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 6px;
}
.dz-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 132px;
  gap: 24px;
  padding: 24px 24px 22px;
  border-radius: var(--r-lg);
  background: var(--coral-soft, #FFEBE6);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* Violet wash that fades in on hover (matches УЗИ direction cards) */
.dz-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, #7B69D8 0%, #6054B1 60%, #4F44A0 100%);
  opacity: 0;
  transition: opacity 320ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}
.dz-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(96, 84, 177, 0.30);
}
.dz-tile:hover::before { opacity: 1; }
.dz-tile:hover .dz-tile-name { color: #fff; }
.dz-tile:hover .dz-tile-link {
  background: rgba(255, 255, 255, 0.92);
  color: var(--violet);
}
.dz-tile-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
  transition: color 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.dz-tile-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--violet);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  transition: background-color 280ms ease, color 280ms ease;
}
.dz-tile-link svg { display: none; }

.dz-cards-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-light);
}

/* ---------- Предупреждение ---------- */
.dz-warning {
  margin-top: 24px;
  background: linear-gradient(135deg, #6F62C4 0%, #8678D4 55%, #9D8FDE 100%);
  border-radius: var(--r-2xl);
  padding: clamp(28px, 3.4vw, 44px);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: 0 22px 50px rgba(58, 46, 128, .24);
}
.dz-warning-ico {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  color: #fff;
}
.dz-warning p {
  margin: 0;
  font-size: clamp(18px, 1.9vw, 22px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
  text-wrap: balance;
}

/* ---------- Врач (about-doctor) — reused from О клинике ---------- */
.about-doctor { padding-top: var(--section-pad); padding-bottom: var(--section-pad); }
.about-doctor-wrap {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}
.about-doctor-photo {
  border-radius: var(--r-2xl);
  overflow: hidden;
  background: var(--bg-gray-card);
  position: sticky;
  top: 24px;
}
.about-doctor-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-doctor-info h2 { margin: 0 0 18px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 700; letter-spacing: -.02em; }
.about-doctor-meta { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.about-doctor-meta p { margin: 0; font-size: 18px; color: var(--text); }
.about-doctor-meta .role { color: var(--violet); font-weight: 700; }
.about-doctor-info h3 { margin: 0 0 16px; font-size: clamp(20px, 2vw, 24px); font-weight: 700; letter-spacing: -.01em; }
.about-edu { list-style: none; margin: 0 0 26px; padding: 0; border-top: 1px solid #ECE8F3; }
.about-doctor-btn { margin-top: 4px; }
.edu-item {
  position: relative;
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 16px 14px;
  border-bottom: 1px solid #ECE8F3;
  border-radius: 8px;
  transition: background .45s cubic-bezier(.22,1,.36,1);
}
.edu-item::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--violet);
  transform: scaleY(0);
  transform-origin: top center;
  opacity: 0;
  transition: transform .45s cubic-bezier(.22,1,.36,1), opacity .45s ease;
}
.edu-item:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--violet) 6%, transparent), transparent 70%); }
.edu-item:hover::before { transform: scaleY(1); opacity: 1; }
.edu-period { font-size: 14px; font-weight: 700; color: var(--violet); white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 1px; }
.edu-desc { font-size: 15px; line-height: 1.55; color: var(--text); text-wrap: pretty; }
.edu-item.edu-hidden { display: none; }
.about-edu.is-expanded .edu-item.edu-hidden { display: grid; }

.dz-edu-more { margin-top: -8px; }
.link-more {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--violet);
  cursor: pointer;
  padding: 0;
  transition: color .2s ease;
}
.link-more:hover { color: var(--violet-hover); text-decoration: underline; }

/* ---------- Reveal helper for stagger inside content ---------- */
.dz-content .reveal { will-change: transform, opacity; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .dz-layout { grid-template-columns: 1fr; }
  .dz-aside {
    position: static;
    flex-direction: column-reverse;
  }
  .dz-nav { display: none; }
  .dz-doctors { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .dz-pills { grid-template-columns: 1fr; }
  .dz-cards { grid-template-columns: 1fr; }
  .about-doctor-wrap { grid-template-columns: 300px 1fr; gap: 32px; }
  .about-doctor-photo { position: static; }
}
@media (max-width: 640px) {
  .dz-doctors { grid-template-columns: 1fr; }
  .dz-warning { flex-direction: column; align-items: flex-start; text-align: left; }
  .about-doctor-wrap { grid-template-columns: 1fr; }
  .about-doctor-photo { max-width: 340px; }
  .edu-item { grid-template-columns: 1fr; gap: 4px; }
}
