/* Portfolio Detail Styles */

/* Hero Section */
.portfolio-hero {
    height: 50vh; /* 降低hero區高度 */
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/hero-bg.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
}

.portfolio-hero-content {
    max-width: 900px;
    padding: 0 2rem;
}

.portfolio-hero h1 {
    font-size: 2.8rem; /* 較小的標題 */
    margin-bottom: 0.8rem;
    color: #ffffff;
    line-height: 1.2;
    font-weight: 600;
}

.portfolio-category {
    font-size: 1rem; /* 較小的類別文字 */
    color: #00e5ff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Content Section */
.portfolio-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 2rem; /* 稍微減少上下間距 */
}

.portfolio-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem; /* 稍微減少間距 */
    margin-bottom: 3.5rem;
}

.portfolio-description h2 {
    font-size: 1.7rem; /* 較小的標題 */
    margin-bottom: 1.2rem;
    color: #00e5ff;
    font-weight: 600;
}

.portfolio-description p {
    margin-bottom: 1.2rem;
    line-height: 1.7; /* 稍微調整行高 */
    font-size: 0.95rem; /* 略小的段落文字 */
    color: #e0e0e0;
}

.portfolio-details {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1.8rem;
    border-radius: 10px;
}

.detail-item {
    margin-bottom: 1.2rem;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item h3 {
    font-size: 1.1rem; /* 略小的標題 */
    margin-bottom: 0.4rem;
    color: #00e5ff;
    font-weight: 500;
}

.detail-item p {
    font-size: 0.95rem;
    color: #e0e0e0;
}

/* Gallery Section */
.portfolio-gallery {
    margin-bottom: 3.5rem;
}

.portfolio-gallery h2, 
.portfolio-video h2,
.related-projects h2 {
    font-size: 1.7rem; /* 統一所有主要標題大小 */
    margin-bottom: 1.5rem;
    color: #00e5ff;
    font-weight: 600;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 8px; /* 稍微降低圓角 */
    overflow: hidden;
    aspect-ratio: 16/9;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.8);
}

/* 燈箱樣式 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    padding: 30px;
}

.lightbox-content {
    display: block;
    max-width: 90%;
    max-height: 80vh;
    margin: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 24px; /* 稍微減小關閉按鈕 */
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: #00e5ff;
}

.lightbox-caption {
    text-align: center;
    color: white;
    padding: 15px 0;
    position: absolute;
    bottom: 0;
    width: 100%;
    left: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    font-size: 0.95rem;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    left: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
}

.lightbox-prev, .lightbox-next {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 20px; /* 較小的箭頭 */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(0, 229, 255, 0.5);
}

.gallery-item::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 1.7rem; /* 稍微減小放大鏡圖示 */
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.gallery-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.gallery-image {
    transition: transform 0.4s ease, filter 0.4s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
    filter: brightness(0.8);
}

/* Video Section */
.portfolio-video {
    margin-bottom: 3.5rem;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Related Projects */
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.related-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.related-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 229, 255, 0.2);
}

.related-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
    transition: transform 0.4s;
}

.related-item:hover img {
    transform: scale(1.05);
}

.related-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 1.2rem;
}

.related-overlay h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: #ffffff;
}

.related-overlay p {
    font-size: 0.9rem;
    color: #cccccc;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .portfolio-content {
        padding: 3rem 2rem;
    }
}

@media (max-width: 992px) {
    .portfolio-hero h1 {
        font-size: 2.4rem;
    }
    
    .portfolio-description h2,
    .portfolio-gallery h2, 
    .portfolio-video h2,
    .related-projects h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .portfolio-info {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-hero {
        height: auto;
        min-height: 40vh;
        padding: 100px 0 50px;
    }
    
    .portfolio-hero h1 {
        font-size: 2rem;
    }
    
    .portfolio-content {
        padding: 2.5rem 1.5rem;
    }
    
    .portfolio-description h2,
    .portfolio-gallery h2, 
    .portfolio-video h2,
    .related-projects h2 {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }
}

@media (max-width: 480px) {
    .portfolio-hero h1 {
        font-size: 1.8rem;
    }
    
    .portfolio-category {
        font-size: 0.9rem;
    }
    
    .portfolio-description p,
    .detail-item p {
        font-size: 0.9rem;
    }
    
    .lightbox {
        padding: 15px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 15px;
    }
    
    .related-overlay {
        padding: 1rem;
    }
    
    .related-overlay h3 {
        font-size: 1rem;
    }
}