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

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

body {
    background-color: #111;
    color: #eee;
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden; /* 데스크탑에서는 전체 스크롤 방지 */
}

.container {
    display: flex;
    height: 100%;
}

/* 사이드바 */
.sidebar {
    width: 250px;
    padding: 40px;
    flex-shrink: 0;
    overflow-y: auto;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 50px;
    letter-spacing: 2px;
    border: 2px solid white;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* 메뉴 버튼 스타일 */
.year-item { margin-bottom: 15px; }
.year-btn {
    background: none; border: none; color: #888;
    font-size: 18px; cursor: pointer; text-align: left;
    width: 100%; padding: 5px 0; transition: 0.3s;
}
.year-btn:hover, .year-btn.active { color: #fff; font-weight: 600; }

.month-list { display: none; padding-left: 15px; margin-top: 5px; }
.month-list.open { display: block; }
.month-btn {
    display: block; background: none; border: none; color: #555;
    font-size: 14px; cursor: pointer; padding: 4px 0;
    text-align: left; width: 100%; transition: 0.3s;
}
.month-btn:hover, .month-btn.active { color: #ddd; }

/* 갤러리 레이아웃 (Grid Masonry) */
.gallery-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-gap: 20px;
    grid-auto-rows: 10px; /* 높이 계산을 위한 기초 단위 */
}

.gallery-item {
    /* background-color: #222; */
    /* border-radius: 4px; */
    overflow: hidden;
    position: relative;
    grid-row-end: span 20; /* 로딩 전 초기 높이 */
}

/* 스켈레톤 로딩 애니메이션 */
.gallery-item::before {
    content: ""; position: absolute; top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { left: 100%; } }
.gallery-item.loaded::before { display: none; }

.gallery-item img {
    width: 100%; display: block;
    opacity: 0; transition: opacity 0.8s ease;
}
.gallery-item img.loaded { opacity: 1; }

/* 라이트박스 (중요: .lightbox.active 공백 없이 붙여쓰기) */
.lightbox {
    display: none; position: fixed; z-index: 9999;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center; align-items: center;
}
.lightbox.active { display: flex; }

.lightbox-content { position: relative; max-width: 90%; max-height: 90%; }
#lightbox-img { max-width: 100%; max-height: 90vh; border-radius: 4px; object-fit: contain; }

.close { position: absolute; top: -50px; right: 0; color: white; font-size: 40px; cursor: pointer; }
.nav-btn {
    background: none; border: none; color: white; font-size: 40px;
    cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%);
}
.prev { left: -60px; }
.next { right: -60px; }

/* 모바일 반응형 */
@media (max-width: 768px) {
    body { overflow: auto; }
    .container { display: block; }
    .sidebar { width: 100%; height: auto; padding: 30px 20px; overflow: visible; }
    .gallery-container { width: 100%; padding: 10px; overflow: visible; }
    .gallery { grid-template-columns: repeat(2, 1fr); grid-gap: 10px; }
    .prev { left: 10px; } .next { right: 10px; }
    .nav-btn { background: rgba(0,0,0,0.3); border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
}