/* =============================================
   sections/experience.css (v18 - Magazine Redesign)
================================================ */

#experience {
    padding: 0 clamp(1rem, 5vw, 5rem);
    margin: 0;
    background: #1a1a1d;
    color: #fff;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#experience-intro-desktop {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3vw;
    box-sizing: border-box;
    color: #fff;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#experience-intro-desktop h2 {
    font-size: clamp(2rem, 2.5vw, 3rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-align: left;
}

#experience-intro-desktop p {
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    color: #c0c0c0;
    line-height: 1.7;
    text-align: left;
    max-width: 500px;
}

#experience.book-is-open #experience-intro-desktop {
    opacity: 0;
    transform: translateX(-30px);
    pointer-events: none;
}

/* --- 💻 Book View (Desktop & Mobile) --- */
#experience-book-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100vh;
}

#experience-book-wrapper.scaled-up {
    transform: scale(1.1);
}

#experience-book {
    height: 72vh;
    max-width: 1120px;
    max-height: 720px;
    aspect-ratio: 2 / 1.2;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    display: none;
    /* Hidden by default, shown by JS */
}

#experience-book .page {
    background-color: #fdfdfd;
    color: #333;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1);
}


/* --- NEW: Magazine Cover Styles --- */
/* (제거) Playfair Display @font-face — src 가 폰트 파일이 아니라 CSS 주소였다. 폰트는 v6-fonts.css 에서 통일한다. */

#experience-book .page--cover {
    background: url('../../assets/images/exp/cover.jpg') no-repeat center center;
    background-size: cover;
    padding: 0;
    box-shadow: inset 10px 0 25px -10px rgba(0, 0, 0, 0.7);
    transform-origin: left;
}

#experience-book .page--cover.flipped {
    transform: rotateY(-180deg);
}

.magazine-cover {
    width: 100%;
    height: 100%;
    position: relative;
    font-family: 'Pretendard', sans-serif;
    color: #fff;
    overflow: hidden;
    padding: clamp(1.5rem, 5vh, 3rem) clamp(1.5rem, 5vw, 3rem);
    box-sizing: border-box;
}

.magazine-crease {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.1) 50%, rgba(0, 0, 0, 0.4));
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    opacity: 0.6;
}

.magazine-header {
    text-align: center;
    position: relative;
    z-index: 2;
}

.magazine-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 7vmin, 3.5rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
}

.magazine-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: clamp(1rem, 2vmin, 1.3rem);
    font-weight: 500;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    padding-left: 0.5em;
    /* Compensate for letter-spacing */
}

