/* 상단 부품(top.php): 타이틀, 메뉴, 검색 팝업 */
/* 타이틀 섹션 */
.Title_Header {
    position: relative;
}
.Title_Img {
    display: flex;
    flex-direction: column;
    width:100%;
    height: var(--title-height, 33vw);
    border-bottom: 1px solid #ccc;
}
.Title_Line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 19.2px;
    height: 90px;
    padding-left: 23.04px;
}
.Title_Menu_Toggle_Button {
    display: none;
}
.Title_Line_Items {
    display: flex;
    align-items: center;
    gap: 19.2px;
    width: 100%;
}
.Title_Line_Left {
    display: flex;
    align-items: center;
}
.Title_Logo {
    font-size: 28.8px;
    transition: color 0.25s ease;
}
.Title_Logo:hover {
    color: #ff0000;
    transition: color 0.25s ease;
}
.Title_Sub {
    background: #b0b0b0;
    font-size: 11px;
    padding: 2px 15.36px;
    margin: 2px 0px 0px 20px;
    border-bottom: 1px solid #999;   /* 추가 */
    transition: background-color 0.25s, color 0.25s ease;
}
.Title_Sub:hover {
    background: #999;
    color: #fff;
    transition: background-color 0.25s, color 0.25s ease;
}
.Title_Sub.active {
    background: #333;
    color: #fff;
}
.Title_Sub img {
    height:38.4px;
}
.Title_Line_Right {
    
}
.NLOG_Home {
    background: #f0f0f0;
    color: #333;
    padding: 9.6px 19.2px;
    margin-right: 10px;
    transition: background-color 0.25s ease;
}
.NLOG_Home:hover {
    background: #e0e0e0;
    transition: background-color 0.25s ease;
}
.Login_In {
    background: #ee7171;
    color: #fff;
    padding: 9.6px 19.2px;
    transition: background-color 0.25s ease;
}
.Login_Out {
    background: #7188ee;
    color: #fff;
    padding: 9.6px 19.2px;
    transition: background-color 0.25s ease;
}
.Login_In:hover {
    background: #dd5c5c;
    transition: background-color 0.25s ease;
}
.Login_Out:hover {
    background: #5c71dd;
    transition: background-color 0.25s ease;
}
.Title_Desc {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    margin-top: 90px;
    padding: 57.6px;
    font-size: var(--title-font-size);
}

/* 메뉴 섹션 */
/* .Top 이 헤더 높이만큼만 감싸 sticky 범위를 제한하므로 레이아웃에서 제외 */
.Top {
    display: contents;
}
.Menu {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #ccc;
}
.Menu_Toggle_Button {
    display: none;
}
.Menu_Items {
    display: contents;
}
.Menu_Block {
    flex: 3;
    padding: 19.2px;
    background-color: #f0f0f0;
    border-left: 1px solid #ccc;
    cursor: default;
    text-align: center;
}
.Menu_Block[onclick] {
    cursor: pointer;
}
.Menu_Block:has(.Menu_Sub) {
    cursor: default;
}
.Menu_Block:hover,
.Menu_Block.active {
    background-color: #e0e0e0;
}

/* 메뉴 버튼 글자: 평소에는 숨기고 펼침 메뉴(1000px 이하)에서만 보인다 */
.Menu_Text {
    display: none;
}

/* 메뉴 서브 항목 스타일 */
.Menu_Block {
    position: relative;
}
.Menu_Sub {
    position: absolute;
    top: 100%;
    left: -1px;
    right: 0;
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    background-color: #f0f0f0;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    transition: max-height 0.25s ease, opacity 0.25s ease;
}
.Menu_Block:hover .Menu_Sub {
    max-height: 576px;
    opacity: 1;
    border-bottom: 1px solid #ccc;
}
.Menu_Sub_Item {
    padding: 15.36px 19.2px;
    border-top: 1px solid #ccc;
    cursor: default;
}
.Menu_Sub_Item[onclick] {
    cursor: pointer;
}
.Menu_Sub_Item:hover,
.Menu_Sub_Item.active {
    background-color: #e0e0e0;
}

.Search_Modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.Search_Box {
    width: 576px; /* 검색 팝업의 너비를 576px로 설정 */
    height: 167.04px; /* 검색 팝업의 높이를 167.04px로 설정 */
    background-color: #ffffff;
    padding: 28.8px;
    border-radius: 4px;
}
.Search_Title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 19.2px;
}
.Search_Title i {
    cursor: pointer;
}
.Side_Menu_Button {
    display: flex;
    flex: 0 0 28px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 0;
    border-left: 1px solid #ccc;
    background: #f0f0f0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
}
.Side_Menu_Button:hover {
    background: #e0e0e0;
}
.Side_Menu_Button:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid #0c29aa;
    outline-offset: -2px;
}

