/* mobile-first overrides for maiorskikh.ru copy */
@media (max-width: 768px) {
  html { font-size: 16px; }
  body { font-size: 16px; line-height: 1.5; }
  .page-title { font-size: 28px !important; line-height: 1.2 !important; margin-bottom: 18px !important; }
  .first-logo-text { font-size: 20px !important; line-height: 1.25 !important; }
  .first-logo-text p { font-size: 16px !important; margin-top: 10px !important; }
  .about-lead { font-size: 16px !important; line-height: 1.55 !important; }
  .about-lead b { font-size: 17px !important; }
  .page h2, .page h3, #service .page-title, #review .page-title, #article .page-title { font-size: 26px !important; line-height: 1.2 !important; margin-bottom: 18px !important; }
  .sd-features-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 16px !important; }
  .sd-feature-new { font-size: 15px !important; padding: 16px !important; }
  .sd-feature-new strong { font-size: 17px !important; }
  .idx-sc-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 16px !important; }
  .service-card { font-size: 15px !important; padding: 16px !important; }
  .service-card p { font-size: 18px !important; margin-bottom: 8px !important; }
  .content-wrapper { padding: 0 10px !important; }
  .about-main { padding-top: 0 !important; }
  .about-results { margin-top: 18px !important; padding: 16px !important; }
  .review-item, .article { margin-bottom: 12px !important; }
  /* .article-name{15px!important} снят: размер заголовка карточки задаётся в блоке сетки статей ниже */
  .footer-wrapper { padding: 16px !important; }
  .footer { flex-direction: column !important; gap: 8px !important; text-align: center !important; font-size: 14px !important; }
  .article-all { padding: 10px 18px !important; font-size: 14px !important; }
}

@media (max-width: 768px) {
  .brain-widget { right: 16px; bottom: 16px; }
  .brain-bubble { width: 96px; height: 96px; }
  .brain-bubble img { width: 76px; height: 76px; }
  .brain-bubble .bolts { width: 116px; height: 116px; inset: -10px; }
  .bubble-label { font-size: 8px; bottom: -14px; }
  .chat-window {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    backdrop-filter: blur(20px);
  }
  .brain-widget:has(.chat-window.is-open) .brain-bubble { display: none; }
}

