/* Юристократ — дополнения. Цвета и шрифты взяты из темы lawyer-zone. */
:root {
    --ye-accent: #a61717;
    --ye-accent-dark: #841212;
    --ye-gold: #c2b697;
    --ye-text: #363435;
    --ye-heading: #3a3a3a;
    --ye-line: #e6e2d8;
    --ye-soft: #f8f6f1;
    --ye-wa: #25d366;
    --ye-wa-dark: #1da851;
}

/* ---------- Плавающая кнопка WhatsApp ---------- */
.ye-wa-float {
    position: fixed;
    right: 24px;
    right: calc(24px + env(safe-area-inset-right));
    bottom: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}
.ye-wa-float__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ye-wa);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    transition: transform .2s ease, background-color .2s ease;
    position: relative;
}
.ye-wa-float__btn::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    border-radius: 50%;
    border: 2px solid var(--ye-wa);
    animation: ye-pulse 2.4s ease-out infinite;
    pointer-events: none;
}
.ye-wa-float__label {
    background: #fff;
    color: var(--ye-text);
    font-family: "Roboto Condensed", sans-serif;
    font-size: 15px;
    line-height: 1.2;
    padding: 9px 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.ye-wa-float:hover .ye-wa-float__btn,
.ye-wa-float:focus-visible .ye-wa-float__btn {
    background: var(--ye-wa-dark);
    transform: scale(1.06);
}
.ye-wa-float:hover .ye-wa-float__label,
.ye-wa-float:focus-visible .ye-wa-float__label {
    opacity: 1;
    transform: none;
}
.ye-wa-float:focus-visible .ye-wa-float__btn {
    outline: 3px solid var(--ye-gold);
    outline-offset: 3px;
}
@keyframes ye-pulse {
    0% { transform: scale(1); opacity: .7; }
    70% { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}
@media (max-width: 767px) {
    .ye-wa-float { right: 16px; bottom: 16px; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); }
    .ye-wa-float__btn { width: 54px; height: 54px; }
    .ye-wa-float__label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ye-wa-float__btn::after { animation: none; display: none; }
}
/* Кнопка «наверх» темы стоит в том же углу — поднимаем её над WhatsApp */
.sm-up-container, #back-to-top, .back-to-top, .evision-back-to-top {
    bottom: 96px !important;
}
@media (max-width: 767px) {
    .sm-up-container, #back-to-top, .back-to-top, .evision-back-to-top { bottom: 84px !important; }
}

/* ---------- Вопрос — ответ ---------- */
.ye-faq {
    margin: 0 0 40px;
    color: var(--ye-text);
}
.ye-faq__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 32px;
}
.ye-faq__nav a {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--ye-line);
    color: var(--ye-text) !important;
    font-size: 14px;
    line-height: 1.3;
    text-decoration: none !important;
    transition: border-color .2s, color .2s;
}
.ye-faq__nav a:hover,
.ye-faq__nav a:focus {
    border-color: var(--ye-accent);
    color: var(--ye-accent) !important;
}
.ye-faq__group {
    margin: 0 0 36px;
    scroll-margin-top: 100px;
}
.ye-faq__topic {
    font-family: "Playfair Display", serif;
    font-size: 24px;
    font-weight: 500;
    color: var(--ye-heading);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ye-gold);
}
.ye-faq__list {
    border-top: 1px solid var(--ye-line);
}
.ye-faq__item {
    border-bottom: 1px solid var(--ye-line);
}
.ye-faq__q {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 4px;
    cursor: pointer;
    list-style: none;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ye-heading);
    transition: color .2s;
}
.ye-faq__q::-webkit-details-marker { display: none; }
.ye-faq__q::marker { content: ""; }
.ye-faq__q:hover,
.ye-faq__item[open] > .ye-faq__q { color: var(--ye-accent); }
.ye-faq__q:focus-visible { outline: 2px solid var(--ye-gold); outline-offset: 2px; }
.ye-faq__icon {
    flex: 0 0 auto;
    position: relative;
    width: 14px;
    height: 14px;
    margin-top: 5px;
}
.ye-faq__icon::before,
.ye-faq__icon::after {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 14px;
    height: 2px;
    background: currentColor;
    transition: transform .25s ease;
}
.ye-faq__icon::after { transform: rotate(90deg); }
.ye-faq__item[open] .ye-faq__icon::after { transform: rotate(0deg); }
.ye-faq__a {
    padding: 0 4px 18px;
    font-size: 16px;
    line-height: 1.65;
}
.ye-faq__a > *:last-child { margin-bottom: 0; }
.ye-faq__a ul, .ye-faq__a ol { padding-left: 20px; margin: 0 0 12px; }
.ye-faq__empty { font-style: italic; }

