:root {
    /*--bg-color: #f9f7e8;*/
    --bg-color: #fff;
    --accent-color: #420918;
    --text-color: #000000;
    --gold-gradient: linear-gradient(90deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Tahoma', sans-serif;
    line-height: 1.6;
    padding-top: 90px;
    padding-bottom: 0;
    margin: 0;
}

/* Шапка */
.main-header {
    background-color: transparent;
    padding: 15px 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.4s ease, background-color 0.4s ease, padding 0.4s ease;
}

/* Шапка скрыта при скролле вниз */
.main-header.hidden {
    transform: translateY(-100%);
}

/* Состояние шапки при прокрутке (добавляется через JS) */
.main-header.scrolled {
    background-color: rgba(66, 9, 24, 0.92);
    backdrop-filter: blur(8px);
    padding: 10px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.main-header nav {
    display: flex;
    justify-content: center;
    gap: 60px; /* Кнопки дальше друг от друга */
}

/* Контейнер навигации */
.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Десктопное меню */
.nav-desktop {
    display: flex;
    gap: 60px;
}

/* --- БУРГЕР-КНОПКА (видна только на мобильных) --- */
.burger-btn {
    display: none; /* Скрыта на десктопе */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.burger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Когда меню открыто, бургер превращается в крестик */
.burger-btn.active .burger-line:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.burger-btn.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-btn.active .burger-line:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Когда шапка прокручена, меняем цвет линий бургера */
.main-header.scrolled .burger-line {
    background-color: #fff;
}

/* --- МОБИЛЬНОЕ МЕНЮ (выпадающее) --- */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(66, 9, 24, 0.97);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.mobile-menu.open {
    max-height: 300px; /* Достаточно для 3 кнопок */
    padding: 20px 0;
}

.mobile-menu-link {
    color: #fff;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1.5px;
    padding: 12px 20px;
    width: 100%;
    text-align: center;
    transition: background-color 0.3s;
}

.mobile-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Кнопки в шапке */
.nav-btn {
    color: var(--accent-color); /* Изначально бордовый текст (чтобы было видно на светлом фоне) */
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500; /* Не жирный, средний */
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 1px;
    padding: 8px 20px;
    border: 1px solid rgba(66, 9, 24, 0.3); /* Тонкая граница */
    border-radius: 4px;
    background: transparent;
    box-shadow: 0 0 8px rgba(66, 9, 24, 0.1); /* Лёгкое свечение */
    transition: all 0.3s ease;
}

/* При наведении на кнопку */
.nav-btn:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(66, 9, 24, 0.4); /* Усиленное свечение */
    transform: translateY(-2px);
}

/* Когда шапка прокручена, меняем цвет текста кнопок на белый для контраста */
.main-header.scrolled .nav-btn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.main-header.scrolled .nav-btn:hover {
    background-color: #fff;
    color: var(--accent-color);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Организаторы */
.organizers-section {
    position: relative;
    z-index: 2; /* Поверх орнаментов */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    padding: 40px 20px 60px; /* Уменьшили верхний отступ, так как шапка фиксированная, но контент теперь в обёртке */
    flex-wrap: nowrap;
}

.organizer {
    display: flex;
    align-items: center;
    gap: 15px;
}

.organizer img {
    height: 70px;
    width: auto;
    object-fit: contain;
}

.organizer span {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-color);
    letter-spacing: 0.5px;
}

/* --- Боковые орнаменты --- */
.hero-section {
    position: relative;
    z-index: 2; /* Поверх орнаментов */
    text-align: center;
    /* Убрали огромный padding-top: 120px, так как теперь нет нужды компенсировать разрыв */
    padding: 20px 20px 60px;
}

/* --- ОБЁРТКА ВЕРХНЕЙ ЧАСТИ --- */
.top-page-area {
    position: relative; /* Якорь для абсолютных орнаментов */
    width: 100%;
    /* Убираем лишние отступы, пусть орнаменты тянутся от самого верха */
}

/* --- БОКОВЫЕ ОРНАМЕНТЫ --- */
.side-ornament {
    position: absolute;
    top: 0;          /* Прижат к самому верху области (сразу под шапкой) */
    bottom: 0;       /* Тянется до самого низа области (вплотную к горизонтальному орнаменту) */
    width: 300px;    /* Ширина рамки (можно менять 250px - 350px) */
    background-size: 100% 100%; /* Растягиваем картинку по высоте и ширине блока */
    background-repeat: no-repeat;
    z-index: 1;      /* Находится ПОД текстом и логотипами */
    pointer-events: none; /* Пропускает клики сквозь себя */
}

.side-ornament-left {
    left: 0;
    background-image: url('/static/images/ornament-side.png');
    background-position: top left;
}

.side-ornament-right {
    right: 0;
    background-image: url('/static/images/ornament-side.png');
    background-position: top right;
    transform: scaleX(-1); /* Зеркальное отражение */
}

/* Центральный контент должен быть выше орнаментов */
.hero-content {
    position: relative;
    z-index: 3; /* Гарантированно выше всего */
}

.hero-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.15;
    margin-bottom: 30px;
}

.hero-title .line-1 {
    display: block;
    font-size: 1.8rem; /* Чуть больше */
    color: var(--text-color);
    letter-spacing: 3px;
    font-weight: 700;
}

.hero-title .line-2 {
    display: block;
    font-size: 5.5rem; /* Заметно больше */
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 15px 0;
    letter-spacing: 2px;
}

.hero-title .line-3 {
    display: block;
    font-size: 2.2rem; /* Чуть больше */
    color: var(--accent-color);
    letter-spacing: 1.5px;
    font-weight: 800;
}

/* Кнопка призыва к действию в главном блоке */
.hero-cta-btn {
    display: inline-block;
    margin-top: 35px;
    padding: 14px 40px;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1.5px;
    border-radius: 4px;
    border: 1px solid var(--accent-color);
    box-shadow: 0 4px 15px rgba(66, 9, 24, 0.3);
    transition: all 0.3s ease;
}

.hero-cta-btn:hover {
    background-color: transparent;
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(66, 9, 24, 0.4);
}

.event-details {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
}

.event-details .separator {
    color: #b38728;
    font-weight: 900;
}

/* Орнамент */
.ornament-wrapper {
    display: flex;
    width: 100%;
    height: 150px; /* Увеличено в два раза */
    overflow: hidden;
    margin: 20px 0;
}

.ornament-left {
    flex: 1;
    background: url('/static/images/ornament-green.png') right center;
    background-size: auto 100%;
}

.ornament-right {
    flex: 1;
    background: url('/static/images/ornament-red.png') left center;
    background-size: auto 100%;
}

/* Общие секции */
.content-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.content-section h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: var(--accent-color);
    text-transform: uppercase;
}

