/* 우리 아이 성장 앨범 - album.css */
/* Last updated: 2026-05-01 - 썸네일 그리드 스타일 추가 */

/* 구글 폰트 임포트 */
@import url('https://fonts.googleapis.com/css2?family=Gamja+Flower&family=Nanum+Pen+Script&family=Noto+Sans+KR:wght@300;400;500;700&family=Cute+Font&display=swap');

/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

html.mobile-view {
    overflow-y: auto;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #FFB7D5 0%, #C7CEEA 50%, #B5EAD7 100%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* 배경 장식 */
body::before {
    content: '⭐';
    position: absolute;
    top: 10%;
    left: 10%;
    font-size: 2em;
    opacity: 0.3;
    animation: twinkle 3s infinite;
}

body::after {
    content: '✨';
    position: absolute;
    bottom: 15%;
    right: 15%;
    font-size: 2.5em;
    opacity: 0.3;
    animation: twinkle 2.5s infinite 0.5s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.album-container {
    position: relative;
    width: 100%;
    max-width: 1800px;
    height: calc(100vh - 120px);
    max-height: 900px;
    margin-bottom: 80px;
}

/* 앨범 책 */
.album-book {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 2000px;
}

/* 페이지 스프레드 */
.page-spread {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
}

.page-spread.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
    pointer-events: auto;
}

.page {
    width: 50%;
    height: 100%;
    background: #FFFEF9;
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.2);
    padding: 70px 60px;
    overflow-y: auto;
    position: relative;
}

/* 페이지 장식 */
.page::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #FFE5EC 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.5;
}

.left-page {
    border-radius: 20px 0 0 20px;
    border-right: 2px dashed #FFB7D5;
}

.left-page::after {
    content: '🌸';
    position: absolute;
    top: 30px;
    left: 30px;
    font-size: 2em;
    opacity: 0.2;
}

.right-page {
    border-radius: 0 20px 20px 0;
}

.right-page::after {
    content: '🎨';
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 2em;
    opacity: 0.2;
}

/* 스크롤바 스타일 */
.page::-webkit-scrollbar {
    width: 12px;
}

.page::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #FFE5EC 0%, #E0E7FF 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 183, 213, 0.2);
}

.page::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFB7D5 0%, #C7CEEA 100%);
    border-radius: 10px;
    border: 2px solid white;
}

.page::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FF6BA9 0%, #A0A8E8 100%);
}

.toc-list::-webkit-scrollbar {
    width: 10px;
}

.toc-list::-webkit-scrollbar-track {
    background: rgba(255, 183, 213, 0.1);
    border-radius: 10px;
}

.toc-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFB7D5 0%, #FFC4E8 100%);
    border-radius: 10px;
}

.toc-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FF6BA9 0%, #FF9FD3 100%);
}

