/* ═══════════════════════════════════════════════════════════════════════════════
   Блоки контента разделов (Live-конструктор, префикс .ae-*)
   Подключается: публичная страница раздела, CKEditor (contentsCss), предпросмотр.
   Разметку генерирует wwwroot/admin/live-editor/blocks.js — классы менять синхронно.
   ═══════════════════════════════════════════════════════════════════════════════ */

.content-text,
.au-editor-body {
    --ae-primary: var(--info-primary, #187D35);
    --ae-primary-dark: var(--info-primary-dark, #0d5a25);
    --ae-gold: var(--info-gold, #c9a227);
    --ae-text: #1e293b;
    --ae-muted: #64748b;
    --ae-border: #e2e8f0;
    --ae-surface: #ffffff;
    --ae-soft: #f8fafc;
}

/* ── Общие модификаторы ─────────────────────────────────────────────────────── */
.ae-maxw-narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.ae-maxw-medium { max-width: 960px; margin-left: auto; margin-right: auto; }
.ae-r-none { border-radius: 0 !important; }
.ae-r-sm { border-radius: 6px; }
.ae-r-md { border-radius: 12px; }
.ae-r-lg { border-radius: 20px; }
.ae-shadow-sm { box-shadow: 0 2px 10px rgba(15, 23, 42, .08); }
.ae-shadow-md { box-shadow: 0 12px 32px rgba(15, 23, 42, .14); }
.ae-border { border: 1px solid var(--ae-border, #e2e8f0); }
.ae-border-left { border-left: 4px solid var(--ae-primary, #187D35); }
.ae-on-dark,
.ae-on-dark :where(p, li, h1, h2, h3, h4, h5, h6, blockquote, cite, figcaption, td, th, dt, dd, span, strong, em) { color: #fff; }
.ae-on-dark a:not(.ae-btn) { color: #fff; text-decoration: underline; }
.ae-clear { clear: both; }

/* Анимации используют уже существующие au-anim-* из chapter-blocks.css */

@media (max-width: 767.98px) {
    .ae-hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
    .ae-hide-desktop { display: none !important; }
}

/* ── Текст ───────────────────────────────────────────────────────────────────── */
.ae-lead { font-size: 1.18em; line-height: 1.65; color: var(--ae-text, #1e293b); }
.ae-small { font-size: .875em; }

.ae-heading--line { padding-bottom: .45em; border-bottom: 2px solid var(--ae-border, #e2e8f0); }
.ae-heading--accent { position: relative; padding-bottom: .5em; }
.ae-heading--accent::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--ae-primary, #187D35), var(--ae-gold, #c9a227));
}
.ae-heading--accent[style*="text-align: center"]::after,
.ae-heading--accent[style*="text-align:center"]::after { left: 50%; transform: translateX(-50%); }
.ae-heading--bar { padding-left: .7em; border-left: 4px solid var(--ae-primary, #187D35); }

.ae-list--check,
.ae-list--arrow,
.ae-list--dot { list-style: none; padding-left: 0 !important; }
.ae-list--check > li,
.ae-list--arrow > li,
.ae-list--dot > li { position: relative; padding-left: 1.9em; }
.ae-list--check > li::before {
    content: "";
    position: absolute;
    left: .15em;
    top: .32em;
    width: 1.1em;
    height: 1.1em;
    border-radius: 50%;
    background: var(--ae-primary, #187D35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.4l2.6 2.5L12 5.4'/%3E%3C/svg%3E") center / 72% no-repeat;
}
.ae-list--arrow > li::before {
    content: "→";
    position: absolute;
    left: .2em;
    top: 0;
    color: var(--ae-primary, #187D35);
    font-weight: 700;
}
.ae-list--dot > li::before {
    content: "";
    position: absolute;
    left: .45em;
    top: .72em;
    width: .45em;
    height: .45em;
    border-radius: 50%;
    background: var(--ae-gold, #c9a227);
}

.ae-quote {
    margin: 1.5rem 0;
    padding: 1.1rem 1.4rem;
    border-left: 4px solid var(--ae-primary, #187D35);
    background: var(--ae-soft, #f8fafc);
    border-radius: 0 12px 12px 0;
    color: var(--ae-text, #1e293b);
    font-size: 1.06em;
}
.ae-quote--large {
    border-left: 0;
    border-radius: 16px;
    padding: 1.6rem 1.8rem;
    text-align: center;
    font-size: 1.25em;
    background: linear-gradient(160deg, #f0f9f2, #fff);
}
.ae-quote__body > :last-child { margin-bottom: 0; }
.ae-quote cite {
    display: block;
    margin-top: .7rem;
    font-size: .85em;
    font-style: normal;
    font-weight: 600;
    color: var(--ae-muted, #64748b);
}
.ae-quote cite::before { content: "— "; }

.ae-callout {
    position: relative;
    margin: 1.25rem 0;
    padding: 1rem 1.2rem 1rem 3.3rem;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a5f;
}
.ae-callout::before {
    position: absolute;
    left: 1.1rem;
    top: 1rem;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.15em;
    line-height: 1.5;
    content: "\f05a";
    color: #2563eb;
}
.ae-callout__title { margin: 0 0 .25rem; font-weight: 700; font-size: 1.02em; }
.ae-callout__text > :last-child { margin-bottom: 0; }
.ae-callout--success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.ae-callout--success::before { content: "\f058"; color: #16a34a; }
.ae-callout--warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.ae-callout--warning::before { content: "\f071"; color: #d97706; }
.ae-callout--danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.ae-callout--danger::before { content: "\f06a"; color: #dc2626; }
.ae-callout--brand { background: linear-gradient(135deg, #05612a, #187D35); border-color: transparent; color: #fff; }
.ae-callout--brand::before { content: "\f0a1"; color: #fde68a; }
.ae-callout--brand a { color: #fff; }
.ae-callout--neutral { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
.ae-callout--neutral::before { content: "\f0eb"; color: #64748b; }

.ae-divider {
    border: 0;
    border-top: 1px solid var(--ae-border, #e2e8f0);
    margin: 2rem auto;
    height: 0;
    width: 100%;
}
.ae-divider--dashed { border-top-style: dashed; }
.ae-divider--dotted { border-top-style: dotted; border-top-width: 3px; }
.ae-divider--thick { border-top-width: 3px; border-top-color: var(--ae-primary, #187D35); }
.ae-divider--gradient {
    border-top: 0;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ae-primary, #187D35), var(--ae-gold, #c9a227));
}
.ae-divider.ae-w-25,
.ae-divider.ae-w-50,
.ae-divider.ae-w-75 { margin-left: auto; margin-right: auto; }

.ae-spacer {
    display: block;
    height: 32px;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
}
@media (max-width: 640px) {
    .ae-spacer { max-height: 48px; }
}

/* Старые встраивания из CKEditor (iframe width="560") не вылезают за экран телефона */
.content-text iframe:not(.ae-video__frame iframe):not(.ae-embed__frame iframe) { max-width: 100%; }

/* ── Ширина и выравнивание медиа ──────────────────────────────────────────── */
.ae-w-25 { width: 25%; }
.ae-w-33 { width: 33.333%; }
.ae-w-50 { width: 50%; }
.ae-w-66 { width: 66.666%; }
.ae-w-75 { width: 75%; }
.ae-w-100 { width: 100%; }
.ae-align-center { margin-left: auto !important; margin-right: auto !important; }
.ae-align-right { margin-left: auto !important; margin-right: 0 !important; }
.ae-align-left { margin-left: 0 !important; margin-right: auto !important; }
.ae-float-left { float: left; margin: .3rem 1.5rem 1rem 0 !important; }
.ae-float-right { float: right; margin: .3rem 0 1rem 1.5rem !important; }

/* ── Изображение ───────────────────────────────────────────────────────────── */
.ae-image {
    display: block;
    margin: 1.5rem 0;
    max-width: 100%;
    box-sizing: border-box;
}
.ae-image a { display: block; }
.content-text .ae-image img,
.ae-image img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    margin: 0 !important;
    box-shadow: none;
    border-radius: inherit;
}
.ae-image.ae-r-none img { border-radius: 0 !important; }
.ae-image.ae-r-sm img { border-radius: 6px !important; }
.ae-image.ae-r-md img { border-radius: 12px !important; }
.ae-image.ae-r-lg img { border-radius: 20px !important; }
.ae-image.ae-r-round img { border-radius: 50% !important; aspect-ratio: 1 / 1; object-fit: cover; }
.ae-image.ae-r-none,
.ae-image.ae-r-sm,
.ae-image.ae-r-md,
.ae-image.ae-r-lg,
.ae-image.ae-r-round { border-radius: 0; }
.ae-image.ae-shadow-sm,
.ae-image.ae-shadow-md { box-shadow: none; }
.ae-image.ae-shadow-sm img { box-shadow: 0 2px 10px rgba(15, 23, 42, .1); }
.ae-image.ae-shadow-md img { box-shadow: 0 14px 34px rgba(15, 23, 42, .18); }
.ae-image.ae-border { border: 0; }
.ae-image.ae-border img { border: 1px solid var(--ae-border, #e2e8f0); }

.ae-ratio-1x1 img, .ae-ratio-1x1 .ae-media-fit { aspect-ratio: 1 / 1; object-fit: cover; }
.ae-ratio-4x3 img, .ae-ratio-4x3 .ae-media-fit { aspect-ratio: 4 / 3; object-fit: cover; }
.ae-ratio-3x2 img, .ae-ratio-3x2 .ae-media-fit { aspect-ratio: 3 / 2; object-fit: cover; }
.ae-ratio-16x9 img, .ae-ratio-16x9 .ae-media-fit { aspect-ratio: 16 / 9; object-fit: cover; }
.ae-ratio-3x4 img, .ae-ratio-3x4 .ae-media-fit { aspect-ratio: 3 / 4; object-fit: cover; }
.ae-ratio-21x9 img, .ae-ratio-21x9 .ae-media-fit { aspect-ratio: 21 / 9; object-fit: cover; }

.ae-image figcaption,
.ae-video figcaption,
.ae-embed figcaption,
.ae-gallery__item figcaption {
    margin-top: .55rem;
    font-size: .88em;
    line-height: 1.5;
    color: var(--ae-muted, #64748b);
    text-align: center;
}

/* ── Галерея ───────────────────────────────────────────────────────────────── */
.ae-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 1.5rem 0;
}
.ae-gallery.ae-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ae-gallery.ae-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ae-gallery.ae-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ae-gallery.ae-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ae-gallery.ae-gap-sm { gap: 8px; }
.ae-gallery.ae-gap-lg { gap: 24px; }
.ae-gallery__item { margin: 0; min-width: 0; }
.ae-gallery__item a { display: block; }
.content-text .ae-gallery img,
.ae-gallery img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 !important;
    border-radius: 12px !important;
    box-shadow: none;
    background: #f1f5f9;
    transition: transform .25s ease, box-shadow .25s ease;
}
.ae-gallery.ae-r-none img { border-radius: 0 !important; }
.ae-gallery.ae-r-sm img { border-radius: 6px !important; }
.ae-gallery.ae-r-lg img { border-radius: 20px !important; }
.ae-gallery a:hover img { box-shadow: 0 10px 24px rgba(15, 23, 42, .16); }
.ae-gallery.ae-r-none,
.ae-gallery.ae-r-sm,
.ae-gallery.ae-r-md,
.ae-gallery.ae-r-lg { border-radius: 0; }

/* ── Видео и встраивания ──────────────────────────────────────────────────── */
.ae-video,
.ae-embed {
    display: block;
    margin: 1.5rem 0;
    max-width: 100%;
    box-sizing: border-box;
}
.ae-video__frame,
.ae-embed__frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: #0f172a;
}
.ae-embed__frame { background: #f1f5f9; border: 1px solid var(--ae-border, #e2e8f0); }
.ae-video__frame { aspect-ratio: 16 / 9; }
.ae-video__frame.ae-ratio-4x3 { aspect-ratio: 4 / 3; }
.ae-video__frame.ae-ratio-1x1 { aspect-ratio: 1 / 1; }
.ae-video__frame.ae-ratio-9x16 { aspect-ratio: 9 / 16; max-height: 80vh; margin: 0 auto; width: auto; }
.ae-video__frame.ae-ratio-21x9 { aspect-ratio: 21 / 9; }
.ae-video__frame iframe,
.ae-video__frame video,
.ae-embed__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: transparent;
}
.ae-video__frame video { object-fit: contain; background: #000; }
.ae-video.ae-r-none .ae-video__frame,
.ae-embed.ae-r-none .ae-embed__frame { border-radius: 0; }
.ae-video.ae-r-none,
.ae-video.ae-r-sm,
.ae-video.ae-r-md,
.ae-video.ae-r-lg { border-radius: 0; }

/* ── Документы / файлы ────────────────────────────────────────────────────── */
.ae-files {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 1.25rem 0;
}
.ae-files.ae-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content-text a.ae-file,
a.ae-file {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 58px;
    padding: 12px 52px 12px 64px;
    border: 1px solid var(--ae-border, #e2e8f0);
    border-radius: 12px;
    background: #fff;
    color: var(--ae-text, #1e293b) !important;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
a.ae-file:hover {
    border-color: var(--ae-primary, #187D35);
    box-shadow: 0 8px 22px rgba(24, 125, 53, .12);
    transform: translateY(-1px);
}
a.ae-file::before {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 17px;
    content: "\f15b";
    color: #475569;
    background: #f1f5f9;
}
a.ae-file::after {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 15px;
    content: "\f019";
    color: var(--ae-primary, #187D35);
}
a.ae-file--link::after { content: "\f35d"; }
a.ae-file--pdf::before { content: "\f1c1"; color: #dc2626; background: #fef2f2; }
a.ae-file--doc::before { content: "\f1c2"; color: #2563eb; background: #eff6ff; }
a.ae-file--xls::before { content: "\f1c3"; color: #16a34a; background: #f0fdf4; }
a.ae-file--ppt::before { content: "\f1c4"; color: #ea580c; background: #fff7ed; }
a.ae-file--img::before { content: "\f1c5"; color: #7c3aed; background: #f5f3ff; }
a.ae-file--zip::before { content: "\f1c6"; color: #a16207; background: #fefce8; }
a.ae-file--video::before { content: "\f1c8"; color: #db2777; background: #fdf2f8; }
a.ae-file--link::before { content: "\f0c1"; color: var(--ae-primary, #187D35); background: #f0fdf4; }
.ae-file__name { font-weight: 600; line-height: 1.35; word-break: break-word; }
.ae-file__meta { font-size: .8em; color: var(--ae-muted, #64748b); }

/* ── Кнопки ────────────────────────────────────────────────────────────────── */
.ae-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1.25rem 0;
    align-items: center;
}
.ae-buttons.ae-justify-center { justify-content: center; }
.ae-buttons.ae-justify-right { justify-content: flex-end; }
.ae-buttons.ae-justify-stretch > .ae-btn { flex: 1 1 0; }
.content-text a.ae-btn,
a.ae-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 22px;
    border-radius: 12px;
    border: 2px solid var(--ae-primary, #187D35);
    background: var(--ae-primary, #187D35);
    color: #fff !important;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.25;
    text-align: center;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}
a.ae-btn:hover {
    background: var(--ae-primary-dark, #0d5a25);
    border-color: var(--ae-primary-dark, #0d5a25);
    box-shadow: 0 10px 22px rgba(24, 125, 53, .22);
    transform: translateY(-1px);
}
.content-text a.ae-btn--outline,
a.ae-btn--outline { background: transparent; color: var(--ae-primary, #187D35) !important; }
a.ae-btn--outline:hover { background: var(--ae-primary, #187D35); color: #fff !important; }
.content-text a.ae-btn--gold,
a.ae-btn--gold { background: var(--ae-gold, #c9a227); border-color: var(--ae-gold, #c9a227); color: #1f1600 !important; }
a.ae-btn--gold:hover { background: #b08b17; border-color: #b08b17; }
.content-text a.ae-btn--light,
a.ae-btn--light { background: #fff; border-color: #fff; color: var(--ae-primary-dark, #0d5a25) !important; }
a.ae-btn--light:hover { background: #f0fdf4; border-color: #f0fdf4; }
.content-text a.ae-btn--dark,
a.ae-btn--dark { background: #0f172a; border-color: #0f172a; color: #fff !important; }
a.ae-btn--dark:hover { background: #1e293b; border-color: #1e293b; }
.content-text a.ae-btn--text,
a.ae-btn--text {
    background: transparent;
    border-color: transparent;
    color: var(--ae-primary, #187D35) !important;
    padding-left: 4px;
    padding-right: 4px;
}
a.ae-btn--text:hover { background: transparent; border-color: transparent; box-shadow: none; text-decoration: underline !important; }
a.ae-btn--sm { min-height: 38px; padding: 7px 16px; font-size: 14px; border-radius: 10px; }
a.ae-btn--lg { min-height: 54px; padding: 13px 30px; font-size: 17px; border-radius: 14px; }
a.ae-btn--pill { border-radius: 999px; }

/* ── Колонки / секции ─────────────────────────────────────────────────────── */
.ae-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    margin: 1.5rem 0;
    box-sizing: border-box;
}
.ae-cols--1 { grid-template-columns: minmax(0, 1fr); }
.ae-cols--1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ae-cols--1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.ae-cols--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.ae-cols--1-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); }
.ae-cols--3-1 { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.ae-cols--1-1-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ae-cols--1-2-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); }
.ae-cols--1-1-1-1 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ae-cols.ae-gap-none { gap: 0; }
.ae-cols.ae-gap-sm { gap: 12px; }
.ae-cols.ae-gap-lg { gap: 40px; }
.ae-cols.ae-valign-center { align-items: center; }
.ae-cols.ae-valign-end { align-items: end; }
.ae-cols.ae-valign-stretch { align-items: stretch; }
.ae-col { min-width: 0; }
.ae-col > :first-child { margin-top: 0; }
.ae-col > :last-child { margin-bottom: 0; }
.ae-cols--boxed > .ae-col {
    padding: 20px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--ae-border, #e2e8f0);
}

@media (max-width: 991.98px) {
    .ae-cols.ae-stack-tablet { grid-template-columns: minmax(0, 1fr); }
    .ae-cols--1-1-1-1:not(.ae-stack-tablet) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ae-gallery.ae-cols-4,
    .ae-gallery.ae-cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .ae-cols,
    .ae-cols--1-1-1-1:not(.ae-stack-tablet) { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .ae-cols.ae-reverse-mobile > .ae-col:first-child { order: 2; }
    .ae-gallery.ae-cols-3,
    .ae-gallery.ae-cols-4,
    .ae-gallery.ae-cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ae-files.ae-cols-2 { grid-template-columns: 1fr; }
    .ae-w-25, .ae-w-33, .ae-w-50, .ae-w-66, .ae-w-75 { width: 100%; }
    .ae-float-left,
    .ae-float-right { float: none; margin: 1rem 0 !important; }
    .ae-buttons.ae-stack-mobile { flex-direction: column; align-items: stretch; }
    .ae-buttons.ae-stack-mobile > .ae-btn { width: 100%; }
}

/* ── Карточки ──────────────────────────────────────────────────────────────── */
.ae-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 1.5rem 0;
}
.ae-cards.ae-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ae-cards.ae-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ae-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--ae-border, #e2e8f0);
    box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
    transition: box-shadow .25s ease, transform .25s ease;
}
.ae-card:hover { box-shadow: 0 14px 34px rgba(15, 23, 42, .12); transform: translateY(-2px); }
.ae-cards--flat .ae-card { box-shadow: none; }
.ae-cards--flat .ae-card:hover { box-shadow: none; transform: none; }
.ae-cards--soft .ae-card { border-color: transparent; background: #f8fafc; box-shadow: none; }
.ae-cards--accent .ae-card { border-top: 4px solid var(--ae-primary, #187D35); }
.content-text .ae-card__img,
.ae-card__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none;
    background: #f1f5f9;
}
.ae-cards.ae-ratio-1x1 .ae-card__img { aspect-ratio: 1 / 1; }
.ae-cards.ae-ratio-4x3 .ae-card__img { aspect-ratio: 4 / 3; }
.ae-cards.ae-ratio-3x4 .ae-card__img { aspect-ratio: 3 / 4; }
.ae-card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 20px; }
.content-text .ae-card__title,
.ae-card__title { margin: 0; font-size: 1.08em; font-weight: 700; line-height: 1.35; color: var(--ae-text, #1e293b); }
.ae-card__text { color: var(--ae-muted, #64748b); font-size: .95em; line-height: 1.6; }
.ae-card__text > :last-child { margin-bottom: 0; }
.content-text a.ae-card__link,
a.ae-card__link {
    margin-top: auto;
    padding-top: 6px;
    font-weight: 600;
    color: var(--ae-primary, #187D35) !important;
    text-decoration: none !important;
}
a.ae-card__link::after { content: " →"; }
a.ae-card__link:hover { text-decoration: underline !important; }
.ae-cards.ae-align-text-center .ae-card__body { text-align: center; align-items: center; }

@media (max-width: 991.98px) {
    .ae-cards.ae-cols-3,
    .ae-cards.ae-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .ae-cards,
    .ae-cards.ae-cols-2,
    .ae-cards.ae-cols-3,
    .ae-cards.ae-cols-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ── Персона / контакт ────────────────────────────────────────────────────── */
.ae-person {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin: 1.5rem 0;
    padding: 22px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--ae-border, #e2e8f0);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}
.ae-person--no-photo { grid-template-columns: minmax(0, 1fr); }
.ae-person--vertical { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; max-width: 360px; }
.ae-person--vertical .ae-person__contacts { justify-items: center; }
.content-text .ae-person__photo,
.ae-person__photo {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center top;
    margin: 0 !important;
    border-radius: 14px !important;
    box-shadow: none;
    background: #f1f5f9;
}
.ae-person--vertical .ae-person__photo { max-width: 180px; aspect-ratio: 1 / 1; border-radius: 50% !important; }
.ae-person__name { margin: 0 0 4px; font-size: 1.25em; font-weight: 700; line-height: 1.3; color: var(--ae-text, #1e293b); }
.ae-person__role { margin: 0 0 10px; font-weight: 600; color: var(--ae-primary, #187D35); line-height: 1.4; }
.ae-person__text { color: var(--ae-muted, #64748b); }
.ae-person__text > :last-child { margin-bottom: 0; }
.content-text ul.ae-person__contacts,
.ae-person__contacts {
    display: grid;
    gap: 6px;
    list-style: none;
    margin: 12px 0 0 !important;
    padding: 0 !important;
}
.content-text .ae-person__contacts li,
.ae-person__contacts li { position: relative; margin: 0 !important; padding-left: 26px; line-height: 1.5; }
.ae-person__contacts li::before {
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    text-align: center;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--ae-primary, #187D35);
}
.ae-person__contacts .ae-c-phone::before { content: "\f095"; }
.ae-person__contacts .ae-c-mail::before { content: "\f0e0"; }
.ae-person__contacts .ae-c-addr::before { content: "\f3c5"; }
.ae-person__contacts .ae-c-time::before { content: "\f017"; }
.ae-person__contacts a { color: inherit !important; text-decoration: none !important; }
.ae-person__contacts a:hover { color: var(--ae-primary, #187D35) !important; }

@media (max-width: 640px) {
    .ae-person { grid-template-columns: minmax(0, 1fr); padding: 18px; }
    .ae-person__photo { max-width: 220px; }
}

/* ── Аккордеон ─────────────────────────────────────────────────────────────── */
.ae-accordion { display: grid; gap: 10px; margin: 1.5rem 0; }
.ae-accordion__item {
    border: 1px solid var(--ae-border, #e2e8f0);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.ae-accordion__item > summary {
    position: relative;
    list-style: none;
    cursor: pointer;
    padding: 14px 52px 14px 18px;
    font-weight: 600;
    color: var(--ae-text, #1e293b);
    line-height: 1.45;
}
.ae-accordion__item > summary::-webkit-details-marker { display: none; }
.ae-accordion__item > summary::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--ae-primary, #187D35);
    border-bottom: 2px solid var(--ae-primary, #187D35);
    transform: translateY(-70%) rotate(45deg);
    transition: transform .2s ease;
}
.ae-accordion__item[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.ae-accordion__item[open] > summary { background: #f0fdf4; color: var(--ae-primary-dark, #0d5a25); }
.ae-accordion__body { padding: 4px 18px 16px; }
.ae-accordion__body > :last-child { margin-bottom: 0; }
.ae-accordion--minimal .ae-accordion__item { border-radius: 0; border-width: 0 0 1px; background: transparent; }
.ae-accordion--minimal .ae-accordion__item[open] > summary { background: transparent; }

/* ── Таблица ───────────────────────────────────────────────────────────────── */
.ae-table-wrap {
    width: 100%;
    margin: 1.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.content .ae-table-wrap table.ae-table,
table.ae-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    display: table;
}
table.ae-table th,
table.ae-table td { padding: 12px 16px; vertical-align: top; text-align: left; }
table.ae-table.ae-table--compact th,
table.ae-table.ae-table--compact td { padding: 7px 10px; font-size: .93em; }
table.ae-table.ae-table--plain-head th { background: #f1f5f9; color: var(--ae-text, #1e293b); }
table.ae-table:not(.ae-table--striped) tr:nth-child(even) { background-color: transparent; }
table.ae-table.ae-table--striped tbody tr:nth-child(even) { background-color: #f8fafc; }
table.ae-table.ae-table--borderless td,
table.ae-table.ae-table--borderless th { border: 0; border-bottom: 1px solid var(--ae-border, #e2e8f0); }
table.ae-table caption { caption-side: bottom; padding-top: 8px; font-size: .88em; color: var(--ae-muted, #64748b); }

@media (max-width: 991.98px) {
    .content .ae-table-wrap table.ae-table { display: table !important; margin: 0 !important; }
    .ae-table-wrap table.ae-table { min-width: 560px; }
}

/* ── Печать: не обрываем блоки ───────────────────────────────────────────── */
@media print {
    .ae-card, .ae-person, .ae-callout, .ae-image, .ae-accordion__item { break-inside: avoid; }
    .ae-accordion__item > .ae-accordion__body { display: block; }
}
