/* static/css/portfolio_detail.css */

/* [필수] 변수 설정 */
:root {
    --primary-blue: #3182F6;
    --text-black: #191F28;
    --text-dark-gray: #333D4B;
    --text-gray: #6B7684;
    --white: #FFFFFF;
    --bg-gray: #F9FAFB;
    --radius-m: 12px;
    --radius-l: 20px;
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.08);
}

.detail-container {
    max-width: 80rem; 
    margin: 0 auto;
    padding: 5rem 3rem 7.5rem;
}

/* --- Title Section --- */
.detail-header {
    text-align: center;
    margin-bottom: 6rem;
    max-width: 100%; 
    margin-left: auto;
    margin-right: auto;
}

.project-title {
    font-size: 3.375rem;
    font-weight: 800;
    color: #191F28;
    margin-bottom: 1.5rem;
    line-height: 1.25;
    letter-spacing: -0.03em;
    word-break: keep-all;
}

.project-subtitle {
    font-size: 1.3125rem;
    color: #4E5968;
    font-weight: 500;
    line-height: 1.65;
    max-width: 60rem; 
    margin: 0 auto;
    word-break: keep-all;
    letter-spacing: -0.01em;
}

/* --- Hero Image --- */
.hero-image-wrapper {
    width: 100%;
    border-radius: var(--radius-l);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    margin-bottom: 6.25rem;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Content Layout (Grid) --- */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 18.75rem; 
    gap: 3.75rem;
}

/* --- Main Content (Left) --- */
.text-block, .solution-section, .result-section {
    margin-bottom: 5rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #191F28;
    border-left: 0.3125rem solid var(--primary-blue);
    padding-left: 1rem;
    border-bottom: 1px solid #E5E8EB;
    padding-bottom: 0.7rem;
    margin-bottom: 1.875rem;
    line-height: 1;
    display: block;
}

.sub-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #333D4B;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.text-block p, .solution-item p {
    font-size: 1.2em;
    line-height: 1.8;
    color: var(--text-dark-gray);
    word-break: keep-all;
    margin-bottom: 0;
}

.detail-image-card {
    background: var(--white);
    padding: 0.625rem;
    border-radius: var(--radius-m);
    box-shadow: 0 0.125rem 0.75rem rgba(0,0,0,0.05);
    margin-top: 1.5rem;
    margin-bottom: 5rem;
}

.detail-image-card img {
    width: 100%;
    border-radius: 0.75rem;
    display: block;
}

.img-caption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-top: 0.75rem;
}

/* --- Result List --- */
.result-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2.5rem;
}

.result-item {
    background-color: #F9FAFB;
    padding: 1.125rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-black);
    
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.result-item:hover {
    transform: translateY(-0.125rem);
    background-color: #fff;
    border-color: #E8F3FF;
    box-shadow: 0 0.25rem 1.25rem rgba(0,0,0,0.06);
}

.check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1875rem;
}

.result-text {
    line-height: 1.6;
}

/* --- Sidebar (Right) --- */
.info-card {
    background-color: var(--white);
    padding: 1.875rem;
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.05);
}

.sticky {
    position: sticky;
    top: 6.25rem;
}

.info-item {
    margin-bottom: 1.5rem;
}

.info-item h3 {
    font-size: 0.9rem;
    color: #1B64DA;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 700;
}

.info-item p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-black);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    font-size: 0.8125rem;
    background-color: #E8F3FF; 
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.info-actions {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    text-align: center;
    padding: 0.875rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: background-color 0.2s;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #1B64DA;
}

.btn-secondary {
    background-color: #F2F7FF; 
    text-align: center;
    padding: 0.875rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: #E8F3FF;
}

.btn-inquiry {
    background-color: #333D4B;
    color: white;
    text-align: center;
    padding: 0.875rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-inquiry:hover {
    background-color: #191F28;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* --- Scroll Animation --- */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.scroll-animate.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }

/* [중요] 줄바꿈(엔터) 처리용 클래스 */
.preserve-text {
    white-space: pre-line;
    word-break: keep-all;
    line-height: 1.6;
}

/* =========================================
   MOBILE RESPONSIVE (반응형)
   ========================================= */
@media (max-width: 768px) {
    /* 레이아웃 & 여백 */
    .detail-container {
        padding: 3rem 1.25rem 5rem;
    }

    /* 1. 헤더 */
    .detail-header {
        margin-bottom: 2.5rem;
        padding: 0 0.5rem;
    }
    .project-title {
        font-size: 2rem;
        line-height: 1.3;
        margin-bottom: 0.8rem;
    }
    .project-subtitle {
        font-size: 1.1rem;
        line-height: 1.6;
    }

    /* 2. 메인 이미지 */
    .hero-image-wrapper {
        margin-bottom: 3rem;
        border-radius: var(--radius-m);
    }

    /* 3. 본문 레이아웃 (1열) */
    .content-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* 4. 사이드바 (정보창) */
    .content-side {
        /* [선택] 정보를 먼저 보고 싶으면 order: -1; */
        order: 1; 
    }
    .info-card {
        padding: 1.5rem;
        background-color: #F9FAFB;
        border: 1px solid #E5E8EB;
    }
    .sticky { position: static; }

    /* 5. 섹션별 간격 축소 */
    .text-block, .solution-section, .result-section {
        margin-bottom: 3.5rem;
    }
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
        padding-bottom: 0.8rem;
    }
    
    /* 폰트 크기 미세 조정 */
    .preserve-text, .solution-item p {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    /* 6. 이미지 카드 */
    .detail-image-card {
        margin-top: 1rem;
        margin-bottom: 3rem;
        padding: 0.5rem;
    }

    /* 7. 성과 리스트 */
    .result-item {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 0.75rem;
    }
}