@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100..900&display=swap');

/* 스크롤바 숨기기 */
.thumbnail-grid::-webkit-scrollbar, 
.image-scroll-wrapper::-webkit-scrollbar,
.name-grid::-webkit-scrollbar, 
.guestbook-list::-webkit-scrollbar,
.detail-description::-webkit-scrollbar,
#credit-page::-webkit-scrollbar {
    display: none; 
    width: 0 !important; 
    height: 0 !important; 
}

.thumbnail-grid,
.image-scroll-wrapper,
.name-grid,
.guestbook-list,
.detail-description,
#credit-page {
    -ms-overflow-style: none; 
    scrollbar-width: none;
}

:root {
    --border-color: #D4D9DD;
    --bg-color-left: #FAFDFF;
    --bg-color-right: #D4D9DD;
    --text-color: #030D14;
    --header-height: 100px;
    --hr-color: #030D14; 
}

@font-face {
    font-family: "ABCGrow-C-Trial";
    src: url("./ABCGrow-C-Trial.woff") format("woff");
    unicode-range: U+0020-007E; 
    font-style: normal;
}

body {
    font-family: "ABCGrow-C-Trial","Noto Sans KR", sans-serif;
    margin: 0;
    background-color: #FAFDFF;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-color);
}

.header {
    width: 100%;
    height: var(--header-height);
    padding: 15px 30px;
    box-sizing: border-box;
    background-color: var(--bg-color-left);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header hr {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    border: none;
}

.logo-area {
    position: relative;
    top: 5px;
    left: 5px;
}

.logo-image-area {
    width: 150px;
    aspect-ratio: 2 / 1.27;
    max-height: calc(var(--header-height) - 10px);
    margin-bottom: 0px;
    display: flex;
    justify-content: left;
    align-items: left;
}

.logo-image-area .logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.header-icons {
    display: flex;
    gap: 20px;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.icon-box {
    aspect-ratio: 1 / 0.67;
    top: 5px;
    width: 75px;
    height: auto;
    margin-bottom: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-box .icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.main-content {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-height));
}

.left-panel {
    width: 50%;
    padding: 30px;
    background-color: var(--bg-color-left);
    border-right: 1px solid var(--border-color);
    overflow-y: auto; 
    height: 100%;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
}

.left-panel hr {
    width: calc(100%);
    margin: 0px 0 20px 0;
    border: none;
    border-bottom: 2px solid var(--hr-color);
}

.left-panel .bottom-hr {
    margin-top: 20px;
    margin-bottom: 0px;
}

.right-panel {
    width: 50%;
    background-color: var(--bg-color-right);
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-sizing: border-box;
    height: 100%;
    position: relative;
}

.right-panel hr {
    width: calc(100%);
    margin: 0px 0 20px 0;
    border: none;
    border-bottom: 2px solid var(--hr-color);
}

.right-panel .bottom-hr {
    margin-top: 20px;
    margin-bottom: 0px;
}

/*art*/
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex-grow: 1; 
    overflow-y: auto; 
    padding-bottom: 20px;
}

.thumbnail-item {
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1em;
    font-weight: bold;
    line-height: 1.2;
    padding: 5px;
    cursor: pointer; 
}

.thumbnail-item .thumb-number { display: none; }
.thumbnail-item .thumb-name { color: var(--text-color); margin-bottom: 3px; }
.thumbnail-item .target-text { font-size: 1em; font-weight: bold; color: #030D14; }
.thumbnail-item:hover, .thumbnail-item.active { background-color: #D4D9DD; }
.thumbnail-item img { display: none; }

.artwork-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex; 
    gap: 10px;
    align-items: baseline; 
}

.artwork-title .eng-title {
    font-size: 1.1em; 
    font-family: "ABCGrow-C-Trial", sans-serif; 
    position: relative;
}

/* PC 기본 스타일 */
.main-image-container {
    width: 100%;
    height: 50%;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.image-scroll-wrapper {
    display: flex;
    overflow-x: auto; 
    gap: 20px; 
    padding-bottom: 10px; 
    width: 100%; 
    height: 100%; 
    align-items: center; 
    -webkit-overflow-scrolling: touch; 
}

.main-artwork-item {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%; 
    width: auto; 
    flex-shrink: 0;
}

.main-artwork-item img {
    width: auto;
    height: auto;
    max-width: 100%;  
    max-height: 100%; 
    object-fit: contain; 
    display: block;
}

.main-artwork-item iframe {
    height: 100%;           
    aspect-ratio: 16 / 9;   
    border: none;
    display: block;
}

.detail-description {
    width: 100%;
    flex: 1;
    padding: 20px 0;
    color: var(--text-color);
    font-size: 1em;
    font-weight: 500;
    text-align: left;
    line-height: 1.8;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    margin-top: auto; 
}

.artwork-meta {
    font-size: 0.9em;  
    font-weight: 300;    
    margin-bottom: 6px;    
    font-weight: normal;
    line-height: 1.5;
}

.artwork-info {
    font-size: 0.9em;
    color: var(--text-color);
    margin-top: 20px;       
    padding-top: 10px;
    line-height: 1.4;
     font-weight: 300;  
    white-space: pre-wrap;  
}

.placeholder {
    color: #D4D9DD;
    font-size: 1.2em;
    text-align: center;
}

/*guest*/
.name-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex-grow: 1;
    overflow-y: auto; 
    padding-bottom: 20px; 
}

.name-item {
    cursor: pointer;
    overflow: hidden;
    transition: border 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1em;
    font-weight: bold;
    line-height: 1.4;
    padding: 5px;
}

.name-item span.target-text {
    font-size: 1em;
    font-weight: bold;
}

.name-item:hover, .name-item.active {
    background-color: #D4D9DD;
}

.guestbook-form-area {
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 0; 
}

.form-content-wrapper {
   position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
    z-index: 2;
}

.form-background-container {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    overflow: hidden;
    min-height: 250px
}

.form-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    z-index: 10;
}

