@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);
    z-index: 10;
    pointer-events: auto; /* 유튜브 iframe으로 터치가 전달되지 않도록 완벽히 방어 */
}

/* 히어로 텍스트: 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;
}

/* -------------------------------------
 * 관리자 퀵메뉴
 * ------------------------------------- */
.mh-admin-quick-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}
.mh-admin-quick-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: #333;
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    font-size: 20px;
    transition: all 0.3s;
}
.mh-admin-quick-menu a:hover {
    transform: translateY(-3px);
    background: var(--primary-color, #003876);
}

/* -------------------------------------
 * V2: 스크롤 관성(래그) + 등장 리빌
 * - 관성 이동은 개별 `translate` 속성 사용 → 기존 hover transform과 충돌 없음
 * - .mh-js 가 있을 때만 리빌 숨김 (JS 실패시 콘텐츠 그대로 노출)
 * ------------------------------------- */
.mh-lag {
    translate: 0 var(--lag, 0px);
    will-change: translate, transform, opacity;
}
.mh-hero-bg {
    will-change: transform;
}

/* JS 활성화시에만 숨김 시작 (프로그레시브 인핸스먼트) */
.mh-js .mh-reveal {
    opacity: 0;
    transform: translateY(46px) scale(.985);
    transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
    transition-delay: var(--d, 0s);
}
.mh-js .mh-reveal.on {
    opacity: 1;
    transform: none;
}

/* 관성 레벨별 등장 속도 미세 조정 (높을수록 약간 느리게) */
.mh-inertia-lv-1.mh-js .mh-reveal { transition-duration: .6s; }
.mh-inertia-lv-5.mh-js .mh-reveal { transition-duration: 1s; }

/* 레벨 0(끄기): 효과 없이 즉시 표시 */
.mh-inertia-lv-0 .mh-lag { translate: none; }
.mh-inertia-lv-0.mh-js .mh-reveal { opacity: 1; transform: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
    .mh-js .mh-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .mh-lag { translate: none !important; }
}

/* ==========================================================================
   Gallery Section (최근 게시물 갤러리)
   ========================================================================== */
.mh-gallery {
    padding: 80px 0;
    position: relative;
    transition: background-color 0.3s;
}

.mh-gallery.bg-white {
    background-color: #ffffff;
}

.mh-gallery.bg-theme {
    background-color: var(--bg-light, #f4f8fb);
}

.mh-gallery.bg-gray {
    background-color: #f7f9fb;
}

/* 갤러리 상단 헤더 영역 */
.mh-gallery .gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 35px;
    position: relative;
}

.mh-gallery .gallery-title-wrap {
    flex: 1;
}

.mh-gallery .gallery-title {
    font-size: 32px;
    font-weight: 800;
    color: #111;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.mh-gallery .gallery-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 36px;
    height: 3px;
    background: var(--accent-color, #00a0e9);
    border-radius: 2px;
}

.mh-gallery .gallery-subtitle {
    font-size: 15px;
    color: #666;
    margin-top: 6px;
}

/* 제목 정렬: 좌측 (기본) */
.mh-gallery .gallery-header.header-align-left {
    justify-content: space-between;
    align-items: flex-end;
}
.mh-gallery .gallery-header.header-align-left .gallery-title-wrap {
    text-align: left;
}
.mh-gallery .gallery-header.header-align-left .gallery-title::after {
    left: 0;
    right: auto;
    transform: none;
}

/* 제목 정렬: 가운데 */
.mh-gallery .gallery-header.header-align-center {
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}
.mh-gallery .gallery-header.header-align-center .gallery-title-wrap {
    text-align: center;
}
.mh-gallery .gallery-header.header-align-center .gallery-title::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}
.mh-gallery .gallery-header.header-align-center .gallery-more-btn {
    position: absolute;
    right: 0;
    bottom: 5px;
}

/* 제목 정렬: 우측 */
.mh-gallery .gallery-header.header-align-right {
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: flex-end;
}
.mh-gallery .gallery-header.header-align-right .gallery-title-wrap {
    text-align: right;
}
.mh-gallery .gallery-header.header-align-right .gallery-title::after {
    left: auto;
    right: 0;
    transform: none;
}

.mh-gallery .gallery-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color, #003876);
    border: 1.5px solid var(--primary-color, #003876);
    padding: 7px 18px;
    border-radius: 24px;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
}

.mh-gallery .gallery-more-btn:hover {
    background: var(--primary-color, #003876);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 56, 118, 0.25);
    transform: translateY(-2px);
}

/* 갤러리 그리드 레이아웃 (1:1 비율 균등 분할) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--gall-cols, 4), minmax(0, 1fr));
    gap: 22px;
}

/* 갤러리 개별 카드 */
.gallery-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.35s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color, #003876);
}

.gallery-card a.card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* 1:1 비율 썸네일 박스 */
.gallery-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-card:hover .gallery-thumb img {
    transform: scale(1.08);
}

/* 썸네일 없을 때 대체 이미지 */
.gallery-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    color: #94a3b8;
    gap: 8px;
    transition: transform 0.45s ease;
}

