/* ========================================= */
/* --- КАРКАС СТРАНИЦЫ ТУРА --- */
/* ========================================= */
.tour-single-page {
    padding-top: 140px;
    /* Отступ под вашу прозрачную шапку */
    background: var(--paper);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}
@media(max-width: 992px) {
    .tour-single-page {
        padding-top: 90px;
    }

    .container {
        padding: 0 20px;
    }

}

/* ========================================= */
/* --- ШАПКА ТУРА И ИЗБРАННЫЙ ОТЗЫВ --- */
/* ========================================= */
.tour-breadcrumbs {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--stone);
    margin-bottom: 24px;
}

.tour-breadcrumbs a {
    color: var(--ink);
    text-decoration: none;
}

.tour-title-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 20px;
}

.tour-title-wrap h1 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.1;
    margin: 0;
    max-width: 800px;
}

@media(max-width: 992px) {

    .tour-title-wrap {
        gap: 0px;
    }
}
/* Отзыв в шапке (вместо кнопки бронирования) */
.tour-header-featured-review {
    flex-shrink: 0;
    max-width: 320px;
}

.header-review-card {
    background: rgba(26, 22, 19, 0.65);
    /* Темный фон для идеальной читаемости */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    border-radius: 12px;
    color: #fff;
}

.header-review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.header-review-author img,
.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Исправляем сплющивание аватарок */
.review-author img,
.avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    /* Жесткий запрет на сжатие элемента */
}

.avatar-placeholder {
    background: #c2a88e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    font-family: sans-serif;
    text-transform: uppercase;
}

.author-info .author-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.author-stars,
.review-stars {
    color: #fbbf24;
    font-size: 14px;
    letter-spacing: 2px;
}

.header-review-text {
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.9;
}


/* ========================================= */
/* --- ГАЛЕРЕЯ НА ВСЮ ШИРИНУ ЭКРАНА --- */
/* ========================================= */
.tour-gallery-section.full-width {
    width: 100%;
    margin-bottom: 60px;
    padding: 0 40px;
}

.tour-gallery-grid {
    display: grid;
    grid-auto-rows: 250px;
    gap: 16px;
    grid-auto-flow: dense;
}
/* Для ОЧЕНЬ широких экранов (от 1200px) - 5 колонок */
@media(min-width: 1200px) {
    .tour-gallery-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    /* 1-е фото: большое слева (занимает 2 колонки в ширину и 2 ряда в высоту) */
    .gallery-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }

    /* 4-е фото: вертикальное справа (занимает 1 колонку в ширину, но тянется на 2 ряда вниз) */
    .gallery-item:nth-child(4) {
        grid-row: span 2;
    }
}
/* Для средних экранов (ноутбуки 993px - 1199px) - 4 колонки (1 большое + 2 маленьких в ряду) */
@media(min-width: 993px) and (max-width: 1199px) {
    .tour-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-item:nth-child(6n) {
        grid-column: span 2;
    }
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

.gallery-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    z-index: 2;
}


/* ========================================= */
/* --- ОСНОВНОЙ КОНТЕНТ И САЙДБАР --- */
/* ========================================= */
.tour-body {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.tour-content {
    flex: 1;
}

.tour-sidebar {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 120px;
    /* Отступ от верха экрана при скролле */
}

/* Виджет формы бронирования */
.booking-widget {
    background: #fff;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.widget-price-huge {
    font-size: 42px;
    font-family: 'Fraunces', serif;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--stone);
}
/* --- Поле выбора дат (Исправление для Safari) --- */
.form-select {
    width: 100%;
    padding: 16px 40px 16px 16px;
    /* Добавили отступ справа для стрелочки */
    background-color: #f5f5f5;
    /* Добавляем свою стрелочку вместо стандартной браузерной */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1613' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    color: var(--ink);
    /* Жестко задаем темный цвет текста */

    /* Отключаем системные стили Safari */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

/* При фокусе убираем стандартную обводку */
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 22, 19, 0.1);
}

.form-group.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f5f5;
    padding: 12px 16px;
    border-radius: 12px;
}

/* --- Счетчик участников (Исправление для Safari) --- */
.counter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.counter input {
    width: 30px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--ink);
    /* Возвращаем темный цвет цифрам */
    font-size: 16px;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* Убираем родные стрелочки внутри поля input number в Safari/Chrome */