.divider {
    width: 60px;
    height: 3px;
    background: var(--gold-gradient);
    margin: 15px auto 30px;
}

/* Экспонентам */
.doc-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.6); /* Лёгкая подложка для выделения блока */
    border-radius: 8px;
    border: 1px solid rgba(66, 9, 24, 0.1);
    text-align: left; /* Текст слева */
}

.doc-text {
    flex: 1;
}

.doc-text p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap; /* Чтобы текст кнопки не переносился */
    box-shadow: 0 4px 10px rgba(66, 9, 24, 0.2);
}

.download-btn:hover {
    background-color: #6a1025;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(66, 9, 24, 0.3);
}

/* Блок итоговой регистрации */
.registration-block {
    text-align: center;
    margin-top: 50px;
    padding: 35px 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(66, 9, 24, 0.15);
    box-shadow: 0 4px 15px rgba(66, 9, 24, 0.05);
}

.registration-block p {
    font-size: 1.15rem;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
}

.registration-btn {
    /* Наследует стили .download-btn, но можно добавить специфику */
    font-size: 1rem;
    padding: 16px 32px;
}

/* Контакты */
.contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    text-align: left;
    margin-top: 30px;
}

.address {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.contact-link:hover {
    color: #b38728;
    text-decoration: underline;
}

.map-frame {
    width: 100% !important;       /* Занимает всю ширину блока */
    height: 100% !important;      /* Занимает всю высоту блока */
    background-color: #e0ddd0;
    border: 0;
    display: block;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #666;
    border-radius: 8px;
}

/* Футер */
footer {
    text-align: center;
    padding: 30px;
    background-color: var(--accent-color);
    color: #fff;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .organizers-section {
        gap: 20px;
        padding: 20px 10px;
    }

    .organizer img {
        height: 40px;
    }

    .organizer span {
        font-size: 0.75rem;
    }

    .hero-title .line-2 {
        font-size: 3rem;
    }

    .hero-title .line-1, .hero-title .line-3 {
        font-size: 1.1rem;
    }

    .event-details {
        flex-direction: column;
        gap: 5px;
    }

    .event-details .separator {
        display: none;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .main-header nav {
        gap: 15px; /* На мобильном кнопки ближе */
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .hero-title .line-2 {
        font-size: 3.5rem;
    }

    .hero-title .line-1, .hero-title .line-3 {
        font-size: 1.2rem;
    }

    /* На мобильном описание и кнопка встают друг под другом */
    .doc-block {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
    }

    .registration-block {
        padding: 25px 15px;
    }

    .registration-block p {
        font-size: 1rem;
    }

    /* На мобильных скрываем десктопное меню и показываем бургер */
    .nav-desktop {
        display: none;
    }

    .burger-btn {
        display: flex;
    }

    /* Центрируем бургер в шапке */
    .main-nav {
        justify-content: center;
    }

    .map-frame {
        height: 350px; /* Увеличили с 300px до 350px для мобильных */
    }
}

/* На десктопе мобильное меню всегда скрыто */
@media (min-width: 769px) {
    .mobile-menu {
        display: none;
    }
}

/* --- АДАПТИВНОСТЬ: Скрываем боковые орнаменты на узких экранах --- */
@media (max-width: 1200px) {
    .side-ornament {
        display: none; /* Скрываем боковые рамки на узких экранах */
    }

    .organizers-section {
        padding: 110px 20px 20px; /* Возвращаем большой отступ только для мобильных, чтобы не наезжало на шапку */
    }

    .hero-section {
        padding: 20px 20px 40px;
    }
}

/* Стили для блока "О ярмарке" */
.about-text {
    text-align: justify;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333333;
}

.about-text .greeting {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 16px;
}

.about-text p:last-child {
    margin-bottom: 0;
}