* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #faf8f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #f8b500 0%, #ff6f61 100%);
    padding: 3rem 1rem;
    text-align: center;
    color: white;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    width: 100%;
}

/* Month group */
.month-group {
    margin-bottom: 2.5rem;
}

.month-label {
    font-size: 1rem;
    font-weight: 600;
    color: #888;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #f0ece4;
}

/* Masonry grid */
.month-grid {
    columns: 3;
    column-gap: 0.75rem;
}

/* Gallery item */
.gallery-item {
    break-inside: avoid;
    margin-bottom: 0.75rem;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #e8e4df;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    display: block;
}

/* Video thumbnail */
.gallery-item video {
    width: 100%;
    display: block;
    pointer-events: none;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.15);
    transition: background 0.2s;
}

.gallery-item:hover .video-overlay {
    background: rgba(0,0,0,0.3);
}

.play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.play-btn::after {
    content: '';
    border-style: solid;
    border-width: 9px 0 9px 18px;
    border-color: transparent transparent transparent #333;
    margin-left: 3px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 5rem 1rem;
}

.cat-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: #f8b500;
}

.empty-state p {
    font-size: 1.1rem;
    color: #999;
    margin-bottom: 0.4rem;
}

.empty-state .hint {
    font-size: 0.85rem;
}

.empty-state code {
    background: #f0ece4;
    padding: 2px 7px;
    border-radius: 4px;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-media {
    max-width: 92vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media img {
    max-width: 92vw;
    max-height: 85vh;
    border-radius: 6px;
    object-fit: contain;
}

.lightbox-media video {
    max-width: 92vw;
    max-height: 85vh;
    border-radius: 6px;
    outline: none;
}

.lightbox-caption {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.2rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    opacity: 0.8;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6rem;
    color: white;
    background: rgba(255,255,255,0.12);
    border: none;
    cursor: pointer;
    padding: 0.9rem 1rem;
    border-radius: 50%;
    transition: background 0.2s;
    opacity: 0.8;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.28);
    opacity: 1;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

footer {
    text-align: center;
    padding: 1.5rem;
    color: #bbb;
    font-size: 0.88rem;
    border-top: 1px solid #eee;
}

@media (max-width: 768px) {
    .month-grid { columns: 2; }
    header { padding: 2rem 1rem; }
    .header-content h1 { font-size: 1.8rem; }
}

@media (max-width: 480px) {
    .month-grid { columns: 2; column-gap: 0.5rem; }
    .gallery-item { margin-bottom: 0.5rem; }
}
