/*
 * zamok.ee — Нарвский замок
 * Дизайн: пастельная лаванда + неоновый фиолетовый + эффект молнии
 *
 * ВАЖНО: CSS custom properties (var()) НЕ используются — IE9 несовместимы.
 * Все цвета прописаны литеральными значениями.
 *
 * ЦВЕТОВАЯ СИСТЕМА (справочник):
 *   bg-main:        #F0EBF8   пастельная лаванда, основной фон
 *   bg-surface:     #EAE2F5   чуть темнее, фон чётных секций
 *   bg-dark:        #1A0A2E   тёмный индиго (казематы, hero)
 *   bg-card:        #FDFAFF   почти белый, карточки
 *   neon-violet:    #9D4EDD   основной неон
 *   neon-bright:    #CC77FF   яркий hover
 *   neon-dim:       #7B2FBE   тёмный неон, активные состояния
 *   lightning:      #E8DCFF   «молния» — светло-фиолетовый
 *   text-dark:      #1C0A3A   почти чёрный тёмно-фиолетовый
 *   text-mid:       #5B2D8E   средний фиолетовый
 *   text-light:     #C4A8E8   светлый (на тёмном фоне)
 *   text-muted:     #8E72B3   приглушённый
 *   border-neon:    rgba(157, 78, 221, 0.5)
 */

/* =====================================================================
   RESET & BASE
   ===================================================================== */
*, *:before, *:after {
    -webkit-box-sizing: border-box;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.75;
    color: #1C0A3A;
    background-color: #F0EBF8;
    overflow-x: hidden;
    padding-top: 60px; /* compensate for fixed nav */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 0;
}

a {
    color: #9D4EDD;
    text-decoration: none;
    -webkit-transition: color 0.25s ease;
    -ms-transition: color 0.25s ease;
    transition: color 0.25s ease;
}

a:hover, a:focus {
    color: #CC77FF;
    outline: none;
}

ul, ol { list-style: none; }

/* =====================================================================
   TYPOGRAPHY
   ===================================================================== */
h1, h2, h3, h4 {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-weight: bold;
    line-height: 1.25;
    color: #1C0A3A;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1.1rem; }
p:last-child { margin-bottom: 0; }

strong { color: #5B2D8E; }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: #EAE2F5;
}

.section-dark {
    background-color: #1A0A2E;
    color: #C4A8E8;
}

/* Casemates section — photo background with 0.4 darkening overlay */
#casemates {
    background-color: #0D0520; /* solid fallback */
    background-image:
        -webkit-linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
        url('../img/bg-casemates.jpg');
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
        url('../img/bg-casemates.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: #CC77FF;
}

.section-dark p,
.section-dark li {
    color: #C4A8E8;
}

.section-dark strong {
    color: #E8DCFF;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.95rem;
    color: #8E72B3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-dark .section-subtitle {
    color: #8E72B3;
}

/* Lightning divider */
.lightning-divider {
    text-align: center;
    margin-bottom: 1.5rem;
}

.lightning-divider:before {
    content: '';
    display: inline-block;
    width: 60px;
    height: 3px;
    background: #CC77FF;
    -webkit-box-shadow: 0 0 10px #9D4EDD, 0 0 20px rgba(157, 78, 221, 0.4);
    box-shadow: 0 0 10px #9D4EDD, 0 0 20px rgba(157, 78, 221, 0.4);
    vertical-align: middle;
}

.section-dark .lightning-divider:before {
    background: #9D4EDD;
    -webkit-box-shadow: 0 0 15px #CC77FF, 0 0 30px rgba(204, 119, 255, 0.5);
    box-shadow: 0 0 15px #CC77FF, 0 0 30px rgba(204, 119, 255, 0.5);
}

/* =====================================================================
   SECTION BACKGROUND IMAGES — parallax / fixed
   ===================================================================== */

/* History — warm stone, parallax on desktop */
#history {
    background-color: #F0EBF8; /* fallback */
    background-image:
        -webkit-linear-gradient(rgba(240, 235, 248, 0.82), rgba(234, 226, 245, 0.86)),
        url('../img/bg-history.jpg');
    background-image:
        linear-gradient(rgba(240, 235, 248, 0.82), rgba(234, 226, 245, 0.86)),
        url('../img/bg-history.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;   /* mobile safe default */
}
.no-touch #history {
    background-attachment: fixed;    /* parallax on desktop */
}

/* Fort — photo bg with 0.4 darkening overlay, parallax on desktop */
#fort {
    background-color: #0D0520; /* solid fallback */
    background-image:
        -webkit-linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
        url('../img/bg-fort-facts.jpg');
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
        url('../img/bg-fort-facts.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
}
.no-touch #fort {
    background-attachment: fixed;
}

#fort .section-subtitle,
#fort h2 {
    color: #fff;
}

/* Tower — Pikk Hermann, dark overlay + parallax */
#tower {
    background-color: #0D0520;
    background-image:
        -webkit-linear-gradient(rgba(5, 1, 14, 0.58), rgba(8, 2, 20, 0.62)),
        url('../img/bg-tower.jpg');
    background-image:
        linear-gradient(rgba(5, 1, 14, 0.58), rgba(8, 2, 20, 0.62)),
        url('../img/bg-tower.jpg');
    background-size: cover;
    background-position: center 30%;
    background-attachment: scroll;
}
.no-touch #tower {
    background-attachment: fixed;
}

/* Casemates — very dark underground, fixed atmosphere */
#casemates {
    background-color: #1A0A2E; /* fallback */
    background-image:
        -webkit-linear-gradient(rgba(10, 3, 18, 0.87), rgba(14, 5, 25, 0.90)),
        url('../img/bg-casemates.jpg');
    background-image:
        linear-gradient(rgba(10, 3, 18, 0.87), rgba(14, 5, 25, 0.90)),
        url('../img/bg-casemates.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
}
.no-touch #casemates {
    background-attachment: fixed;
}

/* =====================================================================
   TOWER — Hermann / Pikk Hermann
   ===================================================================== */
.tower-layout {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 2.5rem;
    -ms-flex-align: start;
    align-items: flex-start;
    margin-top: 1rem;
}

.tower-photo {
    -ms-flex: 0 0 420px;
    flex: 0 0 420px;
    max-width: 100%;
}

.tower-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(157, 78, 221, 0.45);
    -webkit-box-shadow: 0 0 20px rgba(157, 78, 221, 0.25);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.25);
    display: block;
}

