/* ----- Main Manual Content Container ----- */
.manual-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 120px 40px;
    position: relative;
    isolation: isolate;
}

/* 분리된 배경 이미지용 클래스 */
.manual-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../../images/manual_images/manual_background.svg') no-repeat center center;
    background-size: cover;
    /* filter: grayscale(10%) blur(0px); */
    opacity: 1;
    z-index: -1;
    pointer-events: none;
    /* 배경 이미지는 그대로, 검은 오버레이는 ::after로 처리 */
}

.manual-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
}


/* ----- Header Section ----- */
.manual-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* 변경: 콘텐츠를 상단 정렬 */
    margin-bottom: 120px; /* 하단 마진 증가 */
    position: relative;
    top: 40px;
    color: white;
}

.main-content-text h2:lang(ko) {
    font-family: 'Pretendard', sans-serif;
}

.main-content-text h2:lang(en) {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.manual-header-left {
    flex: 1;
    min-width: 300px;
}

.manual-header-right {
    flex: 1;
    max-width: 600px;
    padding-top: 30px;
    padding-right: 150px;
}

.manual-header h1 {
    font-size: 70px; /* 폰트 크기 조정 */
    font-weight: 900;
    margin-bottom: 16px; /* 마진 조정 */
    line-height: 1.1; /* 줄 간격 조정 */
    font-family: 'Plus Jakarta Sans', sans-serif;

}

.manual-header .sub-title {
    font-size: 25px; /* 폰트 크기 조정 */
    font-weight: 500; /* 폰트 두께 조정 */
    color: #888; /* 폰트 색상 변경 */
    margin-bottom: 24px;
}

.manual-header .sub-title:lang(ko) {
    font-family: 'Pretendard', sans-serif;
}

.manual-header .sub-title:lang(en) {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* 오른쪽 섹션 h2 스타일 추가 */
.manual-header-right h2 {
    font-size: 54px;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.3;
}

.manual-header-right h2:lang(ko) {
    font-family: 'Pretendard', sans-serif;
}

.manual-header-right h2:lang(en) {
    font-family: 'Plus Jakarta Sans', sans-serif;
}


.manual-header .description {
    font-size: 18px; /* 폰트 크기 조정 */
    line-height: 1.8; /* 줄 간격 조정 */
    color: #ffffff; /* 폰트 색상 조정 */
    word-break: keep-all;
    /* text-align: justify; */
    text-align: justify;
}

.manual-header .description:lang(ko) {
    font-family: 'Pretendard', sans-serif;
}

.manual-header .description:lang(en) {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ----- Manual Grid Layout ----- */
.manual-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* ----- Individual Manual Item ----- */
.manual-item {
    /* position: relative; */
    cursor: pointer;
    display: block;
    /* object-fit: contain; */
    /* box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); */ /* 그림자 제거 */
    /* background-color: #fff; */ /* 배경색 제거 */
    text-decoration: none;
}

.manual-item-image-wrapper {
    overflow: hidden;
}

.manual-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.manual-item:hover img {
    transform: scale(1.05);
}

.manual-item-content {
    padding: 0px 0px; /* 상하 여백 추가 */
    display: flex;
    align-items: center;
    transition: none;
    position: relative; /* 자식 요소의 위치 기준으로 설정 */
    justify-content: space-between; /* 텍스트와 아이콘 공간 확보 */
}

.manual-item-text h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff; /* 흰색 유지 */
    margin-bottom: -15px; /* 원하는 간격(px)으로 조절 */
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.manual-item-text p {
    font-size: 0.9rem;
    color: #cccccc; /* 연한 회색 유지 */
    font-family: 'Plus Jakarta Sans', sans-serif;

}

.plus-icon {
    position: absolute; /* 절대 위치 유지 */
    top: -20px; /* 상위 요소의 세로 중앙 */
    right: 0px; /* 오른쪽에 배치 */
    transform: translateY(-50%); /* 정확한 세로 중앙 정렬 */
    width: 40px;
    height: 40px;
    background-color: #111111;
    color: white;
    border-radius: 0%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.manual-item:hover .plus-icon {
    transform: translateY(-50%) rotate(90deg);
}
/* ----- Popup Styles ----- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-window {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 1400px;
    height: 90%;
    max-height: 800px;
    background-color: #fff;
    border-radius: 0px;
    z-index: 1001;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.popup-overlay.active .popup-window {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.popup-window.has-background {
    background-size: cover;
    background-position: center;
    color: white; /* 텍스트 색상을 흰색으로 변경 */
    
}

.popup-window.has-background .popup-text {
    flex: 1; /* 텍스트 영역이 전체 너비를 차지하도록 설정 */
    color: rgb(255, 255, 255);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5); /* 텍스트 가독성을 위한 그림자 */
}

.popup-window.has-background .popup-title-container h3,
.popup-window.has-background .popup-title-container h2,
.popup-window.has-background .popup-category {
    color: white;
}

.popup-window.has-background #popup-close {
    color: white;
}

.popup-window.tsb-popup .popup-description{
    color: #ffffff;
    max-width: 380px;

}

.popup-window.erg-popup .popup-description {
    color: #ffffff;
    max-width: 380px;

}


/* 기술통신문, 긴급대응가이드 팝업 텍스트 색상 지정 */

/* 모바일 환경에서 ERG, TSB 팝업의 popup-description 색상 및 shadow 적용 */
@media (max-width: 768px) {
    .popup-window.tsb-popup .popup-description,
    .popup-window.erg-popup .popup-description {
          color: #ffffff !important;
          /* 더 강한 검은색 테두리 효과의 shadow 적용 */
          text-shadow:
                0 0 2px #000,
                0 0 4px #000,
                0 1px 0 #000,
                0 -1px 0 #000,
                1px 0 0 #000,
                -1px 0 0 #000;
    }
}

.popup-window.tsb-popup .popup-title-container h3,
.popup-window.erg-popup .popup-title-container h3 {
    color: black;
    text-shadow: none; /* 제목에는 그림자 제거 */
}


.popup-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
}

