/* ================================================
   TOTAL_IMG1 - 이미지 갤러리형 스킨
   ================================================ */
.TOTAL_IMG1 {
    width: 100%;
    float: left;
}
/* ★ 100% 높이 모드 (그리드 형제와 동일 높이) */
.TOTAL_IMG1.img1_full_height { height: 100%; display: flex; flex-direction: column; }
.TOTAL_IMG1.img1_full_height .img1_grid { flex: 1; min-height: 0; align-content: start; }

/* 그리드 레이아웃 */
.TOTAL_IMG1 .img1_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--img1-grid-min, 200px), 1fr));
    gap: clamp(12px, calc(0.94vw + 9px), 24px);
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* 카드 아이템 */
.TOTAL_IMG1 .img1_card {
    display: block;
    width: 100%;
    background: var(--img1-box-bg, #fff);
    border-radius: var(--img1-box-radius, 16px);
    box-shadow: var(--img1-box-shadow, none);
    overflow: hidden;
    padding: var(--img1-box-padding, 0);
    transition: box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}
.TOTAL_IMG1 .img1_card:hover {
    box-shadow: var(--img1-box-shadow-hover, 0 8px 24px rgba(0,0,0,0.12));
}

/* ================================================
   이미지 영역
   ================================================ */
.TOTAL_IMG1 .img1_thumb {
    position: relative;
    width: 100%;
    aspect-ratio: var(--img1-img-ratio, 3/4);
    overflow: hidden;
    border-radius: var(--img1-img-radius, 0);
    background: var(--img1-img-bg, #f1f5f9);
    border: var(--img1-img-border-width, 0) solid var(--img1-img-border-color, transparent);
    transition: border-color 0.3s ease, border-width 0.3s ease;
}
.TOTAL_IMG1 .img1_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: var(--img1-img-opacity, 1);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.TOTAL_IMG1 .img1_card:hover .img1_thumb {
    border-color: var(--img1-img-border-hover-color, var(--img1-img-border-color, transparent));
    border-width: var(--img1-img-border-hover-width, var(--img1-img-border-width, 0));
}
.TOTAL_IMG1 .img1_card:hover .img1_thumb img {
    transform: scale(1.05);
    opacity: var(--img1-img-hover-opacity, var(--img1-img-opacity, 1));
}

/* ================================================
   영상 플레이 오버레이
   ================================================ */
.TOTAL_IMG1 .img1_play_overlay {
    display: none;
}
/* video 모드일 때만 활성화 */
.TOTAL_IMG1[data-view-mode="video"] .img1_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[data-view-mode="video"] .img1_card:hover .img1_play_overlay {
    background: rgba(0,0,0,0.4);
}
.TOTAL_IMG1[data-view-mode="video"] .img1_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[data-view-mode="video"] .img1_card:hover .img1_play_overlay i {
    opacity: 1;
}

/* ================================================
   텍스트 영역
   ================================================ */
.TOTAL_IMG1 .img1_info {
    padding: var(--img1-txt-padding, 16px 10px 20px);
    text-align: var(--img1-title-align, left);
    width: 100%;
    float: left;
}

/* 라벨 */
.TOTAL_IMG1 .img1_label {
    display: var(--img1-label-display, inline-block);
    font-size: var(--img1-label-size, 11px);
    color: var(--img1-label-font-color, #64748b);
    background: var(--img1-label-color, #f1f5f9);
    padding: var(--img1-label-padding, 2px 8px);
    border-radius: var(--img1-label-radius, 20px);
    margin-bottom: 8px;
    line-height: 1.4;
}

/* 제목 */
.TOTAL_IMG1 .img1_title {
    font-size: var(--img1-title-size, clamp(14px, calc(0.31vw + 13px), 16px));
    font-weight: 700;
    color: var(--img1-title-color, #1e293b);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
}

/* 본문 발췌 */
.TOTAL_IMG1 .img1_content {
    font-size: var(--img1-content-size, 13px);
    color: var(--img1-content-color, #64748b);
    line-height: 1.5;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 날짜 */
.TOTAL_IMG1 .img1_date {
    display: var(--img1-date-display, block);
    font-size: var(--img1-date-size, 12px);
    color: var(--img1-date-color, #94a3b8);
    margin-top: 8px;
    line-height: 1.3;
}

/* NEW 아이콘 */
.TOTAL_IMG1 .img1_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 .img1_empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
}

/* ================================================
   모달
   ================================================ */
.img1_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;
}
.img1_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);
}
.img1_modal_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    gap: 12px;
}
.img1_modal_title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.img1_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;
}
.img1_modal_close:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.img1_modal_body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
/* 모달 내 이미지 */
.img1_modal_img {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
}
.img1_modal_img img {
    width: 100%;
    height: auto;
    display: block;
}
/* 모달 내 본문 */
.img1_modal_content {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    word-break: keep-all;
}
.img1_modal_content img {
    max-width: 100%;
    height: auto;
}
/* 영상 모달 */
.img1_video_wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}
.img1_video_wrap iframe,
.img1_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 .img1_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(8px, 2vw, 16px);
    }
    .TOTAL_IMG1 .img1_info {
        padding: var(--img1-txt-padding, 12px 8px 16px);
    }
    .TOTAL_IMG1 .img1_label {
        font-size: 10px;
        padding: 1px 6px;
        margin-bottom: 6px;
    }
    .img1_modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 12px;
    }
    .img1_modal_body {
        padding: 16px;
    }
}
@media only all and (max-width: 480px) {
    .TOTAL_IMG1 .img1_grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
