/* ============================================================
   custom.css — аккуратные улучшения поверх style.css / section.css.
   Правки не меняют фирменный стиль (зелёный #7AA392, тёмный #404040,
   шрифт Ubuntu), а чинят «прыжок» каруселей, приводят формы/инпуты и
   типографику к хорошим практикам, добавляют состояния фокуса и
   уважение к prefers-reduced-motion.
   ============================================================ */

/* ---- 1. Карусели: убираем «прыжок» при инициализации slick ----
   До того как slick добавит .slick-initialized, все слайды показаны
   стопкой, а затем схлопываются в один ряд — это и есть скачок высоты
   (CLS). Показываем только первый слайд, пока карусель не готова. */
.main_slider:not(.slick-initialized),
.mainDiplom:not(.slick-initialized),
.main_review:not(.slick-initialized) {
    overflow: hidden;
    max-height: 720px;
}
.main_slider:not(.slick-initialized) > *,
.mainDiplom:not(.slick-initialized) > *,
.main_review:not(.slick-initialized) > * {
    display: none !important;
}
.main_slider:not(.slick-initialized) > *:first-child,
.mainDiplom:not(.slick-initialized) > *:first-child,
.main_review:not(.slick-initialized) > *:first-child {
    display: block !important;
}
/* slick рисует на compositor-friendly свойствах — подсказываем браузеру */
.slick-track { will-change: transform; }
/* точки листалки крупнее для тача */
.slick-dots li button { min-width: 24px; min-height: 24px; }

/* ---- 2. Типографика: читаемый интерлиньяж и трекинг ---- */
body { line-height: 1.6; }
p, li, .block_oftext, .man-description, .services__block, .subtitle,
.review-description, .howwork__list-item, .form-agree {
    line-height: 1.6;
}
.block_oftext p { margin-bottom: 1em; }
.block_oftext ul, .block_oftext ol { margin: 0 0 1em 1.25em; list-style: revert; }
.block_oftext li { margin-bottom: .4em; }
/* Крупные заголовки — чуть плотнее (оптический трекинг) */
h1, .h1, .title { letter-spacing: -0.02em; }
h2, .h2, h3, .h3 { letter-spacing: -0.01em; }
/* Тело — комфортная длина строки для длинных текстов */
/* ширина .block_oftext задаётся ниже по типу страницы */
.block_oftext.srok, .about__content .block_oftext { max-width: none; }

/* ---- 3. Кнопки: радиус, плавность, состояние нажатия, фокус ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 8px;
    text-decoration: none;
    line-height: 1.2;
    transition: background-color .18s ease, color .18s ease,
                border-color .18s ease, transform .1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn:active { transform: scale(.98); }

/* ---- 4. Поля ввода: размер, выравнивание, радиус, фокус ---- */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    text-align: left;
    min-height: 48px;
    width: 100%;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;              /* 16px — чтобы iOS не зумил при фокусе */
    line-height: 1.4;
    color: #333;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8a8a8a; opacity: 1; }
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #5f8a76;
    box-shadow: 0 0 0 3px rgba(122, 163, 146, .28);
}
/* select: вернуть стрелку (перебита appearance:none) */
select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%237AA392' d='M6 8 0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}
/* Согласие — читабельнее и с воздухом */
.form-agree { margin-top: 4px; }

/* ---- 5. Фокус для клавиатуры (доступность) ---- */
a:focus-visible,
.btn:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.mobile-menu__link:focus-visible,
.heading__nav-item:focus-visible {
    outline: 3px solid rgba(122, 163, 146, .55);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---- 6. Ссылки-кнопки в навигации/подвале — комфортный тап-таргет ---- */
.heading__nav-item, .mobile-menu__link, .footer__copy-site a, .social a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.social a { display: inline-flex; align-items: center; }

/* ---- 7. Сетки: ровные колонки и одинаковая высота карточек ---- */
@media (min-width: 769px) {
    .services__list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
        align-items: stretch;
    }
    .services__list .services__item { width: auto; margin-bottom: 0; }

    .man-block {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
        align-items: stretch;
    }
    .man-block .man-item { width: auto; margin-bottom: 0; }
}
/* карточка услуги: контент прижат, кнопка — к низу */
.services__item {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
}
.services__item .btn { margin-top: auto; }
.man-item { border-radius: 12px; }

/* ---- 8. Медиа и переносы ---- */
img { height: auto; }
.thumb-wrap iframe, .thumb-wrap video { width: 100%; border-radius: 12px; }
/* не даём длинным словам/URL распирать вёрстку на мобильном */
.block_oftext { overflow-wrap: anywhere; }

/* ---- 9. Плавный скролл и уважение к reduced-motion ---- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    /* revealator анимирует появление на скролле — при reduced-motion
       показываем сразу, без движения */
    [class*="revealator"] { opacity: 1 !important; transform: none !important; }
}

/* ---- 10. Скрытые визуально, но доступные скринридеру подписи ---- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%);
    overflow: hidden; white-space: nowrap;
}

/* ---- 11. Форма-консультация на фоне-блокноте: без обрезки инпутов ----
   Раньше колонка формы сжималась флексом, плейсхолдеры обрезались, поля
   вылезали за пределы блокнота. Даём форме стабильную ширину и центрируем
   её на блокноте; большой padding заменяем на разумный. */
