/* ================================================================
   [Works Detail 통합 스타일 - portfolio_page.css]
   ================================================================ */

/* 1. 전체 구조 및 시작점 통일 (works04.php 기준) */
.works-detail-snap {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    scroll-snap-align: none !important;
    justify-content: flex-start !important;
    padding-top: 140px !important; /* PC 시작점 */
    padding-bottom: calc(var(--site-footer-h, 150px) + 110px) !important;
}

[id^="page-works"] .sub-header {
    padding-top: 0 !important;
    margin-top: 0 !important;
    text-align: center;
}

/* 2. 브레드크럼 및 텍스트 스타일 */
.works-breadcrumb { font-size: 1rem; margin-top: 0; margin-bottom: 18px; color: #aaa; text-align: center; }
.works-breadcrumb a { color: #aaa; text-decoration: none; transition: color 0.2s ease; }
.works-breadcrumb a:hover { color: #ff2c2c; }
.works-breadcrumb .current-noola { color: #ff2c2c !important; font-weight: 600; letter-spacing: 0.01em; }

.brand-desc, .brand-info-text, .brand-intro-text { 
    text-align: center; margin: 18px 0 24px 0; color: #a0a0a0; font-size: 1.13em; font-weight: 300; 
}
.works-detail-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px auto 28px;
}
.works-detail-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 650;
    line-height: 1;
    text-decoration: none !important;
    transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}
.works-detail-action-primary {
    background: #ff2c2c;
    border: 1px solid #ff2c2c;
    color: #fff !important;
}
.works-detail-action-primary:hover,
.works-detail-action-primary:focus-visible {
    background: #e82222;
    border-color: #e82222;
    color: #fff !important;
    outline: none;
}
.works-detail-action-secondary {
    background: #fff;
    border: 1px solid #fff;
    color: #ff2c2c !important;
}
.works-detail-action-secondary:hover,
.works-detail-action-secondary:focus-visible {
    background: transparent;
    border-color: #fff;
    color: #fff !important;
    outline: none;
}
.vertical-divider { width: 2px; height: 32px; background: #fff; margin: 0 auto 18px auto; border-radius: 2px; }

/* 3. 상세 정보 그리드 */
.project-detail-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); row-gap: 24px; column-gap: 40px;
    max-width: 1200px; margin: 32px auto 50px auto; text-align: left;
}
.project-detail-item { display: flex; flex-direction: column; }
.project-detail-title { display: block; font-weight: 600; color: #fff; margin-bottom: 8px; font-size: 1.18em; text-align: left; }
.project-detail-body { color: #a0a0a0; font-weight: 300; line-height: 1.65; word-break: keep-all; overflow-wrap: break-word; font-size: 1.04em; text-align: left; }

/* 4. 이미지 및 비디오 레이아웃 */
.works-image-wrapper { margin-top: 48px; text-align: center; }
.works-detail-img {
    width: min(100%, 1200px) !important;
    max-width: 1200px !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto 1600 / 1000;
    object-fit: contain !important;
    border-radius: 24px;
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
    contain: paint;
    backface-visibility: hidden;
}

@supports (content-visibility: auto) {
    .works-detail-img {
        content-visibility: auto;
        contain-intrinsic-size: 1200px 750px;
    }
}

.video-container {
    position: relative; width: 100% !important; max-width: 1200px !important; height: auto;
    aspect-ratio: 16 / 9;
    margin: 32px auto 0 auto !important; background: transparent !important;
    border-radius: 24px; overflow: hidden; padding: 0 !important;
    border: none !important; outline: none !important;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}
.custom-video, .video-container video {
    width: 100% !important; min-width: 100% !important; max-width: 1200px; height: 100% !important;
    display: block !important; object-fit: contain !important;
    background: transparent !important; border: none !important; border-radius: 24px;
}

/* 5. 핵심 기능 구분선 */
.feature-divider-wrapper { display: flex; align-items: center; justify-content: center; margin: 48px 0; }
.horizontal-divider { flex: 1; height: 2px; background: #fff; opacity: 0.3; }
.core-feature-title { font-size: 2em; font-weight: 700; color: #fff; padding: 0 12px; margin: 0; }

/* 6. [추가] 목록으로 돌아가기 버튼 스타일 */
.works-related-service {
    width: min(100%, 1200px);
    margin: 64px auto 0;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
}
.works-related-service span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}
.works-related-service a {
    color: #fff;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.22s ease;
}
.works-related-service a::after {
    content: " ↗";
    color: #ff2c2c;
}
.works-related-service a:hover {
    color: #ff2c2c;
}
.back-btn-wrapper { margin-top: 80px; display: flex; justify-content: center; padding-bottom: 80px; }
.btn-back-list {
    display: inline-flex; align-items: center; gap: 10px; padding: 16px 40px;
    background: #ff2c2c; border: 1px solid #ff2c2c;
    border-radius: 40px; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.3s, color 0.3s, border-color 0.3s;
    text-decoration: none !important;
}
.btn-back-list:hover,
.btn-back-list:focus,
.btn-back-list:active {
    background: #fff;
    border-color: #fff;
    color: #ff2c2c;
    text-decoration: none !important;
}

/* 7. 라이트 모드 */
body.light-mode [id^="page-works"] .project-detail-title,
body.light-mode [id^="page-works"] .core-feature-title,
body.light-mode [id^="page-works"] h2 { color: #0b0b0b !important; }
body.light-mode [id^="page-works"] .project-detail-body,
body.light-mode [id^="page-works"] .brand-desc { color: #444 !important; }
body.light-mode [id^="page-works"] .vertical-divider,
body.light-mode [id^="page-works"] .horizontal-divider { background: #0b0b0b !important; }
body.light-mode .works-related-service {
    background: #f4f4f4;
    border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .works-related-service span { color: rgba(0, 0, 0, 0.58); }
body.light-mode .works-related-service a { color: #0b0b0b; }
body.light-mode .works-related-service a:hover { color: #ff2c2c; }
body.light-mode .works-detail-action-secondary:hover,
body.light-mode .works-detail-action-secondary:focus-visible {
    border-color: #0b0b0b;
    color: #0b0b0b !important;
}
body.light-mode .btn-back-list { background: #ff2c2c; border-color: #ff2c2c; color: #fff; }
body.light-mode .btn-back-list:hover { background: #fff; border-color: #fff; color: #ff2c2c; }

/* ================================================================
   [모바일 전용 최적화] 시작점 하향 조정 및 텍스트 크기 통일
   ================================================================ */
@media (max-width: 768px) {
    /* 1. 시작점 조금 더 아래로 조정 (기존 85px -> 105px) */
    .works-detail-snap { 
        padding-top: 105px !important;
        padding-bottom: 96px !important;
    }
    
    .works-breadcrumb { font-size: 13px !important; margin-bottom: 10px !important; }

    /* 2. works02, 03, 04 서브 텍스트 크기를 works01과 동일하게 14px로 통일 */
    .brand-desc, 
    .brand-info-text, 
    .brand-intro-text { 
        font-size: 14px !important; 
        margin: 10px 0 20px 0 !important; 
        line-height: 1.4 !important;
    }
    .works-detail-actions {
        gap: 8px;
        margin: 14px auto 22px;
    }
    .works-detail-action {
        min-height: 38px;
        padding: 0 18px;
        font-size: 13px;
    }

    /* 상세 정보 그리드 및 기타 요소 유지 */
    .project-detail-grid { grid-template-columns: 1fr !important; row-gap: 20px !important; margin-top: 24px !important; }
    .project-detail-title { font-size: 16px !important; margin-bottom: 6px !important; }
    .project-detail-body { font-size: 14px !important; line-height: 1.5 !important; }
    .feature-divider-wrapper { margin: 30px 0 !important; }
    .core-feature-title { font-size: 22px !important; }
    .works-image-wrapper, .video-container { margin-top: 24px !important; }
    .works-related-service {
        flex-direction: column;
        align-items: center;
        margin-top: 42px;
        padding: 22px 18px;
        text-align: center;
    }
    .works-related-service a { font-size: 15px; }
    .back-btn-wrapper { margin-top: 50px !important; padding-bottom: 50px !important; }
    .btn-back-list { padding: 12px 30px !important; font-size: 14px !important; }
}