.magazine-headline {
    position: absolute;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.magazine-headline h2 {
    font-size: clamp(1rem, 2.5vmin, 1.3rem);
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.magazine-headline p {
    font-size: clamp(0.7rem, 1.8vmin, 0.9rem);
    font-weight: 400;
    margin: 0;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

.headline-1 {
    top: 35%;
    left: clamp(1.5rem, 3vw, 2rem);
    max-width: 45%;
}

.headline-2 {
    bottom: 30%;
    right: clamp(1.2rem, 3vw, 2rem);
    text-align: right;
    max-width: 50%;
}

.headline-2 h2 {
    font-size: clamp(1rem, 2vmin, 1.5rem);
}

.headline-3 {
    bottom: 15%;
    left: clamp(1.3rem, 4vw, 2.5rem);
}

.magazine-barcode {
    position: absolute;
    bottom: clamp(1.5rem, 5vh, 3rem);
    right: clamp(1.5rem, 5vw, 3rem);
    width: 60px;
    height: 30px;
    background: repeating-linear-gradient(to right, #fff, #fff 2px, transparent 2px, transparent 4px);
    z-index: 2;
}


#experience-book .page--back-cover {
    /* ✅ 배경 이미지 추가 및 오버레이 적용 */
    background-image: linear-gradient(rgba(26, 26, 29, 0.2), rgba(26, 26, 29, 0.2)), url('../../assets/images/exp/backcover.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page .page-content-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    box-sizing: border-box;
    display: flex;
}


/* =========================== */
/*      Text Page Layouts      */
/* =========================== */

.text-page {
    padding: 3vw 3.5vw;
}

.page__video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: brightness(0.7) contrast(1.1);
}

.page__content {
    position: relative;
    z-index: 2;
    max-width: 100%;
}

.text-page.has-video .page__content {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.text-page:not(.has-video) .page__content {
    color: #2c3e50;
}

.page__content h3 {
    font-family: 'Pretendard', sans-serif;
    font-weight: 800;
    line-height: 1.3;
}

.page__content p {
    font-family: 'Pretendard', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Layout 1: Classic Centered */
.layout-text-1 {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.layout-text-1 h3 {
    font-size: clamp(1.8rem, 4vmin, 2.5rem);
    margin-bottom: 1.5rem;
}

.layout-text-1 p {
    font-size: clamp(0.9rem, 1.8vmin, 1.1rem);
    max-width: 90%;
}

/* Layout 2: Title Left, Text Right */
.layout-text-2 {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.layout-text-2 h3 {
    font-size: clamp(2rem, 4.5vmin, 3.5rem);
    margin-bottom: 2rem;
    border-bottom: 2px solid;
    padding-bottom: 1rem;
    width: 80%;
}

.layout-text-2 p {
    font-size: clamp(0.9rem, 1.7vmin, 1rem);
}

/* Layout 3: Moody Bottom-Aligned Title (REDESIGNED) */
.layout-text-3 {
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
}

.layout-text-3 .page__content {
    width: 100%;
}

.layout-text-3 h3 {
    font-size: clamp(2.5rem, 5vmin, 4rem);
    margin-bottom: 1rem;
    writing-mode: horizontal-tb;
    transform: none;
    border: none;
    padding: 0;
    height: auto;
    text-align: left;
}

.layout-text-3 p {
    font-size: clamp(0.9rem, 1.7vmin, 1rem);
    max-width: 85%;
}


/* Layout 4: Quote Style */
.layout-text-4 {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.layout-text-4 h3 {
    font-size: clamp(1.2rem, 2.5vmin, 1.5rem);
    margin-bottom: 1rem;
}

.layout-text-4 p {
    font-size: clamp(1.1rem, 2.5vmin, 1.4rem);
    font-style: italic;
    border-left: 3px solid;
    padding-left: 2rem;
}

/* Layout Sunrise: Special layout for sunrise/sunset page */
.layout-text-sunrise {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
}

.layout-text-sunrise .page__content {
    max-width: 95%;
    /* Ensure it doesn't touch the edge */
}

.layout-text-sunrise h3 {
    font-family: 'Pretendard', sans-serif;
    font-size: clamp(2.5rem, 5vmin, 3.2rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1.5rem;
}

/* Decorative line under the title */
.layout-text-sunrise h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, #e85d04, #d00000);
    /* Deep orange to red */
    border-radius: 2px;
}

/* When on video, use white gradient */
.layout-text-sunrise.has-video h3::after {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.5));
}


.layout-text-sunrise p {
    font-size: clamp(0.9rem, 1.8vmin, 1.05rem);
    max-width: 90%;
    line-height: 1.9;
    /* more spacing */
}

/* =========================== */
/*     Image Page Layouts      */
/* =========================== */

.image-page img {
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    /* For z-index stacking context on hover */
}

.image-page img:hover {
    transform: scale(1.1);
    z-index: 5;
    /* Bring hovered image above its sibling */
}

/* Layout 1: Vertical Stack with Padding */
.layout-image-1 {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.layout-image-1 img {
    width: 85%;
    height: calc(50% - 1rem);
    border-radius: 8px;
}

/* Layout 2: Overlapping Collage */
.layout-image-2 {
    position: relative;
    padding: 0;
    justify-content: center;
    align-items: center;
}

.layout-image-2 img {
    position: absolute;
    border: 5px solid white;
    border-radius: 4px;
}

.layout-image-2 img:nth-child(1) {
    width: 65%;
    height: auto;
    aspect-ratio: 4/3;
    top: 10%;
    left: 5%;
    transform: rotate(-6deg);
    z-index: 1;
}

.layout-image-2 img:nth-child(2) {
    width: 55%;
    height: auto;
    aspect-ratio: 3/4;
    bottom: 8%;
    right: 8%;
    transform: rotate(4deg);
    z-index: 2;
}

.layout-image-2 img:hover {
    transform: scale(1.08) rotate(0deg);
    z-index: 3;
}

/* Layout 3: Full-Bleed Diptych (REDESIGNED) */
.layout-image-3 {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.layout-image-3 img {
    width: 100%;
    height: 50%;
    object-fit: cover;
    border-radius: 0;
    border: none;
    box-shadow: none;
}


/* Layout 4: One Big, One Small */
.layout-image-4 {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}

.layout-image-4 img:nth-child(1) {
    width: 100%;
    height: 65%;
}

.layout-image-4 img:nth-child(2) {
    width: 100%;
    height: 35%;
}


.page .page-number {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: serif;
    font-size: 0.8rem;
    color: #999;
    z-index: 5;
    pointer-events: none;
}

/* --- NEW: Page Flip Prompt (outside book) --- */
.book-container-with-prompt {
    position: relative;
    display: flex;
    /* This makes it a flex item that shrinks/grows */
}

#experience-book {
    flex-shrink: 0;
    /* Prevent the book from shrinking inside the container */
}

.book-flip-prompt {
    position: absolute;
    bottom: -2rem;
    right: -1rem;
    color: #a0a0a0;
    font-family: 'Pretendard', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    /* Start hidden */
    animation:
        prompt-fade-in 0.5s ease 1.2s forwards,
        prompt-nudge 3s ease-in-out 2s infinite;
}

@keyframes prompt-fade-in {
    to {
        opacity: 1;
    }
}

@keyframes prompt-nudge {

    /* Double nudge within the first second (0% to 33.3%) of the 3s cycle */
    0% {
        transform: translateX(0);
    }

    /* First nudge */
    5% {
        transform: translateX(-8px);
    }

    10% {
        transform: translateX(0);
    }

    /* Second nudge */
    15% {
        transform: translateX(-8px);
    }

    20% {
        transform: translateX(0);
    }

    /* The element stays at translateX(0) from 20% to 100%, creating the pause */
    100% {
        transform: translateX(0);
    }
}

/* Hide prompt when book is open */
#experience.book-is-open .book-flip-prompt {
    opacity: 0;
    animation: none;
    /* Stop fade-in if book is opened quickly */
    transition: opacity 0.3s ease;
}


/* --- Obsolete Mobile Scroll View --- */
#experience-scroll,
#skip-edge,
#skip-toast {
    display: none;
}

/* Fallback Slider (if StPageFlip fails) */
.experience-fallback {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    max-width: 1400px;
    max-height: 900px;
    aspect-ratio: 2/1.2;
}

.fallback-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    display: flex;
}

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

.fallback-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
}

.fallback-nav-prev {
    left: 2rem;
}

.fallback-nav-next {
    right: 2rem;
}


/* --- Responsive Breakpoints --- */
@media (max-width: 1200px) {
    #experience-book-wrapper {
        margin: 0;
    }
}

/* --- Tablet View (NEW - Reverting to PC-like layout) --- */
@media (max-width: 1200px) and (min-width: 769px) {
    #experience-intro-desktop h2 {
        font-size: clamp(1.8rem, 2.2vw, 2.5rem);
    }

    #experience-intro-desktop p {
        font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    }

    #experience-book-wrapper {
        height: 100vh;
        padding: 2rem;
    }

    #experience-book {
        width: 90vw;
        height: auto;
        max-width: 1120px;
        aspect-ratio: 2 / 1.2;
    }

    #experience-book-wrapper.scaled-up {
        transform: scale(1.05);
    }

    /* Adjust font sizes inside the book for tablet */
    .magazine-title {
        font-size: clamp(2rem, 6vmin, 3rem);
    }

    .magazine-subtitle {
        font-size: clamp(0.8rem, 1.8vmin, 1.1rem);
    }

    .magazine-headline h2 {
        font-size: clamp(0.9rem, 2.2vmin, 1.2rem);
    }

    .magazine-headline p {
        font-size: clamp(0.6rem, 1.6vmin, 0.8rem);
    }

    .page__content h3 {
        font-size: clamp(1.5rem, 3vmin, 2rem);
    }

    .page__content p {
        font-size: clamp(0.8rem, 1.5vmin, 1rem);
    }
}


