/* ==========================================================================
   Candle Whisper - Main Stylesheet
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* 1. CSS переменные (цвета, шрифты)
/* -------------------------------------------------------------------------- */
:root {
    --bg-color: #1a1a1a;
    --card-bg-color: #252525;
    --text-color: #e0e0e0;
    --accent-color: #c09f58;
    --accent-hover-color: #d4b57a;
    --success-color: #3e6a4f;
    --font-main: 'Inter', sans-serif;
    --font-headings: 'Cormorant Garamond', serif;
}


/* -------------------------------------------------------------------------- */
/* 2. Глобальный сброс и базовые стили
/* -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    font-weight: 300;
    padding-bottom: 95px;
}
/* Класс для блокировки скролла при открытом меню */
body.no-scroll {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

section {
    padding: 100px 0;
    overflow: hidden;
}


/* -------------------------------------------------------------------------- */
/* 3. Типографика
/* -------------------------------------------------------------------------- */
h1, h2, h3 {
    font-family: var(--font-headings);
    font-weight: 400;
    color: white;
}

h2 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 50px;
    font-style: italic;
}


/* -------------------------------------------------------------------------- */
/* 4. Основная разметка и компоненты
/* -------------------------------------------------------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

body:not(.homepage) main {
    padding-top: 150px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--accent-color);
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid var(--accent-color);
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: var(--accent-hover-color);
    border-color: var(--accent-hover-color);
    color: #1a1a1a;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* -------------------------------------------------------------------------- */
/* 5. Шапка сайта (Header)
/* -------------------------------------------------------------------------- */
.header {
    background-color: rgba(26, 26, 26, 0.8);
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-headings);
    font-size: 2rem;
    font-style: italic;
    text-decoration: none;
    color: white;
    z-index: 1002; /* Чтобы логотип был над меню */
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: white;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: white;
}


/* -------------------------------------------------------------------------- */
/* 6. Подвал сайта (Footer)
/* -------------------------------------------------------------------------- */
.footer {
    background-color: #111;
    color: var(--text-color);
    padding: 50px 0;
    text-align: center;
    margin-top: 100px;
}

.footer-logo {
    font-family: var(--font-headings);
    font-size: 2.5rem;
    font-style: italic;
    margin-bottom: 20px;
    color: white;
}

.footer p {
    margin-bottom: 20px;
}

.social-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
}

.social-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
}

.footer-copy {
    font-size: 0.9rem;
    opacity: 0.5;
}


/* ==========================================================================
   7. Стили для выпадающего меню "Пульс" (только для десктопа)
   ========================================================================== */
.nav-item-dropdown {
    position: relative;
}

