/* =========================================================================
   ТеатерАутор — публичен стил
   Тема: театрално бордо, злато и кремаво
   ========================================================================= */

:root {
    --wine:        #7a1f2b;
    --wine-dark:   #531019;
    --wine-deep:   #3a0c12;
    --gold:        #c8a44d;
    --gold-light:  #e3c878;
    --ink:         #241a17;
    --cream:       #faf5ee;
    --paper:       #ffffff;
    --muted:       #6b5d53;
    --line:        #e7ddcf;
    --shadow:      0 10px 30px rgba(58, 12, 18, 0.12);
    --radius:      12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--cream);
    line-height: 1.7;
    font-size: 17px;
}

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.25;
    color: var(--wine-dark);
}

a { color: var(--wine); text-decoration: none; }
a:hover { color: var(--wine-dark); }

img { max-width: 100%; height: auto; }

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ----------------------------------------------------------- Топ лента --- */
.topbar {
    background: var(--wine-deep);
    color: #e9dcd0;
    font-size: 13.5px;
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 38px;
    gap: 16px;
}
.topbar a { color: var(--gold-light); }
.topbar .topbar-links { display: flex; gap: 18px; }

/* --------------------------------------------------------------- Хедър --- */
.site-header {
    background: linear-gradient(180deg, var(--wine-dark), var(--wine));
    color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 0 8px;
    transition: padding .35s ease;
}
.logo {
    display: inline-flex;
    overflow: hidden;
    max-height: 130px;
    opacity: 1;
    transition: max-height .35s ease, opacity .3s ease, transform .35s ease, margin .35s ease;
}
.logo img {
    height: 86px;
    width: auto;
    display: block;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.35));
    transition: transform .2s ease;
}
.logo:hover img { transform: scale(1.03); }

/* Скриване на логото при скролване надолу */
.site-header.scrolled .header-top {
    padding-top: 4px;
    padding-bottom: 4px;
}
.site-header.scrolled .logo {
    max-height: 0;
    opacity: 0;
    margin: 0;
    transform: translateY(-8px);
}

/* ---------------------------------------------------------- Навигация --- */
.main-nav {
    border-top: 1px solid rgba(227, 200, 120, 0.22);
}
.main-nav > ul {
    justify-content: center;
    flex-wrap: wrap;
    padding: 6px 0;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
}
.main-nav li { position: relative; }

.main-nav a {
    display: block;
    color: #f6ece1;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    white-space: nowrap;
    transition: background .18s, color .18s;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li:hover > a {
    background: rgba(255,255,255,0.12);
    color: var(--gold-light);
}
.main-nav li.has-children > a::after {
    content: "▾";
    font-size: 11px;
    margin-left: 6px;
    opacity: .8;
}

/* Падащи менюта */
.main-nav ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 248px;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s, transform .18s, visibility .18s;
    z-index: 200;
}
.main-nav li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.main-nav ul ul a {
    color: var(--ink);
    font-weight: 500;
    padding: 9px 12px;
}
.main-nav ul ul a:hover {
    background: var(--cream);
    color: var(--wine-dark);
}
/* Под-под меню (трето ниво) */
.main-nav ul ul ul {
    top: -8px;
    left: 100%;
}
.main-nav ul ul li.has-children > a::after {
    content: "▸";
}

