/**
 * 시공사례 섹션 스타일
 */

/* ==================== 시공사례 그리드 ==================== */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ==================== 시공사례 아이템 ==================== */

.portfolio-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* 이미지 래퍼 */
.portfolio-item__image-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    background: #f3f4f6;
    overflow: hidden;
}

.portfolio-item__no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.9rem;
}

/* 카테고리 배지 */
.portfolio-item__category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 1rem;
    background: rgba(44, 90, 160, 0.9);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 10;
}

/* 컨텐츠 영역 */
.portfolio-item__content {
    padding: 1.5rem;
}

.portfolio-item__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.portfolio-item__location,
.portfolio-item__date {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0.4rem 0;
}

.portfolio-item__description {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* ==================== 포트폴리오 슬라이더 ==================== */

.portfolio-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.portfolio-slider__item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.portfolio-slider__item.active {
    opacity: 1;
    pointer-events: auto;
}

.portfolio-slider__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 네비게이션 버튼 */
.portfolio-slider__prev,
.portfolio-slider__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-slider:hover .portfolio-slider__prev,
.portfolio-slider:hover .portfolio-slider__next {
    opacity: 1;
}

.portfolio-slider__prev {
    left: 0.75rem;
}

.portfolio-slider__next {
    right: 0.75rem;
}

.portfolio-slider__prev:hover,
.portfolio-slider__next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

/* 이미지 카운터 */
.portfolio-slider__counter {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 10;
}

.portfolio-slider__counter .current {
    font-weight: 700;
}

/* 인디케이터 */
.portfolio-slider__indicators {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.indicator-dot.active {
    width: 24px;
    background: rgba(255, 255, 255, 1);
    border-radius: 4px;
}

/* ==================== 빈 상태 ==================== */

.portfolio-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
    font-size: 1.1rem;
}

/* ==================== 시공사례 모달 ==================== */

.portfolio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    overflow-y: auto;
}

.portfolio-modal.active {
    display: block;
}

/* 오버레이 */
.portfolio-modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1;
}

/* 모달 컨테이너 */
.portfolio-modal__container {
    position: relative;
    max-width: 1200px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1250px) {
    .portfolio-modal__container {
        margin: 1rem;
    }
}

/* 닫기 버튼 */
.portfolio-modal__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-modal__close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
}

/* 모달 헤더 */
.portfolio-modal__header {
    padding: 2.5rem 3rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.portfolio-modal__category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(44, 90, 160, 0.1);
    color: #2c5aa0;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.portfolio-modal__title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.portfolio-modal__meta {
    display: flex;
    gap: 2rem;
    font-size: 1rem;
    color: #6b7280;
}

@media (max-width: 768px) {
    .portfolio-modal__header {
        padding: 2rem 1.5rem 1rem;
    }

    .portfolio-modal__title {
        font-size: 1.5rem;
    }

    .portfolio-modal__meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 갤러리 영역 */
.portfolio-modal__gallery {
    padding: 2rem 3rem;
}

@media (max-width: 768px) {
    .portfolio-modal__gallery {
        padding: 1.5rem;
    }
}

/* 메인 이미지 */
.portfolio-modal__main-image {
    position: relative;
    width: 100%;
    height: 600px;
    background: #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.portfolio-modal__main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .portfolio-modal__main-image {
        height: 400px;
    }
}

/* 모달 네비게이션 버튼 */
.portfolio-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-modal__nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.portfolio-modal__nav--prev {
    left: 1.5rem;
}

.portfolio-modal__nav--next {
    right: 1.5rem;
}

@media (max-width: 768px) {
    .portfolio-modal__nav {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }

    .portfolio-modal__nav--prev {
        left: 0.75rem;
    }

    .portfolio-modal__nav--next {
        right: 0.75rem;
    }
}

/* 모달 카운터 */
.portfolio-modal__counter {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    z-index: 10;
}

/* 썸네일 그리드 */
.portfolio-modal__thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    max-height: 180px;
    overflow-y: auto;
}

.portfolio-modal__thumbnail {
    position: relative;
    width: 100%;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.portfolio-modal__thumbnail:hover {
    border-color: #2c5aa0;
    transform: scale(1.05);
}

.portfolio-modal__thumbnail.active {
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.2);
}

.portfolio-modal__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .portfolio-modal__thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.75rem;
    }

    .portfolio-modal__thumbnail {
        height: 70px;
    }
}

/* 설명 영역 */
.portfolio-modal__content {
    padding: 2rem 3rem 2.5rem;
    border-top: 1px solid #e5e7eb;
}

.portfolio-modal__description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4b5563;
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .portfolio-modal__content {
        padding: 1.5rem;
    }

    .portfolio-modal__description {
        font-size: 0.95rem;
    }
}

/* 키보드 네비게이션 포커스 */
.portfolio-modal__nav:focus,
.portfolio-modal__close:focus {
    outline: 3px solid #2c5aa0;
    outline-offset: 2px;
}

/* 스크롤바 스타일 (WebKit) */
.portfolio-modal__thumbnails::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.portfolio-modal__thumbnails::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.portfolio-modal__thumbnails::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 4px;
}

.portfolio-modal__thumbnails::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* body에 모달 열렸을 때 스크롤 방지 */
body.modal-open {
    overflow: hidden;
}