.counter input::-webkit-outer-spin-button,
.counter input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.counter button {
    background: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--ink);
    /* Возвращаем темный цвет плюсу и минусу */
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-submit {
    width: 100%;
    background: #fde492;
    color: #000;
    border: none;
    padding: 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
}

.widget-footer-info {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--stone);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Инфографика (Важное по туру) в сайдбаре */
.sidebar-infographics {
    margin-top: 32px;
}

.infographics-title {
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 600;
}

.infographics-card {
    background: #fff;
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 16px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.info-icon {
    color: #6b7280;
    display: flex;
    flex-shrink: 0;
    margin-top: 1px;
}

.info-text {
    display: flex;
    flex-direction: column;
}

.info-val {
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
}


/* ========================================= */
/* --- СЕКЦИЯ ОТЗЫВОВ (ВНИЗУ СТРАНИЦЫ) --- */
/* ========================================= */
.tour-reviews-section {
    /* padding: 80px 0;
    border-top: 1px solid var(--line);*/
    margin-top: 40px; 
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.reviews-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--stone);
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.reviews-title-block h2 {
    font-size: 32px;
    margin: 0;
    font-weight: 600;
}

.reviews-total-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.total-score {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.total-text {
    display: block;
    font-size: 11px;
    color: var(--stone);
    margin-top: 4px;
}
/* 
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
} */

.review-card {
    background: #fff;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.review-author {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.review-author img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.author-meta {
    display: flex;
    flex-direction: column;
}

.author-meta .author-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.author-meta .author-subtitle {
    font-size: 11px;
    color: var(--stone);
}

.review-stars {
    margin-bottom: 20px;
    font-size: 16px;
}

.review-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
}

.review-content p {
    margin-top: 0;
}


/* ========================================= */
/* --- АДАПТИВ (ДЛЯ ТЕЛЕФОНОВ И ПЛАНШЕТОВ) --- */
/* ========================================= */
@media(max-width: 992px) {
    .tour-title-wrap {
        flex-direction: column;
    }

    .tour-header-featured-review {
        max-width: 100%;
        margin-top: 20px;
    }

    .tour-body {
        flex-direction: column;
    }

    .tour-sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }

    .tour-gallery-section.full-width {
        padding: 0 20px;
    }

    .tour-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-auto-rows: 250px;
    }

    .gallery-item:nth-child(n) {
        grid-column: span 1;
        grid-row: span 1;
    }

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

    .reviews-header {
        flex-direction: column;
        gap: 24px;
    }

    /* .reviews-grid {
        grid-template-columns: 1fr;
    } */
}



/* --- Сплошной фон шапки только для страницы тура --- */
body.single-tour .site-nav {
    background: #1f5259;
}
/* --- Блок даты над галереей --- */
.tour-availability-wrapper {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    /* Расстояние между надписью и рамкой с датой */
}

/* Стили для надписи "Ближайший поход" */
.tour-availability-wrapper .hero-scroll-heading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--stone);
    text-transform: uppercase;
    margin: 0;
}

.tour-availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 0;
    /* Убрали padding, теперь блок идеально прижат к левому краю */
}

.tour-availability-badge .status-box {
    border: 1px solid var(--rust);
    color: var(--rust);
    padding: 6px 16px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.1em;
}

.tour-availability-badge .status-text {
    color: #a89d96;
    font-style: italic;
    font-size: 18px;
    font-family: 'Fraunces', serif;
}

/* Меняем цвет декоративного элемента перед надписью только в турах */
.tour-availability-wrapper .hero-scroll-heading::before {
    background-color: var(--rust);
    /* Если маркер сделан через фон (линия/квадрат) */
    color: var(--rust);
    /* Если маркер сделан символом (например, тире) */
}

/* --- Сетка отзывов (CSS Multi-column для автоматической компоновки коротких) --- */
.reviews-grid {
    column-count: 3;
    column-gap: 20px;
    display: block;
    /* Убираем Grid, чтобы работали колонки */
}

