/* ============================================
   FANART GALLERY STYLES
   ============================================ */

/* Gallery Background Image */
body {
    background: url('../media/gallery_bg.png') center center / cover no-repeat fixed;
}

/* Dark Page Overlay mit Backdrop Filter */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--color-dark-rgb), 0.7);
    backdrop-filter: var(--backdrop-blur-strong);
    z-index: -1;
    pointer-events: none;
}



/* Fanart Section */
.fanart-section {
    margin-bottom: 4rem;
}

.fanart-category-title {
    font-family: var(--font-family-heading);
    font-size: clamp(1.2rem, 2vw, 2rem);
    color: var(--wg-text);
    text-align: center;
    margin: 2rem 0 1.5rem;
    text-shadow: var(--text-shadow-glow);
    letter-spacing: var(--letter-spacing-lg);
}

/* Fanart Grid */
.fanart-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 0 1rem;
    margin-bottom: 2rem;
}

/* Featured Grid - 3 größere Bilder */
.fanart-grid[data-category="featured"] {
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    max-width: 900px;
    margin: 0 auto 2rem;
}

/* Featured Items - Card Style */
.fanart-grid[data-category="featured"] .fanart-item {
    background: var(--card-bg);
    backdrop-filter: var(--backdrop-blur-strong);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    box-shadow: var(--shadow-glow);
    border: 1px solid rgba(var(--color-glow-rgb), 0.2);
}

.fanart-grid[data-category="featured"] .fanart-item:hover {
    box-shadow: var(--shadow-glow-strong);
    border-color: rgba(var(--color-glow-rgb), 0.4);
    transform: scale(1.02);
}

.fanart-grid[data-category="featured"] .fanart-item img {
    border-radius: var(--border-radius-sm);
}

/* Flexible Zentrierung bei weniger Bildern */
.fanart-grid[data-category="featured"]:has(.fanart-item:nth-child(1):last-child) {
    grid-template-columns: repeat(3, 1fr);
    max-width: 900px;
}

.fanart-grid[data-category="featured"]:has(.fanart-item:nth-child(2):last-child) {
    grid-template-columns: repeat(3, 1fr);
    max-width: 900px;
}

.fanart-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    background: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
}

.fanart-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-glow-strong);
}

.fanart-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-fast);
}

/* Fanart Overlay */
.fanart-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(var(--color-dark-rgb), 0.8));
    padding: 1rem;
    transform: translateY(100%);
    transition: transform var(--transition-fast);
    backdrop-filter: var(--backdrop-blur);
}

.fanart-item:hover .fanart-overlay {
    transform: translateY(0);
}

.fanart-info h3 {
    font-family: var(--font-family-heading);
    font-size: 1rem;
    color: var(--wg-text);
    margin: 0 0 0.25rem 0;
    text-shadow: var(--text-shadow-glow);
}

.fanart-info p {
    font-size: 0.8rem;
    color: var(--wg-text);
    opacity: var(--opacity-medium);
    margin: 0;
}

/* ============================================
   LIGHTBOX MODAL
   ============================================ */

.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 6rem 2rem 6rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--color-dark-rgb), 0.95);
    backdrop-filter: var(--backdrop-blur-strong);
    z-index: 1;
    pointer-events: none;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    backdrop-filter: var(--backdrop-blur-strong);
    box-shadow: var(--shadow-glow-strong);
}

.lightbox-image {
    max-width: 60vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--border-radius-sm);
    scroll-behavior: smooth;
}

.lightbox-info {
    min-width: 250px;
    max-width: 350px;
    color: var(--wg-text);
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.lightbox-info::-webkit-scrollbar {
    width: 4px;
}

.lightbox-info::-webkit-scrollbar-track {
    background: rgba(var(--color-dark-rgb), 0.3);
    border-radius: 2px;
}

.lightbox-info::-webkit-scrollbar-thumb {
    background: var(--wg-glow);
    border-radius: 2px;
}

.lightbox-title {
    font-family: var(--font-family-heading);
    font-size: 1.5rem;
    color: var(--wg-text);
    margin: 0 0 0.5rem 0;
    text-shadow: var(--text-shadow-glow);
}

.lightbox-artist {
    font-size: 1rem;
    color: var(--wg-glow);
    margin: 0 0 1rem 0;
    font-weight: 500;
}

.lightbox-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
    opacity: var(--opacity-high);
}

.lightbox-artist-bio {
    font-size: 0.9rem;
    font-style: italic;
    margin: 0.5rem 0;
    opacity: var(--opacity-medium);
    line-height: 1.4;
}

