/* compact, clean UI */
* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: #faf9f6;
    color: #222
}

.site-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10
}

.site-header h1 {
    margin: 0;
    font-size: 22px
}

.filters {
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 58px;
    z-index: 9
}

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.chip {
    border: 1px solid #ddd;
    background: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer
}

.chip.active {
    background: #111;
    color: #fff;
    border-color: #111
}

.gallery-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px
}

.tile {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    background: #fff
}

.thumb-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0
}

.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s
}

.tile:hover .thumb-wrap img {
    transform: scale(1.03)
}

.play-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px
}

.tile-caption {
    padding: 10px;
    font-size: 14px;
    border-top: 1px solid #f4f4f4;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden
}

.site-footer {
    padding: 20px;
    color: #666;
    font-size: 12px;
    border-top: 1px solid #eee
}

.viewer .viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 10
}

.viewer .back {
    text-decoration: none;
    color: #06f
}

.viewer .vh-title {
    flex: 1
}

.viewer .vh-event {
    font-weight: 700
}

.viewer .vh-caption {
    font-size: 13px;
    color: #555
}

.viewer-main {
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px
}

.full-image {
    max-width: 98vw;
    max-height: 78vh;
    display: block;
    margin: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1)
}

.video-player {
    width: 90vw;
    max-width: 1080px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
    background: #000
}

.video-embed {
    position: relative;
    width: 90vw;
    max-width: 1080px;
    aspect-ratio: 16/9
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1)
}

.viewer-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px
}

.viewer-footer button,
.viewer-header button {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer
}

.viewer-footer button:hover,
.viewer-header button:hover {
    background: #111;
    color: #fff;
    border-color: #111
}

@media (max-width:640px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px
    }

    .filters {
        top: 52px
    }
}