﻿/* event.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    color-scheme: light dark;
}

:root {
    --primary: #007AFF;
    --primary-hover: #0051D5;
    --success: #34C759;
    --bg: #F2F2F7;
    --card: #FFFFFF;
    --text: #000;
    --text-secondary: #8E8E93;
    --border: #E5E5EA;
    --gutter-x: 20px;
    --block-pad: 24px;
    --pill-pad: 8px;
    --grid-gap: 20px;
    --glass-bg: rgba(255,255,255,0.92);
    --glass-br: rgba(0,0,0,0.12);
    /* Gallery button layout (prevents ⋯ and × overlap) */
    --gallery-btn: 44px;
    --gallery-gap: 12px;
    --gallery-pad: 12px; /* outer padding from safe area */
}

.page-content {
    max-width: initial;
    margin: 0;
    padding: 0 0 50px;
    box-shadow: none;
}

.event-shell {
    min-height: 100vh;
    min-height: 100dvh; /* modern mobile viewport */
    display: flex;
    flex-direction: column;
}

.event-main {
    flex: 1 0 auto; /* take remaining space */
}

.event-shell > .footer {
    margin-top: auto; /* push to bottom when content is short */
    flex: 0 0 auto;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0B0B0F;
        --card: #1C1C1E;
        --text: #FFFFFF;
        --text-secondary: #9A9AA0;
        --border: #2A2A2C;
        --glass-bg: rgba(28,28,30,0.90);
        --glass-br: rgba(255,255,255,0.16);
    }
}

/* Base */
body {
    font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--gutter-x);
}

@media (min-width:1240px) {
    .container {
        padding: 0;
    }
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px var(--gutter-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary);
    font-size: 17px;
    transition: opacity .2s;
}

    .back-btn:hover {
        opacity: .7;
    }

.header-actions {
    display: flex;
    gap: 16px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
}

    .action-btn:hover {
        background: var(--border);
        transform: scale(1.08);
    }

/* Hero */
.hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16/6;
    min-height: 240px;
    max-height: 420px;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--fx,50%) var(--fy,40%);
    z-index: 0;
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(38vh,260px);
    background: linear-gradient(to top, rgba(0,0,0,.80) 0%, rgba(0,0,0,.40) 50%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    padding: 0 var(--gutter-x);
    color: #fff;
    z-index: 2;
}

.event-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 12px rgba(0,0,0,.8), 0 1px 3px rgba(0,0,0,.9);
    -webkit-text-fill-color: unset;
}

.event-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 18px;
    text-shadow: 0 2px 8px rgba(0,0,0,.8), 0 1px 2px rgba(0,0,0,.9);
}

.time-ago {
    padding: 6px 14px;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,.10);
}

.event-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,.10);
    color: inherit;
    text-decoration: none;
}

.event-author-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.18);
    font-size: 12px;
    font-weight: 600;
}

    .event-author-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Tabs over hero (pill) */
.hero-tabs {
    position: relative;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    padding: 0 var(--gutter-x);
    z-index: 3;
}

.tabs.tabs-pill {
    display: flex;
    gap: 8px;
    padding: var(--pill-pad);
    background: var(--glass-bg);
    border: 1px solid var(--glass-br);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    backdrop-filter: saturate(120%) blur(18px);
    -webkit-backdrop-filter: saturate(120%) blur(18px);
}

    .tabs.tabs-pill .tab {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 14px;
        border: 1px solid transparent;
        border-radius: 14px;
        background: transparent;
        color: var(--text-secondary);
        font-weight: 700;
        cursor: pointer;
    }

        .tabs.tabs-pill .tab .icon {
            width: 22px;
            height: 22px;
            display: block;
            margin: 0;
            animation: none;
        }

        .tabs.tabs-pill .tab.active {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
        }

            .tabs.tabs-pill .tab.active .icon {
                filter: drop-shadow(0 1px 0 rgba(0,0,0,.08));
            }

.tab-label {
    font-size: 14px;
}

