/* ССК ДОСААФ — стили сайта. Цвета — из эмблемы ДОСААФ (красный, золото) */

:root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --ink: #1d1d1b;
    --muted: #5d5b55;
    --line: #e2dfd8;
    --red: #9b1c1c;
    --red-dark: #6e1414;
    --gold: #c9a227;
    --dark: #1f1f1d;
    --radius: 10px;
    --wrap: 1140px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

a { color: var(--red); }
a:hover { color: var(--red-dark); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(26px, 4.5vw, 38px); }
h2 { font-size: clamp(21px, 3.2vw, 28px); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: #fff; padding: 8px 12px; }

/* Шапка */
.header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header__row { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand img { flex: none; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { font-weight: 700; line-height: 1.2; }
.brand__place { font-size: 14px; color: var(--muted); }

.header__phone { font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }

.burger { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 10px; cursor: pointer; }
.burger span { display: block; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav { background: var(--red); }
.nav__list { display: flex; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; padding: 12px; font-size: 16px; font-weight: 500; }
.nav a:hover, .nav a.is-active { background: var(--red-dark); color: #fff; }

.sveden-bar { background: var(--dark); }
.sveden-bar a { display: inline-block; color: #fff; text-decoration: none; padding: 8px 0; font-size: 15px; }
.sveden-bar a::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.sveden-bar a:hover, .sveden-bar a.is-active { color: var(--gold); }
.sveden-bar .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 24px; }
.sveden-bar a.special-link::before { content: "👁"; background: none; width: auto; height: auto; border-radius: 0; margin-right: 6px; }

/* Контент */
.main { min-height: 50vh; }
.section { padding-top: 32px; padding-bottom: 48px; }

.hero {
    background: linear-gradient(135deg, var(--dark), #3a1414); color: #fff; padding: 56px 0;
}
.hero[style] {
    background: linear-gradient(90deg, rgba(20, 20, 18, .88) 0%, rgba(40, 14, 14, .7) 60%, rgba(40, 14, 14, .35) 100%), var(--hero) right 40% / cover no-repeat;
    padding: 88px 0;
}
.hero h1 { color: #fff; }
.hero__lead { font-size: 19px; max-width: 60ch; opacity: .9; margin: 0 0 24px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
    display: inline-block; padding: 12px 22px; border-radius: var(--radius);
    background: var(--red); color: #fff; text-decoration: none; font-weight: 600; border: 2px solid var(--red);
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn--ghost { background: transparent; border-color: rgba(255, 255, 255, .6); }
.btn--ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cards--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
    display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink);
    border-top: 4px solid var(--red);
}
.card:hover { border-color: var(--red); color: var(--ink); }
.card__title { font-weight: 700; font-size: 19px; }
.card__text { color: var(--muted); }

.crumbs { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.crumbs span { margin: 0 4px; }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 40px; margin: 0 0 24px; }
.toc li { padding: 4px 0; }

.content { max-width: 75ch; }
.content table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }

/* Подвал */
.footer { background: var(--dark); color: #d9d6cf; margin-top: 32px; }
.footer a { color: #fff; }
.footer a:hover { color: var(--gold); }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; padding-top: 32px; padding-bottom: 24px; }
.footer__title { color: #fff; font-weight: 700; margin-bottom: 8px; }
.footer p { margin: 0 0 6px; }
.footer__copy { border-top: 1px solid #3a3a37; padding-top: 16px; padding-bottom: 24px; font-size: 14px; }

@media (max-width: 900px) {
    .burger { display: block; }
    .header__phone { display: none; }
    .nav { display: none; }
    .nav.is-open { display: block; }
    .nav__list { flex-direction: column; padding: 0; }
    .nav a { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .15); }
    .brand__name { font-size: 15px; }
}

/* Список документов */
.docs { list-style: none; margin: 0; padding: 0; max-width: 85ch; }
.docs li { padding: 12px 0 12px 34px; border-bottom: 1px solid var(--line); position: relative; }
.docs li::before {
    content: ""; position: absolute; left: 0; top: 14px; width: 22px; height: 26px;
    border: 2px solid var(--red); border-radius: 3px 8px 3px 3px;
}
.docs a { font-weight: 500; }
.docs__meta { display: block; font-size: 14px; color: var(--muted); }

/* Новости */
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.news-card {
    display: flex; flex-direction: column; gap: 6px; padding: 0 0 18px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink);
}
.news-card:hover { border-color: var(--red); color: var(--ink); }
.news-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.news-card > span { padding: 0 18px; }
.news-card > span:first-of-type { margin-top: 14px; }
.news-card__date, .news-date { font-size: 14px; color: var(--muted); }
.news-card__title { font-weight: 700; font-size: 19px; line-height: 1.3; }
.news-card__text { color: var(--muted); font-size: 16px; }
.news-image { display: block; max-height: 480px; width: auto; border-radius: var(--radius); margin-bottom: 20px; }
.content img { border-radius: 6px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: var(--surface); }
.pager span { background: var(--red); border-color: var(--red); color: #fff; }

.muted { color: var(--muted); }
.btn--outline { background: transparent; color: var(--red); }
.btn--outline:hover { background: var(--red); color: #fff; }

/* Главная */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.features li { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; padding: 12px 14px; font-weight: 600; }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.steps li { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius); background: var(--bg); }
.steps b { font-size: 24px; color: var(--red); }
.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.review { margin: 0; padding: 20px; background: var(--bg); border-radius: var(--radius); }
.review p { margin: 0 0 10px; }
.review footer { font-weight: 600; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }

/* Арсенал */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.tabs a { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-weight: 500; }
.tabs a:hover { border-color: var(--red); }
.cat-title { margin-top: 32px; scroll-margin-top: 16px; }
.weapons { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.weapon { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.weapon__photo { background: #fff; aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); }
.weapon__photo img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.weapon__nophoto { color: var(--muted); font-size: 15px; }
.weapon__body { padding: 16px 18px 18px; }
.weapon h3 { margin: 0 0 6px; font-size: 20px; }
.weapon__price { display: inline-block; margin: 0 0 10px; padding: 3px 10px; background: var(--red); color: #fff; border-radius: 6px; font-weight: 600; }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0 0 10px; font-size: 15px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.weapon summary { cursor: pointer; color: var(--red); font-weight: 500; }
.weapon details p { font-size: 16px; margin: 8px 0 0; }
.cta { margin-top: 28px; font-size: 19px; font-weight: 600; }

/* Цены */
.prices { width: 100%; max-width: 900px; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); margin-bottom: 20px; }
.prices td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prices__price { white-space: nowrap; text-align: right; font-weight: 700; }

/* Галерея */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; display: block; }
.gallery figcaption { font-size: 14px; color: var(--muted); padding: 4px 2px; }

/* Музей и тексты с картинками */
.content img { max-width: 100%; max-height: 560px; width: auto; height: auto; }
.content a[href^="tel:"], .footer a[href^="tel:"] { white-space: nowrap; }

/* Контакты */
.contacts { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: start; }
.map { width: 100%; min-height: 420px; border: 0; border-radius: var(--radius); background: var(--line); }

@media (max-width: 800px) {
    .about, .contacts { grid-template-columns: 1fr; }
    .thumbs { grid-template-columns: repeat(3, 1fr); }
    .hero[style] { padding: 56px 0; }
}

/* Таблицы «Сведений» */
.sveden { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); margin: 0 0 24px; font-size: 16px; }
.sveden th, .sveden td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sveden th[scope=row] { width: 40%; font-weight: 500; color: var(--muted); }
.sveden--wide th { background: var(--bg); font-weight: 600; font-size: 14px; }
.sveden__group th { background: var(--bg); color: var(--ink) !important; font-weight: 700; }
.sveden .doc-link { display: inline-block; font-weight: 500; }
.table-scroll { overflow-x: auto; margin-bottom: 24px; }
.table-scroll .sveden { min-width: 760px; margin: 0; }

/* Версия для слабовидящих */
.special { --ink: #000; --muted: #000; --line: #000; --bg: #fff; --surface: #fff; --red: #000; --red-dark: #000; font-size: 22px; line-height: 1.7; }
.special a { text-decoration: underline; }
.special .nav, .special .sveden-bar, .special .footer, .special .hero, .special .hero[style] { background: #000; }
.special .hero[style] { background-image: none; }
.special img { filter: grayscale(1); }
.special .btn { background: #000; border-color: #000; color: #fff; }
.special .sveden, .special .docs__meta, .special .crumbs, .special .brand__place, .special .sveden-bar a, .special .news-card__text { font-size: inherit; }

/* Онлайн-тесты */
.section-top { margin-top: 32px; }
.quiz { max-width: 820px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; scroll-margin-top: 16px; }
.quiz__progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 12px; }
.quiz__progress span { display: block; height: 100%; background: var(--red); transition: width .3s; }
.quiz__counter { color: var(--muted); margin: 0 0 6px; font-size: 15px; }
.quiz__question { font-size: 21px; margin: 0 0 16px; }
.quiz__options { display: grid; gap: 10px; margin-bottom: 16px; }
.quiz__option { text-align: left; padding: 14px 16px; border: 2px solid var(--line); border-radius: 8px; background: #fff; font: inherit; color: var(--ink); cursor: pointer; }
.quiz__option:hover:not(:disabled) { border-color: var(--red); }
.quiz__option:disabled { cursor: default; }
.quiz__option.is-correct { border-color: #1f7a3a; background: #e6f4ea; }
.quiz__option.is-wrong { border-color: var(--red); background: #fbe9e7; }
.quiz__result { margin-top: 0; }
.quiz__mistakes-title { margin-top: 28px; }
.quiz__mistake { border-top: 1px solid var(--line); padding: 12px 0; }
.quiz__mistake p { margin: 0 0 4px; }
.quiz__mistake-q { font-weight: 600; }
.quiz__mistake-wrong { color: var(--red); }
.quiz__mistake-right { color: #1f7a3a; }
