@charset "utf-8";

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nanum Gothic', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    vertical-align: middle;
}

/* Variables & Color Sets */
:root {
    --container-width: 1200px;
    --header-height: 80px;
}

/* 1. Blue (Default) */
.colorset-blue {
    --primary-color: #003876;
    --accent-color: #00a0e9;
    --text-light: #fff;
    --bg-light: #f4f8fb;
}

/* 2. Pink */
.colorset-pink {
    --primary-color: #e84393;
    --accent-color: #fd79a8;
    --text-light: #fff;
    --bg-light: #fff0f6;
}

/* 3. Green */
.colorset-green {
    --primary-color: #009432;
    --accent-color: #a3cb38;
    --text-light: #fff;
    --bg-light: #f0fff4;
}

/* 4. Gray */
.colorset-gray {
    --primary-color: #2c3e50;
    --accent-color: #bdc3c7;
    --text-light: #fff;
    --bg-light: #ecf0f1;
}

/* 5. Gold */
.colorset-gold {
    --primary-color: #bfa575;
    --accent-color: #d4af37;
    --text-light: #fff;
    --bg-light: #fcfbf5;
}

/* Layout Wrapper */
.mh-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.mh-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: transparent;
    transition: background 0.3s, box-shadow 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.mh-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mh-header.scrolled .mh-logo .text-logo,
.mh-header.scrolled .mh-gnb>ul>li>a {
    color: #333 !important;
}

.mh-header:not(.scrolled) .mh-gnb>ul>li>a {
    color: var(--header-text-color, #fff);
}

.mh-header .mh-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mh-logo img {
    height: 50px;
}

.mh-logo .text-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
}

.mh-gnb ul {
    display: flex;
    gap: 30px;
}

.mh-gnb>ul>li {
    position: relative;
}

.mh-gnb>ul>li>a {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    position: relative;
    padding: 10px 0;
}

.mh-gnb>ul>li>a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.mh-gnb>ul>li:hover>a {
    color: var(--primary-color);
}

.mh-gnb>ul>li:hover>a::after {
    width: 100%;
}

.mh-gnb ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    /* Align left */
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    min-width: 180px;
    /* Slightly wider */
    border-radius: 4px;
    z-index: 1001;
    /* Ensure on top */
}

/* Hover Bridge to prevent menu closing */
.mh-gnb ul ul::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

.mh-gnb li:hover>ul {
    display: block;
}

.mh-gnb ul ul li a {
    display: block;
    padding: 10px 20px;
    font-size: 15px;
    color: #555;
}