/* 표지 디자인 */
.cover-page .left-page {
    background: linear-gradient(135deg, #FF9FD3 0%, #FFC4E8 50%, #C7CEEA 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.cover-page .left-page::before,
.cover-page .left-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.cover-page .left-page::before {
    width: 200px;
    height: 200px;
    top: -50px;
    right: -50px;
}

.cover-page .left-page::after {
    width: 150px;
    height: 150px;
    bottom: -30px;
    left: -30px;
}

.cover-design {
    text-align: center;
    position: relative;
    z-index: 1;
}

.cover-design::before {
    content: '📖';
    display: block;
    font-size: 4em;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.album-title {
    font-family: 'Gamja Flower', cursive;
    font-size: 5em;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 3px 3px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
}

.album-subtitle {
    font-family: 'Cute Font', cursive;
    font-size: 2em;
    margin-bottom: 40px;
    opacity: 0.95;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.album-info {
    margin-top: 40px;
    font-size: 1.2em;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 20px 40px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

.album-info p {
    margin: 10px 0;
    font-weight: 500;
}

.album-info p::before {
    content: '✨ ';
}

/* 목차 */
.table-of-contents {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.toc-title {
    font-family: 'Gamja Flower', cursive;
    font-size: 3.5em;
    color: #FF6BA9;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #FFB7D5;
    text-align: center;
    position: relative;
}

.toc-title::before {
    content: '📚 ';
}

.toc-title::after {
    content: ' 📚';
}

/* 목차 페이지네이션 버튼 */
.toc-pagination {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.toc-page-btn {
    background: rgba(255, 183, 213, 0.2);
    border: 2px solid #FFB7D5;
    color: #FF6BA9;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95em;
}

.toc-page-btn:hover {
    background: rgba(255, 183, 213, 0.4);
    transform: translateY(-2px);
}

.toc-page-btn.active {
    background: linear-gradient(135deg, #FF6BA9 0%, #FFB7D5 100%);
    color: white;
    border-color: #FF6BA9;
}

/* 썸네일 옵션 (컨텐츠 페이지용) */
.thumb-options {
    display: flex;
    gap: 8px;
    padding: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin-bottom: 10px;
}

.thumb-label {
    font-size: 0.9em;
    color: #FF6BA9;
    font-weight: 600;
    margin-right: 5px;
}

.thumb-btn {
    background: rgba(255, 183, 213, 0.2);
    border: 2px solid #FFB7D5;
    color: #FF6BA9;
    padding: 6px 14px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.85em;
}

.thumb-btn:hover {
    background: rgba(255, 183, 213, 0.4);
    transform: translateY(-2px);
}

.thumb-btn.active {
    background: linear-gradient(135deg, #FF6BA9 0%, #FFB7D5 100%);
    color: white;
    border-color: #FF6BA9;
}

/* 사진 그리드 */
.photo-grid {
    display: grid;
    gap: 8px;
    padding: 10px;
    height: calc(100% - 60px);
    align-content: start;
}

/* 1개: 1행 1열 */
.photo-grid.grid-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.photo-grid.grid-1 .grid-item {
    height: 100%;
    max-height: 400px;
}

/* 3개: 1행 3열 */
.photo-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
}

.photo-grid.grid-3 .grid-item {
    height: 100%;
    max-height: 200px;
}

/* 6개: 2행 3열 */
.photo-grid.grid-6 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.photo-grid.grid-6 .grid-item {
    height: 100%;
    max-height: 150px;
}

/* 9개: 3행 3열 */
.photo-grid.grid-9 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.photo-grid.grid-9 .grid-item {
    height: 100%;
    max-height: 120px;
}

.grid-item {
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 그리드 네비게이션 */
.grid-nav {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px;
    margin-top: auto;
}

.grid-nav-btn {
    background: linear-gradient(135deg, #FF6BA9 0%, #FFB7D5 100%);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 107, 169, 0.4);
}

.grid-info {
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
}

.toc-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    position: relative;
}

.toc-item {
    transition: opacity 0.3s ease;
}

.toc-item.hidden {
    display: none;
}

/* 목차 네비게이션 */
.toc-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #FFB7D5;
}

.toc-nav-btn {
    background: linear-gradient(135deg, #FFB7D5 0%, #FFC4E8 100%);
    border: 2px solid white;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 2em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(255, 183, 213, 0.3);
}

.toc-nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #FF6BA9 0%, #C7CEEA 100%);
    transform: scale(1.1);
}

.toc-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.toc-page-info {
    font-size: 1.2em;
    font-weight: 700;
    color: #FF6BA9;
    min-width: 80px;
    text-align: center;
}

.toc-item {
    display: flex;
    align-items: center;
    padding: 18px 15px;
    margin-bottom: 12px;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 183, 213, 0.1) 100%);
    position: relative;
}

.toc-item::before {
    content: '🌟';
    position: absolute;
    left: -5px;
    opacity: 0;
    transition: all 0.3s ease;
}

.toc-item:hover {
    background: linear-gradient(90deg, rgba(255, 183, 213, 0.3) 0%, rgba(255, 228, 236, 0.5) 100%);
    border-left-color: #FF6BA9;
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(255, 107, 169, 0.2);
}

.toc-item:hover::before {
    opacity: 1;
    left: 5px;
}

.toc-date {
    color: #FF6BA9;
    font-weight: 700;
    font-size: 0.95em;
    min-width: 110px;
    background: rgba(255, 183, 213, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
}

.toc-title-text {
    flex: 1;
    color: #2c3e50;
    padding: 0 20px;
    font-size: 1.05em;
    font-weight: 500;
}

.toc-page {
    color: #C7CEEA;
    font-weight: 700;
    min-width: 45px;
    text-align: right;
    font-size: 1.1em;
    background: rgba(199, 206, 234, 0.3);
    padding: 5px 12px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 콘텐츠 페이지 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #FFB7D5;
    background: linear-gradient(90deg, rgba(255, 183, 213, 0.1) 0%, transparent 100%);
    padding: 15px 20px 20px 20px;
    border-radius: 15px 15px 0 0;
}

.page-number {
    font-family: 'Cute Font', cursive;
    font-size: 1.8em;
    font-weight: 700;
    color: #FF6BA9;
    background: rgba(255, 183, 213, 0.3);
    padding: 5px 20px;
    border-radius: 25px;
}

.page-number::before {
    content: '📄 ';
}

.page-date {
    font-size: 1em;
    color: #C7CEEA;
    font-weight: 600;
    background: rgba(199, 206, 234, 0.3);
    padding: 8px 20px;
    border-radius: 25px;
}

.page-date::before {
    content: '📅 ';
}

.post-title {
    font-family: 'Gamja Flower', cursive;
    font-size: 2.5em;
    color: #FF6BA9;
    margin-bottom: 35px;
    line-height: 1.4;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 183, 213, 0.15) 0%, rgba(199, 206, 234, 0.15) 100%);
    border-radius: 20px;
    border-left: 5px solid #FF6BA9;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.post-content {
    flex: 1;
}

.article-text {
    line-height: 2;
    color: #555;
    font-size: 1.15em;
    background: rgba(255, 254, 249, 0.8);
    padding: 25px;
    border-radius: 15px;
}

.article-text p {
    margin-bottom: 25px;
    text-align: justify;
    position: relative;
    padding-left: 15px;
}

.article-text p::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #FFB7D5;
    font-size: 1.2em;
}

.photo-count {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px dashed #FFB7D5;
    color: #FF6BA9;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    background: rgba(255, 183, 213, 0.1);
    padding: 20px;
    border-radius: 15px;
}

.photo-count span::before {
    content: '🎀 ';
}

.photo-count span::after {
    content: ' 🎀';
}

/* 사진 페이지 */
.photo-page {
    position: relative;
    padding: 50px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(255, 228, 236, 0.3) 0%, rgba(199, 206, 234, 0.3) 100%);
}

.photo-viewer {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(255, 107, 169, 0.2);
    border: 5px solid rgba(255, 183, 213, 0.3);
}

.photo-slides {
    position: static;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
    z-index: 10;
}

.photo-nav-btn {
    pointer-events: auto;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #FF6BA9 0%, #FF8DC7 100%);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 107, 169, 0.4);
    transition: all 0.3s ease;
}

.photo-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 169, 0.5);
}

.photo-nav-btn:active {
    transform: scale(0.95);
}

.photo-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.photo-slide.active {
    opacity: 1;
    visibility: visible;
}

.photo-slide img {
    max-width: 100%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 5px;
}

.photo-caption {
    position: absolute;
    bottom: 25px;
    background: linear-gradient(135deg, #FF6BA9 0%, #C7CEEA 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(255, 107, 169, 0.3);
}

.photo-caption::before {
    content: '📷 ';
}

.no-photo {
    color: #FFB7D5;
    font-size: 1.5em;
    font-family: 'Cute Font', cursive;
}

/* 사진 컨트롤 */
.photo-controls {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 25px;
}

.photo-btn {
    background: linear-gradient(135deg, #FFB7D5 0%, #FFC4E8 100%);
    border: 3px solid white;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2.2em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 183, 213, 0.4);
}

.photo-btn:hover {
    background: linear-gradient(135deg, #FF6BA9 0%, #C7CEEA 100%);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 25px rgba(255, 107, 169, 0.5);
}

.photo-btn:active {
    transform: scale(0.95);
}

/* 네비게이션 */
.navigation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 35px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 254, 249, 0.95) 100%);
    padding: 18px 40px;
    border-radius: 60px;
    box-shadow: 0 8px 40px rgba(255, 107, 169, 0.3);
    border: 3px solid rgba(255, 183, 213, 0.3);
    z-index: 1000;
}