.tower-facts-card {
    -ms-flex: 1 1 300px;
    flex: 1 1 300px;
    margin-top: 0;
    padding: 1.25rem 1.5rem;
    -ms-flex-item-align: stretch;
    align-self: stretch;
}

.tower-facts-card h3 {
    color: #CC77FF;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.tower-text {
    color: #C4A8E8;
    line-height: 1.8;
    font-size: 0.97rem;
    margin-top: 2rem;
    width: 100%;
}


@media (max-width: 768px) {
    .tower-layout { gap: 1.5rem; }
    .tower-photo { -ms-flex: 0 0 100%; flex: 0 0 100%; }
    .tower-facts-card { -ms-flex: 0 0 100%; flex: 0 0 100%; }
}

/* Museum — same plain background as gallery had */
#museum {
    background-color: #EAE2F5;
}

/* Gallery — photo background with dark overlay */
#gallery {
    background-color: #0D0520;
    background-image:
        -webkit-linear-gradient(rgba(8, 2, 16, 0.55), rgba(5, 1, 12, 0.60)),
        url('../img/bg-gallery.jpg');
    background-image:
        linear-gradient(rgba(8, 2, 16, 0.55), rgba(5, 1, 12, 0.60)),
        url('../img/bg-gallery.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
}
.no-touch #gallery {
    background-attachment: fixed;
}
#gallery .section-title,
#gallery .glow-title {
    color: #CC77FF;
}
#gallery .section-subtitle,
#gallery .gallery-license {
    color: #C4A8E8;
}

/* =====================================================================
   NAVIGATION
   ===================================================================== */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(26, 10, 46, 0.97);
    border-bottom: 1px solid rgba(157, 78, 221, 0.4);
    -webkit-box-shadow: 0 2px 20px rgba(157, 78, 221, 0.3);
    box-shadow: 0 2px 20px rgba(157, 78, 221, 0.3);
    -webkit-transition: background-color 0.3s ease, -webkit-box-shadow 0.3s ease;
    -ms-transition: background-color 0.3s ease;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Scrolled state — nav shrinks on scroll */
.site-nav.scrolled {
    background-color: rgba(8, 2, 18, 0.99);
    -webkit-box-shadow: 0 2px 28px rgba(157, 78, 221, 0.55);
    box-shadow: 0 2px 28px rgba(157, 78, 221, 0.55);
}

.site-nav.scrolled .nav-inner {
    height: 44px;
}

.site-nav.scrolled .nav-links li a {
    height: 44px;
    line-height: 44px;
}

.site-nav.scrolled .nav-logo-img {
    height: 30px;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: justify;
    justify-content: space-between;
    height: 60px;
    -webkit-transition: height 0.3s ease;
    -ms-transition: height 0.3s ease;
    transition: height 0.3s ease;
}

.nav-logo {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    line-height: 0;
}

.nav-logo-img {
    height: 36px;
    width: auto;
    display: block;
    -webkit-transition: opacity 0.2s;
    transition: opacity 0.2s;
}

.nav-logo:hover .nav-logo-img,
.nav-logo:focus .nav-logo-img {
    opacity: 0.8;
}

.nav-links {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    display: block;
    padding: 0 0.75rem;
    height: 60px;
    line-height: 60px;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.85rem;
    color: #C4A8E8;
    letter-spacing: 0.04em;
    white-space: nowrap;
    -webkit-transition: color 0.2s, background-color 0.2s;
    -ms-transition: color 0.2s, background-color 0.2s;
    transition: color 0.2s, background-color 0.2s;
}

.nav-links li a:hover,
.nav-links li a:focus {
    color: #CC77FF;
    background-color: rgba(157, 78, 221, 0.15);
    -webkit-text-shadow: 0 0 8px rgba(204, 119, 255, 0.6);
    text-shadow: 0 0 8px rgba(204, 119, 255, 0.6);
}

/* Language switcher */
.lang-switcher {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    gap: 2px;
    margin-left: 1rem;
}

.lang-btn {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid rgba(157, 78, 221, 0.5);
    color: #8E72B3;
    cursor: pointer;
    border-radius: 3px;
    letter-spacing: 0.05em;
    -webkit-transition: all 0.2s;
    -ms-transition: all 0.2s;
    transition: all 0.2s;
}

.lang-btn:hover,
.lang-btn:focus,
.lang-btn.active {
    background-color: #9D4EDD;
    border-color: #9D4EDD;
    color: #fff;
    -webkit-box-shadow: 0 0 8px rgba(157, 78, 221, 0.7);
    box-shadow: 0 0 8px rgba(157, 78, 221, 0.7);
    outline: none;
}

/* Hamburger button */
.nav-burger {
    display: none;
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-pack: center;
    justify-content: center;
    -ms-flex-align: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(157, 78, 221, 0.5);
    border-radius: 4px;
    cursor: pointer;
    padding: 6px;
    gap: 5px;
}

.nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #CC77FF;
    border-radius: 2px;
    -webkit-transition: all 0.25s;
    -ms-transition: all 0.25s;
    transition: all 0.25s;
}

.nav-burger:hover span { background: #E8DCFF; }

/* =====================================================================
   HERO
   ===================================================================== */
.section-hero {
    position: relative;
    height: 100vh;
    margin-top: -60px;      /* pull up behind fixed nav, hero still fills full viewport */
    min-height: 500px;
    background-image: url('../img/hero-narva.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: center;
    justify-content: center;
    text-align: center;
    padding: 0;
}

/* Dark overlay */
.section-hero:before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 4, 26, 0.65);
    z-index: 1;
}

