
@font-face {
    font-family: 'Sangyo';
    src: url('font/Sangyo.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Zekton';
    src: url('font/zekton.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Zekton', system-ui, -apple-system, sans-serif;
    background: #2b4f25;
    color: #000000;
    line-height: 1.3;
}

/* === Главный мобильный контейнер === */
.wrapper {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding: 40px 55px 60px 55px;
    overflow: hidden;

    /* 1. Задаем базовый фоновый цвет страницы (бежевый из Figma) с прозрачностью 0.64 */
    background-color: rgb(255 253 238);

    /* 2. Подключаем саму текстуру бумаги */
    background-image: url('img/paperbg.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;

    /* 3. Включаем режим смешивания, который приглушит текстуру под цвет */
    background-blend-mode: multiply;
}

/* === 1. ОБНОВЛЕННАЯ ДЕКОРАТИВНАЯ РАМКА === */
.page-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Рамка не мешает кликам */
    z-index: 10;
}

/* Верхний элемент рамки */
.frame-top {
    position: absolute;
    top: 25px;
    left: -15px;
    right: -15px;
    height: 800px; /* Высота подгоняется автоматически под ширину страницы */
    background: url('img/frame.png') no-repeat top/contain;
}

/* Нижний элемент рамки (тот же файл, развернутый на 180 градусов) */
.frame-bottom {
    position: absolute;
    bottom: -15px;
    left: -15px;
    right: -15px;
    height: 800px;
    background: url('img/frame.png') no-repeat top/contain;
    transform: rotate(180deg);
}

/* АДАПТИВНЫЕ БОКОВЫЕ ЛИНИИ (Оптимизировано для 400px и 350px) */
.frame-line-left,
.frame-line-right {
    position: absolute;

    /* 1. ВЫСОТА ЛИНИЙ:
       На 400px: top станет ~290px, bottom ~260px.
       На 350px: top станет ~255px, bottom ~225px.
       Линии автоматически удлиняются и не отрываются от графической рамки.
    */
    top: clamp(230px, 73vw, 350px);
    bottom: clamp(200px, 65vw, 310px);

    /* 2. ТОЛЩИНА ЛИНИЙ:
       На экранах меньше 400px плавно уменьшается с 1.6px до 1.3px для изящности
    */
    width: clamp(1px, 0.4vw, 1.6px);

    background-color: transparent;
}

/* 3. СДВИГ К КРАЯМ (LEFT / RIGHT):
   Здесь коэффициент 5.65vw идеально вычисляет геометрию:
   - При 400px: 400 * 0.0565 = 22.6px (Линии стоят ровно на контуре)
   - При 350px: 350 * 0.0565 = 19.7px (Линии красиво смещаются ближе к краям)
   Минимальный порог ограничен 14px, чтобы на совсем крошечных экранах линии не прилипли к стеклу.
*/
.frame-line-left {
    left: clamp(14px, 5.65vw, 31px);
}

.frame-line-right {
    right: clamp(14px, 5.65vw, 25px);
}

@media (min-width: 400px) and (max-width: 480px) {
    .frame-line-left,
    .frame-line-right {
        top: clamp(230px, 73vw, 350px);
        bottom: clamp(230px, 65vw, 350px);
        width: 1.4px;
    }
    .frame-line-left { left: clamp(24px, 6.2vw, 31px); }
    .frame-line-right { right: clamp(24px, 6.2vw, 31px); }
}

/* МЕДИА-ЗАПРОС-ПРОСЛОЙКА (Остается без изменений для фиксации от 480px до 700px) */
@media (min-width: 480px) and (max-width: 699px) {
    .frame-line-left,
    .frame-line-right {
        top: 350px;
        bottom: 310px;
        width: 1.6px;
    }
    .frame-line-left { left: 31.5px; }
    .frame-line-right { right: 31.5px; }
}

/* === Навигационная панель === */
.header-bar {
    width: 100%;
    height: 37px;
    background: rgba(76, 75, 64, 0.81);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
}

/* === КНОПКА-БУРГЕР / КРЕСТИК === */
.burger-btn {
    position: absolute; /* Привязываем жестко к ширине страницы 480px, а не к экрану */
    top: 2px;
    right: 15px;
    z-index: 120; /* ВАЖНО: z-index больше, чем у .mobile-menu (110) */

    width: 32px;
    height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    outline: none;
    border-radius: 50%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease;
}

.burger-btn span {
    width: 16px;
    height: 2px;
    background-color: #ffffff;
    display: block;
    border-radius: 1px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, background-color 0.3s ease;
}

/* Анимация превращения в крестик */
.burger-btn.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background-color: #FFFDEF;
}
.burger-btn.active span:nth-child(2) {
    opacity: 0;
}
.burger-btn.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    background-color: #FFFDEF;
}

