/*
Theme Name: Duma Sarov
Theme URI: https://дума-саров.рф/
Author: Duma Sarov project
Description: Официальная модульная тема Городской Думы города Сарова.
Version: 1.3.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: duma-sarov
*/

/* =========================================================
   ИНДИВИДУАЛЬНАЯ СТРАНИЦА ДЕПУТАТА
   ========================================================= */

.deputy-single {
    color: var(--ink, #17243A);
}

.deputy-single__hero {
    padding-top: 28px;
    padding-bottom: 30px;
}

.deputy-single__title {
    max-width: 900px;
    margin: 18px 0 0;
    /* Шапка депутата имеет тёмный фон (--navy из .page-hero),
       поэтому текст — парный токен. Жёсткий #fff не следовал схемам. */
    color: var(--on-navy);
    font-family: "Golos Text", sans-serif;
    font-size: clamp(1.8rem, 3.2vw, 2.7rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.deputy-single__subtitle {
    max-width: 900px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .88);
    font-size: 1.02rem;
    font-weight: 500;
    line-height: 1.5;
}

.deputy-single__body {
    padding-top: 32px;
    padding-bottom: 64px;
}

/* Основная сетка */

.deputy-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.25fr) minmax(285px, .95fr);
    gap: 22px;
    align-items: start;
}

.deputy-layout__main {
    display: grid;
    min-width: 0;
    gap: 20px;
}

/* Основные карточки */

.deputy-profile,
.deputy-district-card,
.deputy-reception-card {
    min-width: 0;
    margin: 0;
    padding: 22px;
    background: var(--paper, #fff);
    border: 1px solid var(--line, #DCE2EB);
    border-radius: var(--r, 4px);
    color: var(--ink, #17243A);
    box-shadow: none;
}

/* =========================================================
   ПРОФИЛЬ ДЕПУТАТА
   ========================================================= */

.deputy-profile__identity {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 140px;
    margin-bottom: 22px;
}

.deputy-profile__photo {
    display: grid;
    flex: 0 0 112px;
    width: 112px;
    height: 140px;
    overflow: hidden;
    place-items: center;
    background: var(--navy, #0B2E6F);
    border-radius: var(--r, 4px);
}

/* Блок A14: фото приходит в размере duma-deputy-single (320×400, 4:5),
   который совпадает с пропорцией рамки 112×140. Принудительные
   переопределения через !important больше не нужны: класс уникален,
   конкурирующих правил для него нет. */
.deputy-profile__image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center 20%;
}

.deputy-profile__avatar {
    display: grid;
    flex: 0 0 112px;
    width: 112px;
    height: 140px;
    min-height: 140px;
    place-items: center;
    border-radius: var(--r, 4px);
    font-size: 1.7rem;
}

.deputy-profile__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* =========================================================
   ПОМОЩНИКИ ДЕПУТАТА (блок A16)
   ========================================================= */

.deputy-assistants {
    margin-top: 22px;
}

.deputy-assistants__list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.deputy-assistant {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--paper);
}

.deputy-assistant__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r);
    background: var(--sky);
    color: var(--blue-d);
}

.deputy-assistant__icon .ic {
    width: 19px;
    height: 19px;
}

.deputy-assistant__body {
    min-width: 0;
}

.deputy-assistant__name {
    margin: 0;
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink);
}

.deputy-assistant__role {
    margin: 2px 0 0;
    font-size: .8rem;
    color: var(--muted);
}

.deputy-assistant__contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    font-size: .85rem;
}

.deputy-assistant__contacts li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.deputy-assistant__contacts .ic {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--blue);
}

.deputy-assistant__contacts a {
    color: var(--blue-d);
    overflow-wrap: anywhere;
}

.deputy-assistants__notice {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 10px 0 0;
    font-size: .78rem;
    color: var(--muted);
}

.deputy-assistants__notice .ic {
    flex: none;
    width: 15px;
    height: 15px;
    margin-top: .15em;
}

@media (max-width: 620px) {
    .deputy-assistant {
        padding: 11px 12px;
    }

    .deputy-assistant__contacts {
        flex-direction: column;
        gap: 5px;
    }
}

/* Метки округа и должности */