/* Tabs content */
.tab-content {
    display: none;
    animation: fadeIn .25s ease;
}

    .tab-content.active {
        display: block;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards / sections */
.event-info-card,
.info-section {
    background: var(--card);
    border-radius: 16px;
    padding: var(--block-pad);
    margin-bottom: calc(var(--block-pad) - 4px);
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.event-info-card {
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.event-location {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.event-details {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 16px;
}

.info-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Participants */
.participants-grid {
    display: grid;
    gap: 12px;
}

.participant {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card);
    border-radius: 12px;
    transition: all .2s;
}

    .participant.participant-clickable {
        cursor: pointer;
        position: relative;
    }

        .participant.participant-clickable:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

    .participant:hover {
        transform: translateX(4px);
        box-shadow: 0 4px 12px rgba(0,0,0,.08);
    }

.participant-avatar {
    --size: 56px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex: 0 0 var(--size);
}

    .participant-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.participant-info {
    min-width: 0;
    flex: 1 1 auto;
}

.participant-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.participant-status {
    color: var(--text-secondary);
    font-size: 14px;
}

.participant-action {
    margin-left: auto;
    padding: 8px 16px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}

    .participant-action:hover {
        background: var(--primary);
        color: #fff;
    }

.participant-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--success);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
}

/* Wishlist */
.wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wishlist-counter {
    color: var(--text-secondary);
    font-size: 16px;
}

.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
    gap: var(--grid-gap);
    margin-bottom: 20px;
}

.gift-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    transition: all .25s;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
}

    .gift-card:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

    .gift-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0,0,0,.12);
    }

    .gift-card.purchased {
        opacity: .7;
    }

.gift-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg);
}

.gift-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.gift-info {
    padding: calc(var(--block-pad) - 8px);
}

.gift-name {
    font-size: 16px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1em * 1.25 * 2);
    margin-bottom: 6px;
}

.gift-price {
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================
   Media grid + upload states
   ============================ */
.media-grid {
    display: grid;
    gap: 8px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

@media (max-width:768px) {
    .media-grid {
        padding: 4px;
        gap: 8px;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width:430px) and (max-width:767px) {
    .media-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width:768px) and (max-width:1023px) {
    .media-grid {
        grid-template-columns: repeat(5, 1fr);
        max-width: 900px;
        padding: 16px;
    }
}

@media (min-width:1440px) {
    .media-grid {
        gap: 12px;
        padding: 24px;
        max-width: 1400px;
    }
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: var(--border);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

    .media-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

@media (hover:hover) and (pointer:fine) {
    .media-item:hover {
        transform: scale(1.02);
        box-shadow: 0 8px 24px rgba(0,0,0,.12);
        z-index: 1;
    }
}

@media (hover:none) and (pointer:coarse) {
    .media-item:active {
        transform: scale(.97);
        opacity: .92;
    }
}

.media-item.media-add {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed var(--border);
    background: color-mix(in srgb, var(--card) 90%, transparent);
    color: var(--text-secondary);
}

.media-add__content {
    display: grid;
    gap: 6px;
    place-items: center;
    text-align: center;
    padding: 8px;
}

.media-add__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    box-shadow: 0 8px 18px rgba(0,0,0,.08);
}

.media-add__label {
    font-weight: 800;
    color: var(--text);
}

.media-add__hint {
    font-size: 13px;
    color: var(--text-secondary);
}

@media (max-width:1023px) {
    .media-add__hint {
        display: none;
    }
}

/* Upload overlay tiles */
.media-item.is-uploading {
    cursor: default;
}

    .media-item.is-uploading::after {
        content: "";
        position: absolute;
        inset: 0;
        background: color-mix(in srgb, var(--card) 70%, transparent);
    }

.media-item .upload-badge {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: color-mix(in srgb, #000 45%, transparent);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.media-item .upload-bar {
    height: 6px;
    flex: 1;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.25);
}

    .media-item .upload-bar > div {
        height: 100%;
        width: 0%;
        background: #fff;
        transition: width .12s linear;
    }

.media-item.is-failed .upload-badge {
    background: rgba(255,59,48,0.75);
}

.media-item.is-done .upload-badge {
    background: rgba(52,199,89,0.75);
}

/* Mobile: hide "Uploading" text, keep % */
@media (max-width:520px) {
    .media-item .upload-badge {
        padding: 6px 8px;
        gap: 6px;
        font-size: 12px;
    }

        .media-item .upload-badge > span:first-child {
            display: none;
        }

    .media-item .upload-pct {
        font-variant-numeric: tabular-nums;
        min-width: 3ch;
        text-align: right;
    }

    .media-item .upload-bar {
        height: 5px;
    }
}

/* ============================
   Gallery modal
   ============================ */
.gallery-modal {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s ease;
    isolation: isolate;
}

    .gallery-modal.active {
        opacity: 1;
    }

.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform .25s ease;
    will-change: transform;
    touch-action: pan-y; /* allow vertical gestures, swipe handled in JS */
}

.gallery-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 120px 20px;
}

    .gallery-slide img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        user-select: none;
        touch-action: none;
        cursor: grab;
    }

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.10);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .gallery-nav:hover {
        background: rgba(255,255,255,0.20);
    }

    .gallery-nav.prev {
        left: 20px;
    }

    .gallery-nav.next {
        right: 20px;
    }

