@charset "UTF-8";

/* CSS Variables for theme colors */
:root {
    --bg-color: #ffffff;
    --text-color: black;
    --text-secondary: #807e7e;
    --link-color: #4a90e2;
    --link-hover: orange;
    --highlight-color: lightskyblue;
    --quote-bg: #f9f9f9;
    --border-color: #e0e0e0;
    --footer-bg: #f8f8f8;
    --nav-text: white;
    --font: "Cinzel", cursive;
    --nav-font-size: 2rem;
    --title-font-size: 3rem;
    --name-font-size: 6rem;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-secondary: #a0a0a0;
    --link-color: #4a90e2;
    --link-hover: orange;
    --highlight-color: lightskyblue;
    --quote-bg: #2a2a2a;
    --border-color: #404040;
    --footer-bg: #2a2a2a;
    --nav-text: #e0e0e0;
    --font: "Monoton", cursive;
    --nav-font-size: 2rem;
    --title-font-size: 3rem;
    --name-font-size: 5rem;
}

/* Apply theme colors */
html, body {
    font-size: 80%;
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 100vh;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/*--------------------------------- Navigation ---------------------------------*/
.nav-menu {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 2rem;
    width: 90%;
    max-width: 800px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-size: var(--nav-font-size);
    font-family: var(--font);
    padding: 0.5rem 1.5rem;
    transition: color 0.3s, font-family 0.3s;
    flex: 1;
    text-align: center;
    transition: opacity 1s ease-in-out;
}

.nav-menu a:hover {
    color: orange;
}

/* 暗黑模式下nav-menu保持相似样式 */
[data-theme="dark"] .nav-menu a {
    color: #e0e0e0;  /* 稍微调整为灰白色 */
}

[data-theme="dark"] .nav-menu a:hover {
    color: orange;
}

/*--------------------------------- Hero wrapper with dual backgrounds ---------------------------------*/
.hero-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 1s ease-in-out;
}

.hero-bg.light {
    background-image: url('images/light1.jpg');
    opacity: 1;
}

.hero-bg.dark {
    background-image: url('images/dark2.jpg');
    opacity: 0;
}

[data-theme="dark"] .hero-bg.light {
    opacity: 0;
}

[data-theme="dark"] .hero-bg.dark {
    opacity: 1;
}

/* Hero name with re-animation */
.hero-name {
    position: relative;
    color: white;
    font-size: var(--name-font-size);
    font-weight: bold;
    font-family: var(--font);
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out 0.5s forwards;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 2;
    transition: font-family 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        /* transform: translateY(20px); */
    }
    to {
        opacity: 1;
        /* transform: translateY(0); */
    }
}

/*--------------------------------- Main content wrapper ---------------------------------*/
.main-content {
    max-width: 1000px;
    width: 90%;
    margin: 2rem auto;
    padding: 0 20px;
}

.title {
    font-size: var(--title-font-size);
    font-weight: 400;
    text-align: center;
    margin: 3rem 0 3rem 0;
    color: var(--text-color);
    font-family: var(--font);
}

/* Links styling */
.link {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s;
}

.link:hover {
    color: var(--link-hover);
}

.highlight {
    color: var(--highlight-color);
}

/* Quote styling */
quote {
    color: var(--text-color);
    opacity: 0.9;
}

.plain-text {
    text-align: justify;
    line-height: 1.;
    font-size: 1.1rem;
    color: var(--text-color);
}

/*--------------------------------- Collections ---------------------------------*/

/* Collections Section */
.collections-section {
    position: relative;
    width: 100%;
    padding: 0rem 0;
    overflow: hidden;
    background-color: var(--bg-color, #ffffff);
}

.collections-title {
    text-align: center;
    font-size: var(--title-font-size, 3rem);
    font-family: var(--font, "Amatic SC", cursive);
    color: var(--text-color, #615c5b);
}

/* Collections Container */
.collections-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px; /* Space for arrows */
}

/* Collections Wrapper - Scrollable */
.collections-wrapper {
    overflow: hidden;
    position: relative;
}

.collections-grid {
    display: flex;
    gap: 1.5rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 0;
}

/* Individual Collection Item */
.collection-item {
    flex: 0 0 calc(25% - 1.125rem); /* Show 4 items at a time */
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 14/9;
    background: #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.collection-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.collection-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.collection-item:hover img {
    transform: scale(1.05);
}

/* Overlay with Collection Name */
.collection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.collection-item:hover .collection-overlay {
    opacity: 1;
}

.collection-name {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.collection-item:hover .collection-name {
    transform: translateY(0);
}

.collection-count {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Navigation Arrows */
.collection-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10;
    transition: background 0.3s ease, transform 0.3s ease;
}

.collection-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.collection-arrow.prev {
    left: 10px;
}

.collection-arrow.next {
    right: 10px;
}

/* Removed disabled styles since arrows are always active */

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><line x1="8" y1="8" x2="24" y2="24" stroke="white" stroke-width="2"/><line x1="24" y1="8" x2="8" y2="24" stroke="white" stroke-width="2"/></svg>') 16 16, pointer;
}

.lightbox.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.3s ease;
}

