/* Алтынаудит — основной стиль. Mobile first.
   Идея: документ аудитора. Книжная антиква в заголовках, тёмные «чернильные» шапки с фото, печать в первом экране.
   Фирменные --ink и --accent задаются из config/app.php (site.colors) в <head>. */

:root {
    --ink: #16324a;
    --accent: #a9822f;
    --ink-deep: #0f2538;
    --text: #22303c;
    --muted: #4f5c67;
    --line: #d3dae0;
    --soft: #e9eef2;
    --paper: #fff;
    --error: #b42318;
    --radius: 6px;
    --container: 1160px;
    --gutter: 16px;
    --serif: "Literata", Georgia, "Times New Roman", serif;
    --sans: "Golos Text", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
    margin: 0;
    font: 400 17px/1.6 var(--sans);
    color: var(--text);
    background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration-color: rgba(22, 50, 74, .35); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(34px, 5.4vw, 58px); letter-spacing: -0.015em; }
h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.01em; }
h3 { font-size: 21px; line-height: 1.3; }
p { margin: 0 0 1em; }

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

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }

.visually-hidden, .form__hp {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100; }
.skip:focus { left: 16px; }

/* ---------- Кнопки ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 50px; padding: 0 26px;
    font: 500 16px/1 var(--sans);
    color: #fff; background: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius);
    text-decoration: none; cursor: pointer;
}
.btn:hover { color: #fff; background: var(--ink-deep); border-color: var(--ink-deep); }
.btn--ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.btn--ghost:hover { color: var(--ink); background: var(--soft); border-color: var(--line); }
.btn--accent { color: var(--ink-deep); background: #c8a253; border-color: #c8a253; }
.btn--accent:hover { color: var(--ink-deep); background: #fff; border-color: #fff; }
.btn--light { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .45); }
.btn--light:hover { color: var(--ink-deep); background: #fff; border-color: #fff; }
.btn--small { min-height: 42px; padding: 0 18px; font-size: 15px; }
.btn--wide { width: 100%; }

.link-more { font-weight: 500; white-space: nowrap; }

/* ---------- Шапка ---------- */

.header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }

