/* main-content 전체 중앙 정렬 및 여백 */
#main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 가로 중앙 */
    text-align: center;
    /* 텍스트 가운데 정렬 */
    padding: 40px 20px;
    /* 상하좌우 여백 */
    background: #f9f9f9;
    /* 원하는 배경색 */
}

/* hero 섹션 연두색 배경, 가로로 길게 */
.hero-works {
    background-color: #d4f7c0;
    /* 연두색 */
    width: 100%;
    height: 200px;
    /* 원하는 가로 길이 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* 세로 중앙 정렬 */
    align-items: center;
    /* 가로 중앙 정렬 */
    color: #1a1a1a;
    text-align: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.hero-works h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero-works p {
    font-size: 18px;
    color: #333;
    margin: 0;
}

/* 반응형 */
@media (max-width: 640px) {
    .hero-works {
        height: 200px;
        /* 모바일에서 조금 작게 */
        padding: 0 16px;
    }

    .hero-works h1 {
        font-size: 28px;
    }

    .hero-works p {
        font-size: 16px;
    }
}

/* 시공사례 카드 레이아웃 */
.works {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* 카드 간 간격 */
}

.work-card {
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.work-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
}

/* 기존 img */
.work-card img.thumb {
    width: 100%;
    height: 200px;
    /* 카드 높이 고정 */
    object-fit: contain;
    /* 이미지 전체가 보이도록 */
    background: #f0f0f0;
    /* 남는 공간 채울 배경색 */
    display: block;
}


/* + 버튼 */
.expand-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 20px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #000;
    color: #fff;
    cursor: pointer;
}

/* 상세 영역: 기본은 감춤 */
.details {
    display: none;
    padding: 16px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

/* 카드 확장 상태 */
.work-card.expanded {
    flex-direction: column;
    /* details가 아래로 내려가도록 */
    align-items: stretch;
}

/* 상세 영역: 항상 아래 */
.work-card .details {
    display: none;
    width: 100%;
    padding: 16px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    box-sizing: border-box;
}

/* 확장 시 details 보이기 */
.work-card.expanded .details {
    display: block;
}

/* 반응형 */
@media (max-width: 640px) {
    .work-card {
        flex-direction: column;
    }

    .work-card img.thumb {
        width: 100%;
        height: auto;
    }
}

/* 펼친 상태: + 버튼 숨기기 */
.work-card.expanded .expand-btn {
    display: none;
}

/* 공통 버튼 */
.expand-btn,
.close-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    /* + 버튼과 같은 좌표 */
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #000;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

/* 기본 상태에서는 X 숨기기 */
.close-btn {
    display: none;
}

/* 펼쳤을 때: + 숨기고 X 보이기 */
.work-card.expanded .expand-btn {
    display: none;
}

.work-card.expanded .close-btn {
    display: flex;
}

/* 여러 칸 카드 그리드 */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(16px, 2vw, 28px);
    align-items: start;
    margin-top: 100px;
    padding-bottom: 100px;
    /* hero와 카드 사이 여백 */
}

@media (max-width: 960px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 40px;
        /* 화면 좁아지면 여백 줄이기 */
    }
}

@media (max-width: 640px) {
    .works-grid {
        grid-template-columns: 1fr;
        margin-top: 60px;
        /* 모바일은 여백 조금만 */
    }
}