@import url('https://fonts.googleapis.com/css2?family=Italianno&display=swap');

:root {
    --bg-color: #faf8f5;
    --text-primary: #333333;
    --text-secondary: #777777;
    --font-sans: 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { 
    scroll-behavior: smooth; 
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #393939; 
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(0);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    pointer-events: none;
}
.page-transition.loaded {
    transform: translateY(-100%);
}
.page-transition.leaving {
    transition: none;
    transform: translateY(100%);
}
.page-transition.leaving-active {
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    transform: translateY(0); 
}

.loader-text {
    font-family: var(--font-serif);
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: #C5A059; 
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.glass-nav {
    position: fixed;
    top: 2rem;
    right: 3rem;
    width: auto;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}
.menu-toggle span {
    width: 18px;
    height: 2px;
    background-color: var(--text-primary);
    transition: 0.3s;
}

nav { display: flex; }
nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 0.8rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    letter-spacing: 0.05em;
}
nav a:hover { color: var(--text-primary); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}
.section-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 3rem;
    letter-spacing: 0.05em;
}

.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    z-index: -2;
    object-fit: cover;
}

.hero-content h1 {
    font-family: 'Impact', 'Arial Black', cursive;
    font-size: 3vw; 
    font-weight: 400;
    color: #fbfbfa; 
    text-shadow: 2px 2px 10px rgba(0,0,0,0.1);
}

.text-center {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 3rem;
}
.view-more-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: 1px solid var(--text-primary);
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}
.view-more-btn:hover {
    background-color: var(--text-primary);
    color: var(--bg-color);
}

.album-card, .ig-post {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}
.album-card:hover, .ig-post:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.img-wrapper { 
    overflow: hidden; 
    aspect-ratio: 3/4; 
}
.album-cover {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--transition-smooth);
}
.album-card:hover .album-cover { transform: scale(1.05); }
.album-title {
    color: var(--text-secondary); 
    font-size: 0.9rem;
    font-weight: 400; 
    letter-spacing: 0.1em; 
    transition: color 0.3s ease;
    padding: 1.5rem; 
    text-align: center;
    margin: 0;
}
.album-card:hover .album-title { color: var(--text-primary); }

.ig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.ig-post { gap: 0; position: relative; } 

.ig-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.ig-images {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.ig-images img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    flex-shrink: 0; 
    transition: filter 0.3s ease; 
}
.ig-images img:hover { filter: brightness(0.9); }

.ig-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0;
}
.ig-btn:hover { 
    background: rgba(255, 255, 255, 0.5); 
    color: #fff; 
    transform: translateY(-50%) scale(1.05); 
}
.ig-btn:active { 
    transform: translateY(-50%) scale(0.95); 
}
.ig-btn.prev { left: 12px; }
.ig-btn.next { right: 12px; }
.ig-btn svg { width: 18px; height: 18px; }

.ig-text {
    padding: 1.5rem;
    background-color: #ffffff;
}
.ig-text h4 { font-weight: 500; margin-bottom: 0.2rem; }

.post-date {
    display: block;
    color: #a0a0a0;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

.ig-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; }

.story-layout { display: flex; flex-direction: column; gap: 3rem; align-items: center; }
.story-img { width: 100%; max-height: 70vh; object-fit: cover; border-radius: 12px; }
.story-text { max-width: 600px; }
.story-text h3 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 400; margin-bottom: 1.5rem; }
.story-text p { color: var(--text-secondary); margin-bottom: 1rem; text-align: justify; }

.story-btn {
    margin-top: 1rem;
}

.about-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}
.about-avatar {
    width: 100%;
    max-width: 450px;
    aspect-ratio: 3/2; 
    border-radius: 16px; 
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.about-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.about-info {
    text-align: center;
    max-width: 600px;
}
.about-info h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}
.about-info p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}
.ig-link {
    display: inline-block;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--text-primary);
    padding-bottom: 2px;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
}
.ig-link:hover {
    opacity: 0.6;
}

.album-page { padding-top: 4rem; }
.album-header { text-align: center; max-width: 800px; padding-bottom: 2rem; }
.album-header h1 { font-family: var(--font-serif); font-size: 2.5rem; font-weight: 400; margin-bottom: 1.5rem; letter-spacing: 0.1em; }
.album-desc { color: var(--text-secondary); font-size: 1rem; line-height: 1.8; }

.masonry-grid {
    column-count: 1;
    column-gap: 1.5rem;
}
.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}
.masonry-item img {
    width: 100%;
    display: block;
    transition: filter 0.3s ease;
}
.masonry-item img:hover {
    filter: brightness(0.9);
}

.photo-grid-standard {
    column-count: 1;
    column-gap: 1.5rem;
}
.photo-grid-standard .masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem; 
    display: block;
    width: 100%;
}