@media (hover:none) and (pointer:coarse) {
    .gallery-nav {
        display: none !important;
    }
}

.gallery-counter {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top));
    left: max(var(--gallery-pad), env(safe-area-inset-left, 0px) + var(--gallery-pad));
    padding: 8px 16px;
    background: rgba(0,0,0,0.50);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    z-index: 6;
}

.gallery-close,
.gallery-actions {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top));
    width: var(--gallery-btn);
    height: var(--gallery-btn);
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.10);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 6;
}

.gallery-close {
    right: max(var(--gallery-pad), env(safe-area-inset-right, 0px) + var(--gallery-pad));
    font-size: 28px;
    line-height: 1;
}

.gallery-actions {
    /* This is the key: closeRight + buttonSize + gap */
    right: calc( max(var(--gallery-pad), env(safe-area-inset-right, 0px) + var(--gallery-pad)) + var(--gallery-btn) + var(--gallery-gap) );
    font-size: 24px;
    line-height: 1;
}

    .gallery-close:hover,
    .gallery-actions:hover {
        background: rgba(255,255,255,0.20);
    }

    .gallery-close:active,
    .gallery-actions:active {
        transform: scale(0.94);
    }

.gallery-menu {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top) + var(--gallery-btn) + 8px);
    right: max(var(--gallery-pad), env(safe-area-inset-right, 0px) + var(--gallery-pad));
    min-width: 220px;
    background: rgba(20,20,22,0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.45);
    padding: 8px;
    z-index: 7;
}

    .gallery-menu[hidden] {
        display: none !important;
    }

.gallery-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 12px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
}

    .gallery-menu-item:hover,
    .gallery-menu-item:focus-visible {
        background: rgba(255,255,255,0.10);
        outline: none;
    }

    .gallery-menu-item.danger {
        color: #FF453A;
    }

        .gallery-menu-item.danger:hover,
        .gallery-menu-item.danger:focus-visible {
            background: rgba(255,69,58,0.16);
        }

.gallery-menu-sep {
    height: 1px;
    margin: 6px 6px;
    background: rgba(255,255,255,0.12);
}

/* Thumbs */
.gallery-thumbs {
    position: absolute;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    height: 80px;
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.70);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 6;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.30) transparent;
}

    .gallery-thumbs::-webkit-scrollbar {
        height: 4px;
    }

    .gallery-thumbs::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.30);
        border-radius: 2px;
    }

.gallery-thumb {
    min-width: 64px;
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: .6;
    transition: opacity .15s ease, border-color .15s ease;
    border: 2px solid transparent;
}

    .gallery-thumb.active {
        opacity: 1;
        border-color: #fff;
    }

    .gallery-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Mobile tweaks */
@media (max-width:768px) {
    :root {
        --gutter-x: 12px;
        --block-pad: 16px;
        --pill-pad: 6px;
        --grid-gap: 12px;
        --gallery-btn: 40px;
        --gallery-gap: 10px;
        --gallery-pad: 12px;
    }

    .hero-content {
        bottom: 50px;
        padding: 0 20px;
    }

    .event-title {
        font-size: 28px;
    }

    .event-meta {
        font-size: 16px;
    }

    .event-info-card {
        margin-top: -50px;
    }

    .tabs.tabs-pill {
        padding: 6px;
        gap: 6px;
    }

        .tabs.tabs-pill .tab {
            flex-direction: column;
            gap: 4px;
            padding: 8px 6px;
        }

            .tabs.tabs-pill .tab .icon {
                width: 22px;
                height: 22px;
            }

    .tab-label {
        font-size: 12px;
        font-weight: 700;
    }

    .wishlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
    }

    .gift-image {
        height: 160px;
    }

    .gallery-slide {
        padding: 60px 10px 90px 10px;
    }

    .gallery-thumbs {
        height: 60px;
        bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .gallery-thumb {
        min-width: 48px;
        width: 48px;
        height: 48px;
    }

    /* Mobile: menu becomes bottom-sheet */
/*    .gallery-menu {
        left: 12px;
        right: 12px;
        top: auto;
        bottom: calc(12px + env(safe-area-inset-bottom));
        min-width: 0;
        border-radius: 16px;
        padding: 10px;
    }

    .gallery-menu-item {
        justify-content: center;
        font-size: 16px;
        padding: 12px 14px;
    }*/
}

