/* Photo / UI·UX 作品集：共用設計 token，與 Graphic 馬賽克間距、圓角一致 */
:root {
    --photo-gap: var(--graphic-media-gap);
    --photo-tile-h: clamp(168px, 26vw, 300px);
    --photo-portrait-ratio: 4 / 5;
    --photo-film-ratio: 16 / 10;
}

/* Photo 四大分類區塊（人像／商品／活動／風景） */
.photo-category + .photo-category {
    margin-top: calc(var(--graphic-media-gap) * 2.25);
}

.photo-category__heading {
    height: fit-content;
    border-left: 10px solid var(--primary-dark-brown);
}

.photo-category__heading h3 {
    font-size: 2rem;
    padding-left: 50px;
    margin: 0;
    color: var(--primary-dark-brown);
}

.photo-category__link {
    text-align: right;
    margin: 0 0 calc(var(--photo-gap) * 2);
}

.photo-category__link--back {
    text-align: left;
}

.photo-category__link a {
    color: var(--primary-brown);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: color 0.2s ease;
}

.photo-category__link a:hover {
    color: var(--primary-dark-brown);
}

.photo-category__link a::after {
    content: " →";
}

.photo-category__link--back a::after {
    content: none;
}

.photo-category__link--back a::before {
    content: "← ";
}

/* —— 人像：雙欄交錯（呼應 Illustration 律動，比例改為直幅）—— */
.photo-portrait-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(var(--photo-gap) * 1.25) calc(var(--photo-gap) * 1.75);
    padding: 8px 0 32px;
}

.photo-portrait-item {
    margin: 0;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
}

.photo-portrait-item:nth-child(even) {
    margin-top: clamp(28px, 5vw, 56px);
}

.photo-portrait-frame {
    width: 100%;
    aspect-ratio: var(--photo-portrait-ratio);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--bg-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-portrait-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.photo-portrait-item:hover .photo-portrait-frame {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(89, 56, 37, 0.12);
}

/* —— 活動：橫向膠卷 + 一大兩小特寫 —— */
.photo-filmstrip-wrap {
    margin-bottom: calc(var(--photo-gap) * 1.5);
}

.photo-filmstrip-label {
    font-size: 0.85rem;
    color: var(--dark-gray);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.photo-filmstrip {
    display: flex;
    gap: var(--photo-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-yellow) transparent;
}

.photo-filmstrip-item {
    flex: 0 0 min(78vw, 540px);
    scroll-snap-align: start;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
    border-radius: var(--radius-card);
    overflow: hidden;
    aspect-ratio: var(--photo-film-ratio);
}

.photo-filmstrip-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-event-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: var(--photo-gap);
    padding-bottom: 32px;
}

.photo-event-feature .photo-event-hero {
    grid-row: span 2;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
    border-radius: var(--radius-card);
    overflow: hidden;
    min-height: clamp(280px, 42vw, 480px);
}

.photo-event-feature .photo-event-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-event-side {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
    border-radius: var(--radius-card);
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.photo-event-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* —— 風景：瀑布流，完整呈現比例（不強裁）—— */
.photo-masonry {
    column-count: 3;
    column-gap: var(--photo-gap);
    padding: 8px 0 40px;
}

.photo-masonry-item {
    break-inside: avoid;
    margin-bottom: var(--photo-gap);
    border: 0;
    padding: 0;
    width: 100%;
    background: transparent;
    cursor: zoom-in;
    border-radius: var(--radius-card);
    overflow: hidden;
    background-color: var(--bg-light);
    display: block;
    transition: transform 0.25s ease;
}

.photo-masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
}

.photo-masonry-item:hover {
    transform: scale(1.01);
}

/* Graphic 馬賽克內的可點擊圖（商品／活動補列） */
.graphic-table--mosaic button[data-photo-lightbox] {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: zoom-in;
}

/* —— UI/UX：案例卡（與 Web 卡片語彙相近，版面左右交替）—— */
.uiux-showcase {
    display: flex;
    flex-direction: column;
    gap: calc(var(--photo-gap) * 2.5);
    padding: 16px 0 48px;
}

.uiux-case {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: calc(var(--photo-gap) * 1.5);
    align-items: center;
    padding: clamp(20px, 3vw, 32px);
    border-radius: var(--radius-card);
    background: var(--bg-light);
    border: 1px solid rgba(166, 93, 51, 0.14);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.uiux-showcase__flow > .uiux-case:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}

.uiux-showcase__flow > .uiux-case:nth-child(even) .uiux-case-visual {
    order: 2;
}

.uiux-showcase__flow > .uiux-case:nth-child(even) .uiux-case-copy {
    order: 1;
}

.uiux-case-visual {
    border-radius: calc(var(--radius-card) - 4px);
    overflow: hidden;
    background: transparent;
    line-height: 0;
}

.uiux-case-visual img {
    width: 100%;
    height: auto;
    display: block;
}

.uiux-case-visual--device {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--photo-gap);
    align-items: start;
    background: transparent;
}

