/* ---------------------------------------- 기본 페이지 영역 ---------------------------------------- */

.page { /* 메인 콘텐츠 영역 */  
    width: 100%;
    /* border: 1px solid #ccc; */
}

.page-contents-area {
    width: 100%;
    padding: 100px 0px 50px 0px;
}

/* ---------------------------------------- 콘텐츠 타이틀 영역 ---------------------------------------- */

.page .subtitle {
    width: 100%;
    display: flex;
    position: relative;

    justify-content: center;
    flex-direction: column;
    padding: 0;
    margin: 0;


    background-image: url('/img/background/Background02.png');
    background-position: center; /* 이미지를 중앙에 배치 */
    background-repeat: no-repeat;
    background-size: cover;
    border-bottom: 1px solid #ccc;

    /* border: 1px solid #ccc; */
    z-index: 1;
}

.page .subtitle::before {
    content: "";
    width: 100%;
    height: 150%;
    position: absolute;
    bottom: 0;
    left: 0;

    background: linear-gradient(to top, #ffffff, transparent);

    z-index: 2;
}

.page .subtitle .contents-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    margin: 250px 0px 40px 0px;
    /* border: 1px solid #ccc; */
    z-index: 999;
}

.page .subtitle .contents-level {
    width: 10%;
    display: block;
    padding: 2px 10px;
    margin-top: 50px;
    margin-bottom: 150px;

    text-align: center;
    font-size: 120%;
    font-weight: 600;
    border: 2px solid #000000;
}

.page .subtitle .contents-subtitle {
    display: flex;
    align-items: center;
}

.page .subtitle .contents-title-text {
    display: flex;
    text-align: center;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

    padding: 0px 50px;

    /* border: 1px solid #ccc; */
}

.page .subtitle h1 {
    font-size: 40px;
}

.page .subtitle h2 {
    font-size: 150%;
    font-weight: 300;
    color: #000000;
}

.page .subtitle img {
    width: auto;
    height: 40px;
    display: inline-block;
    /* margin: auto 0; */
}

.page .page-contents-01 {
    margin-top: 200px;
    padding: 0px 5%;
}

.page .contents-menu-type {
    /* height: 100px; */

    display: flex;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    /* border: 1px solid #ccc; */

    z-index: 999;
}

.page .contents-menu-type .bar {
    width: 3%;
    height: 3px;
    background-color: #2f8f7a;
    text-align: center;
}

.page .contents-menu-type h3 {
    font-size: 120%;
    font-weight: 300;
    color: #000000;

    padding: 30px 0px 30px 0px;
}

/* ---------------------------------------- 페이지 서브메뉴 영역 ---------------------------------------- */

.page .subMenu {
    display: block;
    justify-content: space-between;

    /* border: 1px solid #ccc; */
}

.page .subMenu ul {
    width: 100%;
    display: flex;
    list-style-type: none;

    padding: 0px 15%;
    
}

.page .subMenu ul li {
    width: 50%;
    
    display: flex;
    position: relative;
    text-align: left;
    margin: 20px;

    border: 1px solid rgb(202, 202, 202);
}

.page .subMenu ul li a {
    width: 100%;
    height: 600px;

    display: flex;
    overflow: hidden;
    position: relative; /* 가상 요소의 기준점 설정 */
    
    flex-direction: column;
    justify-content: flex-end;

    text-decoration: none;

    /* border: 1px solid #ccc; */
}

.page .subMenu ul li a div {
    width: 100%;

    display: flex;
    flex-direction: column;

    padding: 20px;
    z-index: 99;
}

