/* ================================================
   TOTAL_IMG1_MV - 이미지 갤러리형 스킨
   ================================================ */
.TOTAL_IMG1_MV {
    width: 100%;
    float: left;
}
/* ★ 100% 높이 모드 (그리드 형제와 동일 높이) */
.TOTAL_IMG1_MV.imgmv_full_height { height: 100%; display: flex; flex-direction: column; }
.TOTAL_IMG1_MV.imgmv_full_height .imgmv_grid { flex: 1; min-height: 0; align-content: start; }

/* ★ 스와이퍼 모드: 각 카드가 swiper-slide(=.TOTAL_IMG1_MV 슬라이드 루트) */
.TOTAL_IMG1_MV.imgmv_slide_root { width: auto; float: none; height: auto; }
.TOTAL_IMG1_MV.imgmv_slide_root .imgmv_card { width: 100%; height: 100%; }
.swiper-slide.imgmv_item { height: auto; }

/* 그리드 레이아웃 */
.TOTAL_IMG1_MV .imgmv_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--imgmv-grid-min, 200px), 1fr));
    gap: clamp(12px, calc(0.94vw + 9px), 24px);
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* 카드 아이템 */
.TOTAL_IMG1_MV .imgmv_card {
    display: block;
    width: 100%;
    background: var(--imgmv-box-bg, #fff);
    border-radius: var(--imgmv-box-radius, 16px);
    box-shadow: var(--imgmv-box-shadow, none);
    overflow: hidden;
    padding: var(--imgmv-box-padding, 0);
    transition: box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}
.TOTAL_IMG1_MV .imgmv_card:hover {
    box-shadow: var(--imgmv-box-shadow-hover, 0 8px 24px rgba(0,0,0,0.12));
}
/* ★ hover 그림자 OFF */
.TOTAL_IMG1_MV.imgmv_no_hover_shadow .imgmv_card:hover {
    box-shadow: var(--imgmv-box-shadow, none) !important;
}

/* ================================================
   이미지 영역
   ================================================ */
.TOTAL_IMG1_MV .imgmv_thumb {
    position: relative;
    width: 100%;
    aspect-ratio: var(--imgmv-img-ratio, 3/4);
    overflow: hidden;
    border-radius: var(--imgmv-img-radius, 0);
    background: var(--imgmv-img-bg, #f1f5f9);
    border: var(--imgmv-img-border-width, 0) solid var(--imgmv-img-border-color, transparent);
    transition: border-color 0.3s ease, border-width 0.3s ease;
}
.TOTAL_IMG1_MV .imgmv_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: var(--imgmv-img-opacity, 1);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.TOTAL_IMG1_MV .imgmv_card:hover .imgmv_thumb {
    border-color: var(--imgmv-img-border-hover-color, var(--imgmv-img-border-color, transparent));
    border-width: var(--imgmv-img-border-hover-width, var(--imgmv-img-border-width, 0));
}
.TOTAL_IMG1_MV .imgmv_card:hover .imgmv_thumb img {
    transform: scale(var(--imgmv-img-hover-scale, 1.05));
    opacity: var(--imgmv-img-hover-opacity, var(--imgmv-img-opacity, 1));
}

/* ================================================
   영상 플레이 오버레이
   ================================================ */
.TOTAL_IMG1_MV .imgmv_play_overlay {
    display: none;
}
/* video 모드일 때만 활성화 */
.TOTAL_IMG1_MV[data-view-mode="video"] .imgmv_play_overlay {
    display: flex;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 2;
}
.TOTAL_IMG1_MV[data-view-mode="video"] .imgmv_card:hover .imgmv_play_overlay {
    background: rgba(0,0,0,0.4);
}
.TOTAL_IMG1_MV[data-view-mode="video"] .imgmv_play_overlay i {
    font-size: clamp(36px, 4vw, 56px);
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.TOTAL_IMG1_MV[data-view-mode="video"] .imgmv_card:hover .imgmv_play_overlay i {
    opacity: 1;
}

/* ================================================
   텍스트 영역
   ================================================ */
.TOTAL_IMG1_MV .imgmv_info {
    padding: var(--imgmv-txt-padding, 16px 10px 20px);
    text-align: var(--imgmv-title-align, left);
    width: 100%;
    float: left;
}

/* 라벨 */
.TOTAL_IMG1_MV .imgmv_label {
    display: var(--imgmv-label-display, inline-block);
    font-size: var(--imgmv-label-size, 11px);
    font-weight: var(--imgmv-label-weight, 400);
    color: var(--imgmv-label-font-color, #64748b);
    background: var(--imgmv-label-color, #f1f5f9);
    padding: var(--imgmv-label-padding, 2px 8px);
    border-radius: var(--imgmv-label-radius, 20px);
    margin-bottom: var(--imgmv-label-mb, 8px);
    line-height: 1.4;
}

/* 제목 — ★ 하단 마진 변수화 */
.TOTAL_IMG1_MV .imgmv_title {
    font-size: var(--imgmv-title-size, clamp(14px, calc(0.31vw + 13px), 16px));
    font-weight: var(--imgmv-title-weight, 700);
    letter-spacing: var(--imgmv-title-spacing, normal);
    color: var(--imgmv-title-color, #1e293b);
    line-height: var(--imgmv-title-lh, 1.4);
    margin-bottom: var(--imgmv-title-mb, 0);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
}

/* 본문 발췌 — ★ 하단 마진 변수화 */
.TOTAL_IMG1_MV .imgmv_content {
    font-size: var(--imgmv-content-size, 13px);
    font-weight: var(--imgmv-content-weight, 400);
    letter-spacing: var(--imgmv-content-spacing, normal);
    color: var(--imgmv-content-color, #64748b);
    line-height: var(--imgmv-content-lh, 1.5);
    margin-top: 6px;
    margin-bottom: var(--imgmv-content-mb, 0);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 날짜 — ★ 두께/하단 마진 변수화 */
.TOTAL_IMG1_MV .imgmv_date {
    display: var(--imgmv-date-display, block);
    font-size: var(--imgmv-date-size, 12px);
    font-weight: var(--imgmv-date-weight, 400);
    color: var(--imgmv-date-color, #94a3b8);
    margin-top: 8px;
    margin-bottom: var(--imgmv-date-mb, 0);
    line-height: 1.3;
}

/* ================================================
   ★ 텍스트 오버레이 모드 (이미지 위로 텍스트)
   - imgmv_overlay : 카드 = 이미지 위 텍스트 절대배치
   - imgmv_overlay_hover : 평소 숨김 → hover 시 노출
   - imgmv_overlay_always : 항상 노출
   ================================================ */
.TOTAL_IMG1_MV.imgmv_overlay .imgmv_card { position: relative; }
/* 썸네일이 카드 전체를 채움 */
.TOTAL_IMG1_MV.imgmv_overlay .imgmv_thumb { width: 100%; height: 100%; }
/* 텍스트를 이미지 위에 절대배치 */
.TOTAL_IMG1_MV.imgmv_overlay .imgmv_info {
    position: absolute; left: 0; right: 0; bottom: 0;
    width: 100%; float: none;
    z-index: 3;
    padding: var(--imgmv-ov-padding, 20px);
    text-align: var(--imgmv-ov-align, left);
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 100%);
    color: #fff;
    transition: opacity .3s ease, transform .3s ease;
}
/* 오버레이 안 텍스트 색 흰색 계열로 (변수 미지정 시) */
.TOTAL_IMG1_MV.imgmv_overlay .imgmv_title   { color: var(--imgmv-title-color, #fff); }
.TOTAL_IMG1_MV.imgmv_overlay .imgmv_content { color: var(--imgmv-content-color, rgba(255,255,255,0.85)); }
.TOTAL_IMG1_MV.imgmv_overlay .imgmv_date    { color: var(--imgmv-date-color, rgba(255,255,255,0.7)); }
/* hover 모드: 평소 숨김 → hover 노출 */
.TOTAL_IMG1_MV.imgmv_overlay_hover .imgmv_info { opacity: 0; transform: translateY(12px); pointer-events: none; }
.TOTAL_IMG1_MV.imgmv_overlay_hover .imgmv_card:hover .imgmv_info { opacity: 1; transform: translateY(0); pointer-events: auto; }
/* 오버레이 정렬: center/right 시 내부 정렬 보정 */
.TOTAL_IMG1_MV.imgmv_overlay .imgmv_label { align-self: flex-start; }

/* NEW 아이콘 */
.TOTAL_IMG1_MV .imgmv_new {
    display: inline-block;
    background: #22c55e;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    margin: 0 3px;
    vertical-align: middle;
    line-height: 1.2;
}

/* 빈 상태 */
.TOTAL_IMG1_MV .imgmv_empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
}

/* ================================================
   모달
   ================================================ */
.imgmv_modal_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.imgmv_modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.imgmv_modal_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    gap: 12px;
}
.imgmv_modal_title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.imgmv_modal_close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.imgmv_modal_close:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.imgmv_modal_body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
/* 모달 내 이미지 */
.imgmv_modal_img {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
}
.imgmv_modal_img img {
    width: 100%;
    height: auto;
    display: block;
}
/* 모달 내 본문 */
.imgmv_modal_content {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    word-break: keep-all;
}
.imgmv_modal_content img {
    max-width: 100%;
    height: auto;
}
/* 영상 모달 */
.imgmv_video_wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}
.imgmv_video_wrap iframe,
.imgmv_video_wrap video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* ================================================
   반응형
   ================================================ */
@media only all and (max-width: 767px) {
    .TOTAL_IMG1_MV .imgmv_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(8px, 2vw, 16px);
    }
    .TOTAL_IMG1_MV .imgmv_info {
        padding: var(--imgmv-txt-padding, 12px 8px 16px);
    }
    .TOTAL_IMG1_MV .imgmv_label {
        font-size: 10px;
        padding: 1px 6px;
        margin-bottom: 6px;
    }
    .imgmv_modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 12px;
    }
    .imgmv_modal_body {
        padding: 16px;
    }
}
@media only all and (max-width: 480px) {
    .TOTAL_IMG1_MV .imgmv_grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
