/* Media Photos Page Styles */
/* 專用於 media_photos.html 頁面 */

/* Container */
.psd-container {
    position: relative;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    overflow: hidden;
}

/* ========================================
   Banner 區域
   ======================================== */
.psd-banner-section {
    position: relative;
    width: 100%;
    margin-top: 7vw;
}

/* banner 圖片 */
.psd-banner-img {
    width: 100%;
    height: auto;
}

/* 頁面標題 */
.psd-page-title {
    position: absolute;
    left: min(13.073vw, 251px);
    bottom: min(7vw, 192px);
    margin: 0;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 500;
    font-size: min(2.3vw, 48px);
    color: #ffffff;
    white-space: nowrap;
}

/* ========================================
   麵包屑與分享區域 - 正常文件流
   ======================================== */
.psd-breadcrumb-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3.385vw 13.021vw 9.085vw 13.021vw;
}

/* 麵包屑 */
.psd-breadcrumb {
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 300;
    font-size: min(1.15vw, 24px);
    color: #000000;
    white-space: nowrap;
}

/* 分享群組 */
.psd-share-group {
    display: flex;
    align-items: center;
    gap: min(0.833vw, 16px);
}

/* 分享文字 */
.psd-share-text {
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    font-size: min(1.25vw, 24px);
    color: #000000;
}

/* 分享圖示 */
.psd-share-icons {
    width: min(7.656vw, 147px);
    height: min(1.823vw, 35px);
}

/* ========================================
   內容區域 - 正常文件流
   ======================================== */
.psd-content-area {
    position: relative;
    width: min(77.5vw, 1488px);
    margin: 0 auto;
    padding: min(6.188vw, 138px) min(1.615vw, 31px) min(5.208vw, 100px);
    background-color: #f2f2f2;
}

/* 頁籤背景 - 用偽元素延伸 */
.psd-content-area::before {
    content: '';
    position: absolute;
    left: 0;
    top: -3.2vw;
    width: 10.5vw;
    height: 3.2vw;
    background-color: #f2f2f2;
    border-radius: 1vw 1vw 0 0;
}

/* ========================================
   頁籤導航
   ======================================== */
.psd-tabs {
    position: absolute;
    left: min(1.667vw, 32px);
    top: min(-1.875vw, -36px);
    display: flex;
    gap: min(3.906vw, 75px);
}

.psd-tab {
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    font-size: min(1.25vw, 24px);
    color: #004a89;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.2s;
}

.psd-tab:hover {
    opacity: 0.7;
}

.psd-tab--active {
    font-weight: 500;
}

/* ========================================
   照片網格 - 使用 CSS Grid
   ======================================== */
.psd-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: min(1.302vw, 25px);
}

/* 照片卡片 */
.psd-photo-card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    overflow: hidden;
}

/* 照片容器 */
.psd-photo-wrapper {
    position: relative;
    width: 100%;
    padding-top: 79.8%; /* 360/451 = 0.798 維持比例 */
    overflow: hidden;
}

.psd-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   照片說明區域
   ======================================== */
.psd-photo-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: min(0.8vw, 20px) min(0.833vw, 16px) 0.5vw;
    height: 3.5vw;
}

/* 照片標題 — 固定兩行高度 */
.psd-photo-title {
    margin: 0;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 500;
    font-size: min(1.2vw, 20px);
    color: #000000;
    line-height: 1.6;
    height: 5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 照片日期 */
.psd-photo-date {
    margin-top: auto;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    font-size: min(0.87vw, 16px);
    color: #a5a5a5;
}

/* ========================================
   照片卡片可點擊
   ======================================== */
.psd-photo-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.psd-photo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ========================================
   圖片瀏覽 Modal (以 1920px 為基準換算 vw)
   ======================================== */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.photo-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 深色半透明背景 */
.photo-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(38, 38, 38, 0.9);
    cursor: pointer;
}

/* 內容區 */
.photo-modal__content {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* 主圖 + 箭頭 橫向容器 */
.photo-modal__viewer {
    display: flex;
    align-items: center;
    gap: 2vw;              /* 箭頭與主圖間距 2vw */
    height: 70%;
}

/* 主圖區 */
.photo-modal__main {
    height: 100%;
    aspect-ratio: 1405 / 816;
    overflow: hidden;
    flex-shrink: 0;
}

.photo-modal__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 左右箭頭 */
.photo-modal__arrow {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4vw;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.photo-modal__arrow svg {
    width: 1.8vw;
    height: 2vw;
    display: block;
}

.photo-modal__arrow:hover {
    opacity: 1;
}

/* 標題 */
.photo-modal__caption {
    margin: 1.5vw 0 1.2vw;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    font-size: 1.15vw;
    color: #ffffff;
    text-align: center;
}

/* 縮圖列 */
.photo-modal__thumbnails {
    display: flex;
    gap: 0.7vw;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 80%;
    padding: 0.15vw 0;
    scroll-behavior: smooth;
}

/* 隱藏捲軸但保留捲動功能 */
.photo-modal__thumbnails::-webkit-scrollbar {
    height: 0;
}

.photo-modal__thumbnails {
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge */
}

.photo-modal__thumb {
    width: 10vw;           /* 13.7vw × 0.725 */
    aspect-ratio: 263 / 153;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    border: 0.1vw solid transparent;
}

.photo-modal__thumb:hover {
    opacity: 0.8;
}

.photo-modal__thumb.is-active {
    opacity: 1;
    border-color: #ffffff;
}

.photo-modal__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   響應式調整
   ======================================== */
@media (max-width: 1200px) {
    .psd-photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .psd-banner-section {
        margin-top: 60px;
    }

    .psd-page-title {
        left: 5vw;
        bottom: 5vw;
        font-size: 24px;
    }

    .psd-breadcrumb-section {
        padding: min(3vw, 30px) min(5vw, 20px);
        flex-direction: column;
        align-items: flex-start;
        gap: min(2vw, 10px);
    }

    .psd-breadcrumb {
        font-size: 14px;
    }

    .psd-share-text {
        font-size: 14px;
    }

    .psd-content-area {
        width: 95%;
        padding: min(5vw, 50px) min(2vw, 20px);
    }

    .psd-tabs {
        position: relative;
        left: 0;
        top: 0;
        margin-bottom: min(3vw, 30px);
        gap: min(2vw, 20px);
        flex-wrap: wrap;
    }

    .psd-tab {
        font-size: 14px;
    }

    .psd-content-area::before {
        display: none;
    }

    .psd-photo-grid {
        grid-template-columns: 1fr;
    }

    .psd-photo-title {
        font-size: 16px;
    }

    .psd-photo-date {
        font-size: 14px;
    }

    /* Modal 響應式 */
    .photo-modal__viewer {
        gap: 2vw;
    }

    .photo-modal__arrow svg {
        width: 5vw;
        height: 6vw;
    }

    .photo-modal__caption {
        font-size: 3.2vw;
        margin: 2.5vw 0;
    }

    .photo-modal__thumbnails {
        max-width: 85vw;
        gap: 1.5vw;
    }

    .photo-modal__thumb {
        width: 16vw;
    }
}
