.stm-documents {
    --stm-doc-blue: #001b72;
    --stm-doc-blue-light: #f2f5ff;
    --stm-doc-border: #d8e1fa;
    --stm-doc-text: #252525;
    --stm-doc-muted: #68758f;
    --stm-doc-white: #ffffff;

    width: 100%;
    max-width: 1425px;
    margin: 0 auto;
    color: var(--stm-doc-text);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    box-sizing: border-box;
}

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


/* Описание страницы */
.stm-documents-intro {
    margin: 0 0 30px;
    padding: 0;
}

.stm-documents-intro p {
    margin: 0;
    padding: 0;
    color: #333333;
    font-size: 16px;
    line-height: 1.8;
}


/* Сетка документов */
.stm-documents-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    width: 100%;
    margin: 0;
    padding: 0;
    align-items: stretch;
}


/* Карточка документа */
.stm-documents-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    min-height: 100%;
    margin: 0;
    padding: 28px;
    background: var(--stm-doc-white);
    border: 1px solid #e3e7f0;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0, 27, 114, 0.045);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.stm-documents-card:hover {
    border-color: #c8d4f2;
    box-shadow: 0 9px 28px rgba(0, 27, 114, 0.08);
}

/* Центрирование изображения документа */
.stm-documents-card__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 260px;
    margin: 0 0 22px;
    overflow: hidden;
}

.stm-documents-card__preview img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
}


/* Иконка PDF */
.stm-documents-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 0 22px;
    color: var(--stm-doc-blue);
    background: var(--stm-doc-blue-light);
    border-radius: 4px;
}

.stm-documents-card__icon svg {
    display: block;
    width: 36px;
    height: 36px;
}


/* Формат документа */
.stm-documents-card__format {
    display: inline-flex;
    align-items: center;
    margin: 0 0 12px;
    padding: 5px 10px;
    color: var(--stm-doc-blue);
    background: #f2f5ff;
    border: 1px solid #e0e7fa;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
}


/* Название и описание карточки */
.stm-documents-card__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    width: 100%;
    height: 60px;
    flex: 0 0 60px;
    margin: 0 0 12px;
    padding: 0;
    color: #202020;
    font-size: 21px;
    line-height: 1.4;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.stm-documents-card__description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    flex: 0 0 102px;
    width: 100%;
    height: 102px;
    margin: 0 0 24px;
    padding: 0;
    color: #626b7c;
    font-size: 15px;
    line-height: 1.7;
}


/* Кнопки */
.stm-documents-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-top: auto;
}

.stm-documents .stm-documents-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 44px;
    margin: 0;
    padding: 11px 15px;
    border: 1px solid var(--stm-doc-blue);
    border-radius: 3px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease,
                border-color .2s ease;
}

.stm-documents .stm-documents-button--primary {
    color: #ffffff !important;
    background: var(--stm-doc-blue);
}

.stm-documents .stm-documents-button--primary:hover {
    color: #ffffff !important;
    background: #12318e;
    border-color: #12318e;
}

.stm-documents .stm-documents-button--secondary {
    color: var(--stm-doc-blue) !important;
    background: #ffffff;
}

.stm-documents .stm-documents-button--secondary:hover {
    color: var(--stm-doc-blue) !important;
    background: #f2f5ff;
}


/* Информационная заметка */
.stm-documents-note {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 26px 0 0;
    padding: 20px 22px;
    background: #f7f8fc;
    border: 1px solid #e8ebf2;
}

.stm-documents-note__icon {
    display: flex;
    flex: 0 0 25px;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    margin-top: 2px;
    color: var(--stm-doc-blue);
}

.stm-documents-note__icon svg {
    display: block;
    width: 23px;
    height: 23px;
}

.stm-documents-note p {
    margin: 0;
    padding: 0;
    color: #4d5668;
    font-size: 14px;
    line-height: 1.7;
}


