/* =========================================================================
 * DEAD CODE — kept temporarily, do NOT extend.
 * Contacts/socials moved out of .header-nav into .header-feed (header.php).
 * Dead selectors in this file:
 *   .header-nav__contacts-item img  (~line 1312)
 *   .header-nav__social ul li img   (~line 1306)
 * ========================================================================= */
.homepage .useful-links {
    padding: var(--section-py) 0;
    background: var(--c-surface);
}

.homepage .icon-cards {
    padding: var(--section-py) 0;
    background: var(--c-surface-soft);
}

.homepage .content-with-title__wrapper {
    margin: 0 !important;
}

.useful-links__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--block-gap);
}

.useful-links__card {
    position: relative;
    height: 280px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--c-brand);
    will-change: transform;
}

/* Базовый градиент */
.useful-links__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
    rgba(50, 83, 144, 0.5),
    rgba(50, 83, 144, 0.75));
    z-index: 1;
}

/* Градиент для hover эффекта */
.useful-links__card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
    rgba(31, 51, 89, 0.7),
    rgba(31, 51, 89, 0.95));
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.useful-links__card:hover::after {
    opacity: 1;
}

.useful-links__card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transform: scale(1.01);
    transition: transform 1.2s cubic-bezier(0.215, 0.610, 0.355, 1.000);
    z-index: 0;
}

.useful-links__card:hover .useful-links__card-bg {
    transform: scale(1.12);
}

.useful-links__card-title {
    padding: 0 20px;
    margin: 0;
    position: relative;
    font-family: Montserrat, sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 20px;
    line-height: 24px;
    color: var(--c-surface);
    text-align: center;
    z-index: 2;
    opacity: 0.95;
    transform: translateZ(0);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.useful-links__card:hover .useful-links__card-title {
    transform: scale(1.05);
    opacity: 1;
}

@media (min-width: 640px) {
    .useful-links__grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--block-gap);
    }

    .useful-links__grid:has(.useful-links__card:nth-child(5)) {
        grid-template-columns: repeat(2, 1fr);
    }

    .useful-links__grid:has(.useful-links__card:nth-child(5)) .useful-links__card:last-child {
        grid-column: auto;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (min-width: 1024px) {
    .useful-links__grid {
        display: flex;
        flex-wrap: nowrap;
        gap: var(--block-gap);
    }

    .useful-links__card {
        flex: 1;
        min-width: 0;
    }
}


/* custom-cards.css */
.custom-cards__grid {
    display: grid;
    gap: var(--block-gap);
}

/* Настройки колонок */
.custom-cards__grid--2-columns,
.custom-cards__grid--3-columns,
.custom-cards__grid--4-columns,
.custom-cards__grid--5-columns {
    grid-template-columns: repeat(1, 1fr);
}

.custom-cards__card {
    position: relative;
    height: 280px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    will-change: transform;
}

/* Базовый градиент */
.custom-cards__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.3),
    rgba(0, 0, 0, 0.5));
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Градиент для hover эффекта */
.custom-cards__card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.5),
    rgba(0, 0, 0, 0.7));
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.custom-cards__card:hover::after {
    opacity: 1;
}

.custom-cards__card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transform: scale(1.01);
    transition: transform 1.2s cubic-bezier(0.215, 0.610, 0.355, 1.000);
    z-index: 0;
}

.custom-cards__card:hover .custom-cards__card-bg {
    transform: scale(1.12);
}

