/* =========================================
   1. ПЕРЕМЕННЫЕ (ЦВЕТА И ШРИФТЫ)
   ========================================= */
:root {
    /* ПАЛИТРА "ТЕХНО-СЕПИЯ" */
    --color-bg-paper: #fdfbf7;      /* Теплый бумажный фон */
    --color-text-main: #2c2420;     /* Темно-коричневый */
    --color-gold: #c5a065;          /* Благородное золото */
    --color-gold-hover: #b08d55;
    --color-gray-soft: #f4f1ea;     /* Подложки */
    --color-tech-blue: #eeeae5c9;     /* Темный акцент */
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
}

/* =========================================
   2. БАЗОВЫЕ СТИЛИ (BODY, TEXT, LINKS)
   ========================================= */
body {
    background-color: var(--color-bg-paper);
    color: var(--color-text-main);
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .font-serif {
    font-family: var(--font-heading);
    color: var(--color-text-main);
}

.link-sepia {
    color: var(--color-gold);
    text-decoration: none;
    transition: color 0.2s ease;
}
.link-sepia:hover {
    color: var(--color-gold-hover);
    text-decoration: underline;
}

/* Утилиты */
.transition-all { transition: 0.3s; }
.hover-shadow:hover {
    background-color: #fff !important;
    border-color: #e5dfd5 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08) !important;
}

/* =========================================
   3. КОМПОНЕНТЫ (BUTTONS, NAVBAR, FOOTER)
   ========================================= */

/* Кнопка Sepia */
.btn-sepia {
    background-color: var(--color-gold);
    color: #fff;
    border: none;
    border-radius: 2px;
    padding: 8px 20px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: 0.3s;
}
.btn-sepia:hover {
    background-color: var(--color-gold-hover);
    color: #fff;
}

/* Кнопки соцсетей */
.btn-social {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    transition: 0.3s;
    border: 1px solid #e5dfd5;
    background: #fff;
    color: var(--color-text-main);
}
.btn-social:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-social.tg:hover { background-color: #24A1DE; border-color: #24A1DE; color: #fff; }
.btn-social.vk:hover { background-color: #0077FF; border-color: #0077FF; color: #fff; }

/* Навигация */
.navbar-custom { background-color: #fff; border-bottom: 1px solid #e5dfd5; padding: 15px 0; }
.navbar-brand { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; color: var(--color-text-main) !important; letter-spacing: 1px; }
.nav-link { color: var(--color-text-main) !important; font-weight: 500; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; padding: 0 15px !important; transition: color 0.3s; }
.nav-link:hover { color: var(--color-gold) !important; }

/* Подвал */
footer { margin-top: auto; background-color: #1a1816; color: #d1cbc5; padding: 60px 0 20px; }
footer h5 { color: #fff; margin-bottom: 20px; }
footer a { color: #b0a8a0; text-decoration: none; transition: 0.3s; }
footer a:hover { color: var(--color-gold); }

/* Исправление для заголовков в темных секциях */
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.tech-section h1, .tech-section h2, .tech-section h3, .tech-section h4, .tech-section h5,
.principles-section h1, .principles-section h2, .principles-section h3,
footer h1, footer h2, footer h3, footer h4, footer h5 {
    color: #ffffff !important;
}

/* Дополнительный класс для сепийных кнопок, чтобы текст всегда был белым */
.btn-sepia {
    background-color: var(--color-gold);
    color: #fff !important;
}

/* =========================================
   4. КАРТОЧКА ОБЪЕКТА (КАТАЛОГ И ГЛАВНАЯ)
   ========================================= */
.prop-card-v2 {
    background: #fff;
    border: 1px solid #f0ebe5;
    border-radius: 10px; /* Добавил скругление, как в каталоге */
    transition: 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.prop-card-v2:hover {
    border-color: var(--color-gold);
    box-shadow: 0 10px 30px rgba(197, 160, 101, 0.15);
    transform: translateY(-5px);
}

.prop-thumb {
    height: 250px; /* Усреднил высоту */
    position: relative;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}
.prop-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s;
}
.prop-card-v2:hover .prop-thumb img { transform: scale(1.05); }

.prop-agent-badge {
    position: absolute; bottom: 15px; right: 15px;
    width: 50px; height: 50px;
    border-radius: 50%; border: 3px solid #fff;
    overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.prop-agent-badge img { width: 100%; height: 100%; object-fit: cover; }


/* =========================================
   5. СТРАНИЦЫ: НОВОСТИ И БЛОГ
   ========================================= */
.article-content { font-size: 1.15rem; line-height: 1.8; color: #2c2420; }
.article-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; }
.article-content h2, .article-content h3 { font-family: var(--font-heading); margin-top: 40px; margin-bottom: 20px; font-weight: 700; }
.article-content ul, .article-content ol { margin-bottom: 30px; }

.news-card-mini { height: 100%; border: none; background: transparent; }
.news-card-mini img { height: 200px; width: 100%; object-fit: cover; border-radius: 4px; margin-bottom: 15px; }
.news-card-mini:hover h5 { color: var(--color-gold); }
.news-card-mini h5 { transition: 0.2s; font-size: 1.1rem; }


/* =========================================
   6. СТРАНИЦА: УСЛУГИ
   ========================================= */
.service-content { font-size: 1.1rem; line-height: 1.7; color: #4a4a4a; }
.service-content h2, .service-content h3 { font-family: var(--font-heading); color: var(--color-text-main); margin-top: 2rem; margin-bottom: 1rem; }
.service-content ul { margin-bottom: 1.5rem; }
.service-content li { margin-bottom: 0.5rem; }

.service-cover { height: 400px; width: 100%; object-fit: cover; border-radius: 10px 150px 10px 10px; margin-bottom: 30px; }
.sticky-sidebar { position: -webkit-sticky; position: sticky; top: 100px; }

/* Форма захвата (Лид) */

.form-control-dark:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: var(--color-gold);
    box-shadow: none;
}
.form-control-dark::placeholder { color: rgba(255, 255, 255, 0.6); }

/* Список услуг (Grid) */
.service-card { background: #fff; border: 1px solid #e5dfd5; border-radius: 8px; padding: 40px 30px; transition: 0.3s; height: 100%; text-align: center; }
.service-card:hover { border-color: var(--color-gold); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(197, 160, 101, 0.15); }
.service-icon { width: 80px; height: 80px; background: var(--color-gray-soft); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 25px; color: var(--color-text-main); font-size: 2rem; transition: 0.3s; }
.service-card:hover .service-icon { background: var(--color-gold); color: #fff; }
.service-link { text-decoration: none; color: inherit; }


/* =========================================
   7. СТРАНИЦА: КОНТАКТЫ
   ========================================= */
.contact-card { background: #fff; padding: 40px; border-radius: 8px; border: 1px solid #e5dfd5; height: 100%; }
.contact-icon { font-size: 1.5rem; color: var(--color-gold); margin-bottom: 15px; }
.map-frame { width: 100%; height: 400px; border: 0; border-radius: 8px; background: #e5e7eb; }

/* =========================================
   8. СТРАНИЦА: ГЛАВНАЯ (HOME)
   ========================================= */
.hero-wrapper { position: relative; padding-top: 60px; padding-bottom: 100px; overflow: hidden; }
.hero-text-block { padding-right: 40px; z-index: 2; }
.hero-title { font-size: 4rem; line-height: 1.1; margin-bottom: 30px; color: var(--color-text-main); }
.hero-title span { color: var(--color-gold); font-style: italic; }
.hero-image-block { position: relative; height: 600px; border-radius: 200px 200px 0 0; overflow: hidden; }
.hero-image-block img { width: 100%; height: 100%; object-fit: cover; }

.search-float-bar {
    background: #fff; padding: 30px; border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    margin-top: -60px; position: relative; z-index: 10;
    border: 1px solid #e5dfd5;
}

/* Статистика */
.stat-item h3 { font-size: 3rem; color: var(--color-gold); margin-bottom: 0; font-family: var(--font-heading); }
.stat-item p { text-transform: uppercase; letter-spacing: 2px; font-size: 0.75rem; font-weight: 700; margin-top: 10px; }

/* Tech Block */
.tech-section { background-color: #1a1816; color: #fff; padding: 100px 0; position: relative; }
.tech-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); padding: 30px; border-radius: 8px; transition: 0.3s; }
.tech-card:hover { background: rgba(255,255,255,0.1); transform: translateY(-5px); }
.tech-icon { font-size: 2rem; color: var(--color-gold); margin-bottom: 20px; }


/* =========================================
   9. СТРАНИЦА: ДЕТАЛЬНАЯ ОБЪЕКТА
   ========================================= */
.detail-gallery {
    position: relative; height: 500px; overflow: hidden;
    border-radius: 150px 10px 0 0; /* Арка */
    border: 1px solid var(--color-gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    background-color: #e5e7eb; cursor: zoom-in;
}
.detail-gallery img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s ease-in-out; }

.thumbs-wrapper { position: relative; display: flex; align-items: center; margin-bottom: 30px; }
.thumbs-scroll { display: flex; gap: 10px; overflow-x: auto; scroll-behavior: smooth; width: 100%; padding: 5px 0; scrollbar-width: none; -ms-overflow-style: none; }
.thumbs-scroll::-webkit-scrollbar { display: none; }

.thumb-item { width: 100px; height: 70px; border-radius: 8px; overflow: hidden; cursor: pointer; opacity: 0.6; transition: 0.2s; flex-shrink: 0; border: 1px solid transparent; }
.thumb-item:hover { opacity: 0.9; }
.thumb-item.active { opacity: 1; border-color: var(--color-gold); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }

.thumb-nav-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: #fff; border: 1px solid #e5dfd5;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--color-text-main);
    transition: 0.2s; flex-shrink: 0; z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.thumb-nav-btn:hover { background: var(--color-gold); color: #fff; border-color: var(--color-gold); }
.thumb-prev { margin-right: 10px; }
.thumb-next { margin-left: 10px; }

.agent-card-sticky {
    position: sticky; top: 100px;
    background: #fff; padding: 30px;
    border: 1px solid var(--color-gold);
    border-radius: 10px 150px 0 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.param-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #e5dfd5 }
.param-label { color: #6c757d; }
.param-value { font-weight: 700; color: var(--color-text-main); }


/* =========================================
   10. СТРАНИЦА: КАТАЛОГ (ФИЛЬТРЫ И КАРТА)
   ========================================= */
.filter-panel {
    background: #fff;
    border-radius: 80px 10px 10px 10px;
    padding: 30px 30px 30px 50px;
    border: 1px solid #e5dfd5;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.map-column { position: relative; }
.map-container {
    position: -webkit-sticky; position: sticky; top: 20px;
    height: 80vh;
    background: #e5e7eb; border: 1px solid #e5dfd5; overflow: hidden;
    border-radius: 10px 80px 10px 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05)
}

.page-link { color: #2c2420; border-color: #e5dfd5; border-radius: 4px; margin: 0 3px; }
.page-item.active .page-link { background-color: var(--color-gold); border-color: var(--color-gold); color: #fff; }

/* =========================================
   АДАПТИВНОСТЬ (MOBILE & TABLET)
   ========================================= */

@media (max-width: 991px) {
    /* 1. Навигация */
    .navbar-custom { padding: 10px 0; }
    .navbar-brand { font-size: 1.2rem; }

    /* 2. Hero-секция (Общее) */
    .hero-wrapper { padding-top: 40px; padding-bottom: 40px; text-align: center; }
    
    .hero-text-block { padding-right: 0; margin-bottom: 30px; }
    
    .hero-title { 
        font-size: 2.2rem !important; /* Уменьшаем, чтобы не вылетало за края */
        line-height: 1.2;
    }

    /* 3. Блок с картинкой (Арка) */
    .hero-image-block, .hero-image-fullwidth { 
        height: auto !important;     /* Уходим от жесткой высоты */
        min-height: 300px;           /* Но сохраняем минимальный объем */
        border-radius: 80px 80px 0 0 !important; /* Смягчаем арку для мобилок */
        margin-top: 20px; 
    }

    /* 4. Плавающие бары (Поиск и Статистика) */
    .search-float-bar, .stats-bar, .stats-floating-container { 
        margin-top: 20px !important; /* Убираем наплыв на картинку, на мобилках это мешает */
        padding: 20px !important;
        border-radius: 10px !important;
    }
    
    .stat-item h3 { font-size: 2.2rem; } /* Уменьшаем цифры стажа */

    /* 5. Каталог и Фильтры */
    .filter-panel { 
        border-radius: 20px !important; 
        padding: 20px !important; 
    }
    
    .map-container { 
        position: static !important; /* Карта больше не "липнет" */
        height: 350px; 
        border-radius: 20px; 
        margin-bottom: 30px; 
    }

    /* 6. Галерея объекта */
    .detail-gallery { 
        height: 300px; 
        border-radius: 20px 20px 0 0 !important; 
    }
    
    .thumb-nav-btn { display: none; } /* Скрываем стрелки пагинации фото, на мобилках лучше свайп */

    /* 7. Техно-секция (темная) */
    .tech-section { padding: 60px 0; }
    .tech-card { margin-bottom: 20px; }
}

/* Доп. правка для совсем маленьких экранов (iPhone) */
@media (max-width: 576px) {
    .hero-title { font-size: 1.8rem !important; }
    .stat-item h3 { font-size: 2rem; }
    .hero-image-block { min-height: 250px; border-radius: 50px 50px 0 0 !important; }
}

/* Карточка гильдии */
.guild-card {
    background: #fff;
    border: 1px solid #e5dfd5;
    border-radius: 8px;
    padding: 30px;
    height: 100%;
    transition: transform 0.3s ease;
    /* Центрируем содержимое */
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center; 
}

.guild-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-color: var(--color-gold);
}

/* Контейнер для логотипа (фиксированный размер) */
.guild-logo-wrapper {
    height: 120px;         /* Общая высота блока */
    width: 100%;
    display: flex;
    align-items: center;   /* Центрируем по вертикали */
    justify-content: center;
    margin-bottom: 20px;
    background-color: #f8f9fa; /* Светлый фон (опционально) */
    border-radius: 8px;
}

/* Само изображение */
.guild-logo {
    max-height: 70px;      /* <--- ВОТ ГЛАВНОЕ ИЗМЕНЕНИЕ (было 100% или 100px) */
    max-width: 200px;      /* Ограничение по ширине */
    width: auto;
    height: auto;
    object-fit: contain;   /* Сохраняем пропорции */
    
    filter: grayscale(100%);
    opacity: 0.8;
    transition: 0.3s;
}

.guild-card:hover .guild-logo {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05); 
}

/* Выравнивание списка по левому краю внутри центрированной карточки */
.guild-list {
    text-align: left;
    display: inline-block; /* Чтобы список был по центру блока, но текст слева */
    margin-top: 15px;
}

.share-btn {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: #fff !important;
    border-color: #f0ebe5 !important;
}

.share-btn:hover {
    border-color: #c5a065 !important; /* Ваше золото */
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 10px rgba(197, 160, 101, 0.2);
}

.share-btn i {
    font-size: 1.1rem;
}

/* Контейнер таймлайна */
.timeline-wrapper {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Центральная вертикальная линия */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5dfd5; /* Цвет из вашей палитры */
    transform: translateX(-50%);
}

/* Общий стиль элемента */
.timeline-item {
    position: relative;
    width: 50%;
    margin-bottom: 60px;
    z-index: 1;
}

/* Точка на линии */
.timeline-dot {
    position: absolute;
    top: 20px;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 3px solid #e5dfd5;
    border-radius: 50%;
    z-index: 3;
}

.timeline-dot.dot-award {
    border-color: var(--color-gold);
    background: var(--color-gold);
    box-shadow: 0 0 10px rgba(197, 160, 101, 0.5);
}

/* Год рядом с точкой */
.timeline-year-bubble {
    position: absolute;
    top: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gold);
    width: 100px;
}

/* Карточка события */
.timeline-card-body {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #f0ebe5;
    transition: 0.3s;
}

.timeline-item:hover .timeline-card-body {
    border-color: var(--color-gold);
    box-shadow: 0 10px 30px rgba(197, 160, 101, 0.1) !important;
}

/* Тег награды */
.award-tag {
    display: inline-block;
    background: #fdfaf5;
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ПОЗИЦИОНИРОВАНИЕ СЛЕВА */
.item-left {
    padding-right: 60px;
    text-align: right;
}
.item-left .timeline-dot { right: -8px; }
.item-left .timeline-year-bubble { right: -130px; text-align: left; }

/* ПОЗИЦИОНИРОВАНИЕ СПРАВА */
.item-right {
    padding-left: 60px;
    margin-left: auto;
    text-align: left;
}
.item-right .timeline-dot { left: -8px; }
.item-right .timeline-year-bubble { left: -130px; text-align: right; }

/* АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ */
@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 50px !important;
        padding-right: 0 !important;
        text-align: left !important;
        margin-left: 0 !important;
    }
    .timeline-dot {
        left: 12px !important;
    }
    .timeline-year-bubble {
        position: relative;
        top: 0;
        left: 0 !important;
        width: auto;
        display: block;
        margin-bottom: 10px;
        text-align: left !important;
    }
}

/* =========================================
   11. МОДУЛЬ: РЕЙТИНГ КВАРТИР
   ========================================= */
.rating-header {
    background: linear-gradient(135deg, #2c2420 0%, #4a3e37 100%);
    color: #fff;
    padding: 60px 0;
    border-radius: 0 0 150px 0;
    margin-bottom: 50px;
}

.rating-intro-box {
    border-left: 4px solid var(--color-gold);
    background: rgba(197, 160, 101, 0.05);
    padding: 25px;
    border-radius: 4px 12px 12px 4px;
}

.rating-card {
    border: 1px solid #e5dfd5;
    background: #fff;
    transition: 0.3s;
}
.rating-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 15px 35px rgba(44, 36, 32, 0.08);
}

.nav-rating {
    background: #fff;
    padding: 8px;
    border-radius: 50px;
    border: 1px solid #e5dfd5;
    display: inline-flex;
    width: auto;
}

.nav-rating .nav-link {
    border-radius: 50px !important;
    padding: 10px 25px !important;
    color: var(--color-text-main) !important;
    border: none !important;
    font-weight: 700;
}

.nav-rating .nav-link.active {
    background-color: var(--color-gold) !important;
    color: #fff !important;
}

/* Светофор цен */
.price-tag { font-size: 1.4rem; font-weight: 800; color: var(--color-text-main); }
.status-up { color: #dc3545; font-weight: 700; }
.status-down { color: #198754; font-weight: 700; }
.status-stable { color: #6c757d; }

.methodology-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    list-style: none;
}
.methodology-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--color-gold);
    font-weight: bold;
}