/* Override/Helper Styles for Works Page */
body {
    background: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #0b0b0b 100%);
    background-color: #0b0b0b;
    color: #ddd;
    font-family: 'Noto Sans TC', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
    cursor: none;
    /* Hide default cursor to use custom one */
}


/* Ambient Grain Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.5;
}

/* 
 * Header is now dynamically loaded and uses home_style.css
 * We override only what's necessary, which is nothing if we want exact match.
 */
/* Header: Must match home_style.css exactly AND sit above the grain texture (z-index: 9999) */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    /* Match home_style var(--header-height) */
    padding: 0 4% !important;
    /* Ensure alignment matches Home */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10002 !important;
    /* Force above grain texture */
    background: rgba(10, 10, 10, 0.8);
    /* Match Home */
    backdrop-filter: blur(5px);
    box-sizing: border-box;
    margin-top: 0;
    /* potential safety */
}

.logo-main {
    font-family: 'Cormorant Garamond', "Noto Serif TC", serif;
    font-size: 1.5rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.2em;
    font-weight: 300;
    text-transform: uppercase;
    /* Ensure no extra margins causing jumps */
    margin: 0;
    line-height: 1.2;
}

.logo-sub {
    display: block;
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 0.1em;
    font-family: sans-serif;
    margin-top: 2px;
}

@media (max-width: 900px) {
    .logo-main {
        font-size: 1.2rem;
        word-wrap: break-word;
        line-height: 1.3;
        /* Ensure wrapped text doesn't overlap */
    }

    header {
        display: flex !important;
        /* Force flex */
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        /* Adjust padding for mobile safely */
        padding-top: 20px !important;
        padding-bottom: 20px !important;
        height: auto !important;
        min-height: 80px !important;
        z-index: 10005 !important;
        background: rgba(10, 10, 10, 0.95) !important;
        /* Darker background for visibility */
    }

    .logo-group {
        max-width: 70%;
        margin-top: 15px !important;
        /* Push logo explicitly down */
    }
}

/* Container Layout */
.works-container {
    max-width: 1600px;
    /* Wider container */
    margin: 120px auto 50px;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 120px 1fr;
    /* Narrower sidebar */
    gap: 60px;
    min-height: 80vh;
}

/* Sidebar Navigation (Updated Style) */
.year-nav {
    position: sticky;
    top: 140px;
    height: calc(100vh - 180px);
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 20px;
}

.year-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Spacing between years */
}

.year-nav li {
    text-align: right;
}

.year-nav a {
    color: #666;
    text-decoration: none;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 1.0rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
    position: relative;
    letter-spacing: 0.05em;
}

.year-nav a:hover,
.year-nav a.active {
    color: #c5a059;
    transform: translateX(-8px);
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* Main Gallery Area */
.year-section {
    margin-bottom: 100px;
    padding-top: 20px;
    opacity: 0;
    /* Fade in animation */
    animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.year-header {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    /* Larger */
    color: #c5a059;
    margin: 0 0 40px 0;
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    padding-bottom: 0px;
    /* Removed padding to stick to line */
    display: inline-block;
}

/* Series / Album Grid */
.series-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.series-card {
    background: #111;
    border: 1px solid #222;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s;
    overflow: hidden;
    position: relative;
}

.series-card:hover {
    transform: translateY(-8px);
    border-color: #c5a059;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.series-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
}

.series-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
    filter: brightness(0.85);
}

.series-card:hover .series-cover {
    transform: scale(1.05);
    filter: brightness(1);
}

.series-info {
    padding: 20px;
    text-align: center;
}

.series-title {
    color: #fff;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.series-count {
    color: #666;
    font-size: 0.8rem;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}

/* Artwork Grid - 3 Columns */
.art-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Fixed 3 columns Desktop */
    gap: 40px;
}

.art-item {
    cursor: none;
    /* Use custom cursor hover effect */
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* Constrain Image Height */
.art-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    cursor: none;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
    background-color: #0d0d0d;
    padding: 12px;
    border: 1px solid #222;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), 0 15px 35px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    overflow: hidden;
    /* Flex center for taller images that shrink */
    display: flex;
    justify-content: center;
    align-items: center;
}


.art-image-wrapper::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 2;
}

.art-image-wrapper:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 40px 80px rgba(0, 0, 0, 0.4);
    border-color: #333;
}

.art-image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    display: block;
    filter: brightness(0.98) contrast(1.02);
    transition: filter 0.4s;
    object-fit: contain;
}


.art-image-wrapper:hover .art-image {
    filter: brightness(1.05) contrast(1.05);
}



.art-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    font-weight: 400;
    color: #fff;
    margin: 1.0rem 0 0.4rem;
    text-align: center;
}

.art-meta {
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.75rem;
    color: #888;
    /* text-muted */
    line-height: 1.6;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
}

.size-break {
    display: block;
    /* Force new line */
    margin-top: 2px;
}

/* Series Header (Inline) */
.series-header {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: #c5a059;
    /* Gold accent */
    text-align: center;
    margin: 40px 0 20px;
    font-style: italic;
    letter-spacing: 0.05em;
    width: 100%;
}

.art-year {
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.75rem;
    color: #666;
    margin-top: 5px;
    text-align: center;
}


/* Responsive */
@media (max-width: 1200px) {
    .art-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .works-container {
        grid-template-columns: 1fr;
        padding: 0 20px;
        gap: 20px;
        /* Reduced gap */
    }

    .year-nav {
        position: relative;
        top: 0;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        white-space: nowrap;
        overflow-x: auto;
        padding: 0 10px 5px 10px;
        /* Added horizontal padding */
        margin-bottom: 30px;
        /* Reduced margin */
    }

    .year-nav ul {
        flex-direction: row;
        gap: 25px;
        padding-left: 5px;
        /* Extra safe padding */
    }

    /* Smaller Year Header on Mobile */
    .year-header {
        font-size: 2.5rem;
        /* Smaller font */
        margin-bottom: 20px;
        /* Tighter spacing */
    }

    /* 
    header {
        padding: 15px 20px;
    }
    */

    .art-grid {
        grid-template-columns: repeat(1, 1fr);
        /* 1 Column Mobile */
        gap: 30px;
        /* Reduced gap */
    }
}

@media (max-width: 600px) {
    .art-image-wrapper {
        margin-bottom: 10px;
        /* Reduced space between image and text */
    }
}

/* --- Styles Moved to room_styles.css --- */
/* Scroll Navigation */
.scroll-nav {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 900;
}

.scroll-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(11, 11, 11, 0.8);
    border: 1px solid #c5a059;
    color: #c5a059;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.scroll-btn:hover {
    background: #c5a059;
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
}