/* Very small phones */
@media (max-width:390px) {
    :root {
        --gutter-x: 8px;
        --block-pad: 12px;
        --pill-pad: 4px;
        --grid-gap: 8px;
    }
}

.participant {
    display: flex;
    align-items: center;
    gap: 16px;
}

.participant-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

    .participant-main:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
        border-radius: 12px;
    }

/* ============================
   Add-card unified style (wishlist + media)
   ============================ */
.add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 200px;
    border: 1.5px dashed var(--border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--card) 90%, transparent);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .2s ease;
}

    .add-card:hover {
        border-color: var(--primary);
        background: color-mix(in srgb, var(--primary) 6%, var(--card));
    }

    .add-card:active {
        transform: scale(0.98);
    }

.add-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    transition: transform .2s ease;
}

.add-card:hover .add-card__icon {
    transform: scale(1.08);
}

.add-card__label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.add-card__hint {
    font-size: 13px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .add-card {
        min-height: 160px;
    }

    .add-card__hint {
        display: none;
    }
}

/* ============================
   Info Section Styles
   ============================ */

/* Section container */
.info-section {
    background: var(--card);
    border-radius: 16px;
    padding: var(--block-pad);
    margin-bottom: calc(var(--block-pad) - 4px);
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

/* Section title with icon */
.info-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.info-section__icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
    flex-shrink: 0;
}

/* Info rows (location, address, parking) */
.info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

    .info-row + .info-row {
        border-top: 1px solid var(--border);
    }

.info-row__icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-row__text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.info-row__text--strong {
    font-weight: 600;
    color: var(--text);
}

/* Description text */
.info-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

/* Program list */
.program-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.program-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 10px;
    transition: background .15s ease;
}

    .program-item:hover {
        background: color-mix(in srgb, var(--primary) 8%, var(--bg));
    }

.program-item__icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.program-item__time {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    min-width: 50px;
}

.program-item__title {
    font-size: 15px;
    color: var(--text);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .info-section__title {
        font-size: 16px;
        gap: 8px;
    }

    .info-section__icon {
        width: 20px;
        height: 20px;
    }

    .info-row {
        gap: 10px;
    }

    .info-row__icon {
        width: 16px;
        height: 16px;
    }

    .info-row__text {
        font-size: 14px;
    }

    .program-item {
        padding: 8px 10px;
    }

    .program-item__time {
        font-size: 13px;
        min-width: 45px;
    }

    .program-item__title {
        font-size: 14px;
    }
}

/* ============================
   Gallery author + counter (centered stack)
   ============================ */
.gallery-footer {
    position: absolute;
    bottom: calc(100px + env(safe-area-inset-bottom)); /* над thumbs */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 6;
}

.gallery-author {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    background: rgba(0,0,0,0.50);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    pointer-events: auto;
    cursor: pointer;
    transition: background .15s ease;
}

    .gallery-author:hover {
        background: rgba(0,0,0,0.65);
    }

    .gallery-author[hidden] {
        display: none !important;
    }

.gallery-author__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,.15);
    flex-shrink: 0;
}

