/* Wagtail RichText: centered paragraph block (Draftail → <p class="richtext-align-center">) */
.richtext-align-center {
    text-align: center;
}

/* Wagtail RichText: centered embedded images (format "center" in image chooser) */
img.richtext-image.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
}

/* Blog layout width fix - align with header container */

/* "Load more" plate: fill like page (body #fefefe); height ~67px as in archive inspector */
.blog .pagination.border_block {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 67.39px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    background-color: #fefefe;
}

.blog .pagination.border_block .fake_link {
    display: inline-block;
    font-size: 1rem;
    line-height: 1.2;
    text-decoration: none;
    margin: 0;
}

/* Match archive layout: center_content uses flex-grow with 7% right padding for gap */
.blog .cell.center_content {
    flex: 1 1 0px;
    width: auto;
    padding-right: 7%; /* Creates visual gap between article and sidebar (matches archive) */
}

/* Sidebar uses fixed width matching archive (20rem = 320px) */
.blog .cell.right_sidebar {
    flex: 0 0 auto;
    width: 20rem; /* 320px - matches archive */
}

/* Blog listing meta: date + rubrics on one line */
.blog .article_bottom {
    font-size: 14px;
    line-height: 1.2;
    color: #757575;
}

.blog .article_bottom .article_date,
.blog .article_bottom .article_tags_bottom {
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.blog .article_bottom .article_tags_bottom {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
}

.blog .article_bottom .rubrics_label {
    color: inherit;
    text-decoration: none;
}

/* Link underline is handled by the global `.link` styles */
.blog .article_bottom .article_tags_bottom a {
    text-decoration: inherit;
}

/* Blog listing preview only — detail page uses same .article_text inside .blog */
.blog .article_list .article_text {
    line-height: 1.4;
    max-height: calc(1.4em * 4);
    overflow: hidden;
}

.blog .article_list .article_text > *:first-child {
    margin-top: 0;
}

.blog .article_list .article_text > *:last-child {
    margin-bottom: 0;
}

/* Markdown (wagtail-markdown) inside article body */
.blog .article_text pre {
    overflow-x: auto;
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 0.9em;
}

.blog .article_text table {
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
}

.blog .article_text table th,
.blog .article_text table td {
    border: 1px solid #ddd;
    padding: 0.35rem 0.5rem;
}

/* StreamField: «Текст с выравниванием» */
.blog .article_text .article-align--left {
    text-align: left;
}

.blog .article_text .article-align--center {
    text-align: center;
}

.blog .article_text .article-align--right {
    text-align: right;
}

/* Рассылка: заметный экран успеха вместо пустой формы */
.subscribe_block--success .newsletter_success_panel {
    display: block;
}

.newsletter_success_panel {
    padding: 0.25rem 0 0.5rem;
    text-align: left;
}

.newsletter_success_title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1b5e20;
    margin: 0 0 0.65rem;
    line-height: 1.3;
}

.newsletter_success_text {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    margin: 0;
}

@media screen and (min-width: 40em) {
    .newsletter_success_title {
        font-size: 1.35rem;
    }
    .newsletter_success_text {
        font-size: 1.05rem;
    }
}

/* Responsive: full width on small screens */
@media screen and (max-width: 639px) {
    .blog .cell.center_content,
    .blog .cell.right_sidebar {
        width: 100%;
        flex: 0 0 auto;
    }
}

/* Футер: правовые ссылки — по одной строке */
.footer_legal_column .footer_legal_heading {
    margin-bottom: 0.35rem;
}

.footer_legal_column > div {
    line-height: 1.35;
}

.footer_legal_column > div + div {
    margin-top: 0.25rem;
}

/* Единый вид ссылок: :visited по умолчанию темнее :link — явно совпадаем с «золотым» футером */
.footer.contrast .footer_legal_column a.gold_link {
    display: inline;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer.contrast .footer_legal_column a.gold_link:link,
.footer.contrast .footer_legal_column a.gold_link:visited {
    color: #f2e6c4;
}

.footer.contrast .footer_legal_column a.gold_link:hover,
.footer.contrast .footer_legal_column a.gold_link:focus {
    color: #ffffff;
    text-decoration: underline;
}

/* Длинные названия документов — одна строка на широком футере */
@media screen and (min-width: 75em) {
    .footer.contrast .footer_legal_column a.gold_link {
        white-space: nowrap;
    }
}

/* PD consent (form_pd_consent_checkboxes): вводные строки без лишнего бокового отступа
   относительно соседней .form_button (кнопка над блоком) — сброс полей абзацев */
.block_form .form .form_field .consent_lead_group {
    margin-inline: 0;
    padding-inline: 0;
    margin-bottom: 0.5rem;
    text-align: left;
    max-width: 100%;
}

.block_form .form .form_field .consent_lead_group .consent_hint,
.block_form .form .form_field .consent_lead_group .consent_intro {
    margin-left: 0;
    margin-right: 0;
    text-align: left;
}

.block_form .form .form_field .consent_lead_group .consent_hint {
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.block_form .form .form_field .consent_lead_group .consent_intro {
    margin-top: 0;
    margin-bottom: 0;
}