.deputy-chip {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 10px;
    border: 1px solid var(--line, #DCE2EB);
    border-radius: 3px;
    background: var(--bg, #F4F6FA);
    color: var(--soft, #344258);
    font: 600 .74rem "Golos Text", sans-serif;
    line-height: 1.3;
}

.deputy-chip--district {
    border-color: var(--blue-l, #D4E1FA);
    background: var(--sky, #E9F0FA);
    color: var(--blue-d, #164BB5);
}

.deputy-chip--position {
    border-color: var(--line, #DCE2EB);
    background: var(--paper, #fff);
    color: var(--navy, #0B2E6F);
}

/* =========================================================
   ИНФОРМАЦИОННЫЕ РАЗДЕЛЫ
   ========================================================= */

.deputy-section {
    margin: 22px 0 0;
    padding: 0;
    border: 0;
}

.deputy-section__title {
    margin: 0 0 12px;
    color: var(--ink, #17243A);
    font: 700 1.05rem "Golos Text", sans-serif;
    line-height: 1.35;
}

.deputy-section__text {
    color: var(--soft, #344258);
    font-size: .94rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.deputy-section__text p {
    margin: 0 0 .85em;
}

.deputy-section__text p:last-child {
    margin-bottom: 0;
}

.deputy-section__text ul,
.deputy-section__text ol {
    padding-left: 1.4em;
}

.deputy-section__text li {
    margin-bottom: .35em;
}

.deputy-election-line {
    margin: 7px 0 0;
    color: var(--muted, #68758A);
    font-size: .88rem;
    line-height: 1.55;
}

/* =========================================================
   ПУБЛИЧНЫЕ ОТЧЁТЫ
   ========================================================= */

.deputy-reports {
    display: grid;
    gap: 8px;
}

.deputy-report {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line, #DCE2EB);
    border-radius: var(--r, 4px);
    background: var(--paper, #fff);
    transition: border-color .15s ease, background-color .15s ease;
}

.deputy-report:hover {
    border-color: var(--blue-l, #7FA5F0);
    background: var(--bg, #F4F6FA);
}

.deputy-report__icon {
    color: var(--blue, #1E56D6);
    font-size: 16px;
    line-height: 1;
}

/* Иконка — встроенный SVG (см. duma_sarov_icon). Размер в em,
   чтобы значок увеличивался вместе с текстом в режиме доступности. */
.deputy-report__icon .ic {
    width: 1.06em;
    height: 1.06em;
}

.deputy-report__body {
    min-width: 0;
}

.deputy-report__title {
    color: var(--ink, #17243A);
    font-size: .87rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.deputy-report__meta {
    margin-top: 4px;
    color: var(--muted, #68758A);
    font-size: .74rem;
    line-height: 1.45;
}

.deputy-report__pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    border: 1px solid var(--line, #DCE2EB);
    border-radius: var(--r, 4px);
    background: var(--paper, #fff);
    color: var(--blue-d, #164BB5);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .15s ease, background-color .15s ease;
}

.deputy-report__pdf:hover {
    border-color: var(--blue, #1E56D6);
    background: var(--sky, #E9F0FA);
    color: var(--navy, #0B2E6F);
}

.deputy-report__pdf:focus-visible {
    outline: 2px solid var(--focus, #F2A516);
    outline-offset: 3px;
}

.deputy-report__pdf .ic {
    width: 1.15em;
    height: 1.15em;
}

.deputy-report__archive {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid var(--line, #DCE2EB);
    border-radius: 3px;
    background: var(--bg, #F4F6FA);
    color: var(--muted, #68758A);
    font-size: .72rem;
    line-height: 1.4;
    white-space: nowrap;
}

.deputy-report__missing {
    color: var(--muted, #68758A);
    font-size: .74rem;
}

/* =========================================================
   ИЗБИРАТЕЛЬНЫЙ ОКРУГ
   ========================================================= */

.deputy-district-card {
    padding: 20px 22px;
}

.deputy-district-card__streets {
    display: block;
    padding: 11px 13px;
    border: 1px solid var(--line, #DCE2EB);
    border-radius: var(--r, 4px);
    background: var(--bg, #F4F6FA);
    color: var(--ink, #17243A);
    font-size: .86rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.deputy-district-card__check {
    margin: 13px 0 0;
    color: var(--muted, #68758A);
    font-size: .82rem;
    line-height: 1.55;
}

.deputy-district-card__check a {
    color: var(--blue, #1E56D6);
    text-decoration: none;
}

.deputy-district-card__check a:hover {
    text-decoration: underline;
}

/* =========================================================
   ПРИЁМ ГРАЖДАН
   ========================================================= */

.deputy-reception-card {
    padding: 21px 22px;
}

.deputy-reception-card__title {
    margin: 0 0 13px;
    color: var(--navy, #0B2E6F);
    font: 700 .8rem "Golos Text", sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.deputy-reception-list {
    margin: 0;
    padding: 0;
}

.deputy-reception-list__row {
    display: grid;
    grid-template-columns: minmax(82px, .8fr) minmax(0, 1.2fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line, #DCE2EB);
}

.deputy-reception-list__row:last-child {
    border-bottom: 0;
}

.deputy-reception-list__row dt {
    margin: 0;
    color: var(--muted, #68758A);
    font-size: .82rem;
    line-height: 1.5;
}

.deputy-reception-list__row dd {
    margin: 0;
    color: var(--ink, #17243A);
    font-size: .83rem;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.deputy-reception-list__row dd a {
    color: var(--blue, #1E56D6);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.deputy-reception-list__row dd a:hover {
    text-decoration: underline;
}

/*
 * Служебное указание сотруднику («Публикуйте только официально
 * подтверждённые сведения…») убрано с публичной страницы по замечанию
 * заказчика — оно адресовано редактору, а не жителю, и осталось подсказкой
 * в форме карточки депутата. Вместо него — нейтральная строка для посетителя,
 * когда график приёма ещё не заполнен.
 */
.deputy-reception-card__empty {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r, 4px);
    background: var(--sky);
    color: var(--soft);
    font-size: .8rem;
    line-height: 1.55;
}

.deputy-reception-card__button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--navy, #0B2E6F);
    border-radius: var(--r, 4px);
    background: var(--navy);
    color: var(--on-navy);
    font-size: .87rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.deputy-reception-card__button:hover {
    border-color: var(--navy-d);
    background: var(--navy-d);
    color: var(--on-navy);
}

.deputy-reception-card__button:focus-visible {
    outline: 2px solid var(--focus, #F2A516);
    outline-offset: 3px;
}

.deputy-reception-card__button .ic {
    width: 1.15em;
    height: 1.15em;
}

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

@media (max-width: 1120px) {
    .deputy-layout {
        grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr);
        gap: 16px;
    }

    .deputy-profile,
    .deputy-district-card,
    .deputy-reception-card {
        padding: 19px;
    }
}

@media (max-width: 782px) {
    .deputy-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .deputy-single__body {
        padding-top: 22px;
        padding-bottom: 44px;
    }

    .deputy-layout__main {
        gap: 16px;
    }

    .deputy-profile,
    .deputy-district-card,
    .deputy-reception-card {
        padding: 18px;
    }
}

@media (max-width: 620px) {
    .deputy-single__hero {
        padding-top: 20px;
        padding-bottom: 24px;
    }

    .deputy-single__title {
        font-size: clamp(1.55rem, 7vw, 2rem);
    }

    .deputy-single__subtitle {
        font-size: .92rem;
    }

    .deputy-profile,
    .deputy-district-card,
    .deputy-reception-card {
        padding: 15px;
    }

    .deputy-profile__identity {
        align-items: flex-start;
        gap: 13px;
        min-height: 100px;
    }

    .deputy-profile__photo,
    .deputy-profile__avatar {
        flex-basis: 76px;
        width: 76px;
        height: 100px;
        min-height: 100px;
    }

    .deputy-profile__avatar {
        font-size: 1.25rem;
    }

    .deputy-profile__badges {
        gap: 6px;
    }

    .deputy-chip {
        font-size: .69rem;
    }

    .deputy-section {
        margin-top: 19px;
    }

    .deputy-report {
        grid-template-columns: 18px minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .deputy-report__pdf,
    .deputy-report__archive,
    .deputy-report__missing {
        grid-column: 2;
        justify-self: start;
    }

    .deputy-reception-list__row {
        grid-template-columns: minmax(76px, .75fr) minmax(0, 1.25fr);
        gap: 8px;
    }
}

/* =========================================================
   ДОСТУПНОСТЬ И УПРАВЛЕНИЕ
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .deputy-report,
    .deputy-report__pdf,
    .deputy-reception-card__button {
        transition: none;
    }
}

/* ==========================================================================
   ФОРМА ОБРАЩЕНИЯ ГРАЖДАНИНА
   Разметку выдаёт модуль приёма обращений плагина (шорткод
   [duma_appeal_form]). Оформление — здесь, в визуальном слое темы,
   чтобы форма выглядела как остальные формы сайта и подчинялась
   цветовым схемам через токены дизайн-системы.
   ========================================================================== */

.appeal {
    max-width: 46rem;
}

.appeal__notice {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: var(--r, 4px);
    background: var(--sky);
    margin-bottom: 20px;
}

.appeal__notice-title {
    font: 600 1rem "Golos Text", sans-serif;
    color: var(--ink);
    margin: 0 0 8px;
}

.appeal__notice p {
    font-size: .86rem;
    line-height: 1.6;
    color: var(--soft);
    margin: 0 0 8px;
}

.appeal__notice p:last-child {
    margin-bottom: 0;
}

.appeal__legal-note {
    font-size: .78rem;
    color: var(--muted);
}

/* Отдельная видимая кнопка обращения к председателю. */
.appeal__chair {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border: 1px solid var(--navy);
    border-radius: var(--r, 4px);
    background: var(--paper);
    margin-bottom: 24px;
}

.appeal__chair-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.appeal__chair-text strong {
    font: 600 .95rem "Golos Text", sans-serif;
    color: var(--ink);
}

.appeal__chair-text span {
    font-size: .84rem;
    color: var(--soft);
}

.appeal__chair-button {
    flex: none;
    min-height: 2.75rem;
}

.appeal__form-title,
.appeal__success-title {
    font: 600 1.15rem "Golos Text", sans-serif;
    color: var(--ink);
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--navy);
}

.appeal__field {
    margin: 0 0 18px;
}

.appeal__label {
    display: block;
    font: 600 .84rem "Golos Text", sans-serif;
    color: var(--ink);
    margin-bottom: 6px;
}

.appeal__req {
    color: var(--red);
}

.appeal__input {
    width: 100%;
    min-height: 2.75rem;
    padding: .55rem .75rem;
    border: 1px solid var(--line);
    border-radius: var(--r, 4px);
    background: var(--paper);
    color: var(--ink);
    font-size: .9rem;
    font-family: inherit;
}

.appeal__textarea {
    min-height: 10rem;
    line-height: 1.6;
    resize: vertical;
}

.appeal__input:focus {
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 3px var(--sky-2);
}

.appeal__input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.appeal__hint {
    display: block;
    margin-top: 6px;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--muted);
}

.appeal__error {
    display: block;
    margin-top: 6px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--red);
}

.appeal__field--error .appeal__input {
    border-color: var(--red);
}

.appeal__check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .84rem;
    line-height: 1.55;
    color: var(--soft);
}

.appeal__check input {
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: .15rem;
}

.appeal__alert {
    padding: 12px 14px;
    border-radius: var(--r, 4px);
    font-size: .86rem;
    line-height: 1.55;
    margin-bottom: 18px;
    border: 1px solid var(--line);
}

.appeal__alert--error {
    border-color: var(--red);
    background: var(--red-bg);
    color: var(--red);
}

.appeal__alert--warning {
    border-color: var(--amber-ln);
    background: var(--amber-bg);
    color: var(--amber-ink);
}

/* Поле-ловушка для автоматических отправок: скрыто от человека,
   но остаётся в разметке. Скрывается сдвигом, а не display:none,
   чтобы простейшие заполнители форм его видели. */
.appeal__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.appeal__actions {
    margin: 22px 0 12px;
}

.appeal__submit {
    min-height: 2.75rem;
}

.appeal__footnote {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.55;
}

.appeal__success {
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: var(--r, 4px);
    background: var(--paper);
}

.appeal__success-list {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
}

.appeal__success-list dt {
    font: 600 .72rem "Golos Text", sans-serif;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

.appeal__success-list dd {
    margin: 2px 0 0;
    font-size: .95rem;
    color: var(--ink);
}

@media (max-width: 620px) {
    .appeal__chair {
        align-items: stretch;
    }

    .appeal__chair-button {
        width: 100%;
        justify-content: center;
    }

    .appeal__submit {
        width: 100%;
        justify-content: center;
    }
}
