/* ============ База ============ */
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background-color: #f1f5f9;
  background-image:
    radial-gradient(at 15% 0%,   rgba(2, 132, 199, 0.07) 0px, transparent 55%),
    radial-gradient(at 90% 15%,  rgba(56, 189, 248, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(15, 23, 42, 0.04) 0px, transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Отступ под шапку при переходе по анкорам */
[id] { scroll-margin-top: 76px; }

/* ============ Sticky-шапка с блюром ============ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 6px 24px -14px rgba(15, 23, 42, 0.18);
}

.site-nav__inner {
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav__brand {
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.95rem;
  line-height: 1.25;
  flex-shrink: 0;
  transition: color 0.2s;
}
.site-nav__brand:hover { color: #0369a1; }

/* Три варианта подписи — переключаются по ширине экрана */
.brand-full,
.brand-mid,
.brand-short { display: none; }

.brand-full { display: inline; }

.brand-mid-sub {
  display: inline-block;
  font-weight: 500;
  font-size: 0.82rem;
  color: #475569;
}

@media (max-width: 1399px) {
  .brand-full { display: none; }
  .brand-mid  { display: inline-block; }
}

@media (max-width: 1023px) {
  .site-nav__inner { padding: 0.6rem 1.1rem; gap: 0.9rem; }
  .site-nav__brand { font-size: 0.9rem; }
  .brand-mid-sub   { font-size: 0.78rem; }
}

@media (max-width: 767px) {
  .brand-mid   { display: none; }
  .brand-short { display: inline; }
  .site-nav__inner { padding: 0.6rem 1rem; gap: 0.6rem; }
  .site-nav__brand { font-size: 0.95rem; }
}

/* Горизонтальное меню ссылок (desktop / tablet) */
.site-nav__links {
  display: flex;
  gap: 0.15rem;
  flex: 1;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.site-nav__links::-webkit-scrollbar { display: none; }
.site-nav__links a {
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.site-nav__links a:hover {
  background: rgba(2, 132, 199, 0.1);
  color: #0369a1;
}
.site-nav__links a.site-nav__cta {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: #fff;
  font-weight: 600;
  margin-left: 0.35rem;
  box-shadow: 0 6px 16px -8px rgba(3, 105, 161, 0.6);
}
.site-nav__links a.site-nav__cta:hover {
  background: linear-gradient(135deg, #075985 0%, #0c4a6e 100%);
  color: #fff;
}

@media (max-width: 1023px) {
  .site-nav__links a { padding: 0.4rem 0.55rem; font-size: 0.78rem; }
}

@media (max-width: 767px) {
  .site-nav__links { display: none; }
}

/* Кнопка-гамбургер (только на мобилке) */
.site-nav__burger {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  font-family: inherit;
}
.site-nav__burger:hover { background: #f1f5f9; border-color: rgba(2, 132, 199, 0.35); }
.site-nav__burger:active { transform: scale(0.97); }
.site-nav__burger span[aria-hidden] { font-size: 1.05rem; line-height: 1; }

@media (max-width: 767px) {
  .site-nav__burger { display: inline-flex; }
}

/* Выпадающая мобильная панель */
.site-nav__mobile {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 1rem 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.site-nav__mobile[hidden] { display: none !important; }
.site-nav__mobile a {
  padding: 0.85rem 0.9rem;
  border-radius: 0.6rem;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.site-nav__mobile a:hover,
.site-nav__mobile a:active {
  background: rgba(2, 132, 199, 0.08);
  color: #0369a1;
}
.site-nav__mobile a.site-nav__cta {
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: #fff;
  font-weight: 600;
  text-align: center;
}
.site-nav__mobile a.site-nav__cta:hover {
  background: linear-gradient(135deg, #075985 0%, #0c4a6e 100%);
  color: #fff;
}

/* ============ Плавное появление/растворение блоков (в обе стороны) ============ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.is-below {
  opacity: 0;
  transform: translateY(30px);
}

.reveal.is-above {
  opacity: 0;
  transform: translateY(-30px);
}

.reveal-delay-1 { transition-delay: 0.18s; }
.reveal-delay-2 { transition-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .reveal.is-below,
  .reveal.is-above {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============ Универсальная карточка ============ */
.site-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 14px 36px -18px rgba(15, 23, 42, 0.18);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.site-card:hover {
  border-color: rgba(2, 132, 199, 0.18);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 26px 54px -22px rgba(2, 132, 199, 0.28);
  transform: translateY(-2px);
}

/* ============ Кнопка VK — пульсирующий градиент + блик ============ */
.btn-vk {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 2.2rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: #fff;
  border-radius: 9999px;
  background: linear-gradient(135deg, #0077FF 0%, #4C75A3 45%, #0077FF 100%);
  background-size: 200% 200%;
  box-shadow: 0 10px 26px -8px rgba(0, 119, 255, 0.55);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  animation:
    vk-gradient 3s ease infinite,
    vk-pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.btn-vk::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: vk-shine 3.6s ease-in-out infinite;
  pointer-events: none;
}
.btn-vk:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 18px 40px -10px rgba(0, 119, 255, 0.65);
}
.btn-vk:active { transform: translateY(0) scale(0.99); }

@keyframes vk-gradient {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes vk-pulse {
  0%   { box-shadow: 0 10px 26px -8px rgba(0, 119, 255, 0.55), 0 0 0 0 rgba(0, 119, 255, 0.55); }
  70%  { box-shadow: 0 10px 26px -8px rgba(0, 119, 255, 0.55), 0 0 0 18px rgba(0, 119, 255, 0); }
  100% { box-shadow: 0 10px 26px -8px rgba(0, 119, 255, 0.55), 0 0 0 0 rgba(0, 119, 255, 0); }
}
@keyframes vk-shine {
  0%   { transform: translateX(-120%); }
  55%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-vk, .btn-vk::before { animation: none; }
}

/* ============ Блок «Хроническое заболевание» ============ */
.disease-alert {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 1rem;
  border-left: 4px solid #dc2626;
  background:
    radial-gradient(at 100% 0%,   rgba(220, 38, 38, 0.10)  0px, transparent 55%),
    radial-gradient(at 0% 100%,   rgba(59, 130, 246, 0.08)  0px, transparent 55%),
    linear-gradient(135deg, rgba(254, 242, 242, 0.85) 0%, rgba(248, 250, 252, 0.7) 100%);
  box-shadow:
    0 24px 48px -28px rgba(220, 38, 38, 0.32),
    0 1px 2px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
}
.disease-alert::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 20% 30%, rgba(220, 38, 38, 0.08), transparent 45%);
  animation: disease-breathe 4s ease-in-out infinite;
}
@keyframes disease-breathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

.disease-title {
  position: relative;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 45%, #e11d48 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation:
    warning-gradient 3.5s ease infinite,
    warning-glow 2.6s ease-in-out infinite;
}
@keyframes warning-gradient {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes warning-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(220, 38, 38, 0)); }
  50%      { filter: drop-shadow(0 0 14px rgba(220, 38, 38, 0.4)); }
}
@media (prefers-reduced-motion: reduce) {
  .disease-title, .disease-alert::before { animation: none; }
}

.disease-text {
  position: relative;
  color: #334155;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.disease-text:last-child { margin-bottom: 0; }
.disease-text strong { color: #b91c1c; }

/* ============ details / FAQ ============ */
details summary::-webkit-details-marker { display: none; }
details summary { list-style: none; }
details summary::after {
  content: '+';
  float: right;
  color: #0369a1;
  font-weight: bold;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.25s ease;
}
details[open] summary::after { content: '−'; }

/* ============ Прочее ============ */
.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prose img { border-radius: 0.75rem; margin: 1.5rem 0; }

/* ============ Лайтбокс для галереи ============ */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}
.lightbox-overlay.is-open { display: flex; }
.lightbox-overlay img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  cursor: default;
  animation: lightbox-in 0.2s ease-out;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10000;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  max-width: 90vw;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
}
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.gallery-lightbox img { cursor: zoom-in; }