.form-elements input, .form-elements select, .form-elements textarea, .form-elements button {
    font-family:  'ABCGrow-C-Trial', 'Noto Sans KR', sans-serif; 
    font-size: 1em;
    padding: 5px;
    margin: 5px 0;
    border: 1px solid var(--hr-color);
    background-color: #D4D9DD;
}

.form-elements textarea {
    flex-grow: 1;
    resize: none;
    min-height: 30px;
}

.form-elements .form-line {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 1em;
    font-weight: bold;
}

.form-elements .form-line input, .form-elements .form-line select {
    border: none;
    border-bottom: 2px solid var(--hr-color);
    margin: 0 2px;
    text-align: center;
    flex: 1;
}

.guestbook-list-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0; 
}

.guestbook-list-title {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 15px;
}

.guestbook-list {
    flex-grow: 1;
    overflow-y: auto;
    border-top: 2px solid var(--hr-color);
    padding-top: 10px;
}

.guestbook-item {
    padding: 10px 0;
    border-bottom: 1px dashed #FAFDFF;
}

.guestbook-item:last-child {
    border-bottom: none;
}

.item-header {
    font-weight: bold;
    margin-bottom: 5px;
}

.item-content {
    font-size: 0.9em;
    line-height: 1.4;
}

/*랜딩*/
#landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color-left); 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden; 
}

.intro-text-container {
    width: 100%;
    overflow: hidden; 
    text-align: center;
    position: absolute; 
    top: 50%;
    transform: translateY(-50%); 
}

.intro-text {
    font-family: "ABCGrow-C-Trial","Noto Sans KR", sans-serif;
    font-size: 2em; 
    color: var(--text-color);
    white-space: nowrap; 
    display: inline-block; 
    animation: slide-in-out 4s linear forwards;
    padding: 0 20px; 
}

@keyframes slide-in-out {
    0% { transform: translateX(100vw); opacity: 1; }
    100% { transform: translateX(-100%); opacity: 1; }
}

.landing-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999; 
    pointer-events: none; 
    transition: opacity 0.5s ease-in-out;
}

.landing-content .logo-image-area {
    width: 60%;
    max-width: 600px;    
    height: auto;
    max-height: none !important; 
    aspect-ratio: auto !important;
    cursor: pointer;
    margin: 0 auto;
    padding: 20px;
}

.landing-content .logo-image {
    width: 100%;
    height: auto;
    display: block;
}

/* --- [중요] Credit Page Styles (PC 기본) --- */
/* 모바일 @media 보다 무조건 위에 있어야 함 */
#credit-page {
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--bg-color-left);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* 위에서부터 시작 */
    overflow-y: auto; 
    animation: fadeIn 0.5s ease;
}

.credit-container {
    text-align: center;
    padding: 30px 20px 100px 20px; 
    max-width: 700px;
    width: 100%;
    box-sizing: border-box;
    height: auto; 
}

.main-title {
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.4;
    word-break: keep-all; 
}

.credit-text h2 {
    font-size: 0.9em;
    margin-bottom: 40px;
    font-family: "ABCGrow-C-Trial", sans-serif;
}

.credit-list p {
    font-size: 0.8em;
    line-height: 1.8;
    margin-bottom: 30px;
}