/* === Мобильное меню === */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: rgba(21, 49, 16, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 110;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open {
    transform: translateX(-50%) translateY(0);
}
.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 240px;
}
.menu-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 44px;
    background: #FFFDEF;
    color: #335D2C;
    text-decoration: none;
    border-radius: 46px;
    font-size: 18px;
    text-transform: uppercase;
}
.menu-link.brand-link {
    font-size: 11px;
    line-height: 1.2;
    padding: 6px 10px;
}

/* === Кнопка "Назад" === */
.back-btn {
    position: absolute;
    left: 15px;
    top: 2px; /* Центрируем ровно по высоте плашки хедера */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    z-index: 10; /* Кнопка выше фона хедера, но ниже открытого меню */
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s ease;
}

.back-btn:active {
    opacity: 0.6;
}

/* === Контент страницы === */
.content-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 70px;
}

/* Название локации */
.location-title {
    font-family: 'Sangyo', serif;
    font-size: 46px;
    line-height: 1.05;
    color: #335D2C;
    text-transform: uppercase;
    word-wrap: break-word;
}

/* === УНИВЕРСАЛЬНЫЙ БЛОК ИЗОБРАЖЕНИЯ === */
.location-image-box {
    width: 100%;
    padding: 0 10px;
    display: flex;
    justify-content: center;
}

.location-image-box img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;

    /* Скругление углов оставляем, если у картинок есть четкие границы */
    border-radius: 12px;

    /* МАГИЯ СМЕШИВАНИЯ: */
    /* Белый фон картинки исчезает, черный рисунок ложится прямо на пергамент */
    mix-blend-mode: multiply;
}

/* Блок технической информации */
.info-card {
    font-size: 16px;
    font-family: 'Zekton', sans-serif;
    color: #000000;
}
.info-card a {
    color: #000000;
    text-decoration: underline;
}

