/* ================================================
   V1_IMG2 - 심플 이미지 카드 신버전 (TOTAL_CARDIMG2 기반, 2026-10-29)
   - 클래스: .V1_IMG2 / vi2_* (구 TOTAL_CARDIMG2 .ci2_slide·card2_* 와 독립 — 같은 페이지 공존 OK)
   - 변수: --ci1-* (탭믹스 슬롯 설정 번개가 이 이름으로 넣음)
   ================================================ */

/* 카드 */
.V1_IMG2 .vi2_item {
    display: flex;
    flex-direction: column;
    background: var(--ci1-box-bg, transparent);
    border-radius: var(--ci1-box-radius, 0);
    border: var(--ci1-box-border-w, 0) solid var(--ci1-box-border-c, transparent);
    overflow: visible;
    box-shadow: var(--ci1-box-shadow, none);
    text-decoration: none;
    width: 100%;
    height: 100%;
    padding: var(--ci1-box-padding, 0);
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.V1_IMG2 .vi2_item:hover {
    box-shadow: var(--ci1-box-hover-shadow, var(--ci1-box-shadow, none));
}

/* 이미지 */
.V1_IMG2 .vi2_thumb {
    position: relative;
    width: 100%;
    aspect-ratio: var(--ci1-img-ratio, var(--thumb-ratio, 16/10));
    border-radius: var(--ci1-img-radius, 16px);
    overflow: hidden;
    background: var(--ci1-img-bg, #f3f4f6);
    border: var(--ci1-img-border-width, 0) solid var(--ci1-img-border-color, transparent);
    box-sizing: border-box;
    transition: border-color 0.3s ease, border-width 0.3s ease;
}
.V1_IMG2 .vi2_thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: var(--ci1-img-opacity, 1);
    transition: transform 0.4s ease, opacity 0.3s ease;
}
.V1_IMG2.vi2_fit_contain .vi2_thumb img { object-fit: contain; }
.V1_IMG2 .vi2_item:hover .vi2_thumb {
    border-color: var(--ci1-img-border-hover-color, var(--ci1-img-border-color, transparent));
    border-width: var(--ci1-img-border-hover-width, var(--ci1-img-border-width, 0));
}
.V1_IMG2 .vi2_item:hover .vi2_thumb img {
    transform: scale(1.05);
    opacity: var(--ci1-img-hover-opacity, var(--ci1-img-opacity, 1));
}

/* 텍스트 영역 */
.V1_IMG2 .vi2_info {
    padding: var(--ci1-txt-padding, clamp(10px, calc(0.47vw + 8.5px), 16px) 0 0 0);
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: var(--ci1-title-align, left);
}
.V1_IMG2.vi2_img_only .vi2_info { display: none; }

/* 라벨 */
.V1_IMG2 .vi2_label {
    display: var(--ci1-label-display, inline-block);
    width: fit-content;
    font-size: var(--ci1-label-size, 12px);
    font-weight: 600;
    letter-spacing: var(--ci1-label-spacing, normal);
    color: var(--ci1-label-font-color, var(--primary, #64748b));
    background: var(--ci1-label-color, transparent);
    border-radius: var(--ci1-label-radius, 0);
    padding: var(--ci1-label-padding, 0);
    line-height: 1.4;
    /* fit-content 라 text-align 이 안 먹음 → 정렬은 margin auto (PHP 가 title_align/label_align 따라 넣음) */
    margin-left: var(--ci1-label-ml, 0);
    margin-right: var(--ci1-label-mr, 0);
}

/* 제목 */
.V1_IMG2 .vi2_title {
    font-size: var(--ci1-title-size, clamp(14px, calc(0.16vw + 13.5px), 16px));
    font-weight: var(--ci1-title-weight, 600);
    letter-spacing: var(--ci1-title-spacing, normal);
    line-height: var(--ci1-title-lh, 1.4);
    color: var(--ci1-title-color, #1f2937);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    transition: color 0.2s ease;
}
.V1_IMG2.vi2_no_title .vi2_title { display: none; }
.V1_IMG2 .vi2_item:hover .vi2_title { color: var(--primary, #111); }

/* 본문 발췌 */
.V1_IMG2 .vi2_desc {
    display: var(--ci1-content-display, -webkit-box);
    font-size: var(--ci1-content-size, clamp(12px, calc(0.16vw + 11.5px), 14px));
    font-weight: var(--ci1-content-weight, 400);
    letter-spacing: var(--ci1-content-spacing, normal);
    line-height: var(--ci1-content-lh, 1.6);
    color: var(--ci1-content-color, #6b7280);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 4px 0 0;
}

/* 날짜 */
.V1_IMG2 .vi2_date {
    display: var(--ci1-date-display, block);
    font-size: var(--ci1-date-size, clamp(12px, calc(0.16vw + 11.5px), 14px));
    color: var(--ci1-date-color, #999);
    letter-spacing: var(--ci1-date-spacing, normal);
    margin-top: 6px;
}

/* NEW 아이콘 */
.V1_IMG2 .vi2_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;
}

/* 빈 상태 */
.V1_IMG2.vi2_empty .empty_li {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #9ca3af;
    font-size: 14px;
}

/* 모바일 */
@media only all and (max-width: 767px) {
    .V1_IMG2 .vi2_thumb { border-radius: var(--ci1-img-radius, 12px); }
    .V1_IMG2 .vi2_info { padding: var(--ci1-txt-padding, 10px 0 0 0); }
    .V1_IMG2 .vi2_title { font-size: var(--ci1-title-size, 14px); }
    .V1_IMG2 .vi2_label { font-size: var(--ci1-label-size, 11px); }
}

/* ★ (2026-11-02) 영상 썸네일 버전 — view_mode=video: 카드에 ▶ 오버레이 + 클릭 시 영상 모달 (TOTAL_IMG1_MV 와 같은 모양) */
.V1_IMG2 .vi2_play { display: none; }
.V1_IMG2[data-view-mode="video"] .vi2_play {
    display: flex; position: absolute; inset: 0; align-items: center; justify-content: center;
    background: rgba(0,0,0,0); transition: background .3s ease; pointer-events: none; z-index: 2;
}
.V1_IMG2[data-view-mode="video"] .vi2_item:hover .vi2_play { background: rgba(0,0,0,.4); }
.V1_IMG2[data-view-mode="video"] .vi2_play i {
    font-size: clamp(36px, 4vw, 56px); color: #fff; opacity: .85; transition: opacity .3s ease, transform .3s ease;
    text-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.V1_IMG2[data-view-mode="video"] .vi2_item:hover .vi2_play i { opacity: 1; transform: scale(1.1); }
.vi2_modal_overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.vi2_modal { background: #fff; border-radius: 16px; width: 100%; max-width: 900px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.vi2_modal_head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #e5e7eb; }
.vi2_modal_title { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vi2_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; }
.vi2_modal_close:hover { background: #e2e8f0; color: #1e293b; }
.vi2_modal_body { flex: 1; overflow-y: auto; padding: 18px; }
.vi2_video_wrap { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; }
.vi2_video_wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; border-radius: 8px; }
@media only all and (max-width: 767px) {
    .vi2_modal { max-width: 100%; max-height: 85vh; border-radius: 12px; }
    .vi2_modal_body { padding: 12px; }
}