@media (max-width: 768px) {

}
.seo-h1{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ==== Секция статей на главной: градиенты карточек классами, не инлайном (16.08.2026) ==== */
.article--g1 { background-image: linear-gradient(135deg, #1f2a44 0%, #A424F4 100%); }
.article--g2 { background-image: linear-gradient(135deg, #2b1b3d 0%, #4a6fd8 100%); }
.article--g3 { background-image: linear-gradient(135deg, #14304a 0%, #7b2ff7 100%); }
.article--g4 { background-image: linear-gradient(135deg, #33224f 0%, #1f8ac0 100%); }

/* ============================================================
   Сетка карточек «Статьи» на главной (16.08.2026)
   Было: bootstrap-колонки col-sm-12/col-lg-4 держали одну колонку вплоть до 992px
   (на планшете 768 карточка вырождалась в полосу 671x220), а flex justify-content:flex-end
   из bureau.css сваливал дату, тег и заголовок в кучу к нижней кромке - верх карточки пустой.
   Стало: собственная grid-сетка 1 / 2 / 3 колонки (mobile-first) и раскладка внутри карточки:
   дата слева сверху, тег-чип справа сверху, заголовок прижат к низу, высоты в ряду равны.
   Механизм фона (inline background-image из include/content/index.php) не трогаем.
   ============================================================ */

/* --- сетка секции: 1 колонка -> 2 (>=576) -> 3 (>=992) --- */
#article .idx-articles-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: stretch;
  margin: 0;
  padding: 0;
}
@media (min-width: 576px) {
  #article .idx-articles-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
  #article .idx-articles-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
}

/* bootstrap-колонки внутри грида - обычные ячейки; ширина и .pd10 снимаются */
#article .idx-articles-row > [class*="col-"] {
  display: flex;
  flex: none;
  width: auto;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0 !important; /* .pd10{padding:10px!important} из template_styles - иначе гуттер задваивается */
}
#article .idx-articles-row > [class*="col-"] > a {
  display: flex;
  width: 100%;
  text-decoration: none;
}

/* --- карточка: тянется на всю ячейку, содержимое распределено по трём полосам --- */
#article .idx-articles-row .article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  column-gap: var(--space-3);
  row-gap: var(--space-3);
  width: 100%;
  height: 100%;
  min-height: 220px;
  margin: 0 !important; /* .article{margin-bottom:12px!important} из мобильного блока выше - отступы даёт gap */
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition: border-color var(--transition-base), transform var(--transition-base);
}
/* на планшете колонка узкая (карточка ~328px): поля и зазор чуть меньше десктопных,
   иначе самый длинный тег «#152-ФЗ, Инструкция» (162px) не влезает в дорожку и жуётся многоточием */
@media (min-width: 576px) {
  #article .idx-articles-row .article { min-height: 240px; padding: 20px; column-gap: var(--space-2); }
}
@media (min-width: 992px) {
  #article .idx-articles-row .article { min-height: 264px; padding: var(--space-5); column-gap: var(--space-3); }
}

/* скрим: верх заметно темнее прежнего (было 0.1) - дата и тег читаются на светлых обложках */
#article .idx-articles-row .article::before {
  padding: 0;
  background: linear-gradient(180deg,
    rgba(10, 10, 15, 0.58) 0%,
    rgba(10, 10, 15, 0.20) 45%,
    rgba(10, 10, 15, 0.92) 100%);
  transition: background var(--transition-base);
}

/* --- дата: левый верх, без плашки (кислотную пилюлю шаблона убрали раньше) --- */
#article .idx-articles-row .article-date {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.2;
  letter-spacing: .02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

/* --- тег: правый верх, читаемый чип на плотной подложке --- */
#article .idx-articles-row .article-tag {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  max-width: 100%;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid rgba(61, 216, 232, 0.45);
  border-radius: 50px;
  background:
    linear-gradient(rgba(61, 216, 232, 0.16), rgba(61, 216, 232, 0.16)),
    rgba(10, 10, 15, 0.62);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--transition-base), background-color var(--transition-base);
}

/* --- заголовок: низ карточки, максимум 5 строк (страховка, чтобы один длинный не раздул ряд;
       нынешним заголовкам хватает: максимум 5 строк на планшете, 4 на мобиле и десктопе) --- */
#article .idx-articles-row .article-name {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: end;
  margin: 0;
  font-family: var(--font-display), sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color: var(--text-primary);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 576px) {
  #article .idx-articles-row .article-name { font-size: 17px; }
}
@media (min-width: 992px) {
  #article .idx-articles-row .article-name { font-size: 18px; }
}

/* --- ховер: лёгкий, как у карточек команды и услуг (бордер-акцент + подъём, без тени) --- */
#article .idx-articles-row .article:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
#article .idx-articles-row .article:hover::before {
  background: linear-gradient(180deg,
    rgba(10, 10, 15, 0.50) 0%,
    rgba(10, 10, 15, 0.12) 45%,
    rgba(10, 10, 15, 0.88) 100%);
}
#article .idx-articles-row .article:hover .article-tag {
  border-color: var(--accent);
  background:
    linear-gradient(rgba(61, 216, 232, 0.26), rgba(61, 216, 232, 0.26)),
    rgba(10, 10, 15, 0.62);
}


/* Широкая плашка услуги НАД сеткой карточек (27.08.2026). Блок и классы те же, что у
   «Сложных интеграций» внизу страницы. Там плашка идёт последней, поэтому отступ у неё
   задан только сверху; первой в ряду ей нужен отступ и снизу. Кнопка внутри - существующий
   .ai-hero-btn, ему нужен отступ от текста плашки. Новых классов правило не вводит. */
.integrations-feature .ai-hero-btn { margin-top: var(--space-3); }
.integrations-feature-link + .service-cards { margin-top: var(--space-6); }
.integrations-feature-link + .idx-sc-grid { margin-top: var(--space-4); }