/* =========================================================
   БЛОК «НЕ НАШЛИ НУЖНОГО ОТВЕТА?»
   ========================================================= */

.stm-documents-help {
    width: 100%;
    margin: 28px 0 20px;
    padding: 30px;
    color: #222222;
    background: var(--stm-doc-blue-light);
    border: 1px solid var(--stm-doc-border);
    border-radius: 0;
}

.stm-documents-help__title {
    margin: 0 0 14px;
    padding: 0;
    color: #252525;
    font-size: 26px;
    line-height: 1.3;
    font-weight: 700;
}

.stm-documents-help__description {
    margin: 0 0 24px;
    padding: 0;
    color: #333333;
    font-size: 16px;
    line-height: 1.75;
}


/* Три контактные карточки */
.stm-documents-help__contacts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.stm-documents-help__contact {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    min-height: 105px;
    margin: 0;
    padding: 20px;
    color: var(--stm-doc-blue) !important;
    background: #ffffff;
    border: 1px solid var(--stm-doc-border);
    border-radius: 0;
    text-decoration: none !important;
    box-shadow: none;
    transition: background-color .2s ease, border-color .2s ease;
}

.stm-documents-help__contact:hover,
.stm-documents-help__contact:focus {
    color: var(--stm-doc-blue) !important;
    background: #fafbff;
    border-color: #b9c9f0;
    text-decoration: none !important;
}

.stm-documents-help__icon {
    display: flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: var(--stm-doc-blue);
    background: var(--stm-doc-blue-light);
}

.stm-documents-help__icon svg {
    display: block;
    width: 23px;
    height: 23px;
}

.stm-documents-help__contact-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.stm-documents-help__label {
    display: block;
    color: var(--stm-doc-muted);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 400;
}

.stm-documents-help__contact strong {
    display: block;
    color: var(--stm-doc-blue);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 700;
    overflow-wrap: anywhere;
}


/* Широкая иллюстрация под контактами */
.stm-documents-banner {
    width: 100%;
    margin: 20px 0 0;
    padding: 0;
    overflow: hidden;
}

.stm-documents-banner img {
    display: block;
    width: 100%;
    height: 200px;
    margin: 0;
    padding: 0;
    object-fit: cover;
    object-position: center;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}


/* =========================================================
   АДАПТИВНОСТЬ
   ========================================================= */

/* Планшеты и небольшие ноутбуки */
@media (max-width: 1050px) {
    .stm-documents-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stm-documents-help__contacts {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stm-documents-help__contact {
        min-height: 85px;
    }
}


/* Мобильные устройства */
@media (max-width: 600px) {
    .stm-documents-intro {
        margin-bottom: 22px;
    }

    .stm-documents-intro p {
        font-size: 15px;
        line-height: 1.7;
    }

    .stm-documents-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .stm-documents-card {
        padding: 22px;
    }

    .stm-documents-card__title {
        font-size: 19px;
    }

    .stm-documents-card__actions {
        flex-direction: column;
    }

    .stm-documents .stm-documents-button {
        width: 100%;
        min-height: 46px;
    }

    .stm-documents-note {
        gap: 10px;
        padding: 16px;
    }

    .stm-documents-help {
        margin-top: 22px;
        padding: 18px;
    }

    .stm-documents-help__title {
        font-size: 22px;
    }

    .stm-documents-help__description {
        margin-bottom: 20px;
        font-size: 15px;
        line-height: 1.6;
    }

    .stm-documents-help__contact {
        gap: 12px;
        padding: 15px;
    }

    .stm-documents-help__contact strong {
        font-size: 14px;
    }

    .stm-documents-banner img {
        height: 120px;
    }
}


/* Очень узкие экраны */
@media (max-width: 360px) {
    .stm-documents-card {
        padding: 17px;
    }

    .stm-documents-help {
        padding: 14px;
    }

    .stm-documents-help__contact {
        gap: 9px;
        padding: 12px;
    }

    .stm-documents-help__icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }
}
/* Заголовок блока документов на главной странице */
.stm-documents-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 24px;
}