/* ---------- Блок консультации ---------- */
.ye-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 40px 0 0;
    padding: 28px 32px;
    background: var(--ye-soft);
    border-left: 4px solid var(--ye-accent);
}
.ye-cta__title {
    font-family: "Playfair Display", serif;
    font-size: 22px;
    color: var(--ye-heading);
    margin: 0 0 6px;
}
.ye-cta__text { margin: 0; line-height: 1.55; }
.ye-cta__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    background: var(--ye-wa);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color .2s;
}
.ye-cta__btn:hover, .ye-cta__btn:focus { background: var(--ye-wa-dark); }
@media (max-width: 767px) {
    .ye-cta { flex-direction: column; align-items: stretch; padding: 22px 20px; }
    .ye-cta__btn { justify-content: center; }
}

/* ---------- Лайтбокс галерей ---------- */
.ye-lb {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 20, .92);
    opacity: 0;
    transition: opacity .2s ease;
    touch-action: pan-y;
}
.ye-lb.is-open { opacity: 1; }
.ye-lb__img {
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 100px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    background: #fff;
    user-select: none;
}
.ye-lb__cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    text-align: center;
    color: #eee;
    font-size: 14px;
    padding: 0 60px;
}
.ye-lb__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background-color .2s;
}
.ye-lb__btn:hover, .ye-lb__btn:focus { background: var(--ye-accent); outline: none; }
.ye-lb__close { top: 14px; right: 14px; }
.ye-lb__prev { left: 14px; top: 50%; margin-top: -24px; }
.ye-lb__next { right: 14px; top: 50%; margin-top: -24px; }
.ye-lb__count { position: absolute; top: 26px; left: 20px; color: #ccc; font-size: 14px; }
@media (max-width: 767px) {
    .ye-lb__img { max-width: 100vw; max-height: calc(100vh - 140px); }
    .ye-lb__prev, .ye-lb__next { top: auto; bottom: 46px; margin-top: 0; }
    .ye-lb__cap { bottom: 104px; padding: 0 16px; }
}
html.ye-lb-lock, html.ye-lb-lock body { overflow: hidden; }

/* Благодарственные письма в галерее: превью в пропорции листа А4 */
.ye-letters .gallery-item img,
.category-blagodarnosti .gallery-item img,
.ye-letters .wp-block-gallery img {
    border: 1px solid var(--ye-line);
    transition: box-shadow .2s, transform .2s;
}
.ye-letters .gallery-item a:hover img,
.category-blagodarnosti .gallery-item a:hover img,
.ye-letters .wp-block-gallery a:hover img {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
    transform: translateY(-2px);
}
.gallery a[data-ye-lb], .wp-block-gallery a[data-ye-lb], a.ye-zoom { cursor: zoom-in; }
/* Меню шапки: после добавления «Блог» и «Вопрос — ответ» возвращаем меню в одну строку с кнопкой */
@media (min-width: 1200px) {
    #primary-menu > li > a { padding-left: 7px; padding-right: 7px; }
}
@media (min-width: 992px) and (max-width: 1199px) {
    #primary-menu > li > a { padding-left: 5px; padding-right: 5px; font-size: 13px; }
}

/* Последнее письмо в неполном ряду не растягиваем на всю ширину */
.wp-block-gallery.ye-letters .blocks-gallery-item { flex-grow: 0; }
.wp-block-gallery.ye-letters.is-cropped .blocks-gallery-item img { object-position: top; }
