.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    cursor: pointer;
    aspect-ratio: 16 / 9;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
}

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

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(23, 43, 77, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 32px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    user-select: none;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-prev {
    left: 32px;
}

.lightbox-next {
    right: 32px;
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.changelog-item {
    background: var(--surface);
    border: 2px solid var(--border);
    border-left: 4px solid var(--accent-color);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    display: grid;
    grid-template-columns: 48px 1fr 2fr auto;
    align-items: center;
    gap: 1.25rem;
}

.changelog-item:hover {
    box-shadow: var(--shadow-md);
    border-left-width: 6px;
    transform: translateX(4px);
}

.changelog-item.failed {
    border-left-color: #DE350B;
    opacity: 0.75;
}

.changelog-item.failed .changelog-status {
    color: #DE350B;
}

.changelog-status {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-align: center;
    position: relative;
    cursor: help;
}

.changelog-status::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--surface);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 10;
    letter-spacing: 0.01em;
}

.changelog-status::before {
    content: '';
    position: absolute;
    bottom: 112%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 10;
}

.changelog-item:hover .changelog-status::after,
.changelog-item:hover .changelog-status::before {
    opacity: 1;
}

.version-tag {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.version-date {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.changelog-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Make links inside changelog descriptions match surrounding text color
   and use only an underline (no color change or button-like styles) */
.changelog-description a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-skip-ink: auto;
}

.changelog-description a:hover,
.changelog-description a:focus {
    color: inherit;
    text-decoration: underline;
}

.changelog-download {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-transform: uppercase;
}

.changelog-download:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.changelog-download:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }

    .lightbox-prev {
        left: 12px;
    }

    .lightbox-next {
        right: 12px;
    }

    .changelog-list {
        gap: 0.5rem;
    }

    .changelog-item {
        grid-template-columns: 40px 1fr;
        grid-template-rows: auto auto;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .changelog-status {
        grid-row: 1 / 3;
        font-size: 1.25rem;
    }

    .version-tag {
        font-size: 0.875rem;
    }

    .changelog-description {
        grid-column: 2;
        font-size: 0.8125rem;
    }

    .changelog-download {
        grid-column: 2;
        justify-self: end;
        padding: 0.375rem 0.875rem;
        font-size: 0.8125rem;
    }
}
