
/* ═══════════════════════════════════════════════════════
   CLS FIXES & PERFORMANCE — добавлено 2026-03-17
   ═══════════════════════════════════════════════════════ */

/* Резервируем место для изображений без размеров */
img {
  height: auto;
}

/* Стабилизируем слайдеры до загрузки JS */
.slick-slider:not(.slick-initialized),
.flexslider:not(.flexslider-loaded) {
  min-height: 300px;
}

/* Резервируем место для каталога проектов */
.cat-item-wrap,
.slide_proj {
  aspect-ratio: 530 / 330;
}

/* Резервируем место для секции с фоном */
.home .section1 {
  min-height: 600px;
}

/* Стабилизируем YouTubeEmbeds */
iframe[src*="youtube"] {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}

/* Убираем layout shift от шрифта slick */
.slick-prev:before,
.slick-next:before {
  font-display: swap;
}

/* Фикс для кнопок и динамических элементов */
.btn, button, a.btn {
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════
   Hero WebP + mobile optimization
   ═══════════════════════════════════════════════════════ */

/* Desktop: WebP hero */
.home .section1 {
  background-image: url(../img/block1/back_d.jpg.webp);
}

/* Mobile: меньший WebP для LCP */
@media (max-width: 768px) {
  .home .section1 {
    background-image: url(../img/block1/back_d_mobile.webp);
    height: auto !important;
    min-height: 480px;
  }
}

/* ═══════════════════════════════════════════════════════
   Резервируем размеры для иконок hero-секции
   ═══════════════════════════════════════════════════════ */

/* Иконки в hero-блоке */
.bullit_b1 li .ico {
  min-width: 40px;
  min-height: 35px;
}

/* Акции/промо изображения */
.promod .img img {
  display: block;
  aspect-ratio: 961 / 312;
  width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════════════════════
   Telegram контакт
   ═══════════════════════════════════════════════════════ */

.contacts .telegram {
  background: url(../img/telegram.png) no-repeat left 4px;
}

.contacts .telegram a {
  color: #1a1a1a;
  text-decoration: underline;
}

.contacts .telegram a:hover {
  text-decoration: none;
  color: #2aabee;
}

/* ═══════════════════════════════════════════════════════
   БЛОГ — archive-stati.php & single-stati.php
   ═══════════════════════════════════════════════════════ */

/* Убираем фоновое изображение дома, ставим светлый фон */
.page_stati .fon_text,
.single_stati .fon_text {
  background: #f5f6f8 !important;
}

/* ── Шапка внутренних страниц блога ── */
.page_stati .section1,
.single_stati .section1 {
  padding-top: 120px;
  padding-bottom: 30px;
  min-height: auto !important;
}
.page_stati .section1 h1,
.single_stati .section1 h1 {
  font-size: 34px;
  margin: 8px 0 0;
  line-height: 1.3;
}
.section1_sub {
  color: rgba(255,255,255,0.85);
  margin: 8px 0 0;
  font-size: 16px;
}

/* ── Секция архива ── */
.stati_section {
  padding: 48px 0 64px;
  background: #f5f6f8;
}

/* ── Сетка ── */
.stati_grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Карточка ── */
.stati_card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.stati_card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.13);
  transform: translateY(-3px);
}

/* Фото карточки */
.stati_card__img_wrap {
  display: block;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.stati_card__img_wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
  display: block;
}
.stati_card:hover .stati_card__img_wrap img { transform: scale(1.05); }
.stati_card__img_placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #e4e9f0 0%, #c9d3e0 100%);
}

/* Тело карточки */
.stati_card__body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.stati_card__meta {
  display: flex;
  gap: 12px;
  margin-bottom: 9px;
  align-items: center;
}
.stati_card__date,
.stati_card__time {
  font-size: 13px;
  color: #999;
  white-space: nowrap;
}

/* Заголовок карточки */
.stati_card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 10px;
  flex: 1;
}
.stati_card__title a {
  color: #1a1a1a;
  text-decoration: none;
}
.stati_card__title a:hover { color: #e85d04; }

/* Выдержка */
.stati_card__excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stati_card__excerpt p { margin: 0; }

/* Кнопка */
.stati_card__btn {
  display: inline-block;
  margin-top: auto;
  padding: 9px 18px;
  background: #e85d04;
  color: #fff !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .2s;
  align-self: flex-start;
  white-space: nowrap;
}
.stati_card__btn:hover { background: #c94d00; }

/* Пагинация */
.stati_pagination {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.stati_pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #dde2ea;
  color: #333;
  text-decoration: none;
  font-size: 15px;
  transition: all .2s;
}
.stati_pagination .page-numbers:hover,
.stati_pagination .page-numbers.current {
  background: #e85d04;
  border-color: #e85d04;
  color: #fff;
}

/* Пустой список */
.stati_empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  font-size: 16px;
  padding: 80px 0;
}

/* ══════════════════════════════════
   Страница статьи (single-stati)
   ══════════════════════════════════ */

/* Обёртка контента — простой responsive контейнер */
.stati_article_wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 20px 56px;
  box-sizing: border-box;
  width: 100%;
  background: #fff;
}

/* Мета: дата + время чтения */
.stati_article_meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #999;
}

/* H1 статьи */
.single_stati h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.3;
  color: #1a1a1a;
  margin: 0 0 22px;
  word-break: break-word;
}

/* Hero-фото */
.stati_article_img {
  margin: 0 0 28px;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}
