/* p-os-v1 — стили блоков Progressive CMS поверх исходной вёрстки сайта.
   Только презентация блоков, которых нет в исходном CSS. */

/* --- Блоки: база --- */
.block { margin: 0 0 24px; }
.block-heading { margin-top: 32px; }

/* --- Слайдер на главной: слайды приходят блоками text@1 (variant slide).
   Исходный CSS вешает оформление на .sl-* классы — повторяем его
   для тегов, которые даёт rich text. --- */
.rs-slider.style1 .slider-content h4 { font-size: 40px; line-height: 45px; font-weight: 600; color: #fff; margin-bottom: 25px; }
.rs-slider.style1 .slider-content h2 { font-size: 100px; line-height: 84px; font-weight: 700; color: #fff; margin-bottom: 40px; }
.rs-slider.style1 .slider-content p  { font-size: 20px; line-height: 28px; font-weight: 500; color: #fff; margin-bottom: 40px; }
.rs-slider.style1 .slider-content ul { margin-bottom: 40px; padding: 0; list-style: none; }
.rs-slider.style1 .slider-content ul li { display: inline-block; margin-right: 30px; }
.rs-slider.style1 .slider-content ul li:last-child { margin-right: 0; }
.rs-slider.style1 .slider-content ul li a {
  padding: 15px 35px; background: #106eea; color: #fff; display: inline-block;
  border-radius: 5px; text-transform: capitalize; transition: all .5s;
}
.rs-slider.style1 .slider-content ul li a:hover { background: #fff; color: #101010; }

/* --- Карточки услуг (timeline@1 variants) --- */
.block-cards .services-item, .block-services-grid .services-item { background: #fff; }
.block-cards .services-icon img, .block-services-grid .services-icon img { max-width: 100%; height: auto; }

/* --- FAQ (faq@1) --- */
.block-faq .card { border: 1px solid #e0e0e0; border-radius: 6px; margin-bottom: 12px; }
.block-faq .card-header { padding: 0; background: #f8f9fb; }
.block-faq details summary {
  cursor: pointer; padding: 18px 22px; font-weight: 600; list-style: none;
  position: relative; padding-right: 48px;
}
.block-faq details summary::-webkit-details-marker { display: none; }
.block-faq details summary:after {
  content: "\f107"; font-family: FontAwesome; position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%); color: #106eea; transition: transform .3s;
}
.block-faq details[open] summary:after { transform: translateY(-50%) rotate(180deg); }
.block-faq .card-body { padding: 4px 22px 18px; }

/* --- CTA (cta@1) --- */
.block-cta { padding: 40px; border-radius: 8px; background: #f2f6fd; }
.block-cta--wide { background: #106eea; color: #fff; text-align: center; }
.block-cta--wide h2 { color: #fff; }
.block-cta--accent { border-left: 4px solid #106eea; background: #f2f6fd; }
.block-cta__actions { margin-top: 18px; }
.block-cta__actions .btn { margin-right: 12px; padding: 12px 30px; background: #106eea; color: #fff; border-radius: 5px; display: inline-block; }
.block-cta__actions .btn:hover { background: #0d5ecc; color: #fff; }
.block-cta__actions .btn--ghost { background: transparent; border: 1px solid #106eea; color: #106eea; }
.block-cta__img { max-width: 220px; height: auto; float: right; margin: 0 0 12px 24px; }

/* --- Код (code@1) — исходник оформляет pre/code в style.css --- */
.block-code { position: relative; }
.block-code pre { margin: 0; }
.block-code__filename { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }

/* --- Галерея (gallery@1) --- */
.block-gallery .gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.block-gallery .gallery-item { margin: 0; }
.block-gallery .gallery-item img { width: 100%; height: auto; border-radius: 6px; }
.block-gallery figcaption { font-size: 13px; color: #777; margin-top: 6px; }

/* --- Связанные материалы (related_content@1) --- */
.block-related .related-card { background: #fff; border: 1px solid #eee; border-radius: 8px; overflow: hidden; }
.block-related .related-card__link { display: block; color: inherit; }
.block-related .related-card__link:hover { text-decoration: none; color: #106eea; }
.block-related .blog-img img { width: 100%; height: auto; }
.block-related .blog-content { padding: 16px; }

/* --- Callout --- */
.block-callout { padding: 18px 22px; border-radius: 6px; background: #f2f6fd; border-left: 4px solid #106eea; }
.block-callout--note { background: #f6f8fa; border-left-color: #6c757d; }
.block-callout--warning { background: #fff8e6; border-left-color: #f0a800; }
.block-callout--success { background: #eefaf0; border-left-color: #28a745; }
.block-callout--accent { background: #f2f6fd; border-left-color: #106eea; }

/* --- Изображения документа --- */
.article-content img, .block-image img, .blog-full img { max-width: 100%; height: auto; }
.block-image--wide { margin-left: -15px; margin-right: -15px; }

/* --- Видео --- */
.block-video { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.block-video iframe, .block-video video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.block-video__caption { font-size: 13px; color: #777; }

/* --- Карта --- */
.block-map .map-frame { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; }
.block-map .map-frame iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.block-map__address { color: #777; margin-top: 8px; }

/* --- Документы --- */
.block-documents ul { list-style: none; padding: 0; }
.block-documents li { padding: 10px 0; border-bottom: 1px dashed #e5e5e5; }
.block-documents__desc { display: block; color: #888; font-size: 13px; }

/* --- 404 --- */
.error-title { font-size: 120px; font-weight: 700; color: #106eea; margin-bottom: 16px; }

/* --- Заголовок поста в шаблоне статьи --- */
.blog-details .blog-post-title { font-size: 30px; line-height: 1.25; margin-bottom: 20px; }
.single-post-meta { list-style: none; padding: 0; margin-bottom: 24px; }
.single-post-meta .p-date { color: #888; }

/* --- Формы CMS (data-pcms-form) в стиле исходных форм --- */
form[data-pcms-form] label { display: block; margin-bottom: 6px; font-weight: 600; }
form[data-pcms-form] input:not([type=checkbox]):not([type=radio]),
form[data-pcms-form] textarea, form[data-pcms-form] select {
  width: 100%; padding: 12px 16px; border: 1px solid #dfdfdf; border-radius: 5px; margin-bottom: 16px;
}
form[data-pcms-form] button[type=submit] {
  background: #106eea; color: #fff; border: 0; padding: 14px 36px; border-radius: 5px; cursor: pointer;
}
form[data-pcms-form] button[type=submit]:hover { background: #0d5ecc; }
.form-status-ok { color: #28a745; }
.form-status-err { color: #dc3545; }

/* --- Главная: слайдер собирается из первых двух text-блоков (theme.js) --- */
.rs-slider.style1 .slider-content .block-text { width: 100%; }
.block-cards.grid-4 .services-item .services-text { font-size: 16px; }

/* --- Карусель публикаций на главной (данные из collections API) --- */
.block-blog-carousel .blog-item { background: #fff; border: 1px solid #eee; border-radius: 8px; overflow: hidden; margin: 0 15px; }
.block-blog-carousel .blog-img img { width: 100%; height: auto; }
.block-blog-carousel .blog-content { padding: 16px; }
.block-blog-carousel .blog-title a { color: inherit; }
.block-blog-carousel .blog-title a:hover { color: #106eea; text-decoration: none; }
.block-blog-carousel .blog-date { color: #888; font-size: 13px; }

/* --- Прелоадер: скрывается классом .loader-hidden (theme.js) --- */
.loader {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 999999;
  transition: opacity .5s ease, visibility .5s ease;
}
.loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 3px solid #e8eef7;
  border-top-color: #106eea;
  border-radius: 50%;
  animation: pos-loader-spin 0.9s linear infinite;
}
@keyframes pos-loader-spin { to { transform: rotate(360deg); } }

/* --- CTA-ссылка в слайде: как .readon.slider-btn в источнике --- */
.rs-slider.style1 .slider-content p > a:only-child {
  display: inline-block;
  padding: 15px 37px;
  background: #ffffff;
  color: #106eea;
  border-radius: 8px;
  transition: all .5s;
}
.rs-slider.style1 .slider-content p > a:only-child:hover {
  background-image: linear-gradient(250deg, #4e95ed 19%, #03228f 100%);
  color: #ffffff;
  text-decoration: none;
}

/* --- Слайдер: точка позиционирования стрелок owl-nav --- */
.rs-slider.style1 { position: relative; }
.rs-slider.style1 .owl-nav .owl-prev i,
.rs-slider.style1 .owl-nav .owl-next i { font-style: normal; }

/* --- Третий слайд главной (AI) --- */
.rs-slider.style1 .slider-content.slide3 {
  background: url(../images/slider/slider-3.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* --- Иконки: Font Awesome 6 (весь набор локально) вместо Flaticon --- */
.rs-slider.style1 .owl-nav .owl-prev i:before,
.rs-carousel.nav-style1 .owl-nav .owl-prev i:before {
  content: "\f104";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}
.rs-slider.style1 .owl-nav .owl-next i:before,
.rs-carousel.nav-style1 .owl-nav .owl-next i:before {
  content: "\f105";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}
#scrollUp i:before { font-family: "Font Awesome 6 Free"; font-weight: 900; }

/* --- Слайды: лёгкое затемнение фона под белый текст (без плашек) --- */
.rs-slider.style1 .slider-content.slide1 {
  background-image: linear-gradient(rgba(13, 20, 34, 0.38), rgba(13, 20, 34, 0.38)),
    url(../images/slider/slider-1-1.jpg);
}
.rs-slider.style1 .slider-content.slide2 {
  background-image: linear-gradient(rgba(13, 20, 34, 0.38), rgba(13, 20, 34, 0.38)),
    url(../images/slider/slider-2.jpg);
}
.rs-slider.style1 .slider-content.slide3 {
  background-image: linear-gradient(rgba(13, 20, 34, 0.18), rgba(13, 20, 34, 0.18)),
    url(../images/slider/slider-3.jpg);
}

/* --- «О компании»: 2 колонки — иллюстрация + структурированный текст --- */
.home-about {
  background: linear-gradient(180deg, #f4f8fe 0%, #eef3fb 100%);
  padding: 90px 0;
  margin-top: 40px;
}
.home-about .ha-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}
.home-about .ha-img { margin: 0; }
.home-about .ha-img img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(13, 34, 79, 0.18);
}
.home-about .ha-text .block-text { margin: 0; }
.home-about .ha-text h4 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #106eea;
  margin: 0 0 14px;
}
.home-about .ha-text h2 {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 700;
  color: #101010;
  margin: 0 0 18px;
}
.home-about .ha-text > .block-text > p:first-of-type {
  font-size: 18px;
  line-height: 1.55;
  color: #3c4453;
  margin: 0 0 26px;
}
/* принципы: абзац, начинающийся с **заголовка** — синий титул + описание */
.home-about .ha-text p:has(> strong:first-child) {
  padding: 14px 0 14px 20px;
  border-left: 3px solid #106eea;
  margin: 0 0 14px;
  color: #5a6270;
  line-height: 1.5;
}
.home-about .ha-text p:has(> strong:first-child) strong:first-child {
  display: block;
  color: #101010;
  font-size: 17px;
  margin-bottom: 4px;
}
.home-about .ha-text p:last-of-type { margin-bottom: 0; }
/* CTA-ссылка в тексте секции — кнопка */
.home-about .ha-text p > a:only-child {
  display: inline-block;
  margin-top: 26px;
  padding: 14px 34px;
  background: #106eea;
  color: #ffffff;
  border-radius: 8px;
  transition: all .4s;
}
.home-about .ha-text p > a:only-child:hover {
  background: #0d5ecc;
  color: #ffffff;
  text-decoration: none;
}
@media (max-width: 991px) {
  .home-about { padding: 60px 0; }
  .home-about .ha-grid { grid-template-columns: 1fr; gap: 36px; }
  .home-about .ha-img { max-width: 560px; margin: 0 auto; }
  .home-about .ha-text h2 { font-size: 30px; }
}

/* --- Сетка услуг на главной: компактные карточки, заголовки тёмные --- */
.block-cards .sec-head { margin-bottom: 46px; }
.block-cards .sec-head .sec-kicker {
  display: block;
  color: #106eea;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.block-cards .sec-head h2 {
  font-size: 36px;
  font-weight: 700;
  color: #101010;
  margin: 0;
}
.block-cards .row { display: flex; flex-wrap: wrap; }
.block-cards .row > div { display: flex; }
.block-cards .services-item {
  display: flex;
  align-items: flex-start;
  width: 100%;
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  padding: 22px;
  transition: box-shadow .35s, transform .35s;
}
.block-cards .services-item:hover {
  box-shadow: 0 14px 34px rgba(13, 34, 79, 0.12);
  transform: translateY(-3px);
}
.block-cards .services-icon { margin: 0 16px 0 0; }
.block-cards .services-icon img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
}
.block-cards .services-content { flex: 1; }
.block-cards .services-text {
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 8px;
}
.block-cards .services-text a { color: #101010; }
.block-cards .services-text a:hover { color: #106eea; text-decoration: none; }
.block-cards .services-desc {
  color: #5a6270;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}
/* первая сетка (4 карточки) — в 4 колонки на широких экранах */
@media (min-width: 1200px) {
  .block-cards.grid-4 .row > .col-lg-4 {
    flex: 0 0 25%;
    width: 25%;
    max-width: 25%;
  }
}
@media (max-width: 767px) {
  .block-cards .sec-head h2 { font-size: 26px; }
}

/* --- Заголовок страницы (page-default): h1 всегда --- */
.pt-title {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  color: #101010;
  margin: 0 0 26px;
}
/* hero-иллюстрация страницы: первый image-блок контента */
.article-content .block-image:first-child { margin-bottom: 30px; }
.article-content .block-image:first-child img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(13, 34, 79, 0.14);
}

/* --- Сайдбар-навигация по услугам раздела --- */
.svc-row { display: flex; align-items: flex-start; gap: 36px; }
.svc-col-main { flex: 1 1 auto; min-width: 0; }
.svc-nav { flex: 0 0 360px; }
.svc-nav-sticky {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.svc-nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  padding: 15px 20px;
  color: #101010;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color .3s, box-shadow .3s, background .3s, color .3s;
}
.svc-nav-item i { color: #106eea; font-size: 13px; flex-shrink: 0; }
.svc-nav-item:hover {
  border-color: #106eea;
  color: #106eea;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(13, 34, 79, 0.10);
}
.svc-nav-active,
.svc-nav-active:hover {
  background-image: linear-gradient(90deg, #03228f 10%, #0e73e4 100%);
  color: #ffffff;
  border-color: transparent;
}
.svc-nav-active i { color: #ffffff; }
@media (max-width: 991px) {
  .svc-row { flex-direction: column; gap: 30px; }
  .svc-nav { flex: auto; width: 100%; }
  .svc-nav-sticky { position: static; }
}

/* hero-иллюстрация в двухколоночном лейауте */
.svc-col-main .block-image:first-of-type { margin: 0 0 28px; }
.svc-col-main .block-image:first-of-type img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(13, 34, 79, 0.14);
}

/* --- Блог на главной: кикер + заголовок + 3 карточки из коллекции Блог --- */
.home-blog { padding: 80px 0 50px; }
.block-related.home-blog { padding: 80px 0 60px; background: #f7f9fc; margin-top: 30px; }
.block-related.home-blog > .container { max-width: 1200px; }
.block-related.home-blog .sec-divider {
  display: block;
  width: 60px;
  height: 4px;
  background: #106eea;
  border-radius: 2px;
  margin: 18px auto 0;
}
.home-blog .home-blog-grid, .home-blog .row { display: flex; flex-wrap: wrap; margin-top: 10px; }
.home-blog .row > div { display: flex; }
.home-blog .blog-item,
.block-related.home-blog .blog-item {
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow .35s, transform .35s;
}
.home-blog .blog-item:hover {
  box-shadow: 0 14px 34px rgba(13, 34, 79, 0.12);
  transform: translateY(-3px);
}
.home-blog .blog-img img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
.home-blog .blog-content { padding: 20px 22px 22px; }
.home-blog .blog-date { color: #8a93a3; font-size: 13px; }
.home-blog .blog-date i { color: #106eea; margin-right: 6px; }
.home-blog .blog-title { margin: 10px 0 0; }
.home-blog .blog-title a {
  color: #101010;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.home-blog .blog-title a:hover { color: #106eea; text-decoration: none; }

/* --- Блог на главной: крупные заголовки + тизер --- */
.home-blog .blog-date { margin-bottom: 10px; }
.home-blog .blog-title { font-size: 21px; font-weight: 700; line-height: 1.3; }
.home-blog .blog-teaser {
  color: #5a6270;
  font-size: 15px;
  line-height: 1.55;
  margin: 10px 0 0;
}

/* --- Карусель блога на главной: стрелки и раскладка --- */
/* align-items: flex-start — карточки естественной высоты по своему контенту,
   а не по самой высокой в ряду */
.home-blog-carousel .owl-stage { display: flex; align-items: flex-start; }
.home-blog-carousel .owl-item { float: none; display: flex; align-items: flex-start; }
.home-blog .owl-nav .owl-prev,
.home-blog .owl-nav .owl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  line-height: 52px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e3e9f2;
  text-align: center;
  color: #101010;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.4s;
  z-index: 2;
}
.home-blog .owl-nav .owl-prev { left: -26px; }
.home-blog .owl-nav .owl-next { right: -26px; }
.home-blog .owl-nav .owl-prev:hover,
.home-blog .owl-nav .owl-next:hover { background: #106eea; color: #ffffff; border-color: #106eea; }
.block-related.home-blog { position: relative; }

/* --- Карусели: содержимое слайда на всю ширину. flex-basis обязателен:
       у bootstrap-колонок flex: 0 0 33.33% и width для flex-элемента игнорируется --- */
.owl-carousel .owl-item > div { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