@media screen and (min-width: 1025px) {
    .page .subMenu ul li .book div {
        background: linear-gradient(to left, #ffffff 50%, #2f8f7a 50%);
        background-size: 200% 100%;
        background-position: 100% 0; 
        transition: background-position 0.2s ease;
    }
    
    .page .subMenu ul li .pronunciation div {
        background: linear-gradient(to right, #ffffff 50%, #c74756 50%);
        background-size: 200% 100%;
        background-position: 0 0; 
        transition: background-position 0.2s ease;
    }
}

@media (hover: hover) {
    .page .subMenu ul li .book:hover div {
        background-position: 0 0;
    }

    .page .subMenu ul li .pronunciation:hover div {
        background-position: 100% 0;
    }

    .page .subMenu ul li a:hover span {
        color: #ffffff;
        transition: all 0.1s ease-in-out;
    }
}

.page .subMenu ul li a .tag {
    margin-bottom: 10%;

    display: block;
    color: rgb(159, 159, 159);
    font-size: 80%;
    font-weight: 500;
}

.page .subMenu ul li a .kor {
    color: #000000;

    font-size: 250%;
    font-family: nanum gothic bold, sans-serif;
}

.page .subMenu ul li a .eng {
    color: #000000;

    font-size: 150%;
    font-weight: 100;
}

.page .subMenu ul li .book::before, .page .subMenu ul li .pronunciation::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    /* opacity: 0.8; */
    
    z-index: -888;
    transition: all 0.2s ease-in-out;
}

.page .subMenu ul li .book::before {
    background-image: url('/page/img/book.jpg');
}

.page .subMenu ul li .pronunciation::before {
    background-image: url('/page/img/pronunciation.jpg');
}

@media (hover: hover) {
    .page .subMenu ul li:hover .book::before, .page .subMenu ul li:hover .pronunciation::before{
        opacity: 1;
        transform: scale(1.05);
        background-color: transparent;
        transition: all 0.2s ease-in-out;
    }
}

.page-contents-02 {
    width: 100%;
    position: relative; /* 자식 요소들의 기준점 */
    overflow: hidden;
}

.page-contents-02 .page-contents-img {
    width: 100%;
    /* [핵심] 고정 높이 대신 비율 설정 (PC 기준 16:9) */
    aspect-ratio: 16 / 9; 
    height: auto;

    display: block;
    position: relative;
    
    background-image: url('/img/background/Background08.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    
    /* z-index는 -999보다 배경 역할을 하도록 1로 설정하는 것이 디버깅에 유리합니다 */
    z-index: 1;
}

/* 상단 흰색 배경과 자연스럽게 이어지는 그라데이션 */
.page-contents-02::before {
    content: "";
    width: 100%;
    height: 40%; /* 그라데이션 높이 조절 */
    position: absolute;
    top: 0; /* 위에서부터 아래로 */
    left: 0;

    /* 하단으로 갈수록 투명해지도록 설정 */
    background: linear-gradient(to bottom, #ffffff 10%, transparent 100%);

    /* 이미지(z-index: 1) 위에 얹혀야 하므로 수치 조정 */
    z-index: 2;
}

.page-contents-03 {
    width: 100%;
    height: 500px;
    display: flex;
    position: relative;

    justify-content: center;
    flex-direction: column;

    /* z-index: -999;
    
    background-image: url('/img/background/Background06.png');
    background-position: center; 
    background-repeat: no-repeat;
    background-size: cover; */
}

/* ---------------------------------------- Book 콘텐츠 영역 ---------------------------------------- */


.page .content-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0px 70px;
    flex: 1;
}

.page .content-image img {
    display: block;
    width: 60%;
}

.chapter-slide img {
    display: block;
    width: 70%; /* 기존에 설정하신 너비 유지 */
    height: auto;
    object-fit: contain; /* 이미지 비율 유지 */
}


/* ---------------------------------------- Pronunciation 콘텐츠 영역 ---------------------------------------- */

.page #pronunciation-area {
    display: flex;
    position: relative;
    width: 100%;
    padding: 0px 70px;
    justify-content: center;
}

/* 1. 부모 컨테이너를 Flexbox로 설정 */
.page .flex-container {
    display: flex;
    flex-wrap: wrap; /* 핵심: 항목이 넘치면 다음 줄로 자동 줄바꿈 */
    gap: 1px;       /* 항목 사이의 간격 */
    justify-content: flex-start; /* 왼쪽부터 채우기 */
}

.chapter-slider-wrapper {
    width: 100%;

    display: flex;             /* 챕터들을 가로로 나열 */
    overflow-x: auto;          /* 가로 스크롤 허용 */
    scroll-snap-type: x mandatory; /* 가로 방향 스냅 강제 설정 */
    -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
    gap: 20px;                 /* 챕터 사이 간격 */
    padding-bottom: 20px;      /* 하단 스크롤바 공간 */
    align-items: stretch;

    /* 스크롤바 숨기기 (표준) */
    scrollbar-width: none; 
    /* 스크롤바 숨기기 (IE/Edge) */
    -ms-overflow-style: none; 
}

.chapter-slider-wrapper::-webkit-scrollbar {
    display: none;
}

/* 2. 슬라이드 한 섹션 (제목 + 그리드) */
.chapter-slide {
    flex: 0 0 100%;             /* 정확히 화면 너비만큼만 차지 */
    width: 100%;                /* 너비 고정 */
    min-width: 100%;      /* 챕터가 하나여도 무조건 화면 너비 100% 차지 */
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;     /* 패딩이 너비에 포함되도록 설정 */
}

.page .chapter-slide h1 {
    display: block;
    color: #2f8f7a;
    font-size: 25px;
    border: 2px solid #2f8f7a;
    padding: 10px 15px;
    margin: 30px auto;        /* 슬라이드 내부 중앙 정렬 */
    width: fit-content;
}   

.chapter-grid-container {
    width: 100%;
    display: grid; /* Flexbox 대신 Grid 사용 */ 
    grid-template-columns: repeat(var(--items-per-row-desktop, 10), 1fr);

    box-sizing: border-box; 
    margin-bottom: 30px;
}

/* 2. 개별 항목(itemBox)의 크기 설정 */
.chapter-grid-container .pron-item-box {

    border: 1px solid #fac963;

    display: flex;
    text-align: center;
    flex-direction: column; /* 자식 요소들을 세로 방향으로 정렬 */
    align-items: center;    /* 가로축 중앙 정렬 */
    justify-content: center;/* 세로 중앙 정렬 */

    /* 데스크톱 itemsPerRow 만큼 너비 설정 */
}

/* P 요소 스타일링 */
.word-text {
    width: 100%;
    padding: 8px 0;
    margin: 0;

    color: black;
    font-size: 50px;
    font-weight: bold;
    font-family: nanum gothic extrabold, sans-serif;
    /* border: 1px solid #ccc; */
}

/* 오디오 없는 박스 배경색 */
.pron-item-box.no-audio {
    background-color: #e1e1e1 !important; /* 회색 배경 */
    border: 1px solid rgb(167, 167, 167);
}

.pron-item-box.no-audio .play-audio-btn {
    background-color: rgb(167, 167, 167); /* 버튼도 회색으로 변경 */
    border: none;
    cursor: help; /* 마우스 커서 기본으로 변경 */
    pointer-events: auto; /* 클릭 이벤트 완전 차단 */
}

.pron-item-box.no-audio .play-audio-btn img {
    opacity: 0.6; /* 이미지도 반투명하게 */
}

.has-tooltip p {
    color: red;
}

.play-audio-btn {
    width: 100%;
    height: 30px;

    border: none;
    cursor: pointer; /* 마우스 오버 시 손가락 모양 */
    padding: 5px;
    margin: 0px;
    /* opacity: 0.5; */
    background-color: #fac963;
    /* border-radius: 5px; */
    transition: all 0.2s ease-in-out;
}

@media (hover: hover) {
    .play-audio-btn:hover {
        /* border: 1px solid #2f8f7a; */
        background-color: #2f8f7a; /* 호버 효과 */
    }
}

/* 버튼 안의 이미지 크기 설정 */
.play-audio-btn img {
    width: 20px; /* 이미지 크기 조절 */
    height: auto;
    display: block;

    margin: 0px auto;
}

/* 화살표 공통 스타일 */
.slide-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000; /* 슬라이드보다 위에 위치 */
    color: #2f8f7a;
    border: none;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
    background-color: transparent;

    opacity: 1;
    visibility: visible;
}

