/* Базовые стили блога (по мотивам Cleverence Docusaurus custom.css) */
:root {
  --cleverence-primary: #0083b0;
  --cleverence-primary-dark: #00759d;
  --cleverence-text: #1a1a2e;
  --cleverence-muted: #5c6370;
  --cleverence-bg: #ffffff;
  /* Как .container в подвале — одна ширина контентной области */
  --cleverence-max-width: 1140px;
  /* Превью ленты / похожие: стандартное 16:9 (близко к старым обложкам Bitrix) */
  --cleverence-preview-aspect-ratio: 16 / 9;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--cleverence-text);
  background: var(--cleverence-bg);
}

.page-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Верхняя панель в духе Docusaurus (.navbar--fixed-top, .navbar__brand, .navbar__logo) */
.site-navbar {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 200;
  height: 60px;
  display: flex;
  align-items: stretch;
  background: var(--cleverence-bg);
  border-bottom: 1px solid #dadde1;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.site-navbar__inner {
  width: 100%;
  max-width: var(--cleverence-max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
}

.site-navbar__left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.site-navbar__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  margin-right: 1rem;
}

.site-navbar__brand:hover {
  opacity: 0.9;
}

.site-navbar__logo {
  display: flex;
  align-items: center;
  line-height: 0;
}

.site-navbar__logo-img {
  display: block;
  width: 220px;
  height: auto;
  max-height: 36px;
  object-fit: contain;
  object-position: left center;
}

@media (max-width: 576px) {
  .site-navbar__logo-img {
    width: min(220px, 58vw);
    max-height: 32px;
  }
}

.page-main {
  flex: 1;
  width: 100%;
  max-width: var(--cleverence-max-width);
  margin: 0 auto;
  /* Горизонтальные отступы как у .container в подвале */
  padding: 1.5rem 1rem 3rem;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1rem;
}

img {
  max-width: 100%;
  height: auto;
}

.article-content__img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem auto;
}

a {
  color: var(--cleverence-primary);
}

a:hover {
  color: var(--cleverence-primary-dark);
}

/* Типографика статей (Markdown / HTML из Bitrix) */
.article .content,
.article-html {
  font-size: 1.05rem;
}

.article .content h2,
.article-html h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.article .content h3,
.article-html h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.article .content p,
.article-html p {
  margin: 0.75rem 0;
}

.article .content table,
.article-html table {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.article .content th,
.article .content td,
.article-html th,
.article-html td {
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

.article .content th,
.article-html th {
  background: #f4f6f8;
}

/* Ленты (ширину задаёт .page-main) */
.sections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.article-feed {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-feed__item {
  padding: 0.65rem 0;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.article-feed__item time {
  color: var(--cleverence-muted);
  font-size: 0.875rem;
}

.nav-crumb {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--cleverence-muted);
}

.nav-crumb a {
  color: var(--cleverence-primary);
  text-decoration: none;
}

/* Баннер cookies перед футером: показываем только новым посетителям */
.cookie-consent {
  position: relative;
  transform: translateY(8px);
  width: min(760px, calc(100% - 24px));
  margin: 0 auto 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cookie-consent--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (min-width: 997px) {
  .cookie-consent.cookie-consent--in-toc {
    position: fixed;
    width: auto;
    max-width: none;
    margin: 0;
    transform: translateY(0);
    z-index: 1200;
  }

  .cookie-consent.cookie-consent--in-toc .cookie-consent__inner {
    border-radius: 12px 0 0 12px;
  }

  .cookie-consent.cookie-consent--desktop-fixed {
    position: fixed;
    right: 16px;
    bottom: 14px;
    margin: 0;
    width: min(360px, calc(100% - 24px));
    z-index: 1200;
    transform: translateY(0);
  }
}

.cookie-consent__inner {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #e6e9ef;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  padding: 12px 14px;
}

.cookie-consent__title {
  font-size: 14px;
  font-weight: 600;
  color: #101828;
  margin: 0 0 6px;
}

.cookie-consent__text {
  margin: 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.45;
}

.cookie-consent__text a {
  color: var(--cleverence-primary);
  word-break: break-word;
}

.cookie-consent__btn {
  margin-top: 10px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #344054;
  border-radius: 8px;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  cursor: pointer;
}

.cookie-consent__btn:hover {
  border-color: #b9c1cf;
  background: #f8fafc;
}

/* Виджет «Готовые решения» — shortcode {{< solutions-promo >}} */
.clv-spromo {
  margin: 2rem 0;
  padding: 1.25rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafbfc;
}

.clv-spromo__heading {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  color: #111827;
}

.clv-spromo__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .clv-spromo__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .clv-spromo__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.clv-spromo-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  margin: 0;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.clv-spromo-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.clv-spromo-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.clv-spromo-card__title a {
  color: #1d4ed8;
  text-decoration: none;
}

.clv-spromo-card__title a:hover {
  text-decoration: underline;
}

.clv-spromo-card__ico {
  flex-shrink: 0;
  line-height: 0;
}

.clv-spromo-card__ico img,
.clv-spromo-card__img {
  display: block;
  width: 56px;
  height: auto;
  max-height: 62px;
  object-fit: contain;
}

.clv-spromo-card__text {
  flex: 1 1 auto;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #374151;
}

.clv-spromo-card__btn {
  align-self: flex-start;
  display: inline-block;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  text-decoration: none;
  background: #fff;
}

.clv-spromo-card__btn:hover {
  background: #f0f9ff;
}

@media (max-width: 576px) {
  .clv-spromo__grid .clv-spromo-card:nth-child(n + 4) {
    display: none;
  }
}

/*
 * Виджет внутри статьи: partial article-inline-images подставляет cleverence.ru img
 * как .article-content__img (margin: 1rem auto), а типографика .article .content h3/p
 * даёт лишние отступы — сброс только внутри .clv-spromo.
 */
.article .content .clv-spromo .clv-spromo-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.article .content .clv-spromo .clv-spromo-card__text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.article .content .clv-spromo .clv-spromo-card__ico .article-content__img,
.article .content .clv-spromo .clv-spromo-card__ico img,
.article .content .clv-spromo .clv-spromo-card__img {
  margin: 0;
  display: block;
  width: 56px;
  max-width: 56px;
  height: auto;
  max-height: 62px;
  object-fit: contain;
}