.lightbox-close:hover {
    transform: rotate(90deg);
}

.lightbox-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 40px;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><line x1="8" y1="8" x2="24" y2="24" stroke="white" stroke-width="2"/><line x1="24" y1="8" x2="8" y2="24" stroke="white" stroke-width="2"/></svg>') 16 16, pointer;
}

.lightbox-title {
    color: white;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
    font-family: var(--font, "Amatic SC", cursive);
}

.lightbox-description {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    padding: 0 20px;
}

.lightbox-grid {
    display: grid;
    /* grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); */
    grid-auto-rows: 180px;
    grid-template-columns: repeat(4, 1fr);  /* 4列 */
    grid-auto-flow: dense;
    gap: 1.5rem;
}

.lightbox-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 0px;
    transition: transform 0.3s ease;
    background: #2a2a2a;
}

/* 横向图片 - 默认尺寸 */
.lightbox-item.horizontal {
    grid-column: span 1;
    grid-row: span 1;
    /* aspect-ratio: 14/9; */
}

/* 竖向图片 - 占两行 */
.lightbox-item.vertical {
    grid-column: span 1;
    grid-row: span 2;
    /* aspect-ratio: 9/12; */
}

/* 特大图片 - 占两列两行 */
.lightbox-item.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.lightbox-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.lightbox-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.lightbox-item:hover .lightbox-caption {
    transform: translateY(0);
}

#miscellaneous .lightbox-grid {
    padding: 0;
    background: transparent;
    grid-auto-rows: 150px;
}

/* Full Image View */
.full-image-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><line x1="8" y1="8" x2="24" y2="24" stroke="white" stroke-width="2"/><line x1="24" y1="8" x2="8" y2="24" stroke="white" stroke-width="2"/></svg>') 16 16, pointer;
}

.full-image-view.active {
    display: flex;
}

.full-image-view img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    pointer-events: auto;
    cursor: default;
}

.full-image-caption {
    color: white;
    text-align: center;
    margin-top: 1rem;
    font-size: 1.2rem;
    padding: 0 20px;
    pointer-events: auto;
    cursor: default;
}

.full-image-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.full-image-close:hover {
    transform: rotate(90deg);
}

.lightbox::after,
.full-image-view::after {
    content: "Click anywhere to close";
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    pointer-events: none;
    animation: fadeInOut 3s ease-in-out;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    z-index: 10;
    transition: background 0.3s ease, transform 0.3s ease;
}

.image-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-nav.prev {
    left: 20px;
}

.image-nav.next {
    right: 20px;
}

/* Dark Theme Support */
[data-theme="dark"] .collections-section {
    background-color: var(--bg-color, #1a1a1a);
}

[data-theme="dark"] .collection-arrow {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .collection-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
}


/*--------------------------------- Footer ---------------------------------*/
footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.5s ease;
    text-align: center;
}

/*--------------------------------- Theme toggle button ---------------------------------*/
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.356);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .theme-toggle {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* On Mobiles */

@media (max-width: 430px) {
    .nav-menu {
        width: 70%;
        display: flex;
        gap: 0.5rem;
    }
    
    .nav-menu a {
        font-size: 1.1rem;
        margin: 0;
    }
    
    .hero-name {
        font-size: 4rem;
    }
    
    [data-theme="dark"] .nav-menu a {
        font-size: 1rem;
    }
    
    [data-theme="dark"] .nav-menu {
        width: 90%;
        max-width: none;
        gap: 0rem;
    }
    
    [data-theme="dark"] .hero-name {
        font-size: 2.5rem;
    }

    .hero-name {
        font-size: 3rem;
    }
    .title {
        font-size: 2.5rem;
        margin: 1rem 0 1rem 0;
    }
    
    /* Collections 一行两张 */
    .collection-item {
        flex: 0 0 calc(50% - 0.5rem);  /* 50%宽度减去一半的gap */
    }
    
    .collections-grid {
        gap: 1rem;
    }

    .collection-arrow {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    /* Lightbox 网格两列 */
    .lightbox-grid {
        grid-template-columns: repeat(2, 1fr);  /* 两列 */
        gap: 0.5rem;  /* 手机上间距小一点 */
    }
    
    /* 竖向图片在手机上不要太高 */
    /* .lightbox-item.vertical {
        grid-row: span 1;
    } */
}