/* --- 1. 섹션 헤더 (정밀 사이즈 및 정렬) --- */
.wwhd-wrapper {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 20px;
}

.wwhd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 60px;
    gap: 60px;
}

.wwhd-main-title {
    font-size: 64px; /* 이미지처럼 큼직하게 */
    font-weight: 800;
    color: #3191FF; /* 주인님이 아까 정해주신 그 색상 */
    margin: 0 0 10px 0;
    line-height: 1.1;
    letter-spacing: -0.5px; /* 세리프체는 자간을 너무 조이지 않는 게 예쁩니다 */
    font-style: normal;
}

.wwhd-sub-title {
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.wwhd-header-right { flex: 1; max-width: 650px; padding-top: 8px; }

.wwhd-header-desc {
    font-size: 16px;
    line-height: 1.7;
    color: #555;
    text-align: justify;
    word-break: keep-all;
}

/* --- 2. 그리드 & 애니메이션 (시간 최적화) --- */
.wwhd-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    transition: grid-template-columns 1.1s cubic-bezier(0.2, 0, 0, 1);
}

.wwhd-item {
    position: relative;
    height: 480px;
    border-radius: 20px;
    overflow: hidden;
    background-image: var(--bg-url);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: all 1.5s cubic-bezier(0.2, 0, 0, 1);
}

.wwhd-item::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 24, 57, 0.88);
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 2;
}
.wwhd-item.is-expanded::after { opacity: 1; }

/* --- 3. 기본 상태 (뱃지 왼쪽 상단 구석) --- */
.wwhd-item-default {
    position: relative;
    z-index: 3;
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.wwhd-badge-container {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
}

.wwhd-badge {
    background: #0055FF;
    opacity: 0.85;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.wwhd-item-title { 
    color: #fff; 
    font-size: 18px; 
    font-weight: 700; 
    opacity: 0; 
    transform: translateY(15px);
    transition: all 0.4s ease;
}

.wwhd-btn-learn { 
    color: #fff; 
    border-bottom: 1px solid #fff; 
    font-size: 12px;
    opacity: 0; 
    transition: all 0.4s ease;
}

.wwhd-item:hover:not(.is-expanded) .wwhd-btn-learn { opacity: 1; }

/* --- 4. 확장 상태 UI & 정중앙 배치 --- */
.wwhd-item-expanded {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 5;
    padding: 20px 50px; /* 상하 여백을 줄여 중앙 공간 확보 */
    display: flex;
    align-items: center; /* 카드 세로 기준 정중앙 배치 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.wwhd-item.is-expanded .wwhd-item-expanded { 
    opacity: 1; 
    visibility: visible; 
    transition: opacity 0.6s ease 0.5s, visibility 0.6s ease 0.5s; 
}

.wwhd-item.is-expanded .wwhd-item-default { opacity: 0; pointer-events: none; }

.wwhd-expanded-inner { 
    display: flex; 
    flex-direction: column; 
    width: 100%; 
    color: #fff; 
    gap: 15px; /* 요소 간 간격 살짝 축소 */
    text-align: left;
}

.wwhd-exp-title { 
    font-size: 26px; 
    font-weight: 800; 
    line-height: 1.3; 
    margin: 0;
}

.wwhd-exp-desc { 
    font-size: 15px; 
    line-height: 1.7; 
    color: rgba(255,255,255,0.95); 
    margin: 0;
    max-width: 520px; 
    word-break: keep-all;
}

.wwhd-btn-detail {
    align-self: flex-start;
    display: inline-block;
    padding: 10px 28px; /* 버튼 세로 크기 살짝 조정 */
    background: #0055FF;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    margin-top: 5px;
}

.wwhd-btn-close {
    position: absolute; top: 25px; right: 25px;
    background: none; border: none; color: #fff; font-size: 35px; cursor: pointer;
    line-height: 1;
}

@media (max-width: 1024px) {
    .wwhd-header { flex-direction: column; gap: 20px; }
    .wwhd-grid { grid-template-columns: repeat(2, 1fr) !important; }
}