.lightbox-artist-twitter {
    font-size: 0.85rem;
    margin: 0.5rem 0 1rem 0;
}

.lightbox-artist-twitter a {
    color: var(--wg-glow);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.lightbox-artist-twitter a:hover {
    color: var(--wg-text);
    text-decoration: underline;
}

/* Kommentar Sections */
.lightbox-comments {
    margin-top: 1rem;
}

.comment-section {
    margin-bottom: 1rem;
    border: 1px solid rgba(var(--color-glow-rgb), 0.2);
    border-radius: var(--border-radius-sm);
    background: rgba(var(--color-card-rgb), 0.3);
}

.comment-toggle {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--wg-text);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.comment-toggle:hover {
    background: rgba(var(--color-glow-rgb), 0.1);
}

.comment-toggle .comment-icon {
    margin-right: 0.5rem;
}

.toggle-arrow {
    transition: transform var(--transition-fast);
    font-size: 0.7rem;
}

.comment-toggle.active .toggle-arrow {
    transform: rotate(180deg);
}

.comment-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-medium), padding var(--transition-medium);
    padding: 0 0.75rem;
}

.comment-content.active {
    max-height: 200px;
    padding: 0.75rem;
    border-top: 1px solid rgba(var(--color-glow-rgb), 0.1);
}

.comment-content p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: var(--opacity-high);
}

/* Lightbox Controls */
.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    background: var(--card-bg);
    color: var(--wg-text);
    font-size: 2.2rem;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-glow);
    z-index: 10005 !important;
    pointer-events: auto !important;
}

.lightbox-close:hover {
    background: var(--wg-glow);
    color: var(--wg-dark);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border: none;
    background: var(--card-bg);
    color: var(--wg-text);
    font-size: 2rem;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-glow);
    z-index: 10003;
}

.lightbox-prev {
    left: -4rem;
}

.lightbox-next {
    right: -4rem;
}

.lightbox-nav:hover {
    background: var(--wg-glow);
    color: var(--wg-dark);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .fanart-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .fanart-grid[data-category="featured"] {
        grid-template-columns: repeat(3, 1fr);
        max-width: 720px;
    }

    .fanart-grid[data-category="featured"]:has(.fanart-item:nth-child(1):last-child) {
        grid-template-columns: 1fr;
        max-width: 240px;
    }

    .fanart-grid[data-category="featured"]:has(.fanart-item:nth-child(2):last-child) {
        grid-template-columns: repeat(2, 1fr);
        max-width: 480px;
    }

    .lightbox-content {
        flex-direction: column;
        max-width: 95vw;
        max-height: 95vh;
        gap: 1rem;
    }

    .lightbox-image {
        max-width: 85vw;
        max-height: 50vh;
    }

    .lightbox-info {
        min-width: auto;
        max-width: none;
        text-align: center;
    }

    .lightbox-nav {
        top: 30%;
    }

    .lightbox-prev {
        left: -2rem;
    }

    .lightbox-next {
        right: -2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .fanart-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        padding: 0 0.5rem;
    }

    .fanart-grid[data-category="featured"] {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }

    .fanart-grid[data-category="featured"]:has(.fanart-item:nth-child(1):last-child) {
        grid-template-columns: 1fr;
        max-width: 250px;
    }

    .fanart-category-title {
        font-size: 1.5rem;
        margin: 1.5rem 0 1rem;
    }

    .lightbox-modal {
        padding: 0;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lightbox-container {
        max-width: 100%;
        max-height: none;
        width: 100%;
        padding: 8rem 1rem 10rem;
        display: block;
    }

    .lightbox-content {
        padding: 1rem;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .lightbox-image {
        max-width: 100%;
        width: 100%;
        max-height: 50vh;
        object-fit: contain;
    }

    .lightbox-info {
        max-height: none;
        overflow-y: visible;
        width: 100%;
        max-width: 100%;
    }

    .lightbox-close {
        position: fixed;
        top: 1rem;
        right: 1rem;
        width: 3.5rem;
        height: 3.5rem;
        font-size: 2rem;
        z-index: 10005 !important;
        pointer-events: auto !important;
        cursor: pointer;
        touch-action: manipulation;
    }

    .lightbox-nav {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .fanart-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .lightbox-info {
        padding: 0.5rem 0;
    }

    .lightbox-title {
        font-size: 1.2rem;
    }

    .lightbox-artist {
        font-size: 0.9rem;
    }

    .lightbox-description {
        font-size: 0.85rem;
    }
}