.dropdown-content {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    background-color: var(--card-bg-color);
    min-width: 360px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
    z-index: 1;
    border-radius: 5px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Общий контейнер для всех блоков в виджете */
#community-pulse-widget { display: flex; flex-direction: column; gap: 25px; }
.pulse-block { display: flex; flex-direction: column; gap: 12px; }
.pulse-block__title { font-size: 0.8rem; color: #999; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 500; border-bottom: 1px solid #444; padding-bottom: 8px; margin-bottom: 5px; }
.pulse-block__choices { display: flex; flex-wrap: wrap; gap: 10px; }
.pulse-choice { background: transparent; border: 1px solid #555; color: #bbb; padding: 6px 12px; border-radius: 5px; cursor: pointer; transition: all 0.3s ease; font-size: 0.9rem; display: flex; gap: 6px; align-items: center; flex-grow: 1; justify-content: center; }
.pulse-choice:hover { border-color: var(--accent-color); color: white; }
.pulse-choice.active { background-color: var(--accent-color); border-color: var(--accent-color); color: var(--bg-color); font-weight: 500; }
.pulse-count { opacity: 0.7; font-size: 0.8rem; }
.pulse-echo { display: flex; flex-direction: column; gap: 15px; }
.pulse-echo__question { font-family: var(--font-headings); font-style: italic; font-size: 1.1rem; color: #ddd; line-height: 1.5; }
.pulse-echo__answers { display: flex; flex-wrap: wrap; gap: 8px; min-height: 25px; }
.pulse-echo__answer { background-color: #333; color: #ccc; padding: 4px 10px; border-radius: 4px; font-size: 0.85rem; animation: fadeInPulse 0.5s ease; }
.pulse-echo__answer-placeholder { font-size: 0.85rem; color: #777; font-style: italic; }
.pulse-echo__form { display: flex; gap: 10px; }
.pulse-echo__input { flex-grow: 1; background-color: #1f1f1f; border: 1px solid #444; color: white; padding: 8px 12px; border-radius: 5px; font-size: 0.9rem; transition: border-color 0.3s; }
.pulse-echo__input:focus { outline: none; border-color: var(--accent-color); }
.pulse-echo__submit { background-color: #444; border: 1px solid #555; color: #ccc; padding: 0 15px; border-radius: 5px; cursor: pointer; font-weight: 500; transition: background-color 0.3s, color 0.3s; }
.pulse-echo__submit:hover { background-color: var(--accent-color); border-color: var(--accent-color); color: var(--bg-color); }


/* ==========================================================================
   8. Мобильное меню и Адаптивность
   ========================================================================== */

/* Стили для кнопки-бургера (скрыта на десктопе) */
.burger-menu {
    display: none; /* Скрываем по умолчанию */
    width: 30px;
    height: 22px;
    position: relative;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 1002; /* Чтобы кнопка была над меню */
}

.burger-menu span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: white;
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.burger-menu span:nth-child(1) { top: 0px; }
.burger-menu span:nth-child(2) { top: 10px; }
.burger-menu span:nth-child(3) { top: 20px; }

/* Анимация бургера в крестик */
.burger-menu.is-open span:nth-child(1) {
    top: 10px;
    transform: rotate(135deg);
}
.burger-menu.is-open span:nth-child(2) {
    opacity: 0;
    left: -60px; /* Сдвигаем среднюю полоску в сторону */
}
.burger-menu.is-open span:nth-child(3) {
    top: 10px;
    transform: rotate(-135deg);
}


/* Медиа-запросы для адаптации */
@media (max-width: 992px) {
    .nav-item-dropdown { display: none; } /* Скрываем Пульс на планшетах (если не нужен) */
}

@media (max-width: 768px) {
    h2 { font-size: 2.5rem; }
    section { padding: 80px 0; }
    main .container { padding: 0 15px; }

    /* Показываем бургер-меню */
    .burger-menu {
        display: block;
    }

    /* Навигация на мобильных */
    .nav-list {
        position: fixed;
        top: 0;
        left: 0; /* <-- ИЗМЕНЕНИЕ: Сбрасываем right и прижимаем к левому краю */
        width: 100vw; /* <-- ИЗМЕНЕНИЕ: Используем viewport width */
        height: 100vh; /* <-- ИЗМЕНЕНИЕ: Используем viewport height */
        padding: 80px 20px 20px;
        background-color: #1a1a1a; /* <-- ИЗМЕНЕНИЕ: Жестко задаем цвет #1a1a1a */
        /* backdrop-filter: blur(10px); <-- убедитесь, что этой строки здесь НЕТ */
        display: flex; /* <-- ИЗМЕНЕНИЕ: Убедимся, что flexbox работает */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.4s ease, visibility 0.4s ease;
        z-index: 1001;
    }

    .nav-list.is-open {
        transform: translateX(0); /* Выдвигаем меню */
        visibility: visible;
    }

    /* Увеличиваем ссылки в открытом меню */
    .nav-list .nav-link {
        font-size: 1.5rem;
    }

    /* Скрываем пункт "Пульс" на мобильных, как и договорились */
    .nav-item-dropdown {
        display: none;
    }
}