/* =====================================
   시공사례 상세 페이지
===================================== */
.portfolio-detail-page {
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    padding: 120px 15px 30px;
    box-sizing: border-box;
}

/* =====================================
   상단 뒤로가기
===================================== */
.portfolio-detail-header {
    margin-bottom: 20px;
}

.portfolio-detail-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: 0.25s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.portfolio-detail-back-btn i {
    font-size: 17px;
}

.portfolio-detail-back-btn:hover {
    background: #f8fafc;
    border-color: #4169e1;
    color: #4169e1;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(65, 105, 225, 0.12);
}

/* =====================================
   전체 박스
===================================== */
.portfolio-detail-box {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    box-sizing: border-box;
}

/* =====================================
   제목
===================================== */
.portfolio-detail-title {
    margin: 0 0 25px;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

/* =====================================
   업체 정보
===================================== */
.portfolio-detail-meta {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
}

.meta-label {
    color: #4169e1;
    font-weight: 600;
}

/* =====================================
   설명
===================================== */
.portfolio-detail-content {
    padding: 25px 0;
    color: #555;
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-line;
}

/* =====================================
   대표 이미지 - 사진 전체 표시
===================================== */
.portfolio-main-image {
    width: 100%;
    max-width: 700px;
    min-height: 250px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.portfolio-main-image img {
    width: 100%;
    height: auto;
    max-height: 650px;
    object-fit: contain;
    display: block;
}

/* =====================================
   사진첩
===================================== */

.portfolio-gallery {
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.portfolio-thumb {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    background: #fff;
}

.portfolio-thumb:hover,
.portfolio-thumb.active {
    border-color: #4169e1;
}

.portfolio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* =====================================
   이미지 모달
===================================== */

.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
}

.image-modal img {
    max-width: 85%;
    max-height: 85vh;
    object-fit: contain;
    touch-action: none;
    user-select: none;
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 40px;
    color: #fff;
    font-size: 45px;
    cursor: pointer;
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 55px;
    height: 55px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    transition: 0.25s;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(65, 105, 225, 0.85);
    transform: translateY(-50%) scale(1.08);
}

.modal-prev {
    left: 40px;
}

.modal-next {
    right: 40px;
}

/* =====================================
   태블릿
===================================== */

@media (max-width: 1060px) {
    .portfolio-detail-page {
        padding: 80px 20px 30px;
    }
}

/* =====================================
   Mobile
===================================== */

@media (max-width: 768px) {
    .portfolio-detail-page {
        padding: 80px 15px 40px;
        overflow-x: hidden;
    }

    /* 목록 버튼 */

    .portfolio-detail-header {
        margin-bottom: 25px;
        width: 100%;
    }

    .portfolio-detail-back-btn {
        width: 100%;
        height: 42px;
        padding: 0 12px;
        border-radius: 10px;
        font-size: 13px;
        box-sizing: border-box;
    }

    /* 상세 박스 */

    .portfolio-detail-box {
        padding: 20px;
        border-radius: 12px;
    }

    .portfolio-detail-title {
        font-size: 22px;
        line-height: 1.4;
        margin-bottom: 20px;
    }

    /* 업체 정보 */

    .portfolio-detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 18px 0;
    }

    .meta-item {
        font-size: 13px;
    }

    /* 내용 */

    .portfolio-detail-content {
        padding: 20px 0;
        font-size: 14px;
        line-height: 1.7;
    }

    /* 대표 이미지 */

    .portfolio-main-image {
        max-width: 100%;
        border-radius: 10px;
    }

    /* 사진첩 */

    .portfolio-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 15px;
    }

    .portfolio-thumb {
        border-radius: 7px;
    }
}

/* =====================================
   모바일 모달
===================================== */

@media (max-width: 600px) {
    .image-modal {
        padding: 0;
        box-sizing: border-box;
        overflow: hidden;
    }

    .image-modal img {
        width: auto;
        max-width: 95vw;
        max-height: 90vh;
        height: auto;
        min-width: 0;
        object-fit: contain;
        transform-origin: center center;
        transition: transform 0.05s linear;
        touch-action: none;
        user-select: none;
        will-change: transform;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        font-size: 36px;
        z-index: 20;
    }

    .modal-prev,
    .modal-next {
        width: 42px;
        height: 42px;
        font-size: 28px;
        font-weight: 700;
        line-height: 1;
        background: rgba(0, 0, 0, 0.65);
        color: #fff;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
        z-index: 20;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }
}
