/* =========================================================
   projects.css
   項目列表 + 滾動縮放 + p1風格詳情浮層 + 全屏看圖
   導航樣式已移交 common.css
========================================================= */

/* --- 1. Base Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: #fcfcfc;
    color: #1a1a1a;
    overflow-x: hidden;
    line-height: 1.6;
}

body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* --- 2. Project List --- */
.list-container {
    width: 100%;
    padding: 0 0 45vh 0;
}

.project-item {
    position: relative;
    width: 90%;
    max-width: 600px;
    margin: 0 auto 20vh auto;
    text-align: center;
}

.img-container {
    width: 100%;
    cursor: pointer;
    will-change: transform, opacity;
    transform-origin: center bottom;
}

.img-container img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.project-title {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 40px;
    width: 100%;
    padding: 0 12px;
    font-size: 13px;
    letter-spacing: 4px;
    font-weight: 300;
    text-transform: uppercase;
    color: #333;
    pointer-events: none;
}

/* --- 3. Detail Overlay --- */
.overlay-backdrop {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.overlay-panel {
    position: absolute;
    left: 0;
    top: 16.67vh;
    width: 100%;
    height: 66.67vh;
    background: #ffffff;
    transform: translateY(100vh);
    transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.overlay-backdrop.active .overlay-panel {
    transform: translateY(0);
}

.overlay-backdrop.closing .overlay-panel {
    transform: translateY(100vh);
}

.overlay-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 72px 40px 96px;
    max-width: 980px;
    margin: 0 auto;
}

.overlay-content::-webkit-scrollbar {
    display: none;
}

.overlay-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#detailTitle {
    text-align: center;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 5px;
    margin-bottom: 24px;
    text-transform: uppercase;
    color: #111;
}

.overlay-description {
    max-width: 560px;
    margin: 0 auto 72px auto;
    font-size: 15px;
    line-height: 2;
    color: #777;
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.4px;
}

.overlay-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 72px;
}

.gallery-item {
    width: 100%;
    display: flex;
    justify-content: center;
}

.gallery-item img {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item img:hover {
    transform: scale(1.02);
}

/* --- 4. Fullscreen Zoom View --- */
.zoom-view {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.zoom-view.active {
    display: flex;
}

.zoom-slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.zoom-slide {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px;
    position: relative;
}

.zoom-slide img {
    max-width: 85%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.02);
}

.zoom-header {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5100;
}

.zoom-counter {
    position: absolute;
    top: 40px;
    left: 40px;
    color: #fff;
    font-size: 16px;
    letter-spacing: 2px;
}

.close-zoom {
    position: absolute;
    top: 30px;
    right: 40px;
    pointer-events: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 35px;
    font-weight: 200;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s ease, color 0.3s ease;
}

.close-zoom:hover {
    transform: scale(1.1);
    color: #ccc;
}

.nav-area {
    position: absolute;
    top: 0;
    height: 100%;
    width: 20%;
    z-index: 5050;
}

.nav-left {
    left: 0;
    cursor: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 24L12 16L20 8' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, w-resize;
}

.nav-right {
    right: 0;
    cursor: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 24L20 16L12 8' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, e-resize;
}

.zoom-view.no-nav .nav-area {
    cursor: default;
}

/* --- 5. Responsive --- */
@media (max-width: 768px) {
    .project-item {
        margin-bottom: 30vh;
    }

    .overlay-panel {
        top: 0;
        height: 100vh;
    }

    .overlay-content {
        padding: 80px 25px;
    }

    #detailTitle {
        font-size: 20px;
        letter-spacing: 3px;
        margin-bottom: 18px;
    }

    .overlay-description {
        font-size: 14px;
        margin-bottom: 50px;
    }

    .overlay-gallery {
        gap: 40px;
    }

    .zoom-slide {
        padding: 40px 20px;
    }

    .zoom-slide img {
        max-width: 100%;
    }

    .close-zoom {
        top: 20px;
        right: 20px;
        font-size: 30px;
    }

    .zoom-counter {
        top: 24px;
        left: 20px;
    }
}