/* Decorative lightning corner frames */
.section-hero:after {
    content: '';
    position: absolute;
    top: 30px; left: 30px;
    right: 30px; bottom: 30px;
    border: 1px solid rgba(157, 78, 221, 0.3);
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 2rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: #E8DCFF;
    -webkit-text-shadow: 0 0 20px #9D4EDD, 0 0 50px rgba(157, 78, 221, 0.5);
    text-shadow: 0 0 20px #9D4EDD, 0 0 50px rgba(157, 78, 221, 0.5);
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 1.2rem;
    color: #C4A8E8;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
    -webkit-text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 3;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.75rem;
    color: #8E72B3;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-scroll:after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(157, 78, 221, 0.8), transparent);
    margin: 0.5rem auto 0;
    -webkit-box-shadow: 0 0 6px #9D4EDD;
    box-shadow: 0 0 6px #9D4EDD;
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn-neon {
    display: inline-block;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.8rem 2rem;
    border: 2px solid #9D4EDD;
    color: #9D4EDD;
    background: transparent;
    cursor: pointer;
    border-radius: 3px;
    -webkit-box-shadow: 0 0 10px rgba(157, 78, 221, 0.4);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.4);
    -webkit-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-neon:hover,
.btn-neon:focus {
    background: #9D4EDD;
    color: #fff;
    -webkit-box-shadow: 0 0 20px #9D4EDD, 0 0 40px rgba(157, 78, 221, 0.4);
    box-shadow: 0 0 20px #9D4EDD, 0 0 40px rgba(157, 78, 221, 0.4);
    outline: none;
}

.btn-neon-ghost {
    border-color: rgba(204, 119, 255, 0.6);
    color: #CC77FF;
}

.btn-neon-ghost:hover,
.btn-neon-ghost:focus {
    background: rgba(157, 78, 221, 0.25);
    color: #E8DCFF;
    border-color: #CC77FF;
}

/* =====================================================================
   NEON CARD
   ===================================================================== */
.neon-card {
    background: #FDFAFF;
    border: 1px solid rgba(157, 78, 221, 0.35);
    border-radius: 6px;
    padding: 1.75rem;
    -webkit-box-shadow: 0 0 14px rgba(157, 78, 221, 0.2),
                        inset 0 0 8px rgba(157, 78, 221, 0.04);
    box-shadow: 0 0 14px rgba(157, 78, 221, 0.2),
                inset 0 0 8px rgba(157, 78, 221, 0.04);
    -webkit-transition: -webkit-box-shadow 0.3s, border-color 0.3s;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.neon-card:hover {
    border-color: rgba(157, 78, 221, 0.7);
    -webkit-box-shadow: 0 0 22px rgba(157, 78, 221, 0.35),
                        inset 0 0 12px rgba(157, 78, 221, 0.08);
    box-shadow: 0 0 22px rgba(157, 78, 221, 0.35),
                inset 0 0 12px rgba(157, 78, 221, 0.08);
}

.section-dark .neon-card {
    background: rgba(40, 15, 70, 0.6);
    border-color: rgba(157, 78, 221, 0.5);
    color: #C4A8E8;
}

.section-dark .neon-card h3,
.section-dark .neon-card h4 {
    color: #CC77FF;
}

/* =====================================================================
   HISTORY TIMELINE
   ===================================================================== */
.timeline {
    position: relative;
    padding: 1rem 0;
}

/* Vertical line */
.timeline:before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(157, 78, 221, 0.3);
    -webkit-box-shadow: 0 0 8px rgba(157, 78, 221, 0.3);
    box-shadow: 0 0 8px rgba(157, 78, 221, 0.3);
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 45%;
    margin-bottom: 2.5rem;
}

.timeline-item:nth-child(odd) {
    margin-left: 0;
    text-align: right;
    padding-right: 2.5rem;
}

.timeline-item:nth-child(even) {
    margin-left: 55%;
    text-align: left;
    padding-left: 2.5rem;
}

/* Timeline dot */
.timeline-item:before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #9D4EDD;
    -webkit-box-shadow: 0 0 10px #9D4EDD, 0 0 20px rgba(157, 78, 221, 0.5);
    box-shadow: 0 0 10px #9D4EDD, 0 0 20px rgba(157, 78, 221, 0.5);
    top: 0.4rem;
}

.timeline-item:nth-child(odd):before {
    right: -7px;
}

.timeline-item:nth-child(even):before {
    left: -7px;
}

.timeline-year {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    color: #9D4EDD;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.timeline-title {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 1.05rem;
    font-weight: bold;
    color: #5B2D8E;
    margin-bottom: 0.5rem;
}

.timeline-text {
    font-size: 0.9rem;
    color: #3D1F6E;
    line-height: 1.65;
}

/* =====================================================================
   FORT SECTION
   ===================================================================== */
.fort-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 2rem;
    -ms-flex-align: start;
    align-items: flex-start;
}

.fort-text-col {
    -ms-flex: 1 1 320px;
    flex: 1 1 320px;
}

.fort-facts-col {
    -ms-flex: 1 1 240px;
    flex: 1 1 240px;
    max-width: 320px;
}

@media (max-width: 680px) {
    .fort-facts-col {
        max-width: 100%;
    }
}


.facts-table {
    width: 100%;
    border-collapse: collapse;
}

.facts-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(157, 78, 221, 0.2);
    font-size: 0.9rem;
    vertical-align: top;
}

.facts-table td:first-child {
    color: #8E72B3;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    padding-right: 1rem;
}

.facts-table td:last-child {
    color: #CC77FF;
    font-weight: bold;
}

/* =====================================================================
   CASEMATES (dark section)
   ===================================================================== */
.casemates-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.casemates-main {
    -ms-flex: 1 1 400px;
    flex: 1 1 400px;
}

/* .casemates-legend removed — legend is now a full-width parallax strip */

/* =====================================================================
   CASEMATES — Parallax legend strip (full-width, same bg as footer)
   ===================================================================== */
.casemates-legend-wrap {
    position: relative;
    margin-top: 2.5rem;
    padding: 3rem 2rem;
    background-color: #080210; /* solid fallback */
    background-image:
        -webkit-linear-gradient(rgba(8, 2, 16, 0.68), rgba(5, 1, 12, 0.75)),
        url('../img/bg-footer.jpg');
    background-image:
        linear-gradient(rgba(8, 2, 16, 0.68), rgba(5, 1, 12, 0.75)),
        url('../img/bg-footer.jpg');
    background-size: cover;
    background-position: center 40%;
    background-attachment: scroll; /* safe default — mobile & iOS */
}

/* CSS parallax: desktop only, no touch */
.no-touch .casemates-legend-wrap {
    background-attachment: fixed;
}

/* Neon line at the top — mirrors footer treatment */
.casemates-legend-wrap:before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: -webkit-linear-gradient(left,
        transparent, rgba(157, 78, 221, 0.6) 30%,
        #CC77FF 50%,
        rgba(157, 78, 221, 0.6) 70%, transparent);
    background: linear-gradient(to right,
        transparent, rgba(157, 78, 221, 0.6) 30%,
        #CC77FF 50%,
        rgba(157, 78, 221, 0.6) 70%, transparent);
    -webkit-box-shadow: 0 0 10px #9D4EDD;
    box-shadow: 0 0 10px #9D4EDD;
}

/* Neon line at the bottom */
.casemates-legend-wrap:after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: -webkit-linear-gradient(left,
        transparent, rgba(157, 78, 221, 0.4) 30%,
        rgba(204, 119, 255, 0.6) 50%,
        rgba(157, 78, 221, 0.4) 70%, transparent);
    background: linear-gradient(to right,
        transparent, rgba(157, 78, 221, 0.4) 30%,
        rgba(204, 119, 255, 0.6) 50%,
        rgba(157, 78, 221, 0.4) 70%, transparent);
}