.mh-gnb ul ul li a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.mh-menu-toggle {
    display: none;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

.mh-menu-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

.mh-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.mh-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Hero Section */
.mh-hero {
    position: relative;
    /* 16:7 비율 유지 (padding-top 트릭)
       padding-top 방식에서는 flex align이 동작하지 않으므로
       mh-hero-content를 absolute로 중앙 배치 */
    padding-top: calc(43.75% + var(--header-height));
    overflow: hidden;
    color: #fff;
}

.mh-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.youtube-embed,
.image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* 16:9 영상을 컨테이너에 꽉 채우기 (상하·좌우 크롭)
   vw 단위로 iframe 크기를 절대값으로 지정하여
   어떤 창 비율에서도 검은 공간 없이 화면을 완전히 덮음

   원리: iframe 가로=100vw, 높이=100vw×(9/16)=56.25vw
         컨테이너 높이(16:7) = 100vw×7/16 = 43.75vw
         → iframe이 항상 컨테이너보다 높으므로 상하 크롭

   극단적으로 가로가 매우 긴 경우(예: 1920×300):
         필요 세로 = 100vw×9/16 < 컨테이너 높이가 될 수 있음
         → 이때는 세로 기준으로 가로를 오버사이즈로 늘려야 함
         → max(100vw, 컨테이너높이×16/9)로 처리
*/
.youtube-embed iframe {
    position: absolute;
    /* 수직 중앙 정렬 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 가로: 100vw vs 세로기준가로(컨테이너높이×16/9) 중 큰 값 사용
       컨테이너 높이 = (43.75vw + 헤더높이) ≈ 43.75vw+80px
       세로기준가로 = (43.75vw + 80px) × (16/9)
       가로를 항상 더 넓게 유지하여 좌우 검은공간 완전 제거 */
    width: max(100vw, calc((43.75vw + var(--header-height)) * 16 / 9));
    /* 높이: 가로×9/16 = 16:9 비율 유지 */
    height: calc(max(100vw, calc((43.75vw + var(--header-height)) * 16 / 9)) * 9 / 16);
    pointer-events: none;
    min-width: 100%;
    min-height: 100%;
}

/* Zoom in to hide controls */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

/* 히어로 텍스트: padding-top 컨테이너 안에서 정확히 중앙 배치 */
.mh-hero-content {
    position: absolute;
    /* 헤더 높이를 고려해 실제 영상 영역의 중앙으로 이동
       영상 영역 = 총 높이에서 헤더 부분 제외
       top = (헤더높이 + 전체높이) / 2 */
    top: calc(var(--header-height) / 2 + 50%);
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 100%;
    padding: 0 20px;
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 20px;
    font-weight: 400;
    opacity: 0.9;
}

/* Quick Links */
.mh-quick {
    background: var(--primary-color);
    padding: 30px 0;
    transform: translateY(-50%);
    margin-bottom: -40px;
}

.mh-quick .mh-container {
    position: relative;
    z-index: 10;
    padding: 0;
}

.quick-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-list li {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

.quick-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 20px 10px;
    border-radius: 8px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.quick-list a:hover {
    background: #fff;
    color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.quick-list .icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.quick-list .text {
    font-size: 16px;
    font-weight: 700;
}

/* Department Section - Updated */
.mh-dept {
    padding: 50px 0;
    background: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    color: #333;
    margin-bottom: 25px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    margin: 10px auto 0;
}

.dept-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.dept-card {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s;
    background: #000;
}

.dept-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.card-bg .bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    opacity: 0.8;
}

.dept-card:hover .card-bg .bg-img {
    transform: scale(1.1);
    opacity: 0.6;
}

/* Hero BG - Updated */
.image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-bg .bg-layer {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    transition: background 0.3s;
}

.dept-card:hover .card-overlay {
    background: linear-gradient(to top, var(--primary-color), transparent 80%);
    opacity: 0.9;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    color: #fff;
    transform: translateY(20px);
    transition: all 0.4s;
}

.dept-card:hover .card-content {
    transform: translateY(0);
}

.dept-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.dept-desc {
    font-size: 15px;
    opacity: 0.8;
    margin-bottom: 20px;
    line-height: 1.5;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.btn-more {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-color);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dept-card:hover .btn-more {
    opacity: 1;
    transform: translateX(0);
}

/* Content & Footer */
.mh-content-wrap {
    padding: 50px 20px;
    min-height: 500px;
}

.mh-footer {
    background: #222;
    color: #aaa;
    padding: 40px 0;
    text-align: center;
}

.mh-footer .address {
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.8;
}

.mh-footer .copyright {
    font-size: 13px;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .mh-quick {
        transform: none;
        margin-bottom: 0;
        padding: 20px 0;
    }

    .quick-list li {
        min-width: 45%;
        max-width: 48%;
    }

    .dept-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Mobile Menu Logic moved to 1024px */
    .mh-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        background: #a3cb38;
        /* Green color from reference */
        border-radius: 50%;
        color: #fff;
        font-size: 16px;
        /* Adjusted for text */
        font-weight: 800;
        /* Bold text */
        border: none;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(163, 203, 56, 0.4);
        transition: transform 0.2s, background 0.2s;
        /* Ensure it sits on the right */
        margin-left: auto;
        font-family: 'Nanum Gothic', sans-serif;
    }

    .mh-menu-toggle:hover {
        transform: scale(1.05);
        background: #96bd32;
    }

    .mh-gnb {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--bg-light);
        /* Changed to theme light background */
        padding: 60px 20px 20px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
        z-index: 1001;
        overflow-y: auto;
    }

    .mh-gnb.active {
        right: 0;
    }

    .mh-menu-close {
        display: block;
    }

    .mh-gnb ul {
        flex-direction: column;
        gap: 0;
    }

    .mh-gnb>ul>li>a {
        border-bottom: 1px solid #eee;
        padding: 15px 0;
    }

    .mh-gnb ul ul {
        position: static;
        box-shadow: none;
        background: #f9f9f9;
        padding-left: 20px;
    }

    /* 모바일 메뉴 텍스트 색상 (설정값 적용) */
    .mh-gnb > ul > li > a,
    .mh-gnb ul ul li a,
    .mh-menu-close {
        color: var(--mobile-menu-text-color, #333) !important;
    }

    /* 모바일 메뉴 밑줄 제거 및 활성화 항목 볼드체 적용 */
    .mh-gnb ul li a::after {
        display: none !important;
    }
    .mh-gnb ul li.active > a {
        font-weight: 800 !important;
    }
}

@media (max-width: 768px) {
    /* 모바일 헤더 높이 변수 업데이트 → iframe 계산식에도 자동 반영 */
    :root {
        --header-height: 60px;
    }

    .mh-header {
        height: 60px;
    }

    .mh-hero {
        /* 모바일에서도 16:7 비율 유지 (헤더 높이 60px 반영) */
        padding-top: calc(43.75% + 60px);
    }

    /* Menu Logic moved to 1024px */

    .hero-title {
        font-size: 32px;
    }

    .hero-title {
        font-size: 32px;
    }

    .dept-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------
 * 권한없음 메시지 / 로그인 폼 강제 숨김
 * 입시 레이아웃 방문자에게 불필요한 시스템 안내 및 로그인 창 제거
 * 실제 라이믹스 메시지 스킨이 사용하는 선택자: #access
 * ------------------------------------- */
.mh-layout #access {
    display: none !important;
}

/* #access가 숨겨지면 부모 컨테이너도 공간 제거 (CSS :has() 지원 브라우저) */
.mh-content-wrap:has(> #access:first-child:last-child) {
    min-height: 0 !important;
    padding: 0 !important;
}