/* =========================================================
   Festival shared styles: база, шапка, меню, футер, кнопки
   Подключается на index.php, news.php, p.php перед CSS страницы.
   ========================================================= */
:root {
    --bg-dark-primary: #101010;
    --bg-dark-secondary: #161616;
    --bg-dark-tertiary: #1C1C1C;
    --bg-light: #F5F0E8;
    --accent-gold: #C9A45C;
    --accent-gold-hover: #D6B56D;
    --accent-bronze: #B8893A;
    --accent-burgundy: #5A1F24;
    --accent-burgundy-hover: #6E252B;
    --accent-burgundy-deep: #2A070B;
    --accent-burgundy-rich: #7A2630;
    --accent-burgundy-muted: #3A1116;
    --burgundy-glow: rgba(122, 38, 48, 0.28);
    --text-light-main: #F7F3EA;
    --text-light-muted: #B8B2A7;
    --text-dark-main: #1A1A1A;
    --text-dark-muted: #55514A;
    --danger: #E46E6E;
    --success: #92D1A6;
    --font-title: 'Cormorant Garamond', serif;
    --font-body: 'Manrope', sans-serif;
    --transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark-primary);
    color: var(--text-light-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul { list-style: none; }

button,
input,
select,
textarea { font: inherit; }

button,
.btn {
    cursor: pointer;
    border: none;
    background: none;
    transition: var(--transition);
}

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

.btn,
.btn-gold,
.btn-outline,
.btn-dark-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-gold {
    background: var(--accent-gold);
    color: #000;
    padding: 15px 28px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--accent-gold);
}

.btn-gold:hover {
    background: var(--accent-gold-hover);
    border-color: var(--accent-gold-hover);
    box-shadow: 0 0 28px rgba(201, 164, 92, 0.24);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-light-main);
    padding: 15px 28px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid rgba(247, 243, 234, 0.25);
}

.btn-outline:hover {
    border-color: rgba(247, 243, 234, 0.7);
    background: rgba(247, 243, 234, 0.06);
}

/* HEADER */
.header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(16, 16, 16, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: var(--transition);
}

.header-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-top {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-light-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-main {
    font-family: var(--font-title);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--accent-gold);
    line-height: 1.15;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light-muted);
}

.nav-link:hover,
.nav-link.active { color: var(--text-light-main); }

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 14px 0;
    margin: -14px 0;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.dropdown-toggle::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: 0.75;
    transition: var(--transition);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 230px;
    padding: 12px;
    background: rgba(16, 16, 16, 0.96);
    border: 1px solid rgba(201, 164, 92, 0.18);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1100;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -18px;
    height: 18px;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.dropdown-link {
    display: block;
    padding: 12px 14px;
    color: var(--text-light-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-link:last-child { border-bottom: none; }

.dropdown-link:hover {
    color: var(--text-light-main);
    background: rgba(201, 164, 92, 0.06);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.lang-switch {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-light-muted);
    white-space: nowrap;
}

.lang-item.active { color: var(--accent-gold); }

.btn-header {
    padding: 10px 20px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.burger {
    display: none;
    width: 32px;
    height: 28px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: transparent;
    z-index: 1200;
}

.burger span {
    width: 100%;
    height: 2px;
    background: var(--text-light-main);
    border-radius: 10px;
    transition: var(--transition);
}

.burger.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* FOOTER */
.footer {
    background: #090909;
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 70px 0 34px;
    color: var(--text-light-main);
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 2fr;
    gap: 60px;
    align-items: start;
    margin-bottom: 46px;
}

.footer-brand p {
    max-width: 430px;
    margin-top: 14px;
    color: var(--text-light-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

.footer-logo { display: inline-block; }

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.footer-links h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-gold);
    margin-bottom: 16px;
}

.footer-links ul { display: grid; gap: 10px; }

.footer-links a {
    color: var(--text-light-muted);
    font-size: 0.92rem;
}

.footer-links a:hover { color: var(--text-light-main); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-top: 26px;
    border-top: 1px solid rgba(255,255,255,.06);
    color: rgba(247,243,234,.55);
    font-size: 0.82rem;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.footer-legal a:hover { color: var(--accent-gold); }

.mobile-bottom-bar {
    display: none;
}

@media (max-width: 1100px) {
    .btn-header { display: none; }
    .nav-menu { gap: 12px; }
    .header-actions { gap: 16px; }
}

@media (max-width: 900px) {
    .header { position: sticky; }

    .header-container {
        padding: 16px 18px;
    }

    .logo-main { font-size: 1.1rem; }
    .logo-top { font-size: 0.56rem; }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(360px, 86vw);
        height: 100vh;
        padding: 92px 28px 34px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0;
        background: rgba(16, 16, 16, 0.98);
        border-left: 1px solid rgba(201, 164, 92, 0.16);
        box-shadow: -24px 0 80px rgba(0,0,0,.45);
        transition: right .35s ease;
        z-index: 1050;
    }

    .nav-menu.active { right: 0; }

    .nav-link,
    .dropdown-link {
        width: 100%;
        font-size: 0.86rem;
        padding: 15px 0;
        letter-spacing: 0.08em;
    }

    .nav-item {
        width: 100%;
        display: block;
        padding: 0;
        margin: 0;
    }

    .dropdown-toggle::after { display: none; }

    .dropdown-menu {
        position: static;
        transform: none;
        width: 100%;
        min-width: 0;
        padding: 0 0 8px 16px;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .dropdown-menu::before { display: none; }

    .dropdown-link {
        color: rgba(247, 243, 234, 0.64);
        border-bottom: 1px solid rgba(255,255,255,.05);
        padding: 12px 0;
    }

    .burger { display: flex; }

    .lang-switch { font-size: 0.74rem; }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
    }

    .mobile-bottom-bar {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: 14px;
        z-index: 900;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        pointer-events: none;
    }

    .mobile-bottom-link {
        pointer-events: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: 12px 16px;
        background: rgba(16,16,16,.92);
        color: var(--text-light-main);
        border: 1px solid rgba(255,255,255,.12);
        backdrop-filter: blur(16px);
        font-size: 0.78rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .09em;
    }

    .mobile-bottom-link-gold {
        background: var(--accent-gold);
        border-color: var(--accent-gold);
        color: #000;
    }

    body { padding-bottom: 76px; }
}

@media (max-width: 560px) {
    .container { padding: 0 18px; }
    .header-container { gap: 12px; }
    .header-actions { gap: 10px; flex-shrink: 0; }
    .logo { min-width: 0; }
    .logo-main { font-size: 1rem; }
    .logo-top { font-size: 0.52rem; letter-spacing: 0.12em; }
    .lang-switch { display: inline-flex; align-items: center; font-size: 0.72rem; }
    .footer { padding-bottom: 96px; }
}