.legend-box {
    max-width: 780px;
    margin: 0 auto;
    padding: 1.75rem 2.5rem;
    border: 1px solid rgba(157, 78, 221, 0.45);
    border-left: 4px solid #9D4EDD;
    background: rgba(8, 2, 16, 0.55);
    border-radius: 0 4px 4px 0;
    -webkit-box-shadow: 0 0 20px rgba(157, 78, 221, 0.2),
                        inset 0 0 12px rgba(157, 78, 221, 0.06);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.2),
                inset 0 0 12px rgba(157, 78, 221, 0.06);
}

.legend-box h4 {
    color: #CC77FF;
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    -webkit-text-shadow: 0 0 8px rgba(157, 78, 221, 0.5);
    text-shadow: 0 0 8px rgba(157, 78, 221, 0.5);
}

.legend-box p {
    font-size: 0.9rem;
    color: #C4A8E8;
    font-style: italic;
    line-height: 1.8;
    margin: 0;
}

/* =====================================================================
   CASEMATES — Tour card
   ===================================================================== */
.casemates-tours-card {
    margin-top: 2.5rem;
    padding: 1.75rem 2rem;
}

/* Two-column layout: photo left, info right */
.tours-layout {
    display: -ms-flexbox;
    display: flex;
    gap: 2rem;
    -ms-flex-align: start;
    align-items: flex-start;
}

.tours-photo {
    -ms-flex: 0 0 260px;
    flex: 0 0 260px;
}

.tours-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(157, 78, 221, 0.45);
    -webkit-box-shadow: 0 0 18px rgba(157, 78, 221, 0.25);
    box-shadow: 0 0 18px rgba(157, 78, 221, 0.25);
}

.tours-info {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
}

.tours-title {
    color: #CC77FF;
    font-size: 1.25rem;
    margin: 0 0 0.85rem;
    -webkit-text-shadow: 0 0 8px rgba(157, 78, 221, 0.5);
    text-shadow: 0 0 8px rgba(157, 78, 221, 0.5);
}

.tours-lead {
    color: #E8DCFF;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.tours-details {
    margin-bottom: 1.25rem;
    border-top: 1px solid rgba(157, 78, 221, 0.25);
}

/* In casemates cards — label on top, value below */
.casemates-tours-card .price-row {
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-align: start;
    align-items: flex-start;
    gap: 0.15rem;
    border-bottom-color: rgba(157, 78, 221, 0.15);
}

.casemates-tours-card .price-label {
    color: #C4A8E8;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.casemates-tours-card .price-value {
    color: #E8DCFF;
    font-size: 0.95rem;
    white-space: normal;
    text-align: left;
}

.tours-booking {
    color: #C4A8E8;
    font-size: 0.875rem;
    margin-bottom: 0.65rem;
}

.tours-contacts {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.1rem;
}

.tours-contact-link {
    color: #CC77FF;
    font-size: 0.875rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(204, 119, 255, 0.35);
    -webkit-transition: color 0.2s, border-color 0.2s;
    transition: color 0.2s, border-color 0.2s;
}

.tours-contact-link:hover,
.tours-contact-link:focus {
    color: #E8DCFF;
    border-bottom-color: rgba(232, 220, 255, 0.6);
}

.tours-link {
    display: inline-block;
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
    text-decoration: none;
}

/* Stack photo+info on small screens */
@media (max-width: 600px) {
    .tours-layout {
        -ms-flex-direction: column;
        flex-direction: column;
    }
    .tours-photo {
        -ms-flex: none;
        flex: none;
        width: 100%;
    }
}

@media (max-width: 520px) {
    .casemates-tours-card {
        padding: 1.25rem 0.875rem;
    }
}

/* =====================================================================
   SCHEDULE TABLE  (.sched-table)
   Used in: casemates tour card, gloria hours, museum opening hours
   ===================================================================== */

/* Container with label above table */
.sched-block {
    margin-bottom: 0.75rem;
}
.sched-block .price-label {
    display: block;
    margin-bottom: 0.3rem;
}

/* Base table */
.sched-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    line-height: 1.4;
}
.sched-table td {
    padding: 0.28rem 0.45rem;
    vertical-align: top;
}
.sched-table td:first-child {
    width: 48%;
    white-space: nowrap;
    font-weight: 600;
}

/* Season header row (museum) */
.sched-table .sched-season td {
    padding-top: 0.65rem;
    padding-bottom: 0.2rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9D4EDD;
    border-bottom: 1px solid rgba(157, 78, 221, 0.2);
}
.sched-table .sched-season:first-child td {
    padding-top: 0.1rem;
}

/* Day header row (casemates tour — Saturday) */
.sched-table .sched-day td {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9D4EDD;
    border-bottom: 1px solid rgba(157, 78, 221, 0.2);
    padding-bottom: 0.2rem;
}

/* Closed row */
.sched-table .sched-closed td {
    color: #9D4EDD;
    font-style: italic;
    opacity: 0.7;
}

/* Light variant (museum card — light background) */
.sched-table .sched-day-col,
.sched-table .sched-time {
    color: #5B2D8E;
}
.sched-table .sched-val {
    color: #1C0A3A;
}

/* Dark variant (casemates dark background) */
.sched-table--dark td:first-child,
.sched-table--dark .sched-day-col,
.sched-table--dark .sched-time {
    color: #C4A8E8;
}
.sched-table--dark .sched-val {
    color: #E8DCFF;
}
.sched-table--dark .sched-day td {
    color: #CC77FF;
    border-bottom-color: rgba(204, 119, 255, 0.3);
}
.sched-table--dark .sched-closed td {
    color: #9D4EDD;
}

/* Museum hours note */
.sched-note {
    font-size: 0.78rem;
    color: #8E72B3;
    margin-top: 0.5rem;
    font-style: italic;
}

/* =====================================================================
   MUSEUM
   ===================================================================== */
.museum-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.museum-card {
    -ms-flex: 1 1 220px;
    flex: 1 1 220px;
}

.museum-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9D4EDD;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(157, 78, 221, 0.3);
}

.museum-card ul { padding: 0; margin: 0; }
.museum-card ul li {
    font-size: 0.9rem;
    color: #3D1F6E;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(157, 78, 221, 0.1);
    padding-left: 1rem;
    position: relative;
}
.museum-card ul li:before {
    content: '›';
    position: absolute;
    left: 0;
    color: #9D4EDD;
}