.stm-documents-heading__content {
    min-width: 0;
}

.stm-documents-heading__title {
    margin: 0 0 8px;
    color: #001b72;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.2;
}

.stm-documents-heading__description {
    margin: 0;
    color: #68758f;
    font-size: 16px;
    line-height: 1.6;
}

.stm-documents-heading__link {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid #001b72;
    border-radius: 8px;
    background: #fff;
    color: #001b72;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}

.stm-documents-heading__link:hover {
    background: #001b72;
    color: #fff;
}

@media (max-width: 600px) {
    .stm-documents-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }
}

/* Единая компоновка карточек документов */
.stm-documents-grid > .stm-documents-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 540px;
}

.stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
    flex: 0 0 240px;
    height: 240px;
    margin: 0 0 36px;
}

.stm-documents-grid .stm-documents-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.stm-documents-grid .stm-documents-card__body .stm-documents-card__title {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    margin: 18px 0 8px;
    padding: 0;
    line-height: 1.4;
}

.stm-documents-grid .stm-documents-card__body .stm-documents-card__description {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    margin: auto 0 16px;
}

.stm-documents-grid .stm-documents-card__actions {
    margin-top: 0;
}

@media (max-width: 600px) {
    .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
        flex-basis: 220px;
        height: 220px;
    }
}

/* Точное смещение заголовка вниз без изменения размеров карточки */
.stm-documents-grid .stm-documents-card__body .stm-documents-card__title {
    position: relative !important;
    top: 18px !important;
    margin-bottom: 26px !important;
    padding-top: 0 !important;
}

/* Увеличение области изображения в карточке документа */
.stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
    flex: 0 0 300px !important;
    height: 300px !important;
}

.stm-documents-grid > .stm-documents-card > .stm-documents-card__preview img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

@media (max-width: 600px) {
    .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
        flex-basis: 260px !important;
        height: 260px !important;
    }
}

/* Вертикальные изображения документов: увеличить в пределах области предпросмотра */
.stm-documents-grid > .stm-documents-card > .stm-documents-card__preview img {
    display: block !important;
    max-width: 100% !important;
    max-height: 300px !important;
    width: auto !important;
    height: 300px !important;
    object-fit: contain !important;
    object-position: center !important;
}

@media (max-width: 600px) {
    .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview img {
        max-height: 260px !important;
        height: 260px !important;
    }
}

/* Единая высота изображений в карточках документов */
.stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 300px !important;
    overflow: hidden;
}

.stm-documents-grid > .stm-documents-card > .stm-documents-card__preview img {
    display: block !important;
    width: auto !important;
    height: 300px !important;
    max-width: 100% !important;
    max-height: 300px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

@media (max-width: 600px) {
    .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
        height: 260px !important;
    }

    .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview img {
        height: 260px !important;
        max-height: 260px !important;
    }
}

/* Единая область предпросмотра для всех документов */
html body .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
    flex: 0 0 500px !important;
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
}

html body .stm-documents-grid .stm-documents-card .stm-documents-card__preview img {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 480px !important;
    object-fit: contain !important;
    object-position: center center !important;
}

@media (max-width: 600px) {
    html body .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
        flex: 0 0 420px !important;
        height: 420px !important;
        min-height: 420px !important;
        max-height: 420px !important;
    }

    html body .stm-documents-grid .stm-documents-card .stm-documents-card__preview img {
        height: auto !important;
        min-height: 0 !important;
        max-height: 400px !important;
    }
}
/* === END STRICT 2:1 RULES === */

