/* GALLERY: "Last Seconds of a Chatbot" */
/* Monochrome design – screenshots are the color */

@import url('https://fonts.googleapis.com/css2?family=Slackey&family=Creepster&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syncopate:wght@400;700&family=Nosifer&display=block');

:root {
    --bg-color: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --text-muted: #777777;
    --border-color: rgba(255, 255, 255, 0.12);
    --title-color: #ff0000;
    --card-bg: rgba(0, 0, 0, 0.3);
    --lightbox-bg: rgba(40, 40, 40, 0.97);
    --font-mono: 'Space Mono', monospace;
    --font-head: 'Syncopate', sans-serif;
    --font-display: 'Nosifer', cursive;
}

.ies-subtle-link {
    color: inherit;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    transition: text-decoration 0.15s ease;
}
.ies-subtle-link:hover {
    text-decoration: underline solid !important;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100%;
}

/* ===================== HEADER ===================== */

.gallery-header {
    text-align: left;
    padding: 35px 40px 10px;
    position: relative;
}

.gallery-header h1 {
    font-family: 'Slackey', 'Comic Sans MS', 'Comic Sans', cursive, sans-serif;
    color: #ffffff;
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    -webkit-text-stroke: 2px #000000;
    text-shadow: 0 0 10px #ffffff, 0 0 20px #ffffff;
    letter-spacing: 4px;
    line-height: 1.1;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.gallery-subtitle {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Donor thank-you / visitor CTA */
.gallery-welcome {
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.gallery-welcome a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--text-muted);
    transition: border-color 0.2s;
}

.gallery-welcome a:hover {
    border-color: var(--text-primary);
}

/* ===================== FILTER BAR ===================== */

.gallery-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 20px 40px 16px;
    flex-wrap: wrap;
}

.filter-buttons {
    display: flex;
    gap: 24px;
}

.filter-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 2px;
    position: relative;
    transition: color 0.25s;
    display: inline-flex;
    align-items: center;
}

.filter-btn .btn-count {
    display: inline-block;
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease, max-width 0.25s ease, margin-left 0.2s ease;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.filter-btn:hover .btn-count {
    opacity: 1;
    max-width: 60px;
    margin-left: 6px;
    color: #ffffff;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text-primary);
    transition: width 0.25s ease;
}

.filter-btn:hover {
    color: var(--text-secondary);
}

.filter-btn.active {
    color: var(--text-primary);
}

.filter-btn.active::after {
    width: 100%;
}

/* Search */
.killer-search {
    position: relative;
}

.killer-search input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 6px 12px;
    border-radius: 3px;
    width: 180px;
    outline: none;
    transition: border-color 0.2s;
}

.killer-search input::placeholder {
    color: var(--text-muted);
}

.killer-search input:focus {
    border-color: var(--text-secondary);
}

.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 3px 3px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: none;
}

.search-suggestions::-webkit-scrollbar { display: none; }

.search-suggestions.active { display: block; }

.search-suggestion {
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}

.search-suggestion:hover,
.search-suggestion.selected {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.search-suggestion .kill-count {
    color: var(--text-muted);
    font-size: 0.6rem;
    margin-left: 6px;
}

/* ===================== PINBOARD (Scatter Layout) ===================== */

.pinboard {
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    /* Negative margin pulls pinboard up so cards can appear next to header */
    /* Actual value set by JS based on header height */
}

.pin-card {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0s;
    will-change: transform;
    display: flex;
    flex-direction: column;
    border: 1px solid #ffffff;
    border-radius: 3px;
    overflow: hidden;
    background: #1a1a1a;
}

.pin-card .card-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #ffffff;
    padding: 4px 6px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pin-card:hover {
    z-index: 100;
}

.pin-card:hover img {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.pin-card img {
    width: 100%;
    flex: 1;
    display: block;
    object-fit: cover;
    min-height: 0;
    transition: box-shadow 0.3s;
}

/* Card icons overlay */
.pin-card .card-icons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Star icon (donation link) – top right */
.pin-card .icon-star {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    opacity: 0.55;
    color: var(--text-primary);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}

/* Heart icon (likes) – bottom right */
.pin-card .icon-likes {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: 0.45;
    color: var(--text-primary);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}

.pin-card .icon-likes svg {
    width: 11px;
    height: 11px;
}

.pin-card .icon-likes span {
    font-size: 0.55rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Fade animation for cards */
.pin-card {
    opacity: 0;
}

.pin-card.visible {
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.3s ease;
}

/* ===================== PAGINATION ===================== */

.gallery-pagination {
    text-align: center;
    padding: 20px 20px 60px;
    position: relative;
    z-index: 5;
}

.load-more-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 28px;
    cursor: pointer;
    transition: color 0.25s, border-color 0.25s;
}

.load-more-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.load-more-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* ===================== LIGHTBOX ===================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: var(--lightbox-bg);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.lightbox.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 0;
}

.lightbox.visible {
    opacity: 1;
}

/* Close button - high z-index, clearly clickable */
.lightbox-close {
    position: fixed;
    top: 12px;
    right: 20px;
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 10002;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s, opacity 0.25s ease;
    border-radius: 2px;
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}



/* Navigation arrows */
.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 80px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, opacity 0.25s ease;
    z-index: 10002;
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--text-primary);
}