.price-row {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -ms-flex-align: center;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(157, 78, 221, 0.1);
    font-size: 0.9rem;
    gap: 1rem;
}

.price-row:last-child { border-bottom: none; }

.price-label {
    color: #3D1F6E;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
}

.price-value {
    font-weight: bold;
    color: #7B2FBE;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    white-space: nowrap;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    text-align: left;
}

.contact-row {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    color: #3D1F6E;
}

.contact-row a { color: #9D4EDD; }
.contact-row a:hover { color: #CC77FF; }

/* =====================================================================
   GALLERY
   ===================================================================== */
.gallery-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 2rem;
}

.gallery-grid a {
    display: block;
    -ms-flex: 1 1 200px;
    flex: 1 1 200px;
    max-width: 280px;
    overflow: hidden;
    border: 1px solid rgba(157, 78, 221, 0.35);
    border-radius: 4px;
    -webkit-box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
    -webkit-transition: -webkit-box-shadow 0.3s, border-color 0.3s;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.gallery-grid a:hover {
    border-color: rgba(157, 78, 221, 0.8);
    -webkit-box-shadow: 0 0 20px rgba(157, 78, 221, 0.45);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.45);
}

.gallery-grid a img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    -webkit-transition: -webkit-transform 0.4s ease;
    transition: transform 0.4s ease;
}

.gallery-grid a:hover img {
    -webkit-transform: scale(1.05);
    -ms-transform: scale(1.05);
    transform: scale(1.05);
}

.gallery-license {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #8E72B3;
    text-align: center;
    font-style: italic;
}

/* Gallery upload form */
.gallery-upload-wrap {
    margin-top: 1.5rem;
    text-align: center;
}

.gallery-upload-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1.4rem;
}

.gallery-upload-area {
    margin-top: 1.2rem;
    background: rgba(253, 250, 255, 0.95);
    border: 1px solid rgba(157, 78, 221, 0.4);
    border-radius: 6px;
    padding: 1.2rem 1.4rem 1rem;
    -webkit-box-shadow: 0 0 16px rgba(157, 78, 221, 0.15);
    box-shadow: 0 0 16px rgba(157, 78, 221, 0.15);
    text-align: left;
}