/* Центрирование изображений документов внутри карточек */
html body .stm-documents-grid .stm-documents-card .stm-documents-card__preview {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

html body .stm-documents-grid .stm-documents-card .stm-documents-card__preview img {
    display: block !important;
    margin: 0 auto !important;
    object-position: center center !important;
    flex-shrink: 0 !important;
}


/* Финальное центрирование изображений по обеим осям */
html body .stm-documents-grid .stm-documents-card .stm-documents-card__preview.stm-documents--portrait,
html body .stm-documents-grid .stm-documents-card .stm-documents-card__preview.stm-documents--landscape {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    place-items: center !important;
    place-content: center !important;
    text-align: center !important;
    position: relative !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

html body .stm-documents-grid .stm-documents-card .stm-documents-card__preview.stm-documents--portrait img,
html body .stm-documents-grid .stm-documents-card .stm-documents-card__preview.stm-documents--landscape img {
    position: static !important;
    inset: auto !important;
    align-self: center !important;
    justify-self: center !important;
    margin: auto !important;
    transform: none !important;
    float: none !important;
}


/* STM DOCUMENTS: unified card layout */
html body .stm-documents-grid > .stm-documents-card {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    height: 820px !important;
    min-height: 820px !important;
    max-height: 820px !important;
    box-sizing: border-box !important;
}

html body .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 500px !important;
    width: 100% !important;
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

html body .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview img {
    position: static !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 480px !important;
    margin: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
}

html body .stm-documents-grid .stm-documents-card__body {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 20px 20px !important;
    box-sizing: border-box !important;
}

html body .stm-documents-grid .stm-documents-card__title {
    position: static !important;
    flex: 0 0 60px !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    overflow: hidden !important;
    line-height: 1.4 !important;
}

html body .stm-documents-grid .stm-documents-card__description {
    flex: 0 0 100px !important;
    height: 100px !important;
    min-height: 100px !important;
    max-height: 100px !important;
    margin: 0 0 12px !important;
    overflow: hidden !important;
}

html body .stm-documents-grid .stm-documents-card__actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-top: auto !important;
}

@media (max-width: 600px) {
    html body .stm-documents-grid > .stm-documents-card {
        height: 740px !important;
        min-height: 740px !important;
        max-height: 740px !important;
    }

    html body .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview {
        flex-basis: 420px !important;
        height: 420px !important;
        min-height: 420px !important;
        max-height: 420px !important;
    }

    html body .stm-documents-grid > .stm-documents-card > .stm-documents-card__preview img {
        max-height: 400px !important;
    }

    html body .stm-documents-grid .stm-documents-card__body {
        padding: 0 14px 16px !important;
    }
}
/* END STM DOCUMENTS unified card layout */

/* STM DOCUMENTS: компактные расстояния между текстом и кнопками */
html body .stm-documents-grid .stm-documents-card__body .stm-documents-card__title {
    margin-bottom: 4px !important;
}

html body .stm-documents-grid .stm-documents-card__body .stm-documents-card__description {
    margin-bottom: 6px !important;
}

html body .stm-documents-grid .stm-documents-card__actions {
    gap: 6px !important;
}


/* STM DOCUMENTS: увеличенные отступы вводного блока */
html body .stm-documents .stm-documents__header {
    margin-bottom: 36px !important;
}

html body .stm-documents .stm-documents__header h1,
html body .stm-documents .stm-documents__header h2 {
    margin-bottom: 24px !important;
}

html body .stm-documents .stm-documents__header p {
    margin-bottom: 28px !important;
}


/* Расстояние между заголовком и описанием документов */
html body .stm-documents .stm-documents-heading__title {
    margin-bottom: 28px !important;
}

html body .stm-documents .stm-documents-heading__description {
    margin-top: 0 !important;
}


/* Чёрный цвет вводных текстов и описаний документов */
html body .stm-documents .stm-documents-heading__description,
html body .stm-documents .stm-documents-card__description,
html body .stm-documents .stm-documents__notice,
html body .stm-documents .stm-documents__intro {
    color: #000000 !important;
}


/* Чёрный цвет уведомления о формате PDF */
html body .stm-documents p {
    color: #000000;
}

