html {
  scroll-behavior: smooth;
}

/* Длинные слова / URL без пробелов — не вылезают за контейнер */
.break-long-text {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Сниппет в списке /articles: перебивает Tailwind Preflight и flex min-width:auto */
.article-list-snippet {
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  word-wrap: break-word !important;
  hyphens: auto !important;
  -webkit-hyphens: auto !important;
  overflow: hidden !important;
}

body {
  background-color: #F9F5F1;
  color: #1A1A1A;
}

.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, visibility;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: none;
}

.glass-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.cta-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.cta-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.cta-button:hover::after {
  left: 100%;
}

#mobile-menu {
  transition: transform 0.3s ease-in-out;
}

/*
 * Контент статей (HTML из Quill).
 * Tailwind CDN подключает Preflight и сбрасывает ul/ol/h — нужны !important и явные правила.
 */
.article-body {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 1.0625rem !important;
  /* Задаётся для каждой статьи в админке: --article-line-height */
  line-height: var(--article-line-height, 1.75) !important;
  color: #1a1a1a !important;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  word-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.article-body > *:first-child {
  margin-top: 0 !important;
}

.article-body h1 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 2rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  margin: 1.5rem 0 0.75rem !important;
  color: #1a1a1a !important;
  display: block !important;
}

.article-body h2 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 1.625rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  margin: 1.35rem 0 0.65rem !important;
  color: #1a1a1a !important;
  display: block !important;
}

.article-body h3 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 1.35rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  margin: 1.15rem 0 0.5rem !important;
  color: #1a1a1a !important;
  display: block !important;
}

.article-body h4 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  margin: 1rem 0 0.5rem !important;
  color: #1a1a1a !important;
  display: block !important;
}

.article-body h5,
.article-body h6 {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  margin: 0.85rem 0 0.4rem !important;
  color: #333 !important;
  display: block !important;
}

.article-body p {
  margin: 0.65rem 0 !important;
  display: block !important;
  line-height: inherit !important;
}

.article-body strong,
.article-body b {
  font-weight: 600 !important;
}

.article-body em,
.article-body i {
  font-style: italic !important;
}

/* Списки: Preflight снимает маркеры — восстанавливаем принудительно */
.article-body ul {
  list-style-type: disc !important;
  list-style-position: outside !important;
  margin: 0.75rem 0 !important;
  padding-left: 1.75rem !important;
  display: block !important;
}

.article-body ol {
  list-style-type: decimal !important;
  list-style-position: outside !important;
  margin: 0.75rem 0 !important;
  padding-left: 1.75rem !important;
  display: block !important;
}

.article-body li {
  margin: 0.35rem 0 !important;
  display: list-item !important;
  list-style: inherit !important;
}

.article-body li > p {
  margin: 0.25rem 0 !important;
}

.article-body li > ul {
  list-style-type: circle !important;
  margin: 0.35rem 0 !important;
}

.article-body li > ul > li > ul {
  list-style-type: square !important;
}

/* Выравнивание Quill (классы на блочных элементах) */
.article-body .ql-align-left {
  text-align: left !important;
}

.article-body .ql-align-center {
  text-align: center !important;
}

.article-body .ql-align-right {
  text-align: right !important;
}

.article-body .ql-align-justify {
  text-align: justify !important;
}

/* На случай inline style от редактора */
.article-body p[style*='text-align: center'],
.article-body h1[style*='text-align: center'],
.article-body h2[style*='text-align: center'],
.article-body h3[style*='text-align: center'] {
  text-align: center !important;
}

.article-body p[style*='text-align: right'],
.article-body h1[style*='text-align: right'],
.article-body h2[style*='text-align: right'],
.article-body h3[style*='text-align: right'] {
  text-align: right !important;
}

/* Отступы абзацев Quill (indent) */
.article-body .ql-indent-1:not(.ql-direction-rtl) {
  padding-left: 3em !important;
}
.article-body .ql-indent-2:not(.ql-direction-rtl) {
  padding-left: 6em !important;
}
.article-body .ql-indent-3:not(.ql-direction-rtl) {
  padding-left: 9em !important;
}
.article-body .ql-indent-4:not(.ql-direction-rtl) {
  padding-left: 12em !important;
}
.article-body .ql-indent-5:not(.ql-direction-rtl) {
  padding-left: 15em !important;
}
.article-body .ql-indent-6:not(.ql-direction-rtl) {
  padding-left: 18em !important;
}
.article-body .ql-indent-7:not(.ql-direction-rtl) {
  padding-left: 21em !important;
}
.article-body .ql-indent-8:not(.ql-direction-rtl) {
  padding-left: 24em !important;
}

.article-body blockquote {
  margin: 1rem 0 !important;
  padding: 0.75rem 1rem !important;
  border-left: 4px solid #d4af37 !important;
  background: rgba(212, 175, 55, 0.08) !important;
  font-style: italic !important;
  color: #4a4a4a !important;
}

.article-body pre,
.article-body .ql-syntax {
  margin: 1rem 0 !important;
  padding: 1rem !important;
  border-radius: 0.5rem !important;
  background: #1a1a1a !important;
  color: #f5f5f5 !important;
  overflow-x: auto !important;
  font-size: 0.9rem !important;
}

.article-body code {
  font-size: 0.9em !important;
  padding: 0.15rem 0.4rem !important;
  border-radius: 0.25rem !important;
  background: #f3f4f6 !important;
}

.article-body pre code {
  padding: 0 !important;
  background: transparent !important;
  color: inherit !important;
}

.article-body a {
  color: #B8860B !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

.article-body a:hover {
  color: #B8860B !important;
}

/* Изображения из редактора */
.article-body img,
.article-body .ql-editor img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 0.5rem !important;
  margin: 1rem auto !important;
  display: block !important;
}

.article-body p img {
  margin-left: auto !important;
  margin-right: auto !important;
}