@media (max-width: 768px) {

    /* On mobile, hide the intro text and show the book directly */
    #experience-intro-desktop {
        display: none;
    }

    #experience-book-wrapper {
        padding: 1rem;
        position: relative;
        /* Centered by parent flex container */
        opacity: 1;
        transform: none;
        pointer-events: auto;
        transition: none;
        /* No absolute positioning or transitions needed */
    }

    #experience-book {
        height: 70vh;
        width: auto;
        max-width: calc(100vw - 40px);
        aspect-ratio: 9 / 13;
    }

    .magazine-crease {
        display: none;
    }

    .magazine-title {
        font-size: 2.5rem;
    }

    .magazine-subtitle {
        font-size: 0.8rem;
    }

    /* --- 사용자 요청: 모바일 표지 폰트 크기 조정 --- */

    /* '국내 최장 케이블카', '해발 1,458m...' 문구 폰트 크기 축소 (빨간 밑줄 부분) */
    .magazine-headline.headline-1 h2,
    .magazine-headline.headline-2 h2 {
        font-size: 1rem;
        /* 기존 0.63rem 에서 축소 */
    }

    /* '대자연이 만든...', '구름이 머무는...' 문구 폰트 크기 확대 (파란 밑줄 부분) */
    .magazine-headline.headline-1 p,
    .magazine-headline.headline-3 p {
        font-size: 0.8rem;
        /* 기존 0.49rem 에서 약 2배 확대 */
    }

    .page {
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    }

    .page .page-content-wrapper {
        padding: 1.5rem;
    }

    .page__content h3 {
        font-size: 1.3rem;
    }

    .page__content p {
        font-size: 0.85rem;
    }

    .text-page {
        padding: 1.5rem;
    }

    .layout-text-2 h3 {
        width: 100%;
    }

    .layout-text-3 {
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
    }

    .layout-text-3 h3 {
        writing-mode: horizontal-tb;
        transform: none;
        border-right: none;
        border-bottom: 2px solid;
        height: auto;
        width: 100%;
        text-align: left;
        padding-right: 0;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .layout-image-1 {
        padding: 1rem;
        gap: 1rem;
    }

    .layout-image-1 img {
        width: 100%;
        height: calc(50% - 0.5rem);
    }

    .layout-image-2 img:nth-child(1) {
        width: 70%;
        top: 5%;
        left: 5%;
    }

    .layout-image-2 img:nth-child(2) {
        width: 60%;
        bottom: 5%;
        right: 5%;
    }

    .layout-image-3 {
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .layout-image-3 img {
        width: 100%;
        height: 50%;
    }

    .layout-image-4 {
        padding: 1rem;
        gap: 1rem;
    }

    #experience-book-wrapper {
        display: flex;
    }

    .book-flip-prompt {
        font-size: 0.9rem;
        bottom: -2rem;
        right: -0.5rem;
    }
}