.gallery-thumb-placeholder i {
    font-size: 38px;
    color: var(--primary-color, #003876);
    opacity: 0.6;
}

.gallery-thumb-placeholder .placeholder-text {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: -0.3px;
}

.gallery-card:hover .gallery-thumb-placeholder {
    transform: scale(1.05);
}

/* 썸네일 호버 오버레이 */
.gallery-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 30, 70, 0.4);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.gallery-thumb-overlay i {
    color: #fff;
    font-size: 26px;
    transform: translateY(10px) scale(0.8);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-card:hover .gallery-thumb-overlay {
    opacity: 1;
}

.gallery-card:hover .gallery-thumb-overlay i {
    transform: translateY(0) scale(1);
}

/* 썸네일 위 소속 게시판 배지 */
.mh-gallery .gallery-board-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3.5px 8.5px;
    border-radius: 6px;
    backdrop-filter: blur(6px);
    letter-spacing: -0.3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    max-width: calc(100% - 20px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: background 0.3s ease, transform 0.3s ease;
}

.gallery-card:hover .gallery-board-badge {
    background: var(--primary-color, #003876);
}

/* 제목 상단 게시판 이름 텍스트 */
.mh-gallery .gallery-item-board {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent-color, #00a0e9);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

/* 카드 텍스트 정보 영역 */
.gallery-body {
    padding: 16px 16px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 제목 (기본 선택) */
.gallery-item-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    transition: color 0.2s ease;
}

.gallery-card:hover .gallery-item-title {
    color: var(--primary-color, #003876);
}

/* 내용 요약 (선택) */
.gallery-item-content {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

/* 메타 정보 (날짜 / 작성자 / 댓글) */
.gallery-meta {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
}

.gallery-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-meta .date {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.gallery-meta .author {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-meta-right .comment-cnt {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--accent-color, #00a0e9);
    font-weight: 700;
}

/* 데이터 없음 안내 */
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    color: #64748b;
}

.gallery-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    color: #94a3b8;
}

.gallery-empty p {
    font-size: 15px;
    font-weight: 600;
}

.gallery-empty span {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
}

/* -------------------------------------
   반응형 미디어 쿼리 (그리드 최적화)
   ------------------------------------- */
@media (max-width: 1024px) {
    .mh-gallery {
        padding: 60px 0;
    }
    .gallery-grid {
        grid-template-columns: repeat(min(var(--gall-cols, 4), 3), minmax(0, 1fr));
        gap: 16px;
    }
    .mh-gallery .gallery-title {
        font-size: 26px;
    }
}

@media (max-width: 768px) {
    .mh-gallery {
        padding: 50px 0;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    .mh-gallery .gallery-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 25px;
    }
    .mh-gallery .gallery-header.header-align-center {
        flex-direction: column;
        gap: 12px;
    }
    .mh-gallery .gallery-header.header-align-center .gallery-more-btn {
        position: static;
    }
    .mh-gallery .gallery-header.header-align-right {
        flex-direction: row-reverse;
    }
    .mh-gallery .gallery-board-badge {
        top: 8px;
        left: 8px;
        font-size: 10px;
        padding: 2.5px 6.5px;
        border-radius: 4px;
    }
    .mh-gallery .gallery-title {
        font-size: 22px;
    }
    .mh-gallery .gallery-subtitle {
        font-size: 13px;
    }
    .gallery-body {
        padding: 12px;
    }
    .gallery-item-title {
        font-size: 14px;
    }
    .gallery-item-content {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .gallery-body {
        padding: 10px 8px;
    }
    .gallery-item-title {
        font-size: 13px;
    }
    .gallery-meta {
        font-size: 11px;
    }
}