.ratio-3-2 {
    aspect-ratio: 3 / 2;
    object-fit: cover;
}
.ratio-2-3 {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.split-layout { display: flex; align-items: flex-start; gap: 2rem; position: relative; }
.left-fixed { 
    position: sticky; 
    top: 100px; 
    width: 76%; 
    height: calc(100vh - 120px); 
    overflow: hidden; 
    border-radius: 12px; 
    background-color: var(--bg-color);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.left-fixed > img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    transition: opacity 0.4s ease-in-out; 
    border-radius: 12px; 
}

.photo-group {
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center; 
    gap: 2rem;
    padding: 1rem 2rem;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}
.photo-group.active {
    display: flex; 
}
.photo-group img {
    width: auto;
    border-radius: 12px; 
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    flex-shrink: 0; 
}
.photo-group img.ratio-3-2 {
    height: 65%; 
}
.photo-group img.ratio-2-3 {
    height: 85%; 
}

.photo-group img.ratio-3-2:only-child,
.photo-group img.ratio-2-3:only-child {
    height: auto; 
    width: auto;
    max-height: 90%; 
    max-width: 100%; 
    margin: auto; 
}

.photo-group::-webkit-scrollbar { display: none; }

.right-scroll { 
    width: 24%; 
    height: calc(100vh - 120px); 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    padding: 0 0 0 1rem; 
    gap: 0.4rem; 
    z-index: 5; 
}
.scroll-item {
    padding: 0.5rem 1rem; 
    opacity: 0.4; 
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 8px;
}
.scroll-item:hover {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.02);
}
.scroll-item.active {
    opacity: 1; 
    background: rgba(0, 0, 0, 0.04);
}
.scroll-item h3 { 
    font-family: var(--font-serif); 
    font-size: 1.15rem; 
    margin: 0; 
    letter-spacing: 0.05em; 
}
.scroll-item p { 
    color: var(--text-secondary); 
    line-height: 1.4; 
    margin-top: 0.2rem; 
    font-size: 0.85rem; 
}

footer { text-align: center; padding: 4rem 2rem; color: var(--text-secondary); font-size: 0.8rem; letter-spacing: 0.1em; border-top: 1px solid rgba(0, 0, 0, 0.05); }

.fade-in, .stagger-item { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.visible, .stagger-item.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
    .section-title { margin-bottom: 1.5rem; }
    .glass-nav { 
        top: 1.5rem; 
        right: 1.5rem; 
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        box-shadow: none;
    }
    .menu-toggle { 
        display: flex; 
        width: 45px; 
        height: 45px; 
        border-radius: 50%; 
        background: rgba(255, 255, 255, 0.5); 
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        justify-content: center; 
        align-items: center; 
    }
    .glass-nav nav { 
        display: none; 
        position: absolute; 
        top: calc(100% + 15px); 
        right: 0; 
        background: rgba(255, 255, 255, 0.95); 
        padding: 0.8rem 1.5rem; 
        border-radius: 50px;
        flex-direction: row; 
        gap: 1.2rem;
        min-width: max-content; 
        box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
    }
    .glass-nav nav.active { display: flex; }
    .glass-nav nav a { margin: 0; }
    
    .hero-content h1 { font-size: 6vw; } 
    .container { padding: 6rem 1rem 3rem; }
    
    .mobile-hide { display: none !important; }
    .ig-grid { grid-template-columns: 1fr; gap: 1rem; }
    
    .text-center { margin-top: 2rem; padding-bottom: 1rem; }
    .story-btn { display: block; width: fit-content; margin-left: auto; margin-right: auto; }

    .split-gallery-container { padding: 80px 0 0 0; }
    .split-layout { 
        flex-direction: column; 
        gap: 1rem; 
        height: calc(100vh - 80px); 
    }
    
    /* 唯一修正點：為手機版 Event 單圖限縮寬度並加圓角，對齊上方區塊 */
    .left-fixed { 
        position: relative; 
        top: 0; 
        width: calc(100% - 2rem); 
        margin: 0 auto;
        height: auto; 
        aspect-ratio: 3 / 2; 
        flex-shrink: 0;
        z-index: 10; 
        background-color: var(--bg-color); 
        border-radius: 12px; 
    }
    /* 人像、底片的群組模式覆寫回原本你喜歡的滿版樣式 */
    .left-fixed.gallery-mode {
        width: 100%;
        margin: 0;
        border-radius: 0;
        aspect-ratio: auto;
        height: 58vh; 
        background-color: transparent;
    }
    .left-fixed > img { width: 100%; height: 100%; object-fit: contain; transition: opacity 0.4s ease-in-out; }
    
    .photo-group { gap: 1rem; padding: 0.5rem 1rem; }
    .photo-group img.ratio-3-2 { height: 60%; }
    .photo-group img.ratio-2-3 { height: 85%; }

    .photo-group img.ratio-3-2:only-child,
    .photo-group img.ratio-2-3:only-child {
        height: auto;
        width: auto;
        max-height: 95%; 
        max-width: 100%; 
        margin: auto; 
    }

    .photo-grid-standard {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .photo-grid-standard .masonry-item {
        margin-bottom: 0; 
    }

    .right-scroll { 
        width: 100%; 
        flex: 1; 
        height: auto; 
        overflow-y: auto; 
        padding: 0.5rem 1rem 8vh 1rem; 
        justify-content: flex-start; 
        gap: 0.3rem; 
        z-index: 5; 
    }
    .scroll-item { 
        padding: 0.4rem 0.5rem; 
        text-align: center;
        flex-shrink: 0;
        border-radius: 6px; 
    }
    .scroll-item h3 { font-size: 1rem; }
    .scroll-item p { 
        font-size: 0.8rem; 
        margin-top: 0.15rem; 
        line-height: 1.3; 
    }
}

@media (min-width: 768px) {
    .photo-grid-standard { column-count: 2; }
    
    .story-layout { flex-direction: row; align-items: flex-start; }
    .story-img { width: 50%; }
    .story-text { width: 50%; padding-left: 2rem; }
    
    .about-layout { flex-direction: row; justify-content: center; gap: 4rem; }
    .about-info { text-align: left; }
    .masonry-grid { column-count: 2; }
}

@media (min-width: 1024px) {
    .photo-grid-standard { column-count: 3; }
    .masonry-grid { column-count: 3; }
}