:root {
    --bg: oklch(97% 0.015 60);
    --bg-alt: oklch(93% 0.022 60);
    --surface: oklch(99% 0.006 60);
    --text: oklch(23% 0.02 40);
    --text-muted: oklch(46% 0.025 45);
    --border: oklch(88% 0.02 55);
    --accent: oklch(64% 0.16 42);
    --accent-dark: oklch(48% 0.14 38);
    --accent-tint: oklch(94% 0.03 42);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Golos Text', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1, h2, h3 {
    font-family: 'Unbounded', system-ui, sans-serif;
    margin: 0;
    letter-spacing: -0.01em;
}

h1 {
    font-family: 'Golos Text', system-ui, sans-serif;
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -0.01em;
}

h2 { font-size: 22px; }

p { line-height: 1.5; }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

header.site-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
    flex-wrap: wrap; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 18px; color: var(--text); }
.city-select {
    padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
    font-size: 14px; font-weight: 600; font-family: inherit; color: var(--text);
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.city-dropdown { position: relative; }
.city-dropdown-panel {
    display: none;
    position: absolute; top: 100%; left: 0; margin-top: 8px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.14);
    padding: 16px; width: 360px; max-height: 380px; overflow-y: auto;
    z-index: 50;
}
.city-dropdown-panel.open { display: block; }
.city-dropdown-group { columns: 2; column-gap: 20px; }
.city-dropdown-group a { display: block; font-size: 14px; padding: 3px 0; break-inside: avoid; }
.btn-primary {
    background: var(--accent); color: white; border: none; padding: 12px 22px;
    border-radius: 10px; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dark); color: white; }
.btn-secondary {
    background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 8px 16px;
    border-radius: 10px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-danger {
    background: none; color: oklch(50% 0.15 25); border: 1px solid oklch(85% 0.06 25); padding: 8px 16px;
    border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-danger:hover { background: oklch(94% 0.05 25); }

.account-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px;
}
.account-row .info { display: flex; flex-direction: column; gap: 4px; }
.account-row .actions { display: flex; gap: 8px; flex-shrink: 0; }
.existing-photo { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); flex: 0 0 auto; }
.existing-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.existing-photo.removed { opacity: 0.3; }
.existing-photo .remove-toggle {
    position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none;
    background: rgba(0,0,0,0.6); color: white; font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
}

.city-blurb p { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin-bottom: 14px; }
.event-description { margin-top: 24px; line-height: 1.7; color: var(--text-muted); }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 16px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent-dark); }
.breadcrumbs .crumb-sep { color: var(--border); }
.breadcrumbs .crumb-current { color: var(--text); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.related-events { padding: 40px 0; border-top: 1px solid var(--border); }
.related-events h2 { font-size: 20px; margin-bottom: 20px; }

section.hero { padding: 48px 0; background: linear-gradient(180deg, var(--accent-tint) 0%, var(--bg) 100%); }
section.hero h1 { font-size: 30px; line-height: 1.25; }
section.hero p.lead { font-size: 17px; color: var(--text-muted); max-width: 600px; margin-top: 14px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-top: 32px; }
.event-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.event-card .thumb { position: relative; height: 130px; background: linear-gradient(135deg, oklch(78% 0.09 45), oklch(70% 0.1 80)); display: flex; align-items: flex-end; padding: 12px; overflow: hidden; }
.event-card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.event-card .tag { position: relative; z-index: 1; background: white; color: var(--accent-dark); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 100px; }
.event-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.event-card h3 { font-size: 15px; font-weight: 600; font-family: 'Golos Text', sans-serif; line-height: 1.35; }
.meta-row { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; }
.meta-row.when { color: var(--accent-dark); font-weight: 600; }

section.categories { padding: 40px 0; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; }
.cat-grid-filter { margin-top: 24px; }
.cat-scroll-wrap { position: relative; }
.cat-scroll-indicator { display: none; }
.cat-tile { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; font-weight: 600; font-size: 14px; }
.cat-tile.active { border-color: var(--accent); background: var(--accent-tint); }

section.cities { padding: 40px 0; }
.cities-alpha-grid { columns: 5 180px; column-gap: 24px; margin-top: 20px; }
.cities-alpha-grid a { display: block; padding: 4px 0; break-inside: avoid; }
.region-title { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-dark); }