#popup-close {
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: #888;
}

.popup-content {
    padding: 0 40px 40px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    gap: 30px;
}

.popup-text {
    flex: 0.6;
}

.popup-text h2 {
    font-size: 1.1rem;
    color: #B1B1B1;
    font-weight: bold;
    margin-bottom: 5px;
}
.popup-text h3 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 20px;
}
.popup-text p {
    font-size: 1rem;
    line-height: 1.7;
    color: #888888;
    word-break: keep-all;
    text-align: left;
}

/* .popup-description {
    font-size: 0.9rem;
    text-align: justify;

} */

.popup-media {
    flex: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.popup-media.padded-top {
    padding: 160px 0 0;
}

/* LTS 팝업 이미지 위치 조정을 위한 스타일 */
.popup-media.lts-image-container {
    /* 원하는 상단 여백(padding-top)으로 조절하여 이미지 위치를 변경할 수 있습니다. */
    padding-top: 100px; 
}

.popup-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.popup-media-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    height: 100%;
    align-content: center;
}

.popup-media-grid .main-image {
    width: 100%;
    border-radius: 8px;
}

.popup-media-grid .sub-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.popup-media-grid .sub-images img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #eee;
}

.popup-media-etm {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-media-etm img {
    position: absolute;
    max-width: 80%;
    max-height: 80%;
}

.popup-media-etm .etm-image-1 {
    transform: rotate(0deg) translate(20%, -15%);
    z-index: 1;
}

.popup-media-etm .etm-image-2 {
    transform: rotate(0deg) translate(-20%, 15%);
    z-index: 2;
}

.popup-media-column {
    --image-overlap: 100px; /* 겹침 정도를 조절하는 변수 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 80%;
    padding-bottom: var(--image-overlap); /* 아래쪽 여백 추가 */
}

.popup-media-column img {
    top: 60px;
    width: 95%;
    border-radius: 8px;
    border: 1px solid #eee;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative; /* z-index 적용을 위해 필요 */
}

.popup-media-column img:not(:first-child) {
    margin-top: calc(-1 * var(--image-overlap));
}

/* 이미지가 겹쳤을 때 위로 올라오는 순서 조정 */
.popup-media-column img:nth-child(1) { z-index: 1; }
.popup-media-column img:nth-child(2) { z-index: 2; }
.popup-media-column img:nth-child(3) { z-index: 3; }


/* ----- New Popup Media Stack Styles ----- */
.popup-media-stack {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-media-stack img {
    position: absolute;
    transition: transform 0.3s ease;
}

/* ----- Responsive Design ----- */

@media (max-width: 1300px) {
    .manual-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    .popup-content {
        flex-direction: column;
        gap: 20px;
        padding: 0 20px 20px;
        overflow-y: auto;
    }
    .popup-text {
        flex: none;
    }
    .popup-media {
        flex: 1;
        /* min-height: 500px; */
    }
    .popup-media-stack {
        transform: scale(0.8);
    }
    .manual-header-right {
    flex: 1;
    max-width: 600px;
    padding-top: 30px;
    padding-right: 0px;
}
.manual-header h1 {
    font-size: 70px; 

}
.popup-media.padded-top {
    padding: 0px 0 0;
}
}

@media (max-width: 1024px) {
    .manual-header {
        flex-direction: column;
        gap: 30px;
        margin-bottom: 80px;
    }
    .manual-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .popup-window {
        width: 95%;
        height: 85%;
    }
    .popup-content {
        padding: 0 20px 20px;
        gap: 20px;
    }
    .popup-text h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .manual-container {
        padding: 60px 20px;
    }
    .manual-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 60px;
    }

    .manual-header h1 {
        font-size: 3rem;
    }
    .manual-header .sub-title {
        font-size: 1.2rem;
    }
    .manual-header-right h2 {
        font-size: 1.8rem;
    }
    .manual-grid {
        grid-template-columns: 1fr;
    }

    .popup-window {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-height: none;
    }

    .popup-content {
        padding: 0 15px 20px;
    }

    .popup-media img {
        max-height: 300px;
    }

    .popup-media.padded-top {
        padding: 0px 0 0;
    }

    .popup-media-stack {
        transform: scale(0.6);
    }
    .popup-title-container h3 {
        font-size: 1.3rem;
    }
    .popup-title-container h2 {
        font-size: 1.1rem;
    }
    .popup-description {
        font-size: 0.9rem;
    }
}


