/* ============================================================
   pages/docs.css — общая стилизация для юридических страниц:
   oferta.html, privacy.html, pdn.html.
   Узкая колонка текста, шаблонный warning-баннер, аккуратная типографика.
   ============================================================ */

.doc {
  padding-block: 32px 64px;
}

.doc__inner {
  max-width: 760px;
  margin: 0 auto;
}

.doc__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  transition: color 0.2s ease-out;
}
.doc__back:hover,
.doc__back:focus-visible {
  color: var(--color-primary-hover);
}

.doc__title {
  color: var(--color-text-main);
  margin: 0 0 24px;
}

/* Warning-баннер шаблонного текста */
.doc__notice {
  margin: 0 0 32px;
  padding: 16px 20px;
  background-color: #FFF8E1;
  border-left: 4px solid #F5B300;
  border-radius: 6px;
  color: #5C4400;
  font-size: 14px;
  line-height: 1.5;
}
.doc__notice strong {
  display: block;
  margin-bottom: 4px;
  font-weight: var(--fw-bold);
  color: #5C4400;
}

/* Контент документа */
.doc__content h2 {
  margin: 32px 0 12px;
  color: var(--color-text-main);
  font-size: 22px;
  line-height: 1.3;
  font-weight: var(--fw-semibold);
}
.doc__content h2:first-of-type {
  margin-top: 0;
}
.doc__content h3 {
  margin: 20px 0 8px;
  color: var(--color-text-main);
  font-size: 18px;
  line-height: 1.3;
  font-weight: var(--fw-semibold);
}
.doc__content p {
  margin: 0 0 12px;
  color: var(--color-text-main);
  font-size: 16px;
  line-height: 1.6;
}
.doc__content ul,
.doc__content ol {
  margin: 0 0 16px 24px;
  padding: 0;
  list-style: disc;
  color: var(--color-text-main);
  font-size: 16px;
  line-height: 1.6;
}
.doc__content ol {
  list-style: decimal;
}
.doc__content li {
  margin-bottom: 6px;
}
.doc__content li:last-child {
  margin-bottom: 0;
}
.doc__content strong {
  font-weight: var(--fw-semibold);
}

/* Реквизиты блока */
.doc__requisites {
  margin-top: 24px;
  padding: 16px 20px;
  background-color: var(--color-bg-elements);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}
.doc__requisites dt {
  font-weight: var(--fw-semibold);
  color: var(--color-text-main);
  margin-top: 8px;
}
.doc__requisites dt:first-child {
  margin-top: 0;
}
.doc__requisites dd {
  margin: 0 0 0;
  color: var(--color-text-secondary);
}

@media (min-width: 768px) {
  .doc {
    padding-block: 40px 80px;
  }
  .doc__title {
    margin-bottom: 28px;
  }
  .doc__content p,
  .doc__content ul,
  .doc__content ol {
    font-size: 17px;
  }
  .doc__content h2 {
    font-size: 26px;
    margin-top: 40px;
  }
}

@media (min-width: 1025px) {
  .doc {
    padding-block: 56px 96px;
  }
}

/* ============================================================
   Финальные анимации для doc-страниц
   ============================================================ */

/* Заголовок документа — fade-in сверху */
.doc__title {
  animation: docTitleIn 0.5s ease-out;
}
@keyframes docTitleIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Warning-баннер — slide-down + лёгкая пульсация тени для привлечения внимания */
.doc__notice {
  animation: docNoticeSlide 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both,
             docNoticeShadowPulse 3s ease-in-out 1s infinite;
}
@keyframes docNoticeSlide {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes docNoticeShadowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 179, 0, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(245, 179, 0, 0.15); }
}

/* Back-link «← Вернуться на главную» — стрелка сдвигается при hover */
.doc__back {
  transition: color 0.2s ease-out;
}
.doc__back::first-letter {
  display: inline-block;
  transition: transform 0.2s ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .doc__back:hover::first-letter {
    transform: translateX(-3px);
  }
}

/* H2 + p в контенте — простой fade-in при скролле через fade-in-up класс,
   но в нашей разметке h2/p не имеют этого класса. Делаем CSS-only fallback:
   просто плавно появляются через прокрутку — без IntersectionObserver. */
.doc__content h2,
.doc__content h3 {
  position: relative;
}
.doc__content h2::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 0.4em;
  height: 0.7em;
  width: 3px;
  background-color: var(--color-primary);
  opacity: 0;
  transform: scaleY(0);
  transform-origin: top center;
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.doc__content h2:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

@media (prefers-reduced-motion: reduce) {
  .doc__title,
  .doc__notice,
  .doc__back::first-letter,
  .doc__content h2::before {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