.gallery-author__name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Counter moves inside footer */
.gallery-footer .gallery-counter {
    position: static;
    padding: 6px 14px;
    background: rgba(0,0,0,0.50);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    color: #fff;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* Mobile */
@media (max-width: 768px) {
    .gallery-footer {
        bottom: calc(80px + env(safe-area-inset-bottom));
        gap: 6px;
    }

    .gallery-author {
        padding: 5px 12px 5px 5px;
        font-size: 13px;
    }

    .gallery-author__avatar {
        width: 24px;
        height: 24px;
    }

    .gallery-author__name {
        max-width: 140px;
    }

    .gallery-footer .gallery-counter {
        padding: 5px 12px;
        font-size: 12px;
    }
}

.gallery-modal,
.gallery-container,
.gallery-track {
    overscroll-behavior: contain;
}

.gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.gallery-track {
    touch-action: none;
}

.gallery-modal.active {
    touch-action: manipulation;
}

/* ============================
   Hero actions menu (floating over hero)
   ============================ */
.hero-wrap {
    position: relative;
}

.hero-actions.menu {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    padding: 0 var(--gutter-x);
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 50;
}

.hero-action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    transition: transform 0.15s ease, opacity 0.15s ease;
}

    .hero-action-btn svg {
        width: 22px;
        height: 22px;
    }

    .hero-action-btn:hover {
        opacity: 0.8;
    }

    .hero-action-btn:active {
        transform: scale(0.94);
    }

/* Override menu-pop positioning for hero */
.hero-actions .menu-pop {
    right: 0;
    min-width: 220px;
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-br);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.hero-action-btn,
.hero-actions .menu-pop {
    pointer-events: auto;
}

/* Submenu styles */
.menu-submenu {
    position: relative;
}

.menu-item--expandable {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

    .menu-item--expandable:hover {
        background: var(--bg);
    }

    .menu-item--expandable svg:first-child {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .menu-item--expandable span {
        flex: 1;
        text-align: left;
    }

.menu-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.menu-item--expandable[aria-expanded="true"] .menu-chevron {
    transform: rotate(90deg);
}

.menu-subitems {
    padding-left: 30px;
}

    .menu-subitems[hidden] {
        display: none;
    }

/* Danger item */
.menu-item-danger {
    color: #FF3B30 !important;
}

    .menu-item-danger:hover {
        background: rgba(255, 59, 48, 0.1) !important;
    }

@media (max-width: 1280px) {
    .hero-actions .menu-pop {
        right: 16px;
    }
}

@media (max-width: 768px) {
    .hero-actions.menu {
        top: 12px;
        padding: 0 12px;
    }

    .hero-action-btn {
        width: 40px;
        height: 40px;
    }

        .hero-action-btn svg {
            width: 20px;
            height: 20px;
        }

    .hero-actions .menu-pop {
        right: 16px;
    }
}

/* ============================
   Gallery top bar
   ============================ */
.gallery-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: calc(12px + env(safe-area-inset-top)) var(--gallery-pad) 12px;
    padding-left: max(var(--gallery-pad), env(safe-area-inset-left));
    padding-right: max(var(--gallery-pad), env(safe-area-inset-right));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 6;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
    pointer-events: none;
}

    .gallery-topbar > * {
        pointer-events: auto;
    }

.gallery-topbar__right {
    display: flex;
    align-items: center;
    gap: var(--gallery-gap);
    flex-shrink: 0;
}

/* Author внутри topbar */
.gallery-topbar .gallery-author {
    padding: 6px 14px 6px 6px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: calc(var(--gallery-btn) / 2);
    min-width: 0;
    max-width: calc(100vw - var(--gallery-btn) * 2 - var(--gallery-gap) * 3 - var(--gallery-pad) * 2);
    text-decoration: none;
}

.gallery-topbar .gallery-author__avatar {
    width: 32px;
    height: 32px;
}

/* Кнопки внутри topbar — убираем position: absolute */
.gallery-topbar .gallery-actions,
.gallery-topbar .gallery-close {
    position: static;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .gallery-topbar {
        padding-top: calc(10px + env(safe-area-inset-top));
        gap: 8px;
    }

    .gallery-topbar__right {
        gap: 8px;
    }

    .gallery-topbar .gallery-author {
        padding: 4px 10px 4px 4px;
        font-size: 13px;
        gap: 6px;
    }

    .gallery-topbar .gallery-author__avatar {
        width: 32px;
        height: 32px;
    }

    .gallery-topbar .gallery-author__name {
        padding-left: 2px;
    }

}

.gallery-topbar .gallery-author {
    min-width: 0;
    flex-shrink: 1;
}

.gallery-topbar .gallery-author__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}