.uiux-case-visual--device img {
    width: 100%;
    height: auto;
    border-radius: calc(var(--radius-card) - 6px);
    box-shadow: 0 10px 30px rgba(89, 56, 37, 0.1);
}

.uiux-case-copy.card-content h3 {
    font-size: 1.35rem;
    color: var(--primary-dark-brown);
    margin: 0 0 10px;
}

/* UI/UX 總覽：鴻閣＋維亞兩欄；其餘官網一列依日期新→舊 */
.uiux-showcase__flow {
    display: flex;
    flex-direction: column;
    gap: calc(var(--photo-gap) * 2.5);
}

.uiux-showcase__pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(var(--photo-gap) * 1.5);
}

.uiux-showcase__pair .uiux-case,
.uiux-showcase__pair .uiux-case:nth-child(even) {
    grid-template-columns: 1fr;
    gap: var(--photo-gap);
    align-items: stretch;
    padding: clamp(16px, 2vw, 24px);
}

.uiux-showcase__pair .uiux-case:nth-child(even) .uiux-case-visual,
.uiux-showcase__pair .uiux-case:nth-child(even) .uiux-case-copy {
    order: unset;
}

.uiux-showcase__pair .uiux-case-copy.card-content h3 {
    font-size: 1.1rem;
}

.uiux-showcase__pair .card-desc {
    font-size: 0.88rem;
    line-height: 1.65;
}

.uiux-showcase__pair .uiux-case-visual--cutout img {
    max-width: min(100%, 200px);
}

.uiux-showcase__pair .uiux-case__cta {
    margin-top: 12px;
    padding: 8px 16px;
    font-size: 0.82rem;
}

/* Lightbox（Photo 子頁共用） */
.photo-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(51, 51, 51, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.photo-lightbox.open {
    display: flex;
}

.photo-lightbox__content {
    position: relative;
    width: min(1400px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.photo-lightbox__stage {
    overflow: auto;
    flex: 1;
    min-height: 0;
    max-height: calc(92vh - 88px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
    cursor: zoom-in;
    touch-action: pan-x pan-y;
}

.photo-lightbox__stage.is-zoomed {
    cursor: grab;
    overflow: hidden;
}

.photo-lightbox__stage.is-dragging {
    cursor: grabbing;
}

.photo-lightbox__stage img {
    display: block;
    border-radius: var(--radius-card);
    transform-origin: center center;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(92vh - 88px);
    object-fit: contain;
}

/* 長圖（UI 捲軸稿）：以寬度為主、可上下捲動 */
.photo-lightbox__stage.is-tall {
    align-items: flex-start;
    justify-content: flex-start;
}

.photo-lightbox__stage.is-tall img {
    width: min(1200px, 100%);
    max-width: none;
    max-height: none;
    min-width: min(720px, 100%);
}

@media (max-width: 768px) {
    .photo-lightbox__stage.is-tall img {
        min-width: 100%;
    }

    .photo-lightbox__zoom-hint {
        font-size: 0.72rem;
    }
}

.photo-lightbox__zoom-hint {
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.photo-lightbox__index {
    display: none;
}

.photo-lightbox__toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.photo-lightbox__toolbar button {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.photo-lightbox__toolbar button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.35);
}

.photo-lightbox__toolbar button:disabled {
    opacity: 0.35;
    cursor: default;
}

.photo-lightbox__nav[hidden] {
    display: none;
}

.photo-lightbox__close {
    position: absolute;
    top: -44px;
    right: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.photo-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
}

.photo-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.35);
}

.photo-lightbox__nav--prev {
    left: -52px;
}

.photo-lightbox__nav--next {
    right: -52px;
}

@media (max-width: 1024px) {
    .photo-portrait-grid {
        gap: var(--photo-gap);
    }

    .photo-portrait-item:nth-child(even) {
        margin-top: 20px;
    }

    .photo-masonry {
        column-count: 2;
    }

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

    .photo-event-feature .photo-event-hero {
        grid-row: auto;
        min-height: 240px;
    }

    .uiux-showcase__flow > .uiux-case,
    .uiux-showcase__flow > .uiux-case:nth-child(even) {
        grid-template-columns: 1fr;
    }

    .uiux-showcase__flow > .uiux-case:nth-child(even) .uiux-case-visual,
    .uiux-showcase__flow > .uiux-case:nth-child(even) .uiux-case-copy {
        order: unset;
    }

    .uiux-showcase__pair {
        grid-template-columns: 1fr;
    }

    .photo-lightbox__nav--prev {
        left: 8px;
    }

    .photo-lightbox__nav--next {
        right: 8px;
    }

    .photo-category__heading h3 {
        padding-left: clamp(16px, 4vw, 50px);
        font-size: clamp(1.65rem, 4.2vw, 2.35rem);
    }
}

@media (max-width: 600px) {
    .photo-portrait-grid {
        grid-template-columns: 1fr;
    }

    .photo-portrait-item:nth-child(even) {
        margin-top: 0;
    }

    .photo-masonry {
        column-count: 1;
    }
}