.logo { font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo__img { width: 220px; height: auto; }
.logo--light, .logo--light:hover { color: #fff; }

.nav-toggle { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: none; border: 0; cursor: pointer; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
    display: block; width: 22px; height: 2px; background: var(--ink); position: relative;
}
.nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bar::before { top: -7px; }
.nav-toggle__bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

.nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 72px); overflow-y: auto;
    padding: 8px var(--gutter) 24px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.nav.is-open { display: block; }
.nav__list { list-style: none; margin: 0; padding: 0; }
.nav__item > a { display: block; padding: 12px 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.nav__item > a[aria-current] { color: var(--accent); }
.nav__drop { list-style: none; margin: 0; padding: 4px 0 8px 16px; }
.nav__drop a { display: block; padding: 6px 0; text-decoration: none; color: var(--muted); }
.nav__drop a:hover { color: var(--ink); }
.header__actions { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.header__phone { font-weight: 500; text-decoration: none; white-space: nowrap; }

@media (min-width: 1024px) {
    .nav-toggle { display: none; }
    .nav { display: flex; align-items: center; gap: 36px; position: static; padding: 0; border: 0; overflow: visible; max-height: none; background: none; }
    .nav__list { display: flex; gap: 28px; }
    .nav__item { position: relative; }
    .nav__item > a { padding: 24px 0; border: 0; font-size: 16px; }
    .nav__drop {
        display: none; position: absolute; top: 100%; left: -20px; min-width: 300px;
        padding: 10px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: 0 14px 30px -12px rgba(15, 37, 56, .25);
    }
    .nav__item--drop:hover .nav__drop, .nav__item--drop:focus-within .nav__drop { display: block; }
    .header__actions { flex-direction: row; align-items: center; gap: 22px; margin: 0; }
}

/* ---------- Хлебные крошки ---------- */

.breadcrumbs { background: var(--ink-deep); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0 auto; padding-top: 22px; font-size: 15px; color: rgba(255, 255, 255, .6); }
.breadcrumbs li + li::before { content: "/"; margin: 0 10px; color: rgba(255, 255, 255, .35); }
.breadcrumbs a { color: rgba(255, 255, 255, .75); text-decoration: none; }
.breadcrumbs a:hover { color: #fff; }

/* ---------- Первый экран: тёмный, фото с печатью ---------- */

.hero { padding: 48px 0 64px; background: var(--ink-deep); color: rgba(255, 255, 255, .8); }
.hero__inner { display: grid; gap: 48px; align-items: center; }
.hero__title { max-width: 15ch; font-size: clamp(38px, 6vw, 64px); line-height: 1.08; color: #fff; }
.hero__lead { max-width: 52ch; font-size: clamp(18px, 2vw, 20px); margin-bottom: 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__visual { position: relative; margin-bottom: 40px; }
.hero__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.hero__seal {
    position: absolute; left: -8px; bottom: -40px; width: 132px; padding: 6px;
    background: var(--paper); border-radius: 50%; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55);
}
.hero__seal:hover .seal { color: var(--ink); }
.hero__visual:not(:has(img)) .hero__seal { position: static; width: 260px; margin: 0 auto; }

@media (min-width: 900px) {
    .hero { padding: 80px 0 96px; }
    .hero__inner { grid-template-columns: 1fr 1fr; gap: 64px; }
    .hero__visual { margin: 0 0 0 auto; width: 100%; max-width: 540px; }
    .hero__photo { aspect-ratio: 5 / 6; }
    .hero__seal { left: -64px; bottom: 36px; width: 172px; }
}

.seal { display: block; width: 100%; height: auto; color: var(--accent); transform: rotate(-8deg); }
.seal text { font-family: var(--sans); font-weight: 500; fill: currentColor; }
.seal__center { font-family: var(--serif) !important; }

/* ---------- Секции ---------- */

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--soft { background: var(--soft); }
.section--ink { background: var(--ink); color: rgba(255, 255, 255, .78); }
.section--ink h2, .section--ink h3 { color: #fff; }
.section--ink .steps__item p { color: rgba(255, 255, 255, .72); }
.section--ink .steps__time { color: #e2c98f; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section__head .section__title { margin: 0; }
.section__title { margin-bottom: 28px; }
.section__lead { max-width: 60ch; margin: -12px 0 32px; color: var(--muted); }
.section__hint { margin: 28px 0 0; }

@media (min-width: 768px) {
    .section { padding: 104px 0; }
    .section--tight { padding: 56px 0; }
}

/* Шапка внутренних страниц: тёмная, справа фото из настроек (--page-photo), уходящее в цвет. */
.page-head {
    padding: 28px 0 48px; color: rgba(255, 255, 255, .82);
    background: linear-gradient(180deg, rgba(15, 37, 56, .86), rgba(15, 37, 56, .94)), var(--page-photo, none) center / cover, var(--ink-deep);
    border-bottom: 3px solid var(--accent);
}
.page-head h1 { color: #fff; max-width: 22ch; }
.page-head__lead { max-width: 62ch; font-size: 19px; }
.page-head__lead p:last-child { margin: 0; }
.section .page-head__lead { color: var(--muted); }
.page-head a { color: #fff; }
.page-head .offer a.btn--ghost { color: var(--ink); }

@media (min-width: 900px) {
    .page-head {
        padding: 40px 0 72px;
        background: linear-gradient(90deg, var(--ink-deep) 38%, rgba(15, 37, 56, .7) 70%, rgba(15, 37, 56, .35)), var(--page-photo, none) right center / cover, var(--ink-deep);
    }
}

.grid { display: grid; gap: 28px; }

@media (min-width: 700px) {
    .grid--2, .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(3, 1fr); gap: 40px; }
}

/* ---------- Услуги: оглавление ---------- */

.toc { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.toc__item { border-bottom: 1px solid var(--line); }
.toc__link { display: grid; gap: 6px; padding: 22px 0; text-decoration: none; color: var(--text); }
.toc__title { font-family: var(--serif); font-size: 23px; line-height: 1.25; color: var(--ink); }
.toc__text { color: var(--muted); }
.toc__link:hover { color: var(--text); }
.toc__link:hover .toc__title { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

@media (min-width: 900px) {
    .toc__link { grid-template-columns: minmax(240px, 1fr) 1.5fr; gap: 40px; align-items: baseline; padding: 26px 0; }
}

/* ---------- Обучение: сетка курсов ---------- */

.courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.course { display: flex; }
.course__link {
    display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 26px;
    border: 1px solid var(--line); border-top: 2px solid var(--ink); border-radius: var(--radius);
    text-decoration: none; color: var(--text); background: var(--paper);
}
.course__title { font-size: 24px; line-height: 1.25; margin: 0; }
.course__text { margin: 0; color: var(--muted); }
.course__more { margin-top: auto; padding-top: 8px; color: var(--ink); font-weight: 500; }
.course__link:hover { color: var(--text); border-color: var(--ink); }
.course__link:hover .course__title, .course__link:hover .course__more { color: var(--accent); }

@media (min-width: 700px) {
    .courses { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}

/* ---------- Что получает клиент ---------- */

.features { display: grid; gap: 28px 48px; }
.features > div { padding-top: 20px; border-top: 3px solid var(--accent); }
.features h3 { margin-bottom: 8px; }
.features p { color: var(--muted); margin: 0; }

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

/* ---------- Этапы (настоящая последовательность — поэтому с номерами) ---------- */

.steps { display: grid; gap: 28px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps__item { display: grid; grid-template-columns: 44px 1fr; gap: 0 16px; counter-increment: step; }
.steps__item::before {
    content: counter(step); grid-row: span 3;
    font-family: var(--serif); font-size: 32px; line-height: 1; color: var(--accent);
}
.steps__item h3 { margin-bottom: 6px; }
.steps__item p { color: var(--muted); margin-bottom: 6px; }
.steps__time { font-size: 15px; font-weight: 500; color: var(--ink); }

@media (min-width: 960px) {
    .steps { grid-template-columns: repeat(4, 1fr); gap: 36px; }
    .steps__item { grid-template-columns: 1fr; }
    .steps__item::before { grid-row: auto; margin-bottom: 14px; font-size: 40px; }
}

/* ---------- Страница услуги ---------- */

.service-head { display: grid; gap: 32px; }
.offer { padding: 26px; background: var(--paper); color: var(--text); border-radius: var(--radius); align-self: start; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .5); }
.offer__note { color: var(--text); margin: 0 0 18px; }
.offer .btn + .btn { margin-top: 8px; }

@media (min-width: 1024px) {
    .service-head { grid-template-columns: 1fr 340px; gap: 72px; }
    .offer { position: sticky; top: 100px; }
}

.blocks { gap: 48px; }
.block h2 { font-size: 28px; }

/* ---------- Текст из админки ---------- */

.prose { max-width: 70ch; }
.prose ul { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { padding: 4px 0; }
.prose li::marker { color: var(--accent); }
.prose--check ul { list-style: none; padding: 0; }
.prose--check li { position: relative; padding: 6px 0 6px 30px; }
.prose--check li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 7px; height: 12px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.prose h2 { margin-top: 1.4em; font-size: 28px; }
.prose a { color: var(--ink); }

/* ---------- Клиенты ---------- */

.clients { columns: 1; column-gap: 48px; list-style: none; margin: 0; padding: 0; }
.clients__item { break-inside: avoid; padding: 12px 0; border-bottom: 1px solid var(--line); }
.clients__item strong { display: block; font-weight: 500; color: var(--ink); line-height: 1.4; }
.clients__item span { font-size: 15px; color: var(--muted); }
.clients__item img { max-height: 48px; width: auto; object-fit: contain; }

@media (min-width: 700px) { .clients { columns: 2; } }
@media (min-width: 1024px) { .clients { columns: 3; } }

/* ---------- Отзывы ---------- */

.review { margin: 0; }
.review blockquote { margin: 0 0 14px; font-family: var(--serif); font-size: 22px; line-height: 1.45; color: var(--ink); }
.review blockquote::before { content: "«"; }
.review blockquote::after { content: "»"; }
.review figcaption { color: var(--muted); }

/* ---------- FAQ ---------- */

.faq { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
    position: relative; padding: 20px 44px 20px 0; font-family: var(--serif); font-size: 20px; color: var(--ink); cursor: pointer; list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; position: absolute; right: 6px; top: 16px; font: 400 26px/1 var(--sans); color: var(--accent); }
.faq__item[open] summary::after { content: "−"; }
.faq__item p { margin: 0; padding: 0 0 22px; color: var(--muted); max-width: 70ch; }

/* ---------- Статьи ---------- */

.post__image { display: block; margin-bottom: 18px; overflow: hidden; border-radius: var(--radius); background: var(--soft); }
.post__image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .3s; }
.post__image:hover img { transform: scale(1.03); }
.post__date { display: block; font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.post__title { font-size: 22px; }
.post__title a { text-decoration: none; }
.post__title a:hover { text-decoration: underline; }
.post__text { color: var(--muted); margin: 0; }
.article__image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin: 8px 0 36px; border-radius: var(--radius); }

.pager { display: flex; gap: 8px; margin-top: 48px; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.pager span { background: var(--ink); color: #fff; border-color: var(--ink); }

.contacts h2 { font-size: 22px; }
.contacts p { font-size: 19px; margin-bottom: 4px; }

/* ---------- Заявка ---------- */

.request { padding: 64px 0; background: var(--ink); color: rgba(255, 255, 255, .8); }
.request__inner { display: grid; gap: 40px; }
.request h2 { color: #fff; }
.request a { color: #fff; text-decoration-color: rgba(255, 255, 255, .4); }
.request a:hover { color: #fff; text-decoration-color: #fff; }
.request__alt { list-style: none; margin: 28px 0; padding: 0; }
.request__alt li { padding: 8px 0; }
.request__alt a { font-size: 19px; }
.request__note { font-size: 15px; }

@media (min-width: 900px) {
    .request { padding: 104px 0; }
    .request__inner { grid-template-columns: 1fr 1fr; gap: 88px; }
}

.form { padding: 28px; background: var(--paper); color: var(--text); border-radius: var(--radius); }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 500; color: var(--ink); }
.field__optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
    width: 100%; padding: 13px 14px; font: inherit; color: var(--text);
    background: var(--paper); border: 1px solid #c6ced5; border-radius: var(--radius);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 50, 74, .12); }
.field textarea { resize: vertical; min-height: 92px; }
.field--error input { border-color: var(--error); }
.field__error, .form__error { display: block; margin-top: 6px; font-size: 15px; color: var(--error); }
.form__error { margin: 0 0 16px; }
.form__consent { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.request .form a { color: var(--muted); }

/* ---------- Подвал ---------- */

.footer { padding: 56px 0 28px; background: var(--ink-deep); color: rgba(255, 255, 255, .7); font-size: 16px; }
.footer a { color: rgba(255, 255, 255, .88); text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { padding: 4px 0; }
.footer__grid { display: grid; gap: 32px; }
.footer__title { margin-bottom: 12px; font-size: 19px; color: #fff; }
.footer__muted { color: rgba(255, 255, 255, .55); font-size: 15px; margin: 12px 0 0; }
.footer__bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
    margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 14px;
}

@media (min-width: 900px) {
    .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

.license { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; margin-bottom: 32px; }
.license__image img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
@media (max-width: 640px) { .license { grid-template-columns: 1fr; } .license__image { max-width: 240px; } }