@media (min-width: 621px) {
    .consult__block {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .consult__form {
        padding: 40px 56px;
        gap: 48px;
        align-items: center;
        width: 100%;
    }
    .consult__form form {
        flex: 0 1 340px;
        min-width: 280px;
        max-width: 340px;
    }
    .consult__left {
        flex: 0 0 auto;
        border: none;             /* на блокноте рамка смотрелась пустым полем */
    }
    /* Платёжная форма шире — там select с длинными опциями */
    .consult__form.pay__form form { flex-basis: 380px; max-width: 420px; }
}
/* Поля внутри форм-блоков не должны прижиматься друг к другу вплотную */
.consult__form form > * { margin-bottom: 14px; }
.consult__form form > *:last-child { margin-bottom: 0; }

/* ============================================================
   Раунд 2 — по замечаниям на скриншотах.
   ============================================================ */

/* ---- 12. Цифры в кружках (были овалами из-за padding) ---- */
.number {
    width: 56px;
    height: 56px;
    min-width: 56px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    font-size: 28px;
}
.howwork__list-item { align-items: center; }

/* ---- 13. Фото сотрудников: единый размер, аккуратный кроп ---- */
.man-item { display: flex; flex-direction: column; }
.man-item .man-photo { overflow: hidden; border-radius: 8px; }
.man-item .man-photo img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    object-position: top center;
    display: block;
}
.man-name { text-align: center; }
.man-description { text-align: left; }

/* ---- 14. Карусель дипломов: одинаковая высота, по центру, без «хвоста» ---- */
.mainDiplom .slick-track { display: flex; align-items: center; }
.mainDiplom .slick-slide { height: auto; float: none; }
.mainDiplom .slick-item {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    box-sizing: border-box;
}
.mainDiplom .slick-item img {
    height: 260px !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

/* ---- 15. Отзывы: карточка ровная, кнопка «Читать полностью», модалка ---- */
.main_review .review-item {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
}
.main_review .review-description { display: flex; flex-direction: column; flex: 1; }
.review-more {
    margin-top: auto;
    align-self: flex-start;
    background: #404040;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease;
}
.review-more:hover { background: transparent; color: #404040; border: 1px solid #404040; }
.fancybox__content .review-full { max-width: 640px; padding: 8px; line-height: 1.6; }
.fancybox__content .review-full p { margin-bottom: .8em; }

/* ---- 16. Блок «Основатель / Об агентстве»: без пустоты, центрирование ---- */
.about_main { max-height: none; align-items: center; }
.about_main .aboutimg img { border-radius: 12px; display: block; }
@media (min-width: 769px) {
    .about_main .aboutimg { align-self: stretch; }
    .about_main .aboutimg img { height: 100%; object-fit: cover; }
}

/* ---- 17. Прайс и текстовые страницы: контент по центру в контейнере ---- */
.block_oftext { margin-left: auto; margin-right: auto; }
.table__price { width: 100%; }
.table__price-row { padding: 20px 0; align-items: baseline; }
.price__title { line-height: 1.4; }
.price__total { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- 18. Форма-консультация: держим в пределах блокнота ---- */
@media (min-width: 621px) {
    .consult__form {
        max-width: 940px;
        margin: 0 auto;
        padding: 48px 96px;
        gap: 32px;
        justify-content: center;
    }
    .consult__form form { flex: 0 1 300px; max-width: 300px; }
    .consult__form.pay__form form { flex-basis: 360px; max-width: 400px; }
}

/* ============================================================
   Раунд 3 — убрали Tailwind CDN (его Preflight ломал заголовки).
   Возвращаем нужные части: глобальный box-sizing и утилиты,
   которыми пользуются формы/кнопки. Заголовки теперь берут
   размеры из style.css (h2 больше не сбрасывается в inherit).
   ============================================================ */

/* глобальный box-sizing (был у Tailwind, теперь свой) */
*, *::before, *::after { box-sizing: border-box; }

/* компат-утилиты для оставшихся классов на формах и кнопках */
.block { display: block; }
.flex { display: flex; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.w-52 { width: 13rem; }
.m-auto { margin-left: auto; margin-right: auto; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.text-sm { font-size: .875rem; }
.font-semibold { font-weight: 600; }
.text-white { color: #fff; }
.pointer-events-auto { pointer-events: auto; }

/* заголовки: страховка на случай, если reset их занулил */
h1, .h1 { font-size: 36px; }
h2, .h2 { font-size: 32px; }
h3, .h3 { font-size: 28px; }
@media (max-width: 768px) {
    h1, .h1 { font-size: 28px; }
    h2, .h2 { font-size: 24px; }
    h3, .h3 { font-size: 22px; }
}

/* Прайс/текстовые страницы шире; фон-листья (.consult) остаются */
.block_oftext { max-width: 900px; }
.type-post .block_oftext { max-width: 74ch; }
.type-page .block_oftext,
.type-service .block_oftext,
.type-rodoslovnaya .block_oftext { max-width: 960px; }