/* --- NEW: Back Cover with CI Logo --- */
.back-cover-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* ✅ 로고를 수직 중앙에 배치 */
    align-items: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.8;
    width: 100%;
    height: 100%;
    position: relative;
    /* ✅ 자식 요소의 절대 위치를 위한 기준점 */

}

.back-cover-logo {
    width: 400px;
    /* ✅ 이 값을 조절하여 너비를 변경하세요 */
    height: 400px;
    /* ✅ 이 값을 조절하여 높이를 변경하세요 */
    background-image: url('../../assets/images/ci.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    /* Convert black logo to white using filters */
    filter: brightness(0) invert(1);
}

.back-cover-text {
    position: absolute;
    /* ✅ 절대 위치로 변경 */
    bottom: 1rem;
    /* ✅ 하단으로부터의 여백 */
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.1em;

}

/* --- NEW: Adjust video text size on PC --- */
@media (min-width: 769px) {

    /* PC 뷰에서 비디오 위 텍스트 크기 조정 */
    .text-page.has-video .page__content h3 {
        /* 기존 폰트 크기의 약 50%로 축소 */
        font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    }

    .text-page.has-video .page__content p {
        /* 기존 폰트 크기의 약 50%로 축소 */
        font-size: clamp(0.8rem, 1vw, 1rem);
    }
}