/* Стили пользовательских секций главной (конструктор).
   Подключается на главной и в конструкторе, чтобы предпросмотр совпадал с сайтом. */

.custom-homepage-block { padding: 20px 0; }
/* Отступ снизу у последнего элемента не нужен: вертикальные поля секции задаются её настройками */
.custom-homepage-block .container > :last-child,
.custom-homepage-block .container-fluid > :last-child,
.custom-homepage-block .hb-el:last-child > :not(.hb-el-tools) { margin-bottom: 0 !important; }
.custom-homepage-block .custom-block-text { font-size: 1rem; line-height: 1.7; }
.custom-homepage-block .custom-block-text p { margin-bottom: .75rem; }
.custom-homepage-block .custom-block-text p:last-child { margin-bottom: 0; }
.custom-homepage-block .custom-block-text img { max-width: 100%; height: auto; border-radius: 8px; }
.custom-homepage-block .custom-block-text iframe { max-width: 100%; border: 0; }
.custom-homepage-block .custom-block-text table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.custom-homepage-block .custom-block-text td,
.custom-homepage-block .custom-block-text th { border: 1px solid #e5e7eb; padding: .5rem .75rem; vertical-align: top; }

.hb-btn { transition: filter .15s ease, transform .15s ease; }
.hb-btn:hover { filter: brightness(.94); transform: translateY(-1px); }

.hb-columns { display: grid; grid-template-columns: repeat(var(--hb-cols, 2), minmax(0, 1fr)); gap: var(--hb-gap, 24px); }
@media (max-width: 767.98px) {
    .hb-columns.hb-columns-stack { grid-template-columns: 1fr; }
}

.hb-image img { height: auto; }

.hb-placeholder {
    padding: 28px 16px; text-align: center; color: #64748b; background: #f8fafc;
    border: 1px dashed #cbd5e1; border-radius: 8px; font-size: 14px;
}
.hb-placeholder i { display: block; font-size: 22px; margin-bottom: 6px; color: #94a3b8; }

.hb-carousel-wrap .announcement-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Элементы с данными сайта ---------- */
.hb-doc { transition: background-color .2s ease, transform .2s ease; cursor: pointer; }
.hb-doc:hover { background-color: #eaf2ff !important; transform: translateY(-2px); }
.hb-doc-icon { width: 52px; }
.hb-doc-title { font-weight: 600; font-size: 16px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hb-doc-download { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }

.hb-announcement { transition: transform .2s ease, box-shadow .2s ease; cursor: pointer; overflow: hidden; }
.hb-announcement:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
.hb-announcement-title { font-size: 17px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.hb-link-card { transition: background-color .2s ease, color .2s ease, transform .2s ease; }
a.hb-link-card:hover { background-color: #3A86F8 !important; color: #fff !important; transform: translateY(-2px); }
a.hb-link-card:hover .hb-link-card-text { color: rgba(255, 255, 255, .85) !important; }
a.hb-link-card:hover .hb-link-card-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.hb-link-card-icon { width: 48px; height: 48px; border-radius: 50%; background: #e8f0fe; color: #3A86F8; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; transition: background-color .2s ease, color .2s ease; }
.hb-link-card-title { font-weight: 600; font-size: 17px; line-height: 1.3; }
.hb-link-card-text { font-size: 14px; line-height: 1.45; }

.hb-contacts-list i { width: 20px; text-align: center; color: #3A86F8; }
.hb-contacts-map iframe, .hb-contacts-map > div, .hb-contacts-map ymaps { width: 100% !important; height: 100% !important; border: 0; }

.hb-alert { border: 1px solid transparent; line-height: 1.55; }
.hb-alert-icon { font-size: 22px; margin-top: 2px; }
.hb-alert-link { font-weight: 600; }
.hb-alert-info { background: rgba(58, 134, 248, .1); border-color: rgba(58, 134, 248, .25); color: #0b2f66; }
.hb-alert-info .hb-alert-icon, .hb-alert-info .hb-alert-link { color: #1d5fd1; }
.hb-alert-warning { background: #fff7e0; border-color: #f5d97a; color: #5c4300; }
.hb-alert-warning .hb-alert-icon, .hb-alert-warning .hb-alert-link { color: #a86b00; }
.hb-alert-danger { background: #fdecec; border-color: #f3b4b4; color: #6b1212; }
.hb-alert-danger .hb-alert-icon, .hb-alert-danger .hb-alert-link { color: #c62828; }
.hb-alert-success { background: #e9f7ef; border-color: #a9dfbf; color: #14532d; }
.hb-alert-success .hb-alert-icon, .hb-alert-success .hb-alert-link { color: #15803d; }

.hb-button-group .hb-btn { display: inline-block; text-align: center; text-decoration: none; font-weight: 600; border-radius: 8px; border: 2px solid transparent; }
.hb-btn-sm { padding: 6px 16px; font-size: 14px; }
.hb-btn-md { padding: 10px 24px; font-size: 16px; }
.hb-btn-lg { padding: 14px 32px; font-size: 18px; }
.hb-btn-primary { background: #3A86F8; border-color: #3A86F8; color: #fff; }
.hb-btn-secondary { background: #f1f5f9; border-color: #f1f5f9; color: #0f172a; }
.hb-btn-outline { background: transparent; border-color: #3A86F8; color: #3A86F8; }
.hb-button-group .hb-btn:hover { color: inherit; }
.hb-button-group .hb-btn-primary:hover { color: #fff; }

/* Отступы между крупными блоками и уточнения вариантов кнопок */
.hb-documents, .hb-announcements, .hb-contacts { margin-bottom: 32px; }
.hb-button-group .hb-btn-outline { border-color: #3A86F8; color: #3A86F8; }
.hb-button-group .hb-btn-outline:hover { background: #3A86F8; color: #fff; }
.hb-button-group .hb-btn-secondary:hover { background: #e2e8f0; color: #0f172a; }
.hb-button-group .hb-btn-primary:hover { filter: brightness(.94); }

/* ---------- Ряд с колонками ---------- */
.hb-row { display: grid; gap: var(--hb-gap, 32px); }
.hb-row-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hb-row-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.hb-row-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.hb-row-1-1-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hb-row-1-1-1-1 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hb-row-col { min-width: 0; }
.hb-row-col > :last-child,
.hb-row-col > .hb-el:last-child > :not(.hb-el-tools) { margin-bottom: 0 !important; }
@media (max-width: 991.98px) {
    .hb-row-1-1-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .hb-row { display: flex; flex-direction: column; }
    .hb-row.hb-row-reverse-mobile { flex-direction: column-reverse; }
}

/* Широкие баннеры */
.homepage-wide-banners .hb-wide-banner {
    position: relative;
    min-width: 0;
    overflow: hidden;
}
.homepage-wide-banners .hb-wide-banner-frame,
.homepage-wide-banners .hb-wide-banner-fixed {
    display: grid;
    place-items: center;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
.homepage-wide-banners .hb-wide-banner-frame {
    padding: clamp(10px, 1.5vw, 18px);
}
.homepage-wide-banners .hb-wide-banner-image-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.18);
    filter: blur(28px) brightness(.50) saturate(1.2);
    pointer-events: none;
}
.homepage-wide-banners .hb-wide-banner-media {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
}
.homepage-wide-banners .hb-wide-banner-frame .hb-wide-banner-media {
    width: min(100%, clamp(300px, 48%, 680px));
}
.homepage-wide-banners .hb-wide-banner-image {
    display: block;
    width: 100%;
    height: auto;
}
.homepage-wide-banners .hb-wide-banner-fixed .hb-wide-banner-media,
.homepage-wide-banners .hb-wide-banner-fixed .hb-wide-banner-image {
    height: 100%;
}
.homepage-wide-banners .hb-wide-banner-fixed .hb-wide-banner-image {
    object-fit: contain;
}