.nav-btn {
    background: linear-gradient(135deg, #FF6BA9 0%, #FFB7D5 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 107, 169, 0.3);
    font-family: 'Noto Sans KR', sans-serif;
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 169, 0.5);
    background: linear-gradient(135deg, #FF9FD3 0%, #C7CEEA 100%);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn span {
    font-size: 1.4em;
}

.page-indicator {
    font-family: 'Cute Font', cursive;
    font-size: 1.5em;
    font-weight: 700;
    color: #FF6BA9;
    min-width: 100px;
    text-align: center;
    background: rgba(255, 183, 213, 0.2);
    padding: 10px 25px;
    border-radius: 30px;
}

/* 목차 버튼 */
.toc-button {
    position: absolute;
    top: 25px;
    left: 25px;
    background: linear-gradient(135deg, #FFB7D5 0%, #FFC4E8 100%);
    border: 3px solid white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    font-size: 1.8em;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(255, 183, 213, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
    color: white;
}

.toc-button::before {
    content: '📚';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.5em;
}

.toc-button:hover {
    background: linear-gradient(135deg, #FF6BA9 0%, #C7CEEA 100%);
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 8px 35px rgba(255, 107, 169, 0.5);
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-spread.active {
    animation: fadeIn 0.5s ease;
}

/* 라이트박스 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(255, 183, 213, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 107, 169, 0.8);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-close:hover {
    background: #FF6BA9;
    transform: rotate(90deg) scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px 25px;
    background: rgba(255, 107, 169, 0.8);
    border-radius: 50%;
    transition: all 0.3s ease;
    user-select: none;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: #FF6BA9;
    transform: translateY(-50%) scale(1.15);
}

.lightbox-caption {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: linear-gradient(135deg, rgba(255, 107, 169, 0.9) 0%, rgba(199, 206, 234, 0.9) 100%);
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2em;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    max-width: 80%;
    text-align: center;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .album-container {
        max-width: 95vw;
    }

    .page-spread {
        flex-direction: column;
    }

    .page {
        width: 100%;
        height: 50%;
        padding: 40px 35px;
    }

    .left-page {
        border-radius: 20px 20px 0 0;
        border-right: none;
        border-bottom: 2px dashed #FFB7D5;
    }

    .right-page {
        border-radius: 0 0 20px 20px;
    }

    .album-title {
        font-size: 3em;
    }

    .post-title {
        font-size: 2em;
    }

    .toc-title {
        font-size: 2.8em;
    }
}

/* 갤럭시 S25 최적화 (393px 기준) */
@media (max-width: 768px) {
    html {
        overflow-x: hidden;
        scroll-behavior: smooth;
    }

    body {
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        align-items: flex-start;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        position: relative;
    }

    body::before,
    body::after {
        display: none;
    }

    .album-container {
        width: 100vw;
        height: auto;
        min-height: calc(var(--vh, 1vh) * 100);
        margin-bottom: 100px;
        max-width: 100%;
        overflow-x: hidden;
        position: relative;
        top: 0;
    }

    .album-book {
        height: auto;
        position: relative;
        top: 0;
    }

    .page-spread {
        position: absolute;
        top: 0 !important;
        left: 0;
        width: 100%;
        height: auto;
        min-height: calc(var(--vh, 1vh) * 90);
        flex-direction: column;
    }

    .page-spread.active {
        position: absolute;
        top: 0 !important;
    }

    .page {
        width: 100%;
        max-width: 100vw;
        padding: 30px 20px;
        height: auto;
        min-height: 45vh;
        overflow-y: visible;
        overflow-x: hidden;
        box-shadow: none;
        border-radius: 0;
        position: relative;
    }

    .page::before,
    .left-page::after,
    .right-page::after {
        display: none;
    }

    .left-page {
        border-radius: 0;
        border-right: none;
        border-bottom: 3px solid #FFB7D5;
    }

    .right-page {
        border-radius: 0;
        background: linear-gradient(135deg, rgba(255, 228, 236, 0.3) 0%, rgba(199, 206, 234, 0.3) 100%);
    }

    /* 표지 */
    .cover-page .left-page {
        min-height: calc(var(--vh, 1vh) * 50);
        justify-content: center;
        display: flex;
        align-items: center;
    }

    .cover-page .right-page {
        min-height: calc(var(--vh, 1vh) * 50);
    }

    /* 모바일 스크롤바 숨기기 */
    .page::-webkit-scrollbar,
    .toc-list::-webkit-scrollbar {
        width: 4px;
    }

    .page::-webkit-scrollbar-thumb,
    .toc-list::-webkit-scrollbar-thumb {
        background: rgba(255, 183, 213, 0.5);
    }

    .cover-design::before {
        font-size: 3em;
    }

    .album-title {
        font-size: 2.5em;
        line-height: 1.2;
        margin-bottom: 15px;
    }

    .album-subtitle {
        font-size: 1.5em;
    }

    .album-info {
        padding: 15px 30px;
        margin-top: 30px;
    }

    /* 목차 */
    .table-of-contents {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .toc-title {
        font-size: 2em;
        margin-bottom: 15px;
        padding-bottom: 12px;
        flex-shrink: 0;
    }

    .toc-pagination {
        flex-shrink: 0;
        margin-bottom: 15px;
        gap: 8px;
    }

    .toc-page-btn {
        padding: 6px 15px;
        font-size: 0.9em;
    }

    .thumb-options {
        margin-bottom: 8px;
        gap: 5px;
        padding: 8px;
    }

    .thumb-label {
        font-size: 0.75em;
    }

    .thumb-btn {
        padding: 4px 10px;
        font-size: 0.7em;
    }

    /* 모바일에서도 PC와 동일한 그리드 유지 */
    .photo-grid {
        gap: 5px;
        padding: 5px;
    }

    .photo-grid.grid-3 .grid-item {
        max-height: 100px;
    }

    .photo-grid.grid-6 .grid-item {
        max-height: 80px;
    }

    .photo-grid.grid-9 .grid-item {
        max-height: 60px;
    }

    .grid-nav {
        gap: 10px;
        padding: 5px;
    }

    .grid-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 1em;
    }

    .grid-info {
        font-size: 0.8em;
    }

    .toc-list {
        padding-right: 5px;
        overflow-y: auto;
        overflow-x: hidden;
        flex: 1;
        -webkit-overflow-scrolling: touch;
    }

    .toc-nav {
        flex-shrink: 0;
        margin-top: 15px;
        padding-top: 15px;
        gap: 15px;
    }

    .toc-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.8em;
    }

    .toc-page-info {
        font-size: 1.1em;
        min-width: 70px;
    }

    .toc-item {
        padding: 15px 12px;
        margin-bottom: 8px;
        flex-wrap: nowrap;
        font-size: 0.95em;
    }

    .toc-date {
        min-width: 90px;
        font-size: 0.85em;
        padding: 4px 10px;
    }

    .toc-title-text {
        font-size: 0.95em;
        padding: 0 12px;
    }

    .toc-page {
        width: 35px;
        height: 35px;
        min-width: 35px;
        font-size: 0.95em;
    }

    /* 콘텐츠 페이지 */
    .page-header {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 15px;
        margin-bottom: 20px;
    }

    .page-number {
        font-size: 1.3em;
        padding: 4px 15px;
    }

    .page-date {
        font-size: 0.9em;
        padding: 6px 15px;
    }

    .post-title {
        font-size: 1.6em;
        padding: 15px;
        margin-bottom: 20px;
        line-height: 1.3;
    }

    .article-text {
        font-size: 1em;
        padding: 20px;
        line-height: 1.8;
        word-break: keep-all;
        overflow-wrap: break-word;
    }

    .article-text p {
        margin-bottom: 15px;
    }

    .article-text p::before {
        display: none;
    }

    .photo-count {
        margin-top: 20px;
        padding: 15px;
    }

    /* 사진 페이지 */
    .photo-page {
        padding: 20px 15px;
        min-height: 50vh;
    }

    .photo-viewer {
        min-height: calc(var(--vh, 1vh) * 45);
        height: calc(var(--vh, 1vh) * 45);
        border-radius: 15px;
    }

    .photo-slide img {
        max-height: 85%;
    }

    .photo-caption {
        bottom: 15px;
        padding: 10px 25px;
        font-size: 1em;
    }

    .photo-btn {
        width: 50px;
        height: 50px;
        font-size: 1.8em;
    }

    .photo-controls {
        margin-top: 20px;
        gap: 20px;
    }

    /* 네비게이션 */
    .navigation {
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        padding: 12px 20px;
        gap: 20px;
        z-index: 1000;
        width: 90%;
        max-width: 350px;
        justify-content: space-between;
    }

    .nav-btn {
        padding: 12px 18px;
        font-size: 1em;
        flex: 0 0 auto;
    }

    .nav-btn span {
        font-size: 1.5em;
    }

    .nav-text {
        display: none;
    }

    .page-indicator {
        font-size: 1.2em;
        min-width: 80px;
        padding: 8px 15px;
        flex: 0 1 auto;
    }

    /* 목차 버튼 */
    .toc-button {
        width: 55px;
        height: 55px;
        font-size: 1.4em;
        top: 15px;
        left: 15px;
    }

    .toc-button::before {
        font-size: 0.6em;
    }

    /* 라이트박스 */
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 40px;
        width: 50px;
        height: 50px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 35px;
        width: 55px;
        height: 55px;
        padding: 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-caption {
        font-size: 1em;
        padding: 12px 25px;
        bottom: 20px;
        max-width: 85%;
    }

    .lightbox-image {
        max-width: 92%;
        max-height: 80vh;
    }
}

/* 작은 화면 (360px~400px, 갤럭시 S 시리즈) */
@media (max-width: 400px) {
    .page {
        padding: 25px 15px;
    }

    .album-title {
        font-size: 2em;
    }

    .album-info {
        font-size: 1em;
    }

    .toc-title {
        font-size: 1.7em;
        margin-bottom: 12px;
    }

    .toc-pagination {
        gap: 6px;
        margin-bottom: 12px;
    }

    .toc-page-btn {
        padding: 5px 12px;
        font-size: 0.85em;
    }

    .toc-item {
        padding: 12px 8px;
        font-size: 0.88em;
    }

    .toc-date {
        min-width: 80px;
        font-size: 0.78em;
        padding: 4px 8px;
    }

    .toc-title-text {
        font-size: 0.9em;
        padding: 0 10px;
    }

    .toc-page {
        width: 32px;
        height: 32px;
        font-size: 0.85em;
    }

    .toc-nav {
        margin-top: 12px;
        padding-top: 12px;
        gap: 12px;
    }

    .toc-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1.6em;
    }

    .toc-page-info {
        font-size: 1em;
        min-width: 65px;
    }

    .post-title {
        font-size: 1.4em;
        padding: 12px;
    }

    .article-text {
        font-size: 0.95em;
        padding: 18px;
    }

    .navigation {
        width: 95%;
        max-width: 340px;
        padding: 10px 15px;
        gap: 12px;
    }

    .nav-btn {
        padding: 10px 15px;
    }

    .page-indicator {
        font-size: 1.1em;
        min-width: 70px;
    }
}

/* 매우 작은 화면 (340px 이하) */
@media (max-width: 360px) {
    .page {
        padding: 20px 12px;
    }

    .album-title {
        font-size: 1.8em;
    }

    .album-subtitle {
        font-size: 1.2em;
    }

    .toc-title {
        font-size: 1.5em;
    }

    .toc-page-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .toc-item {
        padding: 10px 6px;
        font-size: 0.82em;
    }

    .toc-date {
        min-width: 75px;
        font-size: 0.75em;
    }

    .toc-title-text {
        font-size: 0.85em;
        padding: 0 8px;
    }

    .toc-page {
        width: 30px;
        height: 30px;
        font-size: 0.8em;
    }

    .toc-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1.5em;
    }

    .post-title {
        font-size: 1.3em;
        padding: 10px;
    }

    .article-text {
        font-size: 0.9em;
        padding: 15px;
    }

    .navigation {
        width: 98%;
        padding: 8px 12px;
        gap: 10px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .page-indicator {
        font-size: 1em;
        min-width: 60px;
        padding: 6px 10px;
    }

    .toc-button {
        width: 48px;
        height: 48px;
        font-size: 1.2em;
    }
}

/* 썸네일 표시 옵션 */
.thumbnail-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
}

.thumb-option-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.thumb-option-buttons {
    display: flex;
    gap: 8px;
}

.thumb-option-btn {
    padding: 8px 16px;
    border: 2px solid #FF6BA9;
    background: white;
    color: #FF6BA9;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.thumb-option-btn:hover {
    background: #FFF0F5;
}

.thumb-option-btn.active {
    background: linear-gradient(135deg, #FF6BA9 0%, #FF8DC7 100%);
    color: white;
    border-color: transparent;
}

/* 그리드 모드 스타일 */
.photo-slides.grid-mode {
    display: grid !important;
    gap: 8px;
    padding: 15px;
    overflow-y: auto;
    align-content: start;
}

.photo-slides.grid-1 {
    grid-template-columns: 1fr;
}

.photo-slides.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.photo-slides.grid-6 {
    grid-template-columns: repeat(3, 1fr);
}

.photo-slides.grid-9 {
    grid-template-columns: repeat(3, 1fr);
}

.photo-slides.grid-mode .photo-slide {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    cursor: pointer;
}

.photo-slides.grid-mode .photo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.photo-slides.grid-mode .photo-slide:hover img {
    transform: scale(1.05);
}

.photo-slides.grid-mode .photo-caption {
    display: none;
}

.photo-slides.grid-mode + .photo-nav {
    display: none;
}

/* 모바일 그리드 반응형 */
@media (max-width: 768px) {
    .thumbnail-options {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .thumb-option-buttons {
        gap: 6px;
    }

    .thumb-option-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .photo-slides.grid-3,
    .photo-slides.grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-slides.grid-9 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .thumb-option-btn {
        padding: 5px 10px;
        font-size: 0.75em;
    }

    .photo-slides.grid-6,
    .photo-slides.grid-9 {
        grid-template-columns: repeat(2, 1fr);
    }

    .thumb-options {
        gap: 3px;
        margin-bottom: 5px;
        padding: 5px;
    }

    .thumb-label {
        font-size: 0.7em;
    }

    .thumb-btn {
        padding: 3px 7px;
        font-size: 0.65em;
    }

    /* 480px 이하에서도 3열 그리드 유지 */
    .photo-grid {
        gap: 3px;
        padding: 3px;
    }

    .photo-grid.grid-1 .grid-item {
        max-height: 150px;
    }

    .photo-grid.grid-3 .grid-item {
        max-height: 70px;
    }

    .photo-grid.grid-6 .grid-item {
        max-height: 55px;
    }

    .photo-grid.grid-9 .grid-item {
        max-height: 45px;
    }

    .grid-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9em;
    }

    .grid-info {
        font-size: 0.7em;
    }
}