/* Бутон за мобилно меню */
.nav-toggle {
    display: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* --------------------------------------------------------------- Hero --- */
.hero {
    background:
        linear-gradient(rgba(58,12,18,.78), rgba(83,16,25,.86)),
        radial-gradient(circle at 20% 20%, #7a1f2b, #3a0c12 70%);
    color: #fff;
    text-align: center;
    padding: 84px 22px;
    border-bottom: 4px solid var(--gold);
}
.hero h1 {
    color: #fff;
    font-size: clamp(28px, 5vw, 48px);
    margin: 0 0 14px;
}
.hero p {
    font-size: clamp(16px, 2.4vw, 20px);
    max-width: 720px;
    margin: 0 auto 26px;
    color: #f0e4d8;
}
.hero .gold { color: var(--gold-light); }

.btn {
    display: inline-block;
    background: var(--gold);
    color: var(--wine-deep);
    padding: 13px 28px;
    border-radius: 30px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform .15s, background .15s;
}
.btn:hover { background: var(--gold-light); color: var(--wine-deep); transform: translateY(-2px); }
.btn-outline {
    background: transparent;
    color: var(--gold-light);
    border: 2px solid var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--wine-deep); }

/* ------------------------------------------------------------ Секции --- */
.section { padding: 60px 0; }
.section-title {
    text-align: center;
    font-size: clamp(24px, 4vw, 34px);
    margin: 0 0 8px;
    position: relative;
}
.section-subtitle {
    text-align: center;
    color: var(--muted);
    margin: 0 auto 40px;
    max-width: 640px;
}
.divider {
    width: 70px;
    height: 3px;
    background: var(--gold);
    margin: 14px auto 30px;
    border-radius: 3px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 4px 14px rgba(58,12,18,.06);
    transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .icon {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 24px;
    margin-bottom: 14px;
}
.card h3 { margin: 0 0 8px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }

/* --------------------------------------------- Съдържание на страница --- */
.page-hero {
    background: linear-gradient(180deg, var(--wine-dark), var(--wine));
    color: #fff;
    padding: 56px 22px;
    text-align: center;
    border-bottom: 4px solid var(--gold);
}
.page-hero h1 { color: #fff; margin: 0; font-size: clamp(26px, 4.5vw, 40px); }
.page-hero p { color: #f0e4d8; margin: 10px 0 0; }

.breadcrumbs {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: var(--muted);
}
.breadcrumbs .container { padding-top: 12px; padding-bottom: 12px; }
.breadcrumbs a { color: var(--wine); }

.content {
    max-width: 880px;
    margin: 0 auto;
    padding: 50px 22px 70px;
}
.content h2 { margin-top: 34px; }
.content h3 { margin-top: 26px; }
.content img { max-width: 100%; height: auto; border-radius: 10px; }
.content figure { margin: 20px 0; }
.content figure img { display: block; }
.content figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; text-align: center; }
.content table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.content th, .content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.content th { background: var(--cream); }
.content ul, .content ol { padding-left: 22px; }
.content blockquote {
    border-left: 4px solid var(--gold);
    margin: 20px 0;
    padding: 6px 18px;
    background: var(--paper);
    color: var(--muted);
    font-style: italic;
}

/* --------------------------------------------------------- Вграден PDF --- */
.pdf-embed {
    margin: 26px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #fff;
}
.pdf-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: linear-gradient(180deg, var(--wine-dark), var(--wine));
    color: #fff;
}
.pdf-name { font-weight: 600; font-size: 15px; }
.pdf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.pdf-btn:hover { background: var(--gold); color: var(--wine-deep); border-color: var(--gold); }
.pdf-frame {
    display: block;
    width: 100%;
    height: var(--pdf-h, 720px);
    border: 0;
    background: #f4efe7;
}
.pdf-missing {
    padding: 18px;
    color: var(--wine-dark);
    background: #fbe6e6;
    font-weight: 600;
}
@media (max-width: 600px) {
    .pdf-frame { height: 70vh; }
    .pdf-name { width: 100%; }
}

/* ------------------------------------------------ Банер за бисквитки --- */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    max-width: 1040px;
    margin: 0 auto;
    padding: 16px 20px;
    background: var(--ink);
    color: #f3ece2;
    border: 1px solid #3a2a23;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.cookie-banner.show { display: flex; }
.cookie-text { flex: 1 1 320px; font-size: 14.5px; line-height: 1.55; }
.cookie-text a { color: var(--gold-light); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-btn {
    cursor: pointer;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid transparent;
    transition: background .15s, color .15s;
}
.cookie-btn-accept { background: var(--gold); color: var(--wine-deep); }
.cookie-btn-accept:hover { background: var(--gold-light); }
.cookie-btn-ghost { background: transparent; color: #f3ece2; border-color: rgba(255,255,255,.35); }
.cookie-btn-ghost:hover { background: rgba(255,255,255,.1); }
@media (max-width: 600px) {
    .cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 14px; }
    .cookie-actions { width: 100%; }
    .cookie-btn { flex: 1; }
}

/* ------------------------------------------------------------- Форми --- */
.form-card {
    max-width: 620px;
    margin: 0 auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-row input,
.form-row textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: var(--cream);
}
.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: #fff;
}
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
}
.alert-success { background: #e9f6ec; color: #1f6b35; border: 1px solid #bfe3c8; }
.alert-error { background: #fbeaea; color: #9a2a2a; border: 1px solid #f0c4c4; }

/* -------------------------------------------------------------- Футър --- */
.site-footer {
    background: var(--wine-deep);
    color: #e2d4c8;
    padding: 50px 0 24px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 36px;
}
.site-footer h4 { color: var(--gold-light); margin: 0 0 14px; }
.site-footer a { color: #e2d4c8; }
.site-footer a:hover { color: var(--gold-light); }
.site-footer ul { list-style: none; padding: 0; margin: 0; line-height: 2; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    margin-top: 34px;
    padding-top: 18px;
    text-align: center;
    font-size: 13.5px;
    color: #c4b4a7;
}

/* ----------------------------------------------------------- Адаптив --- */
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .logo img { height: 60px; }
    .header-top { padding: 14px 0; }
    .site-header.scrolled .header-top { min-height: 46px; }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--wine-dark);
        max-height: 0;
        overflow: hidden;
        border-top: none;
        transition: max-height .3s ease;
    }
    .main-nav > ul { padding: 8px; }
    .main-nav.open { max-height: 80vh; overflow-y: auto; }
    .main-nav ul { flex-direction: column; gap: 0; padding: 8px; }

    .main-nav ul ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: rgba(0,0,0,.18);
        padding: 0 0 0 12px;
        display: none;
    }
    .main-nav li.open > ul { display: block; }
    .main-nav ul ul a { color: #f0e4d8; }
    .main-nav ul ul a:hover { background: rgba(255,255,255,.08); color: var(--gold-light); }
    .main-nav ul ul ul { left: 0; top: 0; }
}
