/* 사이드바 레이아웃 */
.container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sidebar { 
    width: 180px; 
    flex-shrink: 0; 
}

/* 연도 버튼 스타일 */
.year-button {
    width: 100%; 
    padding: 15px; 
    margin-bottom: 12px;
    border: none; 
    border-radius: 10px; 
    background: white;
    cursor: pointer; 
    font-weight: 600; 
    color: #7a6851;
    transition: 0.3s; 
    box-shadow: 0 2px 5px rgba(212, 165, 116, 0.15);
    font-size: 16px;
}

.year-button.active {
    background: linear-gradient(135deg, #d4a574 0%, #c89456 100%);
    color: white;
}

.year-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(200, 148, 86, 0.25);
}

/* 갤러리 그리드 레이아웃 */
.main-content { 
    flex-grow: 1; 
}

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

/* 갤러리 아이템 카드 */
.gallery-item { 
    background: white; 
    border-radius: 15px; 
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(212, 165, 116, 0.15);
    transition: 0.3s;
    cursor: pointer;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(200, 148, 86, 0.25);
}

.gallery-image img { 
    width: 100%; 
    height: 200px; 
    object-fit: cover; 
    display: block;
}

/* 관리자 컨트롤 버튼 */
.admin-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.admin-edit-btn,
.admin-delete-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.admin-edit-btn {
    background: #3498db;
    color: white;
}

.admin-edit-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.admin-delete-btn {
    background: #e74c3c;
    color: white;
}

.admin-delete-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 텍스트 영역: 제목과 댓글 배지 정렬 */
.gallery-description { 
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
}

.gallery-description .title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.gallery-description h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #4a3f35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.comment-badge {
    background-color: #d4a574;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(212, 165, 116, 0.2);
}

.gallery-content { 
    display: none; 
}

.gallery-content.active { 
    display: block; 
}

/* 태블릿 반응형 (768px ~ 1024px) */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .sidebar {
        width: 150px;
    }

    .year-button {
        padding: 12px;
        font-size: 15px;
    }
}

/* 모바일 반응형 (최대 768px) */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px;
        align-items: center;
        gap: 20px;
    }
    
    .sidebar {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .year-button {
        width: 100%;
        margin-bottom: 0;
        padding: 12px;
        font-size: 1rem;
    }

    .main-content {
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .admin-controls {
        top: 5px;
        right: 5px;
        gap: 5px;
    }

    .admin-edit-btn,
    .admin-delete-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .gallery-description h3 {
        font-size: 1rem;
    }

    .gallery-image img {
        height: 180px;
    }
}

/* 작은 모바일 (최대 480px) */
@media (max-width: 480px) {
    .container {
        padding: 8px;
        gap: 15px;
    }

    .sidebar {
        gap: 8px;
    }

    .year-button {
        padding: 10px;
        font-size: 0.95rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-image img {
        height: 160px;
    }

    .gallery-description {
        padding: 12px 15px;
    }

    .gallery-description h3 {
        font-size: 0.95rem;
    }

    .comment-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* 매우 작은 화면 (최대 360px) */
@media (max-width: 360px) {
    .year-button {
        padding: 8px;
        font-size: 0.9rem;
    }

    .gallery-image img {
        height: 140px;
    }

    .gallery-description h3 {
        font-size: 0.9rem;
    }
}