/* JS에서 opacity가 0이 되었을 때의 상태 */
.slide-nav-btn[style*="opacity: 0"] {
    visibility: hidden; /* 완전히 투명해지면 숨김 처리 */
}

.slide-nav-btn:hover {
    color: #c74756;
}

.slide-nav-btn.next {
    padding-left: 20px;
}

.slide-nav-btn.prev {
    padding-right: 20px;
}

.slide-nav-btn:hover.next {
    padding-left: 40px;
}

.slide-nav-btn:hover.prev {
    padding-right: 40px;
}

.slide-nav-btn.prev {
    left: 0px; /* #pronunciation-area의 왼쪽 끝 */
}

.slide-nav-btn.next {
    right: 0px; /* #pronunciation-area의 오른쪽 끝 */
}

.page-numbers-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 8px;
    row-gap: 10px;
    margin-bottom: 20px;
    min-height: 30px; /* 번호가 다시 그려질 때 높이 깜빡임 방지 */
}

.page-num-item {
    cursor: pointer;
    font-size: 16px;
    color: #999;
    min-width: 20px;
    text-align: center;
    transition: color 0.2s;
}

.page-num-item.active {
    color: #2f8f7a;
    font-weight: bold;
    text-decoration: underline; /* 현재 위치 강조 */
}

/* 구분선 스타일 */
.page-divider {
    color: #ddd;
    font-size: 14px;
    pointer-events: none;
    user-select: none;
}