.credit-logo-area {
    width: 150px;
    margin: 50px auto 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.credit-logo-area:hover {
    transform: scale(1.1);
}

.credit-logo-area img {
    width: 100%;
    height: auto;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 이미지 확대 모달 (Lightbox) 스타일 --- */
.image-modal {
    display: none; 
    position: fixed; 
    z-index: 20000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.55); 
    backdrop-filter: blur(5px);
}

.modal-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-media-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-media-container img, 
#modal-media-container iframe {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
#modal-media-container iframe {
    width: 80%;
    aspect-ratio: 16 / 9;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 20001;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 20001;
}

.next { right: 0; border-radius: 3px 0 0 3px; }
.prev { left: 0; border-radius: 3px 0 0 3px; }
.prev:hover, .next:hover { background-color: rgba(0, 0, 0, 0.8); }


/* --- [최종] 모바일 반응형 (화면 너비 768px 이하) --- */
/* [중요] 미디어 쿼리는 항상 파일의 맨 끝에 있어야 합니다! */
@media (max-width: 768px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden !important;
    }

    :root {
        --header-height: 60px;
    }

    .header {
        height: var(--header-height);
        padding: 0 10px; 
        justify-content: space-between;
        width: 100%;
        box-sizing: border-box; 
    }

    .header .logo-image-area {
        width: 90px;
        height: auto;
        flex-shrink: 0; 
    }

    .header-icons {
        gap: 5px;
        flex-shrink: 0; 
    }

    .icon-box {
        width: 38px;
        height: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .main-content {
        flex-direction: column-reverse;
        height: auto;
        min-height: calc(100dvh - var(--header-height));
    }

    .left-panel, .right-panel {
        width: 100%;
        height: auto;
        border-right: none;
        padding: 15px; 
        box-sizing: border-box;
    }

    .left-panel {
        border-top: 2px solid var(--border-color);
        max-height: 400px;
    }
    
    .thumbnail-grid {
         grid-template-columns: repeat(3, 1fr);
    }

    .thumbnail-item {
        word-break: keep-all; 
        font-size: 0.9em;    
    }

    .header hr {
        display: none;
    }
    
    .intro-text {
        font-size: 1.5em; 
        white-space: nowrap !important;
        animation-duration: 4s;
    }
    
    .landing-content .logo-image-area {
        width: 60%;
        max-width: 200px;
        max-height: none !important; 
        aspect-ratio: auto !important;
    }

    /* 이미지 크기 고정 */
    .main-image-container {
        height: 350px !important;
        min-height: 350px !important;
        max-height: 350px !important;
        flex: none !important;
        margin-bottom: 20px;
    }

    .image-scroll-wrapper {
        height: 100% !important;
    }

    .main-artwork-item {
        height: 100% !important;
        width: auto !important;
    }

    .main-artwork-item img, 
    .main-artwork-item iframe {
        max-height: 100% !important;
        width: auto !important;
        object-fit: contain !important;
    }

    .detail-description {
        flex: 1;
        overflow-y: auto;
    }

    /* [중요] 크레딧 페이지 모바일 수정 (화면 안 나가게) */
    #credit-page {
        align-items: flex-start; /* 모바일은 위에서부터 시작 */
        height: auto;
        min-height: calc(100dvh - 60px);
        padding-bottom: 50px;
    }

    .credit-container {
        width: 100% !important; /* 강제로 화면 꽉 채움 */
        max-width: 100% !important; /* 넘침 방지 */
        padding: 40px 20px !important;
        box-sizing: border-box; /* 패딩 포함 너비 계산 */
        text-align: center !important; /* 중앙 정렬 강제 */
    }

    .main-title { font-size: 1.4em; }
    .sub-title { font-size: 1.2em; }
    
    /* 긴 텍스트 줄바꿈 및 정렬 */
    .credit-description-text { 
        text-align: left; 
        text-align-last: left; 
        word-break: keep-all;
    }
    
    .staff-row { display: flex; flex-direction: column; margin-bottom: 15px; }
    .staff-row strong { margin-bottom: 2px; color: #888; font-size: 0.9em; }
    
    .prev, .next {
        font-size: 20px;
        padding: 10px;
    }
    #modal-media-container iframe {
        width: 95%;
    }
}

/* --- 인포 영역 웹링크 스타일 --- */
.info-web-link {
    display: inline-block; /* 줄바꿈 적용 */
    margin-top: 8px;       /* 인스타 아이디와 간격 */
    color: var(--text-color);
    text-decoration: none; /* 밑줄 제거 */
    font-weight: bold;     /* 글자 굵게 */
    font-size: 0.9em;
    border-bottom: 1px solid var(--text-color); /* 얇은 밑줄 */
    padding-bottom: 2px;
    cursor: pointer;
}

.info-web-link:hover {
    color: #555;
    border-bottom-color: #555;
}