/* Текстовое описание */
.description-text {
    font-size: 16px;
    font-family: 'Zekton', sans-serif;
    color: #000000;
    text-align: justify;
}
.description-text p {
    margin-bottom: 14px;
}
.description-text p:last-child {
    margin-bottom: 0;
}
/* ========================================== */
/* === ДЕСКТОПНАЯ ВЕРСИЯ САЙТА (от 700px)    === */
/* ========================================== */
@media (min-width: 700px) {
    body {
        background: #2b4f25;
        margin: 0;
        padding: 0;
    }

    .wrapper {
        max-width: 1152px;
        /* Увеличиваем вертикальные паддинги, чтобы контент не залезал под рамки */
        padding: 120px 80px 140px 80px;
        margin: 0 auto;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);

        /* 1. ФОН КАК В МОБИЛЬНОЙ ВЕРСИИ */
        background-color: rgb(255 253 238);

        /* 2. Подключаем саму текстуру бумаги */
        background-image: url('img/paperbg.jpg');
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center center;

        /* 3. Включаем режим смешивания, который приглушит текстуру под цвет */
        background-blend-mode: multiply;

        position: relative;
        min-height: 100vh;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* === 2. СВЕРХУ И СНИЗУ РАМКИ БЕЗ БОКОВЫХ ЛИНИЙ === */
    /* === 1. ОБНОВЛЕННАЯ ДЕКОРАТИВНАЯ РАМКА === */
    .page-frame {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none; /* Рамка не мешает кликам */
        z-index: 10;
    }

    /* Верхний элемент рамки */
    .frame-top {
        position: absolute;
        top: 70px;
        left: -40px;
        right: -40px;
        height: 150%; /* Высота подгоняется автоматически под ширину страницы */
        background: url('img/frame.png') no-repeat top/contain;
    }

    /* Нижний элемент рамки (тот же файл, развернутый на 180 градусов) */
    .frame-bottom {
        position: absolute;
        bottom: -15px;
        left: -40px;
        right: -40px;
        height: 150%;
        background: url('img/frame.png') no-repeat top/contain;
        transform: rotate(180deg);
    }


    /* ПОЛНОСТЬЮ СТИРАЕМ БОКОВЫЕ ЛИНИИ */
    .frame-line-left,
    .frame-line-right {
        display: none !important;
    }

    /* === 3. АДАПТИВНАЯ ДЕСКТОПНАЯ ШАПКА И МЕНЮ ИЗ INDEX.HTML === */
    .header-bar {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100px;
        background: rgba(0, 0, 0, 0.58);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 5%;
        box-sizing: border-box;
        z-index: 20; /* Выше рамок, чтобы ссылки нажимались */
    }

    .burger-btn {
        display: none !important;
    }

    .back-btn {
        position: absolute;
        top: 34px;
        left: 2%;
        width: 32px;
        height: 32px;
        z-index: 25;
    }

    .mobile-menu {
        position: absolute;
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        height: 100px;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        z-index: 21;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        padding: 0 5%;
        box-sizing: border-box;
    }

    .menu-nav {
        display: flex;
        flex-direction: row;
        max-width: 100%;
        width: 100%;
        justify-content: flex-end;
        align-items: center;
        gap: clamp(15px, 3vw, 40px);
    }

    .menu-link.brand-link {
        margin-right: auto;
        text-align: left;
        font-size: clamp(16px, 2vw, 24px);
        color: #ffffff;
        background: transparent;
        padding: 0;
        min-height: auto;
        font-family: 'Zekton', sans-serif;
        text-transform: lowercase;
    }

    .menu-link:not(.brand-link) {
        background: transparent;
        color: #ffffff;
        font-size: clamp(16px, 2vw, 24px);
        min-height: auto;
        width: auto;
        padding: 0;
        text-transform: lowercase;
        white-space: nowrap;
        font-family: 'Zekton', sans-serif;
    }

    .menu-link:hover {
        opacity: 0.8;
    }

    /* === ОБНОВЛЕННАЯ СЕТКА КОНТЕНТА === */
    .content-container {
        display: grid;
        /* Умное распределение:
           Левая колонка сжимается/расширяется строго по естественной ширине картинки,
           но не шире 60% всего макета.
           Правая колонка (карточка) забирает весь свободный остаток.
        */
        grid-template-columns: minmax(300px, 55%) 1fr;
        gap: 40px;
        margin: 40px clamp(15px, 4vw, 55px) 20px;
        position: relative;
    }

    /* 1. Заголовок (Посередине, на всю ширину) */
    .location-title {
        grid-column: 1 / -1;
        text-align: center;
        font-size: clamp(50px, 8vw, 96px);
        margin-top: 70px;
    }

    /* 2. Фото (Слева) */
    .location-image-box {
        grid-column: 1;
        width: 100%;
        padding: 0;
        display: flex;
        justify-content: flex-start;
        /* align-self: stretch заставит блок быть одной высоты с карточкой,
           а картинка внутри отцентрируется */
        align-self: stretch;
        align-items: center;
    }

    .location-image-box img {
        width: 100%;
        max-width: max-content; /* Картинка не раздувается больше своего реального размера */
        height: auto !important;
        display: block;
        border-radius: 12px;
        mix-blend-mode: multiply;
    }

    /* 3. Справочная информация (Справа) */
    .info-card {
        grid-column: 2;
        font-size: clamp(12px, 1.8vw, 17px);
        line-height: 1.2;
        /* Важно: убираем align-self: center, чтобы карточка тоже тянулась.
           Вместо этого центрируем внутреннее содержимое, если нужно,
           или оставляем её красивым блоком, равным по высоте картинке.
        */
        background: rgba(0,0,0,0.03);
        padding: clamp(20px, 2.5vw, 30px); /* Адаптивные внутренние отступы */
        border-radius: 24px;
        height: max-content; /* Карточка сжимается ровно под объем текста в ней */
        align-self: center;
    }

    /* 4. Описание (На всю ширину внизу) */
    .description-text {
        grid-column: 1 / -1;
        font-size: clamp(16px, 1.8vw, 20px);
        line-height: 1.45;
        text-align: justify;
        margin-top: 20px;
        columns: 1;
    }

}