.stati_article_img img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 480px;
  object-fit: cover;
  border-radius: 10px;
}

/* Контент статьи */
.stati_article_content {
  font-size: 16px;
  line-height: 1.8;
  color: #2d2d2d;
  overflow-wrap: break-word;
  word-break: break-word;
}
.stati_article_content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: #1a1a1a;
  line-height: 1.3;
}
.stati_article_content h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
  color: #1a1a1a;
}
.stati_article_content p {
  margin: 0 0 16px;
}
.stati_article_content ul {
  list-style: disc;
  margin: 0 0 18px;
  padding-left: 22px;
}
.stati_article_content ol {
  list-style: decimal;
  margin: 0 0 18px;
  padding-left: 22px;
}
.stati_article_content li {
  margin-bottom: 8px;
  line-height: 1.65;
}
.stati_article_content strong { color: #111; }
.stati_article_content a { color: #e85d04; }
.stati_article_content a:hover { text-decoration: none; }
.stati_article_content blockquote {
  border-left: 4px solid #e85d04;
  margin: 20px 0;
  padding: 14px 18px;
  background: #fff8f5;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: #555;
  box-sizing: border-box;
}
.stati_article_content img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 16px 0;
  box-sizing: border-box;
}
.stati_article_content .article_cta {
  display: block;
  text-align: center;
  padding: 14px 20px;
  background: #e85d04;
  color: #fff !important;
  border-radius: 6px;
  font-weight: 700;
  font-size: 16px;
  margin: 24px 0;
  text-decoration: none !important;
  transition: background .2s;
  box-sizing: border-box;
  width: 100%;
}
.stati_article_content .article_cta:hover { background: #c94d00; }

/* Кнопка назад */
.stati_article_back {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #e8edf3;
}
.stati_article_back a {
  color: #e85d04;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
}
.stati_article_back a:hover { text-decoration: underline; }

/* Раздел похожих статей */
.stati_related {
  padding: 44px 0 56px;
  background: #f5f6f8;
}
.stati_related h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px;
  color: #1a1a1a;
}

/* ══════════════════════════════════
   АДАПТИВ
   ══════════════════════════════════ */

/* Планшет */
@media only screen and (max-width: 1100px) {
  .stati_grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

/* Мобильный (основной брейкпоинт сайта 768px) */
@media only screen and (max-width: 768px) {

  /* Шапка блога/статьи */
  .page_stati .section1,
  .single_stati .section1 {
    padding-top: 80px;
    padding-bottom: 10px;
  }
  .section1_sub { font-size: 14px; }

  /* Хлебные крошки — перенос */
  .breadcrumbs ul { flex-wrap: wrap; }
  .breadcrumbs ul li { font-size: 12px; white-space: normal; }

  /* Сетка → 1 колонка */
  .stati_grid { grid-template-columns: 1fr; gap: 14px; }

  /* Карточки горизонтальные */
  .stati_card { flex-direction: row; align-items: stretch; }
  .stati_card__img_wrap {
    width: 110px;
    min-width: 110px;
    aspect-ratio: auto;
    min-height: 110px;
    border-radius: 0;
  }
  .stati_card__img_placeholder {
    width: 110px;
    min-width: 110px;
    min-height: 110px;
    aspect-ratio: auto;
  }
  .stati_card__body { padding: 12px 14px 14px; }
  .stati_card__title { font-size: 13px; margin-bottom: 8px; }
  .stati_card__excerpt { display: none; }
  .stati_card__meta { margin-bottom: 5px; }
  .stati_card__btn { padding: 6px 12px; font-size: 12px; }

  /* Страница статьи */
  .stati_article_wrap { padding: 20px 16px 40px; }
  .single_stati h1 { font-size: 20px; margin-bottom: 16px; }
  .stati_article_meta { font-size: 13px; gap: 8px; margin-bottom: 10px; }
  .stati_article_img { margin-bottom: 18px; border-radius: 6px; }
  .stati_article_img img { max-height: 220px; border-radius: 6px; }
  .stati_article_content { font-size: 15px; line-height: 1.72; }
  .stati_article_content h2 { font-size: 17px; margin: 22px 0 10px; }
  .stati_article_content h3 { font-size: 15px; margin: 16px 0 8px; }
  .stati_article_content blockquote { padding: 10px 14px; }
  .stati_article_content ul,
  .stati_article_content ol { padding-left: 18px; }

  /* Похожие статьи */
  .stati_related { padding: 28px 0 36px; }
  .stati_related h2 { font-size: 18px; margin-bottom: 16px; }
  .stati_related .stati_grid { grid-template-columns: 1fr; }
  .stati_related .stati_card { flex-direction: row; }

  /* section9 — фикс горизонтального переполнения на мобиле */
  .section9 .foto_ofice_wrap {
    width: 100%;
    max-width: 340px;
    height: auto;
    min-height: 215px;
  }
  .section9 .foto_ofice_wrap .foto_ofice_w {
    width: 100%;
    height: 215px;
  }
  .section9 .ulli { width: 100%; }
}

/* Маленькие телефоны */
@media only screen and (max-width: 420px) {
  .stati_card__img_wrap,
  .stati_card__img_placeholder { width: 90px; min-width: 90px; }
  .single_stati h1 { font-size: 18px; }
  .stati_article_content { font-size: 14px; }
  .stati_article_wrap { padding: 16px 14px 32px; }
}
