/* MPB_MAIN_02_stack - 트랙inner 스택 위젯 CSS */
/* 그리드 분할, 아이템 박스, 헤더(제목/부제목/더보기), 데코, 관리자 모드 포함 */
/* 게시판 리스트(mpb02_xxx)만 각 latest 스킨에서 처리 */

/* 전체 감싸는 영역 - 세로 정렬 */
.stack_content_wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 타이틀 영역 */
.MPB_MAIN_02_stack .sub_stit_box {
    margin-bottom: clamp(20px, calc(1.56vw + 15px), 40px);
}

/* 타이틀이 비어있으면 숨김 */
.MPB_MAIN_02_stack .sub_stit_box:empty {
    display: none;
    margin: 0;
}

/* ================================================
   아이템 박스 공통 스타일
   ================================================ */

/* stack_item 패딩 */
.stack_item {
  
}

/* 헤더 영역 (제목, 부제목, 더보기) */
.stack_header {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: clamp(12px, calc(0.94vw + 9px), 24px);
    padding-bottom: clamp(10px, calc(0.78vw + 7.5px), 20px);
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.stack_header_txt {
    flex: 1;
    min-width: 0;
}

.stack_title {
    font-size: clamp(16px, calc(0.63vw + 14px), 20px);
    font-weight: 700;
    color: var(--item-color, #1976d2);
    margin: 0;
}

.stack_subtitle {
    font-size: clamp(12px, calc(0.23vw + 11.25px), 14px);
    color: #666;
    margin: 6px 0 0 0;
    line-height: 1.4;
}

/* 더보기 버튼 */
.stack_more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff!important;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.stack_more:hover {
    opacity: 0.85;
    transform: scale(1.1);
}

/* ================================================
   그리드 레이아웃
   ================================================ */
.stack_grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(15px, calc(1.17vw + 11.25px), 30px);
}

/* 아이템 래퍼 */
.stack_item_wrapper {
    position: relative;
}

/* 공통 아이템 스타일 - 기본 박스만 */
.stack_item { width: 100%; float: left
   
}

/* 배경색 채우기 타입 (stack_item_fill 클래스 추가 시) */
.stack_item.stack_item_fill {
    background: var(--item-color, #1976d2);
    border-color: var(--item-color, #1976d2);
}

.stack_item.stack_item_fill .stack_header {
    border-bottom-color: rgba(255,255,255,0.3);
}

.stack_item.stack_item_fill .stack_title,
.stack_item.stack_item_fill .stack_subtitle {
    color: #fff;
}

.stack_item.stack_item_fill .stack_more {
    background: #fff;
    color: var(--item-color, #1976d2);
}

/* 제목 없이 통으로 표시 (stack_list_full) */
.stack_list_full {
    /* 헤더가 없으므로 패딩 없이 꽉 채움 */
}

.stack_item:has(.stack_list_full) {
    padding: 0;
}

.stack_item:has(.stack_list_full) .stack_list_full {
    height: 100%;
}

/* ================================================
   데코 배경 영역 (contents-container 외부)
   txt[99]='deco'인 항목의 txt[1] HTML이 여기에 출력됨
   ================================================ */
.stack_deco_area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.stack_deco_bg {
    position: absolute;
    pointer-events: none;
}

/* 데코 내부 .bg 클래스 기본 스타일 */
.stack_deco_bg .bg {
    position: absolute;
}

/* 데코 영역 (그리드 내 아이템) - 사용 안함 */
.stack_deco {
    display: none;
}

/* ================================================
   관리자 모드 스타일
   ================================================ */

/* 스택 전체 설정 뱃지 */
.stack_badge {
    position: absolute;
    top: -15px;
    right: 10px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.stack_badge:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.stack_badge i {
    font-size: 14px;
}

.stack_badge .badge_hint {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    margin-left: 4px;
}

/* 관리자 모드 그리드 */
.stack_grid.stack_admin_mode {
    position: relative;
    border: 2px dashed transparent;
    transition: border-color 0.2s ease;
}

.stack_grid.stack_admin_mode:hover {
    border-color: #10b981;
}

/* 관리자 개별 항목 편집 아이콘 */
.stack_edit_icon {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stack_edit_icon i {
    color: #fff;
    font-size: 12px;
}

.stack_item_wrapper:hover .stack_edit_icon {
    opacity: 1;
}

.stack_edit_icon:hover {
    background: #059669;
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.5);
}

/* 관리자 모드 - 아이템 호버 시 강조 */
.stack_admin_mode .stack_item_wrapper:hover .stack_item {
    outline: 2px dashed #10b981;
    outline-offset: 2px;
}

/* ================================================
   반응형
   ================================================ */
@media screen and (max-width: 1200px) {
    .stack_grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 640px) {
    .stack_grid {
        grid-template-columns: 1fr;
    }
}