.custom-cards__card-title {
    padding: 0 20px;
    margin: 0;
    position: relative;
    font-family: Montserrat, sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 20px;
    line-height: 24px;
    color: var(--c-surface);
    text-align: center;
    z-index: 2;
    opacity: 0.95;
    transform: translateZ(0);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-cards__card:hover .custom-cards__card-title {
    transform: scale(1.05);
    opacity: 1;
}

/* Медиа-запросы для разных размеров экрана */
@media (min-width: 640px) {
    .custom-cards__grid--2-columns,
    .custom-cards__grid--3-columns,
    .custom-cards__grid--4-columns,
    .custom-cards__grid--5-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .custom-cards__grid--2-columns {
        grid-template-columns: repeat(2, 1fr);
    }

    .custom-cards__grid--3-columns {
        grid-template-columns: repeat(3, 1fr);
    }

    .custom-cards__grid--4-columns {
        grid-template-columns: repeat(4, 1fr);
    }

    .custom-cards__grid--5-columns {
        grid-template-columns: repeat(5, 1fr);
    }
}


/* icon-cards.css */
/*.icon-cards {*/
/*    margin: 0;*/
/*    padding: 4rem 0;*/
/*}*/

.icon-cards__grid {
    display: grid;
    gap: var(--block-gap);
}

/* Grid columns configuration */
.icon-cards__grid--2-columns,
.icon-cards__grid--3-columns,
.icon-cards__grid--4-columns,
.icon-cards__grid--5-columns {
    grid-template-columns: repeat(1, 1fr);
}

.icon-cards__card {
    position: relative;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-decoration: none;
    background-color: var(--c-surface-tint);
    will-change: transform;
    padding: var(--card-py) var(--card-px);
    transition: all 0.3s ease;
}

.icon-cards__card--link {
    cursor: pointer;
    text-decoration: none;
}

.icon-cards__card--link:hover {
    /* Darker variant of --c-surface-tint so hover stays in the brand-blue
       family and is visually distinct from both the default card tint and
       the section's neutral background. */
    background-color: #d6e4f5;
}

.icon-cards__card--link:hover .icon-cards__icon img {
    transform: scale(1.05);
}

.icon-cards__icon img {
    margin: 0;
    padding: 0;
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.icon-cards__info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.icon-cards__card-title {
    margin: 0;
    padding: 0;
    font-family: Montserrat, sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.5;
    color: var(--c-brand);
    text-align: center;
}

.icon-cards__card-description {
    margin: 0;
    padding: 0;
    font-family: Avenir Next Cyr, sans-serif;
    font-style: normal;
    font-size: 16px;
    line-height: 1.5;
    color: var(--c-text);
    text-align: center;
}

.icon-cards__card-description a {
    color: var(--c-brand);
    text-decoration: none;
    border-bottom: 1px solid rgba(50, 83, 144, 0.2);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.icon-cards__card-description a:hover {
    color: var(--c-brand-dark);
    border-bottom-color: var(--c-brand-dark);
}

/* Responsive grid settings */
@media (min-width: 640px) {
    .icon-cards__grid--2-columns,
    .icon-cards__grid--3-columns,
    .icon-cards__grid--4-columns,
    .icon-cards__grid--5-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .icon-cards__grid--2-columns {
        grid-template-columns: repeat(2, 1fr);
    }

    .icon-cards__grid--3-columns {
        grid-template-columns: repeat(3, 1fr);
    }

    .icon-cards__grid--4-columns {
        grid-template-columns: repeat(4, 1fr);
    }

    .icon-cards__grid--5-columns {
        grid-template-columns: repeat(5, 1fr);
    }
}


.content-with-title__wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--section-gy);
}


/* page-content.css */
/* Основной контейнер контента */
.page-content {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: Avenir Next Cyr, sans-serif;
    font-style: normal;
    line-height: 1.5;
    color: #2C3E50;
    font-size: 16px;
}

/* Типографика заголовков */
.page-content h1, .page-content h2, .page-content h3,
.page-content h4, .page-content h5, .page-content h6 {
    font-family: Montserrat, sans-serif;
    margin: 1em 0;
    color: var(--c-text);
    font-weight: 700;
}

.page-content h1 {
    font-size: 2em;
}

.page-content h2 {
    font-size: 1.8em;
}

.page-content h3 {
    font-size: 1.6em;
}

.page-content h4 {
    font-size: 1.4em;
}

.page-content h5 {
    font-size: 1.2em;
}

.page-content h6 {
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Параграфы и текст */
.page-content p {
    margin: 0.8em 0;
    font-size: 1.1em;
}

.page-content strong {
    color: var(--c-text);
    font-weight: 600;
}

.page-content mark {
    background-color: rgba(50, 83, 144, 0.1);
    color: var(--c-brand);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

/* Списки */
.page-content ul,
.page-content ol {
    margin: 0 0 1.5em 0;
    padding-left: 1.5em;
    list-style-position: outside;
}

.page-content ol > li::marker,
.page-content ul > li::marker {
    color: var(--c-brand);
}

.page-content ul li {
    position: relative;
    padding: 0.2rem 0;
}

.page-content ul ul {
    margin: 0.5em 0;
}

.page-content ul ul > li::marker,
.page-content ol ol > li::marker {
    color: rgba(50, 83, 144, 0.7);
}

.page-content ul ul ul > li::marker,
.page-content ol ol ol > li::marker {
    color: rgba(50, 83, 144, 0.5);
}

/* Нумерованные списки */
.page-content ol {
    list-style: decimal;
    counter-reset: item;
}

.page-content ol ol {
    list-style: lower-alpha;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.page-content ol ol ol {
    list-style: lower-roman;
}

/* Цитаты */
.page-content blockquote {
    margin: 2em 0;
    padding: 1.5em 2em;
    border-left: 4px solid var(--c-brand);
    background-color: rgba(50, 83, 144, 0.05);
    border-radius: 0 4px 4px 0;
}

.page-content blockquote p {
    color: var(--c-brand);
    font-size: 1.1em;
    font-style: italic;
}

.page-content blockquote cite {
    display: block;
    margin-top: 1em;
    color: rgba(50, 83, 144, 0.7);
    font-size: 0.9em;
}

/* Tables — neutral palette: soft-grey header band, faint zebra on
   even rows. Borders use a black-overlay rgba so the dividers stay
   visible on both white and the zebra row background. */
.page-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
    border: 1px solid rgba(0, 0, 0, 0.12);
    table-layout: fixed;
}

.page-content table caption {
    width: 100%;
    white-space: normal;
    word-wrap: break-word;
    margin: 1em;
}

.page-content th {
    background-color: var(--c-surface-tint);
    color: var(--c-text);
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.page-content td,
.page-content th {
    padding: 1em;
    text-align: left;
    border: 1px solid rgba(0, 0, 0, 0.12);
    min-width: 120px;
}

.page-content tbody tr:nth-child(even) {
    background-color: var(--c-surface-soft);
}

/* Drop the leading margin off the first thing in any cell so headings
   that open a column don't push their text below the cell padding. */
.page-content table td > *:first-child,
.page-content table th > *:first-child {
    margin-top: 0;
}

/* Brand the inline links inside tables — the global .page-content a
   rule reaches them, but the underline below uses a translucent brand
   color that disappears on the zebra band. Tighten that here. */
.page-content table a {
    color: var(--c-brand);
    border-bottom-color: var(--c-brand);
}

.page-content table a:hover {
    color: var(--c-brand-dark);
    border-bottom-color: var(--c-brand-dark);
}

/* Код */
.page-content pre {
    background-color: var(--c-surface-soft);
    padding: 1.5em;
    margin: 2em 0;
    border-radius: 4px;
    border: 1px solid rgba(50, 83, 144, 0.1);
}

.page-content code {
    font-family: 'JetBrains Mono', 'Fira Code', Monaco, Consolas, monospace;
    font-size: 0.9em;
    color: var(--c-brand);
    background-color: rgba(50, 83, 144, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

/* Определения */
.page-content dt {
    color: var(--c-brand);
    font-weight: 600;
    margin-top: 1.2em;
}

.page-content dd {
    margin-left: 2em;
    margin-top: 0.5em;
    color: #566573;
}

/* Ссылки */
.page-content a {
    color: var(--c-brand);
    text-decoration: none;
    border-bottom: 1px solid rgba(50, 83, 144, 0.2);
    transition: border-color 0.2s ease, color 0.2s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.page-content a:hover {
    color: var(--c-brand-dark);
    border-bottom-color: var(--c-brand-dark);
}

/* Горизонтальная линия */
.page-content hr {
    margin: 2em 0;
    border: none;
    height: 1px;
    background-color: rgba(50, 83, 144, 0.2);
}

/* Изображения */
.page-content img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    display: block;
}

.page-content figure {
    margin: 1em 0;
}

.page-content figcaption {
    margin-top: 0.5em;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .page-content table caption {
        margin: 1em 0;
    }
}

@media (max-width: 768px) {
    .page-content h1 {
        font-size: 1.8em;
    }

    .page-content h2 {
        font-size: 1.6em;
    }

    .page-content h3 {
        font-size: 1.4em;
    }

    .page-content h4 {
        font-size: 1.2em;
    }

    .page-content h5 {
        font-size: 1.0em;
    }

    .page-content h6 {
        font-size: 0.9em;
    }

    .page-content blockquote {
        padding: 1em;
        margin: 1.5em 0;
    }

    .page-content pre {
        padding: 1em;
        margin: 1.5em 0;
    }
}

/* Стили для планшетов */
@media (min-width: 769px) {
    .page-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .page-content td,
    .page-content th {
        padding: 0.8em;
        width: 1%;
    }
}

/* Стили для мобильных устройств */
@media (max-width: 768px) {
    .page-content table {
        display: block;
        width: 100%;
        margin: 1em 0;
        border: none;
        background: transparent;
    }

    .page-content table caption {
        display: flex;
        justify-content: center;
    }

    .page-content thead {
        display: none;
    }

    .page-content tbody,
    .page-content tr,
    .page-content td {
        display: block;
        width: 100%;
    }

    .page-content tr {
        margin-bottom: 1em;
        background: var(--c-surface);
        border: 1px solid var(--c-surface-soft);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .page-content td {
        position: relative;
        padding: 0.8em 1em;
        border-bottom: 1px solid var(--c-surface-soft);
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 2.5em;
    }

    .page-content td:last-child {
        border-bottom: none;
    }

    /* Используем data-header для отображения заголовков */
    .page-content td::before {
        content: attr(data-header);
        font-weight: 600;
        color: var(--c-brand);
        padding-right: 1em;
        flex: 1;
        max-width: 40%;
    }

    /* Стили для контента ячейки */
    .page-content td .cell-content {
        flex: 2;
        text-align: right;
    }

    .page-content tr:nth-child(even) {
        background-color: var(--c-surface-soft);
    }

    .page-content td {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* Дополнительные стили для маленьких экранов */
@media (max-width: 480px) {
    .page-content td {
        padding: 0.7em 1em;
        font-size: 0.9em;
        flex-direction: column;
        align-items: flex-start;
    }

    .page-content td::before {
        margin-bottom: 0.3em;
        max-width: 100%;
    }

    .page-content td .cell-content {
        width: 100%;
        text-align: left;
    }

    .page-content tr {
        margin-bottom: 0.8em;
    }
}

.wp-video {
    margin: 0.8em 0;
}


.feedback-section {
    font-family: Avenir Next Cyr, sans-serif;
    font-style: normal;
    padding: var(--section-py) 0;
}

/* The brand-tinted band reads as a homepage feature — on internal
   pages the form should sit flush with the surrounding content, not
   carry its own coloured container. */
.homepage .feedback-section {
    background: var(--c-surface-tint);
}

.feedback-section .homepage-title {
    margin-bottom: var(--section-gy);
}

/* Editor-facing warning shown when the block is rendered without
   either a Google Forms URL or any configured fields — bold red so
   it can't be missed inside the otherwise calm section. */
.feedback-not-configured {
    color: var(--c-danger);
    font-weight: 700;
}

.feedback-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.feedback-description {
    margin-bottom: 2rem;
    line-height: 1.6;
    color: var(--c-text);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--c-text);
}

.required::after {
    content: '*';
    color: var(--c-danger);
    margin-left: 4px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--c-border);
    background: var(--c-surface-soft);
    transition: border-color 0.3s ease;
    margin-top: 4px;
    border-radius: 0;
}

.form-input:focus {
    outline: none;
    border-color: var(--c-brand);
}

.form-input.error {
    border-color: var(--c-danger);
}

.error-message {
    color: var(--c-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.visible {
    display: block;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Radio/checkbox groups in contact form. */
.form-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 20px;
    color: var(--c-text);
}

.form-choice input[type="radio"],
.form-choice input[type="checkbox"] {
    flex-shrink: 0;
    accent-color: var(--c-brand);
    margin: 0;
}

/* Native <select> styled like .form-input. */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23474747' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 36px;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Site-wide button system. Resting state: soft-surface fill, brand
   border, brand text — same look as the .share-button used in the
   tabs block. On hover the whole button shifts as one unit: fill,
   border and text colour all change together so it reads as a
   single colored block (no thin outline ring). */
.btn,
.btn-submit,
.empty-state__action,
.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-brand);
    color: var(--c-brand);
    font-family: Montserrat, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn:hover:not(:disabled),
.btn-submit:hover:not(:disabled),
.empty-state__action:hover,
.empty-state__action:focus-visible,
.share-button:hover {
    background: var(--c-brand-dark);
    border-color: var(--c-brand-dark);
    color: var(--c-surface);
    outline: none;
}

.btn:disabled,
.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn svg,
.btn-submit svg,
.empty-state__action svg,
.share-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Primary: form submit. Filled brand so it dominates over Clear. */
.btn-submit {
    background: var(--c-brand);
    color: var(--c-surface);
}

.btn-submit:hover:not(:disabled) {
    background: var(--c-brand-dark);
    border-color: var(--c-brand-dark);
    color: var(--c-surface);
}

/* Secondary: form reset / destructive — outlined neutral so it
   stays quieter than Submit, but with a white fill + visible dark
   border so it doesn't disappear into the form's grey background. */
.btn-clear {
    background: var(--c-surface);
    border-color: rgba(0, 0, 0, 0.25);
    color: var(--c-text);
}

.btn-clear:hover:not(:disabled) {
    background: var(--c-text);
    border-color: var(--c-text);
    color: var(--c-surface);
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--c-surface);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.success-message {
    display: none;
    background-color: var(--c-success-bg);
    color: var(--c-success-text);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.character-count {
    color: #666;
    font-size: 0.875rem;
    text-align: right;
    margin-top: 0.25rem;
}

.hidden-field {
    display: none;
    visibility: hidden;
    position: absolute;
    left: -9999px;
}


/* Стили для секции новостей */
.site-news {
    padding: var(--section-py) 0;
    background-color: var(--c-surface-soft);
}

/* Грид для главной страницы - всегда 3 колонки */
.site-news__grid {
    display: grid;
    gap: var(--block-gap);
}

@media (max-width: 991px) {
    .site-news__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .site-news__grid {
        grid-template-columns: 1fr;
    }
}

/* Базовая структура сетки */
.site-news__grid {
    display: grid;
    gap: var(--block-gap);
}

.site-news__grid--2-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-news__grid--3-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-news__grid--4-columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.site-news__grid--5-columns {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.site-news--all-news .site-news__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* Всегда 3 колонки по умолчанию */
}

.site-news--all-news {
    background-color: var(--c-surface);
    padding: 0;
}

/* Адаптивность для страницы всех новостей */
@media (max-width: 991px) {
    .site-news--all-news .site-news__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .site-news--all-news .site-news__grid {
        grid-template-columns: 1fr;
    }
}

/* Карточка новости */
.site-news__item {
    display: flex;
    flex-direction: column;
    background-color: var(--c-surface);
    transition: all 0.3s ease;
    overflow: hidden;
}

.site-news--all-news .site-news__item {
    background-color: var(--c-surface-soft);
}

/* Контейнер для изображения */
.site-news__image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Строго квадратное соотношение */
    overflow: hidden;
    background-color: var(--c-surface-soft);
}

.site-news__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.site-news__grid--2-columns .site-news__image-wrapper,
.site-news__grid--3-columns .site-news__image-wrapper,
.site-news__grid--4-columns .site-news__image-wrapper,
.site-news__grid--5-columns .site-news__image-wrapper {
    padding-bottom: 100%;
    aspect-ratio: 1;
}

.site-news__item:hover .site-news__image {
    transform: scale(1.05);
}

/* Контент карточки */
.site-news__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: var(--card-py) var(--card-px);
}

/* Заголовок */
.site-news__title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 500;
    margin: 0;
}

.site-news__link {
    color: var(--c-brand);
    text-decoration: none;
    transition: color 0.3s ease;
    font-family: Montserrat, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.5;
}

.site-news__link:hover {
    color: var(--c-brand-dark);
}

/* Мета-информация */
.site-news__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;

    color: #666;
    font-family: Montserrat, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
}

.site-news__date, .site-news__category {
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-news__date img, .site-news__category img {
    width: 16px;
    height: 16px;
}

.site-news__category {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-news__category:hover {
    color: #292929;
}

/* Текст новости */
.site-news__summary {
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: 'Avenir Next Cyr', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* Адаптивность */
@media (max-width: 1400px) {
    .site-news__grid--5-columns {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .site-news__grid--4-columns,
    .site-news__grid--5-columns {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .site-news__grid--3-columns,
    .site-news__grid--4-columns,
    .site-news__grid--5-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .site-news__grid {
        grid-template-columns: 1fr !important;
    }
}

/* Кнопка "Смотреть все" */
.site-news__footer {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    text-align: center;
}

/* Unified vertical spacing — one section rhythm everywhere. Both tokens
   resolve to the same value; --section-gy is kept as an alias so existing
   selectors that target sub-row spacing (title↔content) stay readable.
   Homepage scopes a larger value locally (more air for the landing-style
   colored bands) — see the .homepage override below. */
:root {
    --section-py: 2rem;
    --section-gy: var(--section-py);
    --block-gap: 20px;    /* grid/flex gap between cards/tiles/items */
    --card-py: 28px;      /* card vertical padding */
    --card-px: 24px;      /* card horizontal padding */

    /* Typography — host font for the theme; core overrides (e.g. ASW) read
       this token so they stay portable when the theme font changes. */
    --font-base:      "Avenir Next Cyr", sans-serif;

    /* Color tokens — only the heaviest-reused brand/text values are aliased
       here. Section background tints, border greys, and one-off hex codes
       are intentionally left as raw hex pending a separate visual review. */
    --c-brand:        #325390;
    --c-brand-dark:   #092655;
    --c-text:         #474747;
    --c-text-muted:   #6c757d;

    /* Surfaces — slightly off-white default (warmer than pure #ffffff,
       softer on the eyes for large areas of body text). */
    --c-surface:        #fffdfd;     /* default page surface */
    --c-surface-soft:   #f7f7f9;     /* alternate band (cool neutral) */
    /* Brand-derived accent tint — color-mix keeps it in the same hue
       family as --c-brand instead of the previous sky-blue (#e6f0fb)
       which read as a different palette. */
    --c-surface-tint:   color-mix(in srgb, var(--c-brand) 10%, white);

    /* Borders / dividers */
    --c-border:         #e5e7eb;

    /* Functional / status — kept for form feedback */
    --c-danger:         #dc3545;
    --c-success-bg:     #d4edda;
    --c-success-text:   #155724;

    /* Scrollbar palette — softer than the raw brand colour so the bar
       reads as a calm theme accent rather than a focal element. The
       hover state lifts to full brand for a clear interaction cue. */
    --c-scrollbar-track:       var(--c-surface-soft);
    --c-scrollbar-thumb:       color-mix(in srgb, var(--c-brand) 35%, white);
    --c-scrollbar-thumb-hover: var(--c-brand);
}
@media (max-width: 767px) {
    :root {
        --section-py: 1rem;
        --block-gap: 16px;
        --card-py: 20px;
        --card-px: 16px;
    }
}

.homepage { --section-py: 3rem; }
@media (max-width: 767px) {
    .homepage { --section-py: 1.5rem; }
}

/* Universal vertical rhythm for all templates that use .main-content-wrapper
   (every template except homepage). The wrapper owns top/bottom outer
   padding and the gap between its direct children — breadcrumbs, the
   content block, pagination, etc. — so they visually belong to one
   content area instead of floating as separate bands. Token-driven, so
   spacing scales correctly on mobile via the --section-py override. */
.main-content-wrapper {
    padding: var(--section-py) 0;
    gap: var(--section-py);
}
.main-content-wrapper > * {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* basic-with-custom-blocks: blocks themselves are spacing-agnostic — gap on
   the wrapper spaces siblings uniformly regardless of which/how many blocks
   render. Reset zeros each block's own outer padding so existing per-block
   section spacing doesn't stack with the wrapper gap. */
.page-content-content {
    display: flex;
    flex-direction: column;
    gap: var(--section-py);
}
.page-content-content > * {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Tighten typography rhythm inside the_content() output.
   Original .page-content rules were tuned for long-form articles;
   on simpler pages the resulting whitespace is too loose. */
.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
    margin: 0.6em 0 0.3em;
}
.page-content p {
    margin: 0.4em 0;
}
.page-content ul,
.page-content ol {
    margin: 0 0 0.75em;
}
.page-content > *:first-child { margin-top: 0; }
.page-content > *:last-child { margin-bottom: 0; }

/* Leading image: drop top margin even when wrapped by classic-editor <p>
   or by the Sienna accessibility plugin (data-asw-* wrappers). :has()
   targets a first-child wrapper whose only meaningful content is an img. */
.page-content > img:first-child,
.page-content > figure:first-child img,
.page-content > *:first-child:has(> img:only-child) img {
    margin-top: 0;
}

/* Visual spacer rendered by the the_content filter when editors leave
   empty paragraphs as separators (the typical TinyMCE/Classic side-
   effect of pressing Enter twice). The PHP filter folds runs of empty
   <p> into a single semantic spacer with a size class — 1 / 2 / 3,
   capped — so an accidentally long run can't blow out the layout. */
.content-spacer {
    display: block;
    width: 100%;
}
.content-spacer--1 { height: 1em; }
.content-spacer--2 { height: 2em; }
.content-spacer--3 { height: 3em; }

/* Homepage keeps the legacy block-owns-spacing model: colored bg blocks
   (.useful-links, .icon-cards, .feedback-section, .site-news) carry their
   own padding to form full bands. Transparent blocks below need explicit
   padding too, scoped to .homepage so it doesn't apply on basic-with-
   custom-blocks pages where the wrapper handles rhythm via gap. */
.homepage .rich-text-content {
    padding: var(--section-py) 0;
}

.page404-wrapper { padding: 6rem 0; }
@media (max-width: 991px) { .page404-wrapper { padding: 4rem 0; } }
@media (max-width: 575px) { .page404-wrapper { padding: 3rem 0; } }

/* Constrain icon dimensions regardless of SVG natural size */
.header-nav__social ul li img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}
.header-nav__contacts-item img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}