/* Content area */
.lightbox-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 1300px;
    padding: 20px 80px;
    gap: 24px;
    margin: auto 0;
}

.lightbox-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 16px;
}

.lightbox-img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    transition: transform 0.2s ease;
}

/* Zoomed state (Desktop) */
.lightbox.zoomed {
    padding-top: 60px;
}

.lightbox.zoomed .lightbox-content {
    margin: 0 auto;
    padding-bottom: 50px;
}

.lightbox.zoomed .lightbox-img {
    max-height: none;
}

@media (min-width: 769px) {
    .lightbox-img {
        cursor: zoom-in;
    }

    .lightbox.zoomed .lightbox-img {
        cursor: zoom-out;
        max-width: 92vw;
        width: auto;
    }
}

.lightbox.zoomed .lightbox-info {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.lightbox.zoomed .lightbox-info:hover {
    opacity: 1;
}

/* Translation Panel */
.lightbox-translation-panel {
    width: 280px;
    flex-shrink: 0;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.lightbox-translation-panel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.translation-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.translation-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.translation-msg {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.translation-msg.msg-user {
    color: #ffffff;
    padding-left: 0;
}

.translation-msg.msg-assistant {
    color: var(--text-secondary);
    padding-left: 8px;
    border-left: 2px solid var(--text-muted);
}

.translation-msg.msg-system {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.7rem;
    text-align: left;
    padding: 4px 0;
}

.translation-msg .msg-role {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.lightbox-translate-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lightbox-translate-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.lightbox-translate-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* White globe emoji */
.globe {
    filter: grayscale(1) brightness(5);
    display: inline-block;
}

/* Translation loading dots */
.translation-loading {
    text-align: center;
    padding: 20px 0;
    font-size: 1.5rem;
    color: var(--text-muted);
    letter-spacing: 4px;
}

.translation-loading span {
    display: inline-block;
    animation: loadDot 1.4s infinite;
}

.translation-loading span:nth-child(2) { animation-delay: 0.2s; }
.translation-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadDot {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}

.translation-slow-hint {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 0 0;
}

/* Info panel */
.lightbox-info {
    text-align: center;
    max-width: 500px;
    width: 100%;
    padding: 0;
}

.lightbox-killer-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.lightbox-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.lightbox-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 12px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.lightbox-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.lightbox-like-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 5px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.lightbox-like-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.lightbox-like-btn.liked {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.lightbox-like-btn svg {
    width: 13px;
    height: 13px;
}

.lightbox-donate-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 5px 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.lightbox-donate-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.lightbox-donate-btn svg {
    width: 13px;
    height: 13px;
}

/* Counter */
.lightbox-counter {
    position: static;
    margin-top: 14px;
    margin-bottom: 4px;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    font-family: var(--font-mono);
    transition: opacity 0.25s ease;
}

/* Hide lightbox controls when mobile pinch-zoomed */
.lightbox.viewport-zoomed .lightbox-close,
.lightbox.viewport-zoomed .lightbox-prev,
.lightbox.viewport-zoomed .lightbox-next,
.lightbox.viewport-zoomed .lightbox-counter {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 768px) {
    .gallery-header {
        padding: 35px 20px 8px;
    }

    .gallery-header h1 {
        font-size: clamp(1rem, 5.5vw, 1.6rem);
    }

    .gallery-filter {
        gap: 14px;
        padding: 14px 15px 12px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 14px;
        width: 100%;
    }

    .filter-btn {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }

    .filter-btn-sub {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }

    .killer-search {
        width: 100%;
    }

    .killer-search input {
        width: 100%;
    }

    /* Lightbox mobile */
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        font-size: 1.8rem;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-content {
        flex-direction: column;
        align-items: center;
        padding: 10px 48px;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .lightbox-translation-panel {
        width: 100%;
        max-height: none;
    }

    .lightbox-img {
        max-height: 55vh;
    }

    .lightbox-close {
        top: 8px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
}

/* ===================== SCROLLBAR ===================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===================== GALLERY INFO BUTTON & MODAL ===================== */

.gallery-info-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.25s, border-color 0.25s, background-color 0.25s;
    align-self: center;
}

.gallery-info-btn:hover {
    color: #ffffff;
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.gallery-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
}

.gallery-modal-backdrop.active {
    display: block;
}

.gallery-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    z-index: 10000;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.gallery-modal.active {
    display: block;
}

.gallery-modal-content {
    padding: 25px 30px;
}

.gallery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.gallery-modal-header h3 {
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.gallery-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.gallery-modal-close:hover {
    color: #ffffff;
}

.gallery-modal-body {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* White Background & Black Accent Theme Variant for Open Letter */
.gallery-modal-black {
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.85), 0 0 15px rgba(255, 255, 255, 0.6), 0 12px 40px rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    max-width: 720px;
    color: #111111;
    overflow: hidden; /* Overlay & inner scroll area manage containment */
}

.gallery-modal-black .gallery-modal-content {
    padding: 28px 36px 0 36px;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    box-sizing: border-box;
    position: relative;
}

.gallery-modal-black .gallery-modal-header {
    border-bottom: 2px solid #000000;
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.gallery-modal-black .gallery-modal-header h3 {
    color: #000000;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.gallery-modal-black .gallery-modal-close {
    color: #000000;
    font-size: 1.6rem;
    font-weight: bold;
}

.gallery-modal-black .gallery-modal-close:hover {
    color: #555555;
}

/* Scroll area without visible scrollbar */
.gallery-modal-black .gallery-modal-scroll-area {
    position: relative;
    overflow-y: auto;
    max-height: 60vh;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    padding-bottom: 45px; /* Extra padding so the last line scrolls above the fade overlay */
}

.gallery-modal-black .gallery-modal-scroll-area::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.gallery-modal-black .gallery-modal-body {
    font-size: 0.9rem;
    line-height: 1.75;
    color: #1a1a1a;
}

.gallery-modal-black .gallery-modal-body p {
    margin-bottom: 16px;
}

.gallery-modal-black .letter-salutation {
    font-weight: 700;
    font-size: 0.95rem;
    color: #000000;
}

.gallery-modal-black .letter-quote {
    margin: 18px 0;
    padding: 12px 18px;
    border-left: 4px solid #000000;
    background: #f4f4f4;
    font-style: italic;
    font-weight: 600;
    color: #000000;
    cursor: pointer;
    transition: background-color 0.2s, border-left-width 0.2s, transform 0.15s;
    user-select: none;
}

.gallery-modal-black .letter-quote:hover {
    background: #eaeaea;
    border-left-width: 6px;
    transform: translateX(2px);
}

.gallery-modal-black .letter-closing {
    margin-top: 24px;
    font-style: normal;
    color: #444444;
}

.gallery-modal-black .letter-closing em,
.gallery-modal-black .letter-closing i {
    font-style: italic;
}

.gallery-modal-black .letter-closing strong {
    color: #000000;
}

/* Bottom fade-out overlay anchored flush to the bottom edge of the modal box */
.gallery-modal-black .modal-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 135px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.88) 35%, rgba(255, 255, 255, 0.45) 70%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.gallery-modal-black .modal-fade-overlay.no-fade {
    opacity: 0;
}

/* Modal view switching & static footer links */
.gallery-modal-black .modal-toggle-wrapper {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed #cccccc;
}

.gallery-modal-black .modal-toggle-link {
    display: inline-block;
    font-weight: 700;
    color: #000000;
    text-decoration: underline;
    font-size: 0.92rem;
    transition: color 0.15s, transform 0.15s;
    cursor: pointer;
}

.gallery-modal-black .modal-toggle-link:hover {
    color: #444444;
    transform: translateX(3px);
}

.gallery-modal-black .modal-static-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid #000000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}

.gallery-modal-black .modal-footer-link {
    color: #333333;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: color 0.15s, transform 0.15s;
}

.gallery-modal-black .modal-footer-link:hover {
    color: #000000;
    text-decoration: underline;
    transform: translateX(2px);
}

.gallery-modal-black .modal-footer-link .footer-icon {
    font-size: 1rem;
    opacity: 0.8;
}

/* Custom Donate Button for Modal */
.gallery-modal-black .modal-donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.7rem;
    background-color: #ffffff;
    color: #000000;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid #000000;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
    letter-spacing: 0.5px;
}

.gallery-modal-black .modal-donate-btn:hover {
    background-color: #000000;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ===================== FLAG BUTTON (Lightbox) ===================== */

.lightbox-flag-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 5px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.lightbox-flag-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.lightbox-flag-btn.flagged {
    color: var(--text-primary);
    border-color: var(--text-primary);
    cursor: default;
    opacity: 0.7;
}

.lightbox-flag-btn svg {
    width: 13px;
    height: 13px;
}

/* ===================== FLOATING CONTROLS (TOP & IMPRINT) ===================== */

.gallery-floating-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.gallery-floating-controls.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.floating-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s ease;
    box-sizing: border-box;
}

.floating-btn.scroll-to-top {
    font-size: 1.2rem;
}

.floating-btn.imprint-btn {
    font-size: 1.05rem;
    font-family: serif, sans-serif;
    padding-bottom: 1px;
}

.floating-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.35);
}

.floating-btn:active {
    transform: scale(0.92);
}

@media (max-width: 768px) {
    .gallery-floating-controls {
        bottom: 20px;
        right: 20px;
    }
}

/* ===================== SUB-CATEGORY FILTER SEPARATOR ===================== */

.filter-btn-sub {
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}