footer.site-footer { padding: 40px 0 24px; background: var(--text); color: oklch(85% 0.01 60); }
footer.site-footer a { color: oklch(85% 0.01 60); font-size: 13px; }
footer.site-footer a:hover { color: white; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 32px; padding-bottom: 24px; border-bottom: 1px solid oklch(38% 0.01 60); }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col .logo { white-space: nowrap; }

.form-page { max-width: 640px; margin: 40px auto; padding: 0 24px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-weight: 600; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 14px; background: var(--surface);
}
.errors { background: oklch(94% 0.05 25); color: oklch(40% 0.12 25); padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; }

.event-detail { max-width: 720px; margin: 40px auto; padding: 0 24px; }
.event-detail .thumb-large { height: 320px; border-radius: 16px; background: linear-gradient(135deg, oklch(78% 0.09 45), oklch(70% 0.1 80)); margin-bottom: 24px; background-size: cover; background-position: center; }

.gallery { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 24px; }
.gallery-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
    flex: 0 0 100%; aspect-ratio: 16 / 9; scroll-snap-align: start;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.9); color: var(--text);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); cursor: pointer;
}
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.gallery-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.6); cursor: pointer; }
.gallery-dot.active { background: white; }

/* Мобильные переопределения — держать этот блок последним в файле:
   при равной специфичности побеждает то, что идёт позже в источнике,
   независимо от медиа-условия. Любые новые мобильные правки — сюда. */
@media (max-width: 600px) {
    .container { padding: 0 16px; }
    header.site-header { padding: 12px 16px; }
    .form-page, .event-detail { padding: 0 16px; }
    .footer-cols { grid-template-columns: 1fr; gap: 24px; padding-bottom: 40px; }
    .cities-alpha-grid { columns: 2; column-gap: 16px; }

    .event-detail .gallery, .event-detail .thumb-large {
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
    }
    .gallery-arrow { display: none; }

    h1 { font-size: 17px; }
    section.hero h1 { font-size: 18px; line-height: 1.3; }
    .event-detail h1 { font-size: 20px; line-height: 1.3; }
    h2 { font-size: 15px; }
    h3 { font-size: 14px; }

    section.hero p.lead { font-size: 14px; line-height: 1.4; }
    p { line-height: 1.4; }
    .city-blurb p, .event-description { line-height: 1.45; }

    .cat-grid-filter {
        display: grid;
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-template-rows: repeat(3, auto);
        grid-auto-columns: max-content;
        gap: 8px;
        overflow-x: auto;
        margin-top: 16px;
        padding-bottom: 6px;
        padding-right: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .cat-grid-filter::-webkit-scrollbar { display: none; }
    .cat-grid-filter .cat-tile {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 13px;
    }

    .cat-scroll-wrap::after {
        content: "";
        position: absolute;
        top: 0; right: 0; bottom: 6px;
        width: 28px;
        background: linear-gradient(90deg, transparent, var(--bg) 85%);
        pointer-events: none;
    }
    section.categories .cat-scroll-wrap::after { background: linear-gradient(90deg, transparent, var(--surface) 85%); }

    .cat-scroll-indicator {
        display: block;
        height: 4px;
        background: var(--border);
        border-radius: 4px;
        margin-top: 10px;
        overflow: hidden;
    }
    .cat-scroll-indicator-bar {
        height: 100%;
        background: var(--accent);
        border-radius: 4px;
        transform-origin: left;
        width: 0;
    }
}
