:root {
    --green: #183b2a;
    --green2: #28533c;
    --wood: #c99b5a;
    --cream: #f7f1e7;
    --ink: #1f2521;
    --muted: #687069;
    --line: #e7ddcf;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font: 16px/1.55 Arial, system-ui, sans-serif;
    color: var(--ink);
    background: #fff;
}

a {
    color: inherit;
}

/* ИСПРАВЛЕНО: добавлено height:auto, чтобы картинки не искажались */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: auto;
}

/* Шапка */
.top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
}

.logo {
    font-weight: 900;
    font-size: 26px;
    color: var(--green);
    text-decoration: none;
}

.logo span {
    color: var(--wood);
}

.menu {
    display: flex;
    gap: 18px;
    align-items: center;
}

.menu a {
    text-decoration: none;
    color: #304036;
    font-weight: 600;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--wood);
    color: #1d160b;
    text-decoration: none;
    font-weight: 800;
    border: 0;
    cursor: pointer;
}

.btn.dark {
    background: var(--green);
    color: #fff;
}

/* Главный экран */
.hero {
    background: linear-gradient(90deg, rgba(24, 59, 42, .92), rgba(24, 59, 42, .55)), url('../img/hero.webp') center/cover;
    min-height: 720px;
    color: #fff;
    display: flex;
    align-items: center;
}

.hero h1 {
    font-size: clamp(36px, 6vw, 70px);
    line-height: 1.04;
    margin: 0 0 20px;
    max-width: 930px;
}

.lead {
    font-size: 20px;
    max-width: 780px;
    color: #f7ead8;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 34px;
    align-items: center;
}

/* Карточки и формы */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 50px rgba(24, 59, 42, .10);
}

.form {
    color: var(--ink);
}

label {
    display: block;
    font-weight: 700;
    margin: 12px 0 6px;
}

input,
textarea,
select {
    width: 100%;
    padding: 14px;
    border: 1px solid #d8cfbf;
    border-radius: 12px;
    font: inherit;
}

/* Секции и заголовки */
section {
    padding: 82px 0;
}

h2 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
    margin: 0 0 18px;
    color: var(--green);
}

/* Сетка */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

/* ДОБАВЛЕНО: сетка категорий с вертикальными карточками */
.grid.cats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 300px));
    gap: 24px;
    justify-content: center;
}

.tile {
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
}

/* ДОБАВЛЕНО: вертикальные картинки 4:5 с обрезкой вместо искажения */
.tile img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center;
}

.tile .p {
    padding: 22px;
}

.muted {
    color: var(--muted);
}

.cream {
    background: var(--cream);
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
}

td,
th {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    background: #ecdfcc;
}

/* Внутренние страницы */
.breadcrumbs {
    font-size: 14px;
    color: var(--muted);
    padding-top: 28px;
}

.page-hero {
    background: var(--cream);
    padding: 54px 0;
}

.page-hero h1 {
    font-size: clamp(34px, 5vw, 58px);
    margin: 0;
    color: var(--green);
}

/* Подвал */
.footer {
    background: #10251b;
    color: #e9efe9;
    padding: 54px 0;
}

.footer a {
    color: #fff;
}

.footgrid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
}

/* Прочее */
.mobilebar {
    display: none;
}

.notice {
    padding: 18px;
    border-radius: 14px;
    background: #fff4df;
    border: 1px solid #ead4aa;
}

.burger {
    display: none;
}

.article-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    align-items: center;
}

/* Мобильная версия */
@media (max-width: 820px) {
    .menu {
        display: none;
    }

    .burger {
        display: block;
    }

    .hero {
        min-height: auto;
        padding: 70px 0;
    }

    .hero-grid,
    .grid,
    .footgrid {
        grid-template-columns: 1fr;
    }

    /* Категории на телефоне остаются по центру, а не на всю ширину */
    .grid.cats {
        grid-template-columns: minmax(220px, 300px);
    }

    .mobilebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 10px;
        border-top: 1px solid var(--line);
        z-index: 20;
    }

    .article-card {
        grid-template-columns: 1fr;
    }

    section {
        padding: 56px 0;
    }

    body {
        padding-bottom: 72px;
    }
}