.gallery-upload-fields {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -ms-flex-align: flex-end;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.gallery-upload-field {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 0.3rem;
    -ms-flex: 1 1 160px;
    flex: 1 1 160px;
    min-width: 140px;
}

.gallery-upload-field label {
    font-size: 0.78rem;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    color: #5B2D8E;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gallery-upload-field--file {
    -ms-flex: 1 1 200px;
    flex: 1 1 200px;
}

.gallery-upload-field--file input[type="file"] {
    font-size: 0.85rem;
    color: #5B2D8E;
    padding: 0.3rem 0;
    cursor: pointer;
}

.gallery-upload-actions {
    display: -ms-flexbox;
    display: flex;
    gap: 0.5rem;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-item-align: end;
    align-self: flex-end;
    padding-bottom: 2px;
}

.btn-neon--sm {
    font-size: 0.82rem;
    padding: 0.35rem 1rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(157, 78, 221, 0.4);
    border-radius: 3px;
    color: #8E72B3;
    cursor: pointer;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}
.btn-ghost:hover { border-color: #9D4EDD; color: #9D4EDD; }
.btn-ghost--sm { font-size: 0.82rem; padding: 0.35rem 0.9rem; }

.gallery-upload-note {
    margin-top: 0.65rem;
    font-size: 0.78rem;
    color: #8E72B3;
    font-style: italic;
    line-height: 1.4;
}

.gallery-upload-msg {
    margin-top: 0.75rem;
    padding: 0.55rem 0.9rem;
    border-radius: 4px;
    font-size: 0.88rem;
    font-family: 'Trebuchet MS', Arial, sans-serif;
}
.gallery-upload-success {
    background: rgba(78, 157, 100, 0.1);
    border: 1px solid rgba(78, 157, 100, 0.5);
    color: #2d7a48;
}
.gallery-upload-error {
    background: rgba(204, 51, 102, 0.1);
    border: 1px solid rgba(204, 51, 102, 0.5);
    color: #cc3366;
}

/* Magnific Popup — description bar ABOVE the image */
.mfp-img-desc {
    color: #E8DCFF;
    font-size: 0.95rem;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    text-align: center;
    padding: 0.55rem 2rem 0.4rem;
    background: rgba(13, 4, 26, 0.75);
    min-height: 2rem;
    line-height: 1.4;
    -webkit-text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Magnific Popup overrides — neon theme */
.mfp-bg { background: rgba(13, 4, 26, 0.9); }
.mfp-arrow:before, .mfp-arrow:after { border-color: transparent; }
.mfp-arrow-left:after  { border-right-color: #9D4EDD; }
.mfp-arrow-right:after { border-left-color: #9D4EDD; }
.mfp-counter { color: #8E72B3; font-family: 'Trebuchet MS', 'Arial', sans-serif; }
.mfp-close {
    color: #CC77FF;
    font-size: 2rem;
    -webkit-text-shadow: 0 0 10px #9D4EDD;
    text-shadow: 0 0 10px #9D4EDD;
}
.mfp-title { color: #E8DCFF; font-style: italic; font-size: 0.82rem; }
.mfp-image-holder .mfp-content {
    border: 1px solid rgba(157, 78, 221, 0.5);
    -webkit-box-shadow: 0 0 40px rgba(157, 78, 221, 0.3);
    box-shadow: 0 0 40px rgba(157, 78, 221, 0.3);
}

/* =====================================================================
   COMMENTS
   ===================================================================== */
.comments-layout {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin-top: 2rem;
}

.comments-form-col {
    -ms-flex: 0 1 360px;
    flex: 0 1 360px;
}

.comments-list-col {
    -ms-flex: 1 1 320px;
    flex: 1 1 320px;
}

/* Form */
.comment-form { position: relative; }

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8E72B3;
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: #FDFAFF;
    border: 1px solid rgba(157, 78, 221, 0.35);
    border-radius: 4px;
    color: #1C0A3A;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.95rem;
    -webkit-transition: border-color 0.2s, -webkit-box-shadow 0.2s;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: #9D4EDD;
    -webkit-box-shadow: 0 0 8px rgba(157, 78, 221, 0.4);
    box-shadow: 0 0 8px rgba(157, 78, 221, 0.4);
}

.form-control.field-error {
    border-color: #cc3366;
    -webkit-box-shadow: 0 0 6px rgba(204, 51, 102, 0.4);
    box-shadow: 0 0 6px rgba(204, 51, 102, 0.4);
}

textarea.form-control {
    height: 130px;
    resize: vertical;
    min-height: 80px;
}

/* =====================================================================
   RICH TEXT EDITOR — toolbar + contenteditable + emoji picker
   ===================================================================== */

/* Скелет: toolbar + editor — единая визуальная группа */
.editor-toolbar {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(16, 5, 30, 0.95);
    border: 1px solid rgba(157, 78, 221, 0.4);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

/* Кнопки тулбара */
.editor-btn {
    background: transparent;
    border: 1px solid rgba(157, 78, 221, 0.25);
    border-radius: 3px;
    color: #C4A8E8;
    cursor: pointer;
    font-family: Georgia, serif;
    font-size: 0.88rem;
    min-width: 28px;
    height: 26px;
    line-height: 24px;
    text-align: center;
    padding: 0 6px;
    -webkit-transition: background 0.15s ease, border-color 0.15s ease,
                        color 0.15s ease, box-shadow 0.15s ease;
    transition: background 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, box-shadow 0.15s ease;
}

.editor-btn:hover,
.editor-btn:focus {
    background: rgba(157, 78, 221, 0.18);
    border-color: rgba(157, 78, 221, 0.6);
    color: #CC77FF;
    outline: none;
}

/* Активное форматирование */
.editor-btn.is-active {
    background: rgba(157, 78, 221, 0.28);
    border-color: #9D4EDD;
    color: #CC77FF;
    -webkit-box-shadow: 0 0 6px rgba(157, 78, 221, 0.4);
    box-shadow: 0 0 6px rgba(157, 78, 221, 0.4);
}

.editor-btn--i { font-style: italic; }
.editor-btn--u { text-decoration: underline; }

/* Разделитель */
.editor-sep {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: rgba(157, 78, 221, 0.25);
    margin: 0 3px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* Кнопка Emoji */
.editor-emoji-btn {
    display: -ms-inline-flexbox;
    display: inline-flex;
    -ms-flex-align: center;
    align-items: center;
    gap: 3px;
    min-width: auto;
    padding: 0 8px;
    font-family: inherit;
    font-size: 1rem;
}

.editor-arrow {
    font-size: 0.55rem;
    color: #8E72B3;
    line-height: 1;
}

/* Contenteditable поле */
.editor-content {
    border-radius: 0 0 4px 4px !important;
    min-height: 130px;
    max-height: 320px;
    overflow-y: auto;
    cursor: text;
    white-space: pre-wrap;
    word-break: break-word;
    word-wrap: break-word;
    outline: none !important;
    line-height: 1.65;
}

.editor-content:focus {
    border-color: #9D4EDD !important;
    -webkit-box-shadow: 0 0 8px rgba(157, 78, 221, 0.4) !important;
    box-shadow: 0 0 8px rgba(157, 78, 221, 0.4) !important;
}

/* Placeholder через CSS :before (IE9+) */
.editor-content.is-empty:before {
    content: attr(data-placeholder);
    color: #5A3E80;
    font-style: italic;
    pointer-events: none;
    display: block;
}

/* Скрытая textarea (только для отправки формы) */
.editor-hidden {
    position: absolute !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

/* Счётчик символов */
.editor-footer {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-pack: end;
    justify-content: flex-end;
    margin-top: 4px;
}

.editor-charcount {
    font-family: 'Trebuchet MS', Arial, sans-serif;
    font-size: 0.72rem;
    color: #5A3E80;
    letter-spacing: 0.03em;
    -webkit-transition: color 0.2s ease;
    transition: color 0.2s ease;
}

.editor-charcount.near-limit { color: #CC77FF; }
.editor-charcount.over-limit { color: #cc3366; }

/* ---- Emoji picker ------------------------------------------------- */
.editor-emoji-wrap { position: relative; }

.emoji-picker {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 288px;
    max-height: 220px;
    overflow-y: auto;
    background: #120424;
    border: 1px solid rgba(157, 78, 221, 0.55);
    border-radius: 8px;
    -webkit-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7),
                        0 0 20px rgba(157, 78, 221, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7),
                0 0 20px rgba(157, 78, 221, 0.2);
    padding: 8px;
    z-index: 600;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 2px;
}

.emoji-picker.is-open {
    display: -ms-flexbox;
    display: flex;
}

/* Если пикер уходит за правый край — открывать влево */
.emoji-picker.open-left {
    left: auto;
    right: 0;
}

.emoji-item {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.3rem;
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    padding: 0;
    -webkit-transition: background 0.1s ease, border-color 0.1s ease;
    transition: background 0.1s ease, border-color 0.1s ease;
}

.emoji-item:hover,
.emoji-item:focus {
    background: rgba(157, 78, 221, 0.2);
    border-color: rgba(157, 78, 221, 0.4);
    outline: none;
}

/* Honeypot — скрыт через CSS */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.form-message {
    display: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.form-message.success {
    background: rgba(78, 157, 100, 0.1);
    border: 1px solid rgba(78, 157, 100, 0.5);
    color: #2a7a45;
}

.form-message.error {
    background: rgba(204, 51, 102, 0.08);
    border: 1px solid rgba(204, 51, 102, 0.4);
    color: #cc3366;
}

.comments-pending-note {
    font-size: 0.8rem;
    color: #8E72B3;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Comment items */
.comment-item {
    margin-bottom: 1rem;
}

.comment-meta {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-weight: bold;
    color: #9D4EDD;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.78rem;
    color: #8E72B3;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
}

.comment-body {
    font-size: 0.9rem;
    color: #3D1F6E;
    line-height: 1.65;
}

.comments-loading {
    text-align: center;
    padding: 2rem;
    color: #8E72B3;
    font-size: 0.9rem;
}

.comments-none {
    text-align: center;
    padding: 2rem;
    color: #8E72B3;
    font-size: 0.9rem;
    font-style: italic;
    border: 1px dashed rgba(157, 78, 221, 0.25);
    border-radius: 4px;
}

/* =====================================================================
   MAP — Google Maps iframe, full-width, no borders
   ===================================================================== */
.map-section {
    padding: 0;
    margin: 0;
    line-height: 0; /* убирает нежелательный gap под iframe */
}

.map-wrapper {
    width: 100%;
    height: 476px;
    overflow: hidden;
    position: relative;
    background-color: #0a0a0a;
}

.map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 768px) {
    .map-wrapper { height: 360px; }
}

@media (max-width: 480px) {
    .map-wrapper { height: 260px; }
}

/* =====================================================================
   FOOTER — 3 колонки + parallax фон казематов
   ===================================================================== */
.site-footer {
    position: relative;
    /* Parallax: тёмный overlay + фотография для футера */
    background-color: #080210; /* fallback */
    background-image:
        -webkit-linear-gradient(rgba(8, 2, 16, 0.58), rgba(5, 1, 12, 0.58)),
        url('../img/bg-footer.jpg');
    background-image:
        linear-gradient(rgba(8, 2, 16, 0.52), rgba(5, 1, 12, 0.58)),
        url('../img/bg-footer.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll; /* безопасный default для mobile */
    border-top: 2px solid rgba(157, 78, 221, 0.45);
    -webkit-box-shadow: 0 -4px 30px rgba(157, 78, 221, 0.2);
    box-shadow: 0 -4px 30px rgba(157, 78, 221, 0.2);
    padding: 2.8rem 0;
}

/* Параллакс только на desktop без touch */
.no-touch .site-footer {
    background-attachment: fixed;
}

/* Тонкая неоновая линия вверху */
.site-footer:before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: -webkit-linear-gradient(left,
        transparent, rgba(157, 78, 221, 0.7) 30%,
        #CC77FF 50%,
        rgba(157, 78, 221, 0.7) 70%, transparent);
    background: linear-gradient(to right,
        transparent, rgba(157, 78, 221, 0.7) 30%,
        #CC77FF 50%,
        rgba(157, 78, 221, 0.7) 70%, transparent);
    -webkit-box-shadow: 0 0 12px #9D4EDD;
    box-shadow: 0 0 12px #9D4EDD;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

/* Три колонки — каждая ~33% минус паддинги */
.footer-col {
    -ms-flex: 0 0 calc(33.333% - 1.5rem);
    flex: 0 0 calc(33.333% - 1.5rem);
    padding: 0 0.75rem;
}

.footer-col--left  { text-align: left; }
.footer-col--center { text-align: center; }
.footer-col--right { text-align: right; }

.footer-copy {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.82rem;
    color: #8E72B3;
    letter-spacing: 0.03em;
    margin: 0;
    white-space: nowrap;
}

.footer-link {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.85rem;
    color: #C4A8E8;
    letter-spacing: 0.03em;
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(157, 78, 221, 0.4);
    -webkit-transition: color 0.2s ease, border-color 0.2s ease,
                        text-shadow 0.2s ease;
    transition: color 0.2s ease, border-color 0.2s ease,
                text-shadow 0.2s ease;
}

.footer-link:hover,
.footer-link:focus {
    color: #CC77FF;
    border-color: #CC77FF;
    -webkit-text-shadow: 0 0 10px rgba(204, 119, 255, 0.6);
    text-shadow: 0 0 10px rgba(204, 119, 255, 0.6);
    outline: none;
}

/* Иконка внешней ссылки для музея */
.footer-link--museum:after {
    content: ' \2197'; /* ↗ */
    font-size: 0.75em;
    opacity: 0.7;
}

/* Кнопки в футере — выглядят как ссылки (privacy + feedback) */
.footer-feedback-btn {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(157, 78, 221, 0.4);
    padding: 0 0 2px;
    cursor: pointer;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.85rem;
    color: #C4A8E8;
    letter-spacing: 0.03em;
    margin-top: 0.5rem;
    display: inline-block;
    -webkit-transition: color 0.2s ease, border-color 0.2s ease,
                        text-shadow 0.2s ease;
    transition: color 0.2s ease, border-color 0.2s ease,
                text-shadow 0.2s ease;
}

.footer-feedback-btn:hover,
.footer-feedback-btn:focus {
    color: #CC77FF;
    border-color: #CC77FF;
    -webkit-text-shadow: 0 0 10px rgba(204, 119, 255, 0.6);
    text-shadow: 0 0 10px rgba(204, 119, 255, 0.6);
    outline: none;
}

/* Кнопка политики конфиденциальности — выглядит как ссылка */
.footer-privacy-btn {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(157, 78, 221, 0.4);
    padding: 0 0 2px;
    cursor: pointer;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.85rem;
    color: #C4A8E8;
    letter-spacing: 0.03em;
    -webkit-transition: color 0.2s ease, border-color 0.2s ease,
                        text-shadow 0.2s ease;
    transition: color 0.2s ease, border-color 0.2s ease,
                text-shadow 0.2s ease;
}

.footer-privacy-btn:hover,
.footer-privacy-btn:focus {
    color: #CC77FF;
    border-color: #CC77FF;
    -webkit-text-shadow: 0 0 10px rgba(204, 119, 255, 0.6);
    text-shadow: 0 0 10px rgba(204, 119, 255, 0.6);
    outline: none;
}

/* -----------------------------------------------------------------------
   Мобильный футер — колонки складываются вертикально
   ----------------------------------------------------------------------- */
@media (max-width: 680px) {
    .footer-inner {
        -ms-flex-direction: column;
        flex-direction: column;
        -ms-flex-align: center;
        align-items: center;
        gap: 1.2rem;
    }

    .footer-col {
        -ms-flex: none;
        flex: none;
        width: 100%;
        padding: 0;
        text-align: center !important;
    }

    .site-footer {
        padding: 2rem 0;
    }
}

/* =====================================================================
   FOOTER RIGHT COLUMN — дополнительные строки
   ===================================================================== */
.footer-col--right {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-align: end;
    align-items: flex-end;
    gap: 0.45rem;
}

.footer-desc {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.72rem;
    color: #E4D9F4;
    letter-spacing: 0.02em;
    font-style: italic;
    margin: 0;
}

.footer-dev {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.75rem;
    color: #8E72B3;
    letter-spacing: 0.03em;
    margin: 0;
}

.footer-dev a {
    color: #9D4EDD;
    text-decoration: none;
    border-bottom: 1px dotted rgba(157, 78, 221, 0.5);
    -webkit-transition: color 0.2s ease, text-shadow 0.2s ease;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.footer-dev a:hover,
.footer-dev a:focus {
    color: #CC77FF;
    -webkit-text-shadow: 0 0 8px rgba(204, 119, 255, 0.5);
    text-shadow: 0 0 8px rgba(204, 119, 255, 0.5);
}

@media (max-width: 680px) {
    .footer-col--right {
        -ms-flex-align: center;
        align-items: center;
    }
}

/* =====================================================================
   PRIVACY MODAL — всплывающее окно политики конфиденциальности
   ===================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    background: rgba(8, 2, 18, 0.88);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 2rem 1rem;
}

.modal-overlay.is-open {
    display: block;
}

.modal-dialog {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    background: #140826;
    border: 1px solid rgba(157, 78, 221, 0.5);
    border-radius: 6px;
    -webkit-box-shadow: 0 0 50px rgba(157, 78, 221, 0.35),
                        inset 0 0 30px rgba(157, 78, 221, 0.06);
    box-shadow: 0 0 50px rgba(157, 78, 221, 0.35),
                inset 0 0 30px rgba(157, 78, 221, 0.06);
    padding: 2.5rem 2.5rem 2rem;
}

@media (max-width: 600px) {
    .modal-dialog {
        padding: 1.5rem 1.2rem 1.5rem;
    }
}

.modal-title {
    font-family: 'Georgia', serif;
    font-size: 1.35rem;
    color: #CC77FF;
    margin: 0 2.5rem 1.8rem 0;
    -webkit-text-shadow: 0 0 12px rgba(157, 78, 221, 0.5);
    text-shadow: 0 0 12px rgba(157, 78, 221, 0.5);
}

.modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: transparent;
    border: 1px solid rgba(157, 78, 221, 0.4);
    border-radius: 50%;
    color: #C4A8E8;
    font-size: 1rem;
    width: 2rem;
    height: 2rem;
    line-height: 1.9rem;
    text-align: center;
    cursor: pointer;
    padding: 0;
    -webkit-transition: background 0.2s ease, color 0.2s ease;
    transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
    background: rgba(157, 78, 221, 0.2);
    color: #CC77FF;
    outline: none;
}

/* Контент внутри модала */
.modal-body h2 {
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.95rem;
    color: #9D4EDD;
    margin: 1.4rem 0 0.6rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(157, 78, 221, 0.2);
}

.modal-body h2:first-child {
    margin-top: 0;
}

.modal-body p,
.modal-body li {
    font-size: 0.88rem;
    color: #C4A8E8;
    line-height: 1.65;
    margin-bottom: 0.5rem;
}

.modal-body ul {
    list-style: disc;
    padding-left: 1.4rem;
}

.modal-body a {
    color: #9D4EDD;
    text-decoration: none;
    border-bottom: 1px dotted rgba(157, 78, 221, 0.5);
}

.modal-body a:hover {
    color: #CC77FF;
}

.modal-body strong {
    color: #DBC4F8;
}

.modal-body em {
    color: #A88ED0;
}

.modal-footer-btn {
    margin-top: 1.8rem;
    text-align: center;
}

/* =====================================================================
   FEEDBACK MODAL — форма обратной связи
   ===================================================================== */

/* Уже используем .modal-overlay/.modal-dialog — только задаём ширину */
#feedback-modal .modal-dialog {
    max-width: 520px;
}

/* Success / error banners */
.feedback-success {
    background: rgba(78, 157, 100, 0.12);
    border: 1px solid rgba(78, 157, 100, 0.5);
    color: #4e9d64;
    border-radius: 4px;
    padding: 0.7rem 1rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.feedback-error {
    background: rgba(204, 51, 102, 0.1);
    border: 1px solid rgba(204, 51, 102, 0.5);
    color: #cc3366;
    border-radius: 4px;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* File input */
.form-control-file {
    display: block;
    width: 100%;
    font-family: 'Trebuchet MS', 'Arial', sans-serif;
    font-size: 0.88rem;
    color: #C4A8E8;
    margin-top: 0.3rem;
}

/* Hint under file input */
.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: #8E72B3;
    font-style: italic;
}

/* =====================================================================
   COOKIE BANNER
   ===================================================================== */
.cookie-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: rgba(13, 4, 26, 0.97);
    border-top: 1px solid rgba(157, 78, 221, 0.5);
    padding: 1rem 1.5rem;
    -webkit-box-shadow: 0 -4px 20px rgba(157, 78, 221, 0.2);
    box-shadow: 0 -4px 20px rgba(157, 78, 221, 0.2);
}

.cookie-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 1rem;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.cookie-text {
    font-size: 0.85rem;
    color: #8E72B3;
    -ms-flex: 1 1 300px;
    flex: 1 1 300px;
}

/* =====================================================================
   SECTION TITLES — neon glow effect
   ===================================================================== */
.glow-title {
    color: #5B2D8E;
}

.section-dark .glow-title {
    color: #CC77FF;
    -webkit-text-shadow: 0 0 12px rgba(204, 119, 255, 0.5);
    text-shadow: 0 0 12px rgba(204, 119, 255, 0.5);
}

/* =====================================================================
   SKIP TO CONTENT (accessibility)
   ===================================================================== */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 0;
    z-index: 99999;
    background: #9D4EDD;
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.skip-link:focus { top: 0; }

/* =====================================================================
   UTILITIES
   ===================================================================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* lang-hidden: replaces HTML hidden attribute (IE9-safe) */
.lang-hidden { display: none !important; }

/* =====================================================================
   RESPONSIVE — tablet 768px
   ===================================================================== */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-links.is-open {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-direction: column;
        flex-direction: column;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(13, 4, 26, 0.99);
        border-bottom: 1px solid rgba(157, 78, 221, 0.4);
        -webkit-box-shadow: 0 4px 20px rgba(157, 78, 221, 0.3);
        box-shadow: 0 4px 20px rgba(157, 78, 221, 0.3);
        padding: 0.5rem 0;
        z-index: 999;
        -webkit-transition: top 0.3s ease;
        -ms-transition: top 0.3s ease;
        transition: top 0.3s ease;
    }
    .site-nav.scrolled .nav-links.is-open {
        top: 44px;
    }
    .nav-links.is-open li a {
        height: auto;
        line-height: 1;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    .nav-burger { display: -ms-flexbox; display: flex; }
    .lang-switcher { margin-left: 0.5rem; }

    .timeline:before { left: 20px; }
    .timeline-item { width: 100%; margin-left: 0 !important; text-align: left !important; padding-right: 0 !important; padding-left: 3rem !important; }
    .timeline-item:before { left: 13px !important; right: auto !important; }

    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.6rem; }
    .hero-content h1 { font-size: 2.4rem; }
    .hero-subtitle { font-size: 1rem; }

    .section { padding: 3.5rem 0; }
}

@media (max-width: 500px) {
    .hero-content h1 { font-size: 1.8rem; }
    .hero-subtitle { font-size: 0.9rem; letter-spacing: 0.05em; }
    .section-hero:after { top: 15px; left: 15px; right: 15px; bottom: 15px; }
    h2 { font-size: 1.4rem; }
    .gallery-grid a { -ms-flex: 1 1 140px; flex: 1 1 140px; }
}