@media (max-width: 1500px) {
    .Title_Header {
        display: flex;
        flex-direction: column;
    }

    .Title_Line {
        position: static;
        order: 0;
        width: 100%;
        height: auto;
        min-height: 64px;
        padding: 12px 24px;
        background: #f0f0f0;
        border-bottom: 1px solid #ccc;
    }

    .Title_Line_Items {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .Title_Line_Right {
        margin: 0 0 0 auto !important;
    }

    .Title_Img {
        order: 1;
    }

    .Title_Desc {
        margin-top: 0;
    }
}

@media (max-width: 1200px) {
    .Menu_Admin_Settings {
        display: none;
    }
}

@media (max-width: 1000px) {
    .Title_Img {
        height: max(260px, var(--title-height, 33vw));
        min-height: 260px;
    }

    .Title_Line {
        height: auto;
        min-height: 64px;
        flex: 0 0 auto;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px 12px;
        padding: 12px 16px;
    }

    .Title_Line_Left {
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 12px;
    }

    .Title_Logo {
        font-size: 24px;
    }

    .Title_Sub {
        margin: 0;
        padding: 5px 8px;
    }

    .Title_Line_Right {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0 !important;
    }

    .NLOG_Home,
    .Login_In,
    .Login_Out {
        padding: 8px 10px;
    }

    .Title_Desc {
        flex: 1 0 auto;
        height: auto;
        min-height: 160px;
        padding: 32px 20px;
        font-size: clamp(20px, var(--title-font-size), 52px);
    }

    .Title_Desc span {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .Menu {
        flex-wrap: wrap;
    }

    .Menu_Toggle_Button {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        border: 0;
        border-left: 1px solid #ccc;
        background: #f0f0f0;
        color: inherit;
        cursor: pointer;
        font: inherit;
        text-align: left;
    }

    .Menu_Toggle_Button:hover,
    .Menu_Expanded .Menu_Toggle_Button {
        background: #e0e0e0;
    }

    .Menu_Toggle_Button:focus-visible {
        position: relative;
        z-index: 1;
        outline: 2px solid #0c29aa;
        outline-offset: -2px;
    }

    .Menu_Toggle_Button i {
        transition: transform 0.2s ease;
    }

    .Menu_Expanded .Menu_Toggle_Button i {
        transform: rotate(180deg);
    }

    .Menu_Items {
        display: none;
        flex: 0 0 100%;
        flex-direction: column;
        width: 100%;
    }

    .Menu_Expanded .Menu_Items {
        display: flex;
        max-height: calc(100vh - 60px); /* 목록이 화면보다 길면 메뉴 안에서 스크롤 (60px = 메뉴 버튼 줄 높이 추정값) */
        overflow-x: hidden;
        overflow-y: auto;
    }

    .Menu_Block {
        flex: 0 0 auto !important;
        width: 100%;
        padding: 12px;
        border-left: 0;
        border-top: 1px solid #ddd;
        text-align: left;
        white-space: normal;
    }

    .Menu_Items .Menu_Text {
        display: inline;
        margin-left: 8px;
    }

    .Menu_Items .Menu_Sub {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        max-height: 0;
        border: 0;
        opacity: 0;
    }

    /* 펼침 메뉴 상태: 마우스 오버로 열리지 않고, 클릭으로 붙는 Menu_Sub_Open 일 때만 연다 */
    .Menu_Items .Menu_Block:has(.Menu_Sub) {
        cursor: pointer;
    }

    .Menu_Items .Menu_Block:hover .Menu_Sub {
        max-height: 0;
        border-bottom: 0;
        opacity: 0;
    }

    .Menu_Items .Menu_Block.Menu_Sub_Open .Menu_Sub {
        max-height: 576px;
        border-bottom: 1px solid #ccc;
        opacity: 1;
    }

    .Menu_Items .Menu_Block.Menu_Sub_Open .Menu_Sub:last-child {
        border-bottom: 0px;
    }
    
    .Menu_Items .Menu_Sub {
        margin: 12px -12px -12px;
    }

    .Menu_Items .Menu_Sub_Item {
        padding: 12px 12px 12px 24px;
    }

    .Search_Box {
        width: calc(100vw - 32px);
        height: auto;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .Title_Line {
        padding: 10px 12px;
    }

    .Title_Line_Left,
    .Title_Line_Right {
        width: 100%;
    }

    .Title_Line_Right {
        justify-content: flex-end;
    }

    .Title_Logo {
        font-size: 22px;
    }

    .Title_Sub {
        font-size: 12px;
    }

    .Title_Desc {
        min-height: 145px;
        padding: 24px 16px;
    }

    .Search_Box {
        padding: 20px;
    }
}

@media (max-width: 800px) {
    .Title_Line {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        flex-wrap: nowrap;
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
        gap: 0;
        padding: 0;
    }

    .Title_Menu_Toggle_Button {
        display: flex;
        box-sizing: border-box;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        border: 0;
        background: #f0f0f0;
        color: inherit;
        cursor: pointer;
        font: inherit;
        text-align: left;
    }

    .Title_Menu_Toggle_Button:hover,
    .Title_Menu_Expanded .Title_Menu_Toggle_Button {
        background: #e0e0e0;
    }

    .Title_Menu_Toggle_Button:focus-visible {
        outline: 2px solid #0c29aa;
        outline-offset: -2px;
    }

    .Title_Menu_Toggle_Button i {
        transition: transform 0.2s ease;
    }

    .Title_Menu_Expanded .Title_Menu_Toggle_Button i {
        transform: rotate(180deg);
    }

    .Title_Line_Items {
        display: none;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        flex: 0 0 auto;
        height: auto;
        gap: 0;
        width: 100%;
    }

    .Title_Menu_Expanded .Title_Line_Items {
        display: flex;
    }

    .Title_Line_Left,
    .Title_Line_Right {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        flex: 0 0 auto;
        gap: 0;
        width: 100%;
        margin: 0 !important;
        border-top: 1px solid #ddd;
    }

    .Title_Logo,
    .Title_Sub,
    .NLOG_Home,
    .Login_In,
    .Login_Out {
        display: block;
        width: 100%;
        margin: 0;
        padding: 10px 16px;
        text-align: left;
    }
}

/* 스크롤 리빌 효과 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.reveal {
    opacity: 1;
    transform: translateY(0);
}