.review-card {
    break-inside: avoid;
    /* Запрещаем разрывать карточку между колонками */
    page-break-inside: avoid;
    display: inline-block;
    /* Помогает избежать багов с отступами в колонках */
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;

    background: #fff;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* Стили для текстовой цитаты (вместо звезд) */
.review-quote {
    font-family: 'Fraunces', serif;
    font-size: 18px;
    font-style: italic;
    color: var(--rust);
    /* Оранжевый цвет акцента */
    margin-bottom: 16px;
    line-height: 1.3;
}

/* --- Адаптив для колонок отзывов --- */
@media(max-width: 992px) {
    .reviews-grid {
        column-count: 2;
    }
}

@media(max-width: 600px) {
    .reviews-grid {
        column-count: 1;
    }
}

/* --- Стили для лейбла внутри текстового контента --- */
.tour-content .hero-scroll-heading {
    color: var(--stone);
    /* Темный цвет текста */
    margin-bottom: 32px;
    /* Отступ вниз до текста */
}

.tour-content .hero-scroll-heading::before {
    background-color: var(--rust);
    /* Оранжевый маркер (линия/квадрат) */
    color: var(--rust);
    /* Оранжевый маркер (символ) */
}

/* --- Секция организаторов --- */
.tour-organizers-section {
    margin-top: 60px;
    /* margin-bottom: 60px;
    padding-top: 40px; */
    /* border-top: 1px solid rgba(0, 0, 0, 0.1);  */
    /* Верхняя линия над всем блоком, если нужна */
}

/* Настройка отступов для заголовка внутри секции */
.tour-organizers-section .hero-scroll-heading {
    margin-bottom: 40px;
    color: var(--rust);
    /* Красный/терракотовый цвет как на макете */
}

.tour-organizers-section .hero-scroll-heading::before {
    background-color: var(--rust);
    color: var(--rust);
}

/* --- Карточка организатора --- */
.organizer-card {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    padding: 40px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    /* Линия между организаторами */
}

/* Убираем линию у последнего элемента */
.organizer-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* --- Фотография --- */
.organizer-photo {
    flex-shrink: 0;
    width: 140px;
}

.organizer-photo img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.organizer-photo .avatar-placeholder {
    width: 140px;
    height: 140px;
    font-size: 40px;
}

/* --- Текстовая часть --- */
.organizer-details {
    flex-grow: 1;
}

.organizer-role {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--stone, #8c8880);
    /* Серый цвет для должности */
    margin-bottom: 12px;
}

.organizer-name {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 400;
    margin: 0 0 16px 0;
    color: #1a1a1a;
}

/* Стили для текста из the_content() */
.organizer-bio p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 16px 0;
}

.organizer-bio p:last-child {
    margin-bottom: 0;
}

/* --- Адаптив --- */
@media (max-width: 768px) {
    .organizer-card {
        flex-direction: column;
        gap: 24px;
        padding: 32px 0;
    }

    .organizer-photo {
        width: 100px;
    }

    .organizer-photo img,
    .organizer-photo .avatar-placeholder {
        width: 100px;
        height: 100px;
    }
}

/* --- Кнопка в шапке (Бронировать) --- */
.btn-header-book {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fde492;
    /* В цвет вашей основной желтой кнопки */
    color: var(--ink);
    padding: 8px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-left: 16px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn-header-book:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Адаптив для маленьких экранов */
@media (max-width: 576px) {
    .tour-availability-badge {
        flex-wrap: wrap;
        /* Позволяет элементам переноситься на новую строку */
    }

    .btn-header-book {
        margin-left: 0;
        margin-top: 12px;
    }
}

/* --- Настройка кнопки Бронировать в блоке дат --- */
.tour-availability-badge .btn-community {
    margin-left: 20px;
    padding: 12px 24px;
    /* Немного уменьшаем отступы для шапки */
    font-size: 13px;
    white-space: nowrap;
    /* Чтобы текст не переносился */
}

/* --- Мобильная версия: кнопка на всю ширину --- */
@media (max-width: 576px) {
    .tour-availability-badge {
        flex-direction: column;
        /* Ставим элементы друг под другом */
        align-items: stretch;
        /* Растягиваем элементы на всю ширину */
        gap: 15px;
    }

    .tour-availability-badge .btn-community {
        margin-left: 0;
        /* Убираем отступ слева */
        text-align: center;
        /* Центрируем текст */
        display: block;
        /* Делаем блочной для 100% ширины */
    }
}