/* ==========================================================================
   Fotobedna Gallery — custom replacement for UniteGallery
   Justified flexbox layout + GLightbox overrides + hover effects + share buttons
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. HEADER EVENT NAME OVERLAY
   -------------------------------------------------------------------------- */

.fb-header-event-name {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 75px;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.08) 0%,
        rgba(0, 0, 0, 0.35) 40%,
        rgba(0, 0, 0, 0.35) 60%,
        rgba(0, 0, 0, 0.08) 100%
    );
}

.fb-header-event-name .fb-header-title {
    font-family: Montserrat, sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.25);
    text-align: center;
    padding: 0 30px;
    max-width: 90%;
    line-height: 1.3;
}

.fb-header-event-name .fb-header-subtitle {
    font-family: Montserrat, sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.78);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    margin-top: 4px;
    letter-spacing: 0.02em;
    text-align: center;
    padding: 0 30px;
    max-width: 90%;
}

.fb-header-event-name .fb-header-date {
    font-family: Montserrat, sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    margin-top: 6px;
    letter-spacing: 0.05em;
}

@media (max-width: 767px) {
    .fb-header-event-name .fb-header-title {
        font-size: 1.8rem;
    }
    .fb-header-event-name .fb-header-subtitle {
        font-size: 1rem;
    }
    .fb-header-event-name .fb-header-date {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .fb-header-event-name .fb-header-title {
        font-size: 1.3rem;
    }
    .fb-header-event-name .fb-header-subtitle {
        font-size: 0.85rem;
    }
    .fb-header-event-name .fb-header-date {
        font-size: 0.8rem;
    }
}

/* --------------------------------------------------------------------------
   1. UNIFORM CSS GRID LAYOUT
   -------------------------------------------------------------------------- */

.fb-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 12px 0;
    margin: 0;
    width: 100%;
    align-items: start;
}

.fb-gallery-row {
    display: contents;
}

.fb-gallery-item {
    overflow: hidden;
    position: relative;
    cursor: pointer;
    line-height: 0;
    aspect-ratio: 4/3;
}

.fb-gallery-item.fb-justified {
    flex: 0 0 auto;
}

.fb-gallery-item img,
.fb-gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --------------------------------------------------------------------------
   1b. PHOTO CARD LAYOUT (with details)
   -------------------------------------------------------------------------- */

.fb-gallery-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.fb-gallery-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.fb-gallery-card-img {
    overflow: hidden;
    position: relative;
    line-height: 0;
    background: #f3f4f6;
}

.fb-gallery-card-img img,
.fb-gallery-card-img video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.fb-gallery-card:hover .fb-gallery-card-img img,
.fb-gallery-card:hover .fb-gallery-card-img video {
    transform: none;
}

.fb-gallery-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    min-height: 0;
    font-size: 0.7rem;
    line-height: 1.4;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.fb-gallery-card-header .fb-photo-actions {
    position: static;
    opacity: 1;
    margin-left: auto;
    flex-shrink: 0;
}

.fb-gallery-card-info {
    padding: 5px 8px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.fb-gallery-card-section {
    display: none;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.6;
}
.fb-gallery--search .fb-gallery-card-section {
    display: inline-block;
}
.fb-section-galerie {
    background: #dcfce7;
    color: #166534;
}
.fb-section-nepouzite {
    background: #fef3c7;
    color: #92400e;
}
.fb-section-smazane {
    background: #fee2e2;
    color: #991b1b;
}

.fb-gallery-card-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.fb-gallery-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.7rem;
    color: #6b7280;
    flex-shrink: 0;
}

.fb-gallery-card-prints {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fb-gallery-card-prints i {
    font-size: 0.75rem;
    color: #aa8d3f;
}

.fb-gallery-card-prints-errors {
    color: #e74c3c;
}

.fb-gallery-card-emails {
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    overflow: hidden;
}

.fb-gallery-card-emails > i {
    font-size: 0.6rem;
    color: #9ca3af;
    flex-shrink: 0;
    display: none;
}

.fb-gallery-card-email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.fb-gallery-card-email i {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-right: 4px;
}

.fb-gallery-card--large {
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.fb-gallery-card--large:hover {
    box-shadow: none;
    transform: none;
}

.fb-gallery-card--large .fb-gallery-card-img img,
.fb-gallery-card--large .fb-gallery-card-img video {
    max-height: 60vh;
    object-fit: contain;
    transition: none;
}

.fb-gallery-card--large:hover .fb-gallery-card-img img,
.fb-gallery-card--large:hover .fb-gallery-card-img video {
    transform: none;
}

/* --------------------------------------------------------------------------
   2. HOVER EFFECTS
   -------------------------------------------------------------------------- */

.fb-gallery .fb-gallery-item::after,
.fb-gallery .fb-gallery-card .fb-gallery-card-img::after {
    display: none !important;
    content: none !important;
}

.fb-gallery .fb-gallery-card.fb-gallery-card--large .fb-gallery-card-img::after {
    display: none !important;
    content: none !important;
}

.fb-gallery-item .fb-icon {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 32px;
    height: 32px;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 2;
    fill: #fff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

.fb-gallery-item:hover .fb-icon {
    opacity: 1;
}

.fb-gallery-card:hover .fb-greenscreen-btn {
    opacity: 1;
}

@media (hover: none) {
    .fb-gallery-item::after,
    .fb-gallery-card-img::after {
        display: none !important;
    }
    .fb-gallery-item .fb-icon {
        display: none;
    }
    .fb-gallery-card .fb-greenscreen-btn {
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   3. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .fb-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .fb-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .fb-gallery {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .fb-gallery-card-info {
        padding: 6px 8px;
    }
    .fb-gallery-card-name {
        font-size: 0.7rem;
    }
    .fb-gallery-card-emails {
        font-size: 0.6rem;
    }
}

@media (max-width: 400px) {
    .fb-gallery {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* --------------------------------------------------------------------------
   4. PRELOADER / LOADING STATE
   -------------------------------------------------------------------------- */

.fb-gallery-loading {
    text-align: center;
    padding: 40px 0;
    color: #aa8d3f;
    font-size: 16px;
}

/* --------------------------------------------------------------------------
   5. GLIGHTBOX THEME OVERRIDES
   -------------------------------------------------------------------------- */

html.glightbox-open {
    overflow: hidden;
    scrollbar-gutter: stable;
}

body.gscrollbar-fixer {
    margin-right: 0 !important;
}

body.fb-lightbox-open #header #headerBottomCont {
    z-index: 0 !important;
}

.glightbox-clean .goverlay {
    background: rgba(0, 0, 0, 0.65) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.glightbox-clean .gslide-description {
    background: transparent !important;
    z-index: 3 !important;
}

.glightbox-clean .gslide-title {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    font-weight: 400;
    margin: 0;
    padding: 6px 0 0;
}

.glightbox-clean .gnext,
.glightbox-clean .gprev {
    width: 50px;
    height: 55px;
}

.glightbox-clean .gclose {
    z-index: 4;
}

.gslide-media {
    max-height: calc(100vh - 100px) !important;
}

.gslide-media .gvideo-local {
    max-width: 95vw !important;
    max-height: calc(100vh - 100px) !important;
}

.gslide-media img.zoomable {
    cursor: default !important;
}

.glightbox-mobile .gslide-description {
    display: none !important;
}

.fb-lightbox-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1000000;
    padding: 10px 16px calc(env(safe-area-inset-bottom, 8px) + 8px);
    box-sizing: border-box;
    text-align: center;
}

/* Slide counter */
.fb-lightbox-counter {
    position: fixed;
    top: 14px;
    left: 12px;
    color: #fff;
    font-family: 'Open Sans Condensed', sans-serif;
    font-size: 14px;
    z-index: 100001;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* --------------------------------------------------------------------------
   6. SHARE BUTTONS (in lightbox)
   -------------------------------------------------------------------------- */

.fb-share-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0 4px;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

@media (hover: none) and (pointer: coarse) {
    .fb-share-buttons {
        gap: 16px;
        padding: 12px 0 4px;
    }
    .fb-share-btn {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
}

.fb-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    color: #fff;
    fill: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.fb-share-btn i,
.fb-share-btn svg {
    color: #fff;
    fill: #fff;
}

.fb-share-btn:hover {
    transform: scale(1.12);
    opacity: 1;
    box-shadow: 0 4px 14px rgba(0,0,0,.45);
}

.fb-share-btn:active {
    transform: scale(.95);
}

.fb-share-facebook {
    background: #1877f2;
}

.fb-share-facebook:hover {
    background: #1565d8;
}

.fb-share-instagram {
    display: none;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
}

.fb-share-instagram:hover {
    background: linear-gradient(135deg, #7232a0, #e01a1a, #e5a03e);
}

@media (hover: none) and (pointer: coarse) {
    .fb-share-instagram {
        display: inline-flex;
    }
}

.fb-share-download {
    background: #aa8d3f;
}

.fb-share-download:hover {
    background: #9a7f38;
}

/* --------------------------------------------------------------------------
   7. TOAST NOTIFICATION
   -------------------------------------------------------------------------- */

.fb-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0,0,0,.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 999999;
    opacity: 0;
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

.fb-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   8. TPA DESIGN SYSTEM - Standalone definitions for frontend
   These mirror the admin TPA classes so the gallery page works without admin CSS
   -------------------------------------------------------------------------- */

.tym-po-akci-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 30px;
}

.tym-po-akci-wrapper::before,
.tym-po-akci-wrapper div::before,
.tym-po-akci-wrapper div::after,
.tym-po-akci-wrapper section::before,
.tym-po-akci-wrapper article::before,
.tym-po-akci-wrapper header::before,
.tym-po-akci-wrapper main::before,
.tym-po-akci-wrapper footer::before,
.tym-po-akci-wrapper aside::before,
.tym-po-akci-wrapper details::before,
.tym-po-akci-wrapper nav::before,
.tym-po-akci-wrapper p::before,
.tym-po-akci-wrapper h1::before,
.tym-po-akci-wrapper h2::before,
.tym-po-akci-wrapper h3::before,
.tym-po-akci-wrapper a::before,
.tym-po-akci-wrapper button::before,
.tym-po-akci-wrapper input::before,
.tym-po-akci-wrapper summary::before {
    display: none !important;
    content: none !important;
    clear: none !important;
}

.tpa-section {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
    transition: box-shadow 0.2s ease;
}

.tpa-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.tpa-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

.tpa-section-header > i {
    font-size: 1.1rem;
    color: #aa8d3f;
}

.tpa-section-date {
    font-size: 0.9rem;
    font-weight: 400;
    color: #6b7280;
    white-space: nowrap;
}

.tpa-section-title {
    margin: 0;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.tpa-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 1;
    min-width: 0;
    align-self: center;
}

.tpa-header-actions .fb-galerie-search {
    min-width: 160px;
    max-width: 240px;
    flex-shrink: 1;
}

.tpa-header-actions .tpa-btn-action {
    text-decoration: none;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.tpa-section-body {
    padding: 1.25rem;
}

.tpa-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.tpa-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.tpa-info-item--tab {
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tpa-info-item--tab:hover {
    border-color: rgba(170, 141, 63, 0.3);
    box-shadow: 0 2px 8px rgba(170, 141, 63, 0.12);
}

.tpa-info-item--tab.tpa-info-item--active {
    border-color: #aa8d3f;
    box-shadow: 0 0 0 2px rgba(170, 141, 63, 0.2);
    background: rgba(170, 141, 63, 0.06);
}

.tpa-info-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(170, 141, 63, 0.1);
    color: #aa8d3f;
    font-size: 1rem;
    flex-shrink: 0;
}

.tpa-info-content {
    min-width: 0;
}

.tpa-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tpa-info-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.tpa-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.tpa-btn-action:hover {
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tpa-toggle-group {
    display: inline-flex;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
}

.tpa-toggle-btn {
    padding: 0.5rem 0.875rem;
    border: none;
    background: #fff;
    color: #6b7280;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    border-right: 1px solid #dee2e6;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.tpa-toggle-btn:first-child {
    border-radius: 7px 0 0 7px;
}

.tpa-toggle-btn:last-child {
    border-right: none;
    border-radius: 0 7px 7px 0;
}

.tpa-toggle-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.tpa-toggle-btn--active {
    color: #065f46;
    background: rgba(16, 185, 129, 0.05);
    box-shadow: inset 0 0 0 2px #10b981;
}

.tpa-toggle-btn--active:hover {
    background: rgba(16, 185, 129, 0.1);
}

.tpa-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.tpa-empty-state > i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.tpa-empty-state > p {
    font-size: 1rem;
    margin: 0;
}

/* Dark mode for TPA standalone */
@media (prefers-color-scheme: dark) {
    html, body {
        background-color: #0f172a !important;
        color: #e5e7eb;
    }
    .tym-po-akci-wrapper {
        color: #e5e7eb;
    }
    .tpa-section {
        background: #1f2937;
        border-color: rgba(255, 255, 255, 0.08);
    }
    .tpa-section:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    .tpa-section-header {
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }
    .tpa-section-title {
        color: #f3f4f6;
    }
    .tpa-section-date {
        color: #9ca3af;
    }
    .tpa-info-item {
        background: #111827;
        border-color: rgba(255, 255, 255, 0.05);
    }
    .tpa-info-icon {
        background: rgba(170, 141, 63, 0.2);
    }
    .tpa-info-label {
        color: #9ca3af;
    }
    .tpa-info-value {
        color: #f3f4f6;
    }
    .tpa-info-item--tab:hover {
        border-color: rgba(170, 141, 63, 0.4);
    }
    .tpa-info-item--tab.tpa-info-item--active {
        border-color: #aa8d3f;
        box-shadow: 0 0 0 2px rgba(170, 141, 63, 0.25);
        background: rgba(170, 141, 63, 0.1);
    }
    .tpa-info-item--highlight {
        background: rgba(170, 141, 63, 0.12);
        border-color: rgba(170, 141, 63, 0.2);
    }
    .tpa-info-item--highlight .tpa-info-icon {
        background: rgba(170, 141, 63, 0.2);
    }
    .tpa-toggle-group {
        border-color: #374151;
        background: #1f2937;
    }
    .tpa-toggle-btn {
        background: #1f2937;
        color: #9ca3af;
        border-right-color: #374151;
    }
    .tpa-toggle-btn:hover {
        background: #374151;
        color: #e5e7eb;
    }
    .tpa-toggle-btn--active {
        color: #34d399;
        background: rgba(16, 185, 129, 0.1);
    }
    .tpa-btn-action {
        background: #1f2937;
        color: #e5e7eb;
        border-color: #374151;
    }
    .tpa-btn-action:hover {
        background: #374151;
    }
    .tpa-btn-action--primary {
        background: #aa8d3f;
        color: #fff;
        border-color: #aa8d3f;
    }
    .tpa-btn-action--primary:hover {
        background: #9a7f38;
    }
    .tpa-empty-state {
        color: #6b7280;
    }
    .fb-pozadi-thumb {
        background: #111827;
        border-color: rgba(255, 255, 255, 0.08);
    }
    .fb-pozadi-count {
        color: #9ca3af;
    }
}

[data-bs-theme=dark],
[data-bs-theme=dark] body {
    background-color: #0f172a !important;
    color: #e5e7eb;
}

[data-bs-theme=dark] .tpa-section {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme=dark] .tpa-section-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
[data-bs-theme=dark] .tpa-section-title {
    color: #f3f4f6;
}
[data-bs-theme=dark] .tpa-section-date {
    color: #9ca3af;
}
[data-bs-theme=dark] .tpa-info-item {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.05);
}
[data-bs-theme=dark] .tpa-info-item--tab:hover {
    border-color: rgba(170, 141, 63, 0.4);
}
[data-bs-theme=dark] .tpa-info-item--tab.tpa-info-item--active {
    border-color: #aa8d3f;
    box-shadow: 0 0 0 2px rgba(170, 141, 63, 0.25);
    background: rgba(170, 141, 63, 0.1);
}
[data-bs-theme=dark] .tpa-info-label {
    color: #9ca3af;
}
[data-bs-theme=dark] .tpa-info-value {
    color: #f3f4f6;
}
[data-bs-theme=dark] .tpa-toggle-group {
    border-color: #374151;
    background: #1f2937;
}
[data-bs-theme=dark] .tpa-toggle-btn {
    background: #1f2937;
    color: #9ca3af;
    border-right-color: #374151;
}
[data-bs-theme=dark] .tpa-toggle-btn:hover {
    background: #374151;
    color: #e5e7eb;
}
[data-bs-theme=dark] .tpa-toggle-btn--active {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
}
[data-bs-theme=dark] .tpa-btn-action {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #374151;
}
[data-bs-theme=dark] .tpa-empty-state {
    color: #6b7280;
}

@media (max-width: 768px) {
    .tpa-info-grid {
        grid-template-columns: 1fr 1fr;
    }
    .tpa-section-body {
        padding: 1rem;
    }
    .tym-po-akci-wrapper {
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .tpa-info-grid {
        grid-template-columns: 1fr;
    }
    .tpa-section-header {
        padding: 0.75rem 1rem;
    }
    .tpa-section-body {
        padding: 0.75rem;
    }
    .tym-po-akci-wrapper {
        padding: 10px 8px;
    }
    .tpa-header-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }
    .tpa-btn-label {
        display: none;
    }
    .tpa-header-actions .tpa-btn-action {
        padding: 0.5rem 0.65rem;
    }
}

/* --------------------------------------------------------------------------
   9. GALLERY SECTION TABS
   -------------------------------------------------------------------------- */

.fb-galerie-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.fb-galerie-tabs {
    flex-shrink: 0;
}

.fb-galerie-tabs .tpa-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fb-galerie-tabs .tpa-toggle-btn i {
    font-size: 0.8em;
    opacity: 0.7;
}

.fb-galerie-tabs .tpa-toggle-btn--active i {
    opacity: 1;
}

.fb-galerie-toolbar .fb-galerie-search {
    margin-left: auto;
    margin-bottom: 0;
    flex-shrink: 1;
    min-width: 150px;
    max-width: 280px;
}

@media (max-width: 900px) {
    .fb-galerie-toolbar {
        flex-wrap: wrap;
    }
    .fb-galerie-toolbar .fb-galerie-search {
        max-width: 100%;
        min-width: 0;
        flex-basis: 100%;
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .fb-galerie-tabs .tpa-toggle-group {
        flex-direction: column;
        border-radius: 8px;
    }
    .fb-galerie-tabs .tpa-toggle-btn {
        width: 100%;
        justify-content: center;
        padding: 0.625rem 1rem;
        border-right: none;
        border-bottom: 1px solid var(--bs-border-color, #dee2e6);
        border-radius: 0 !important;
    }
    .fb-galerie-tabs .tpa-toggle-btn:first-child {
        border-radius: 7px 7px 0 0 !important;
    }
    .fb-galerie-tabs .tpa-toggle-btn:last-child {
        border-bottom: none;
        border-radius: 0 0 7px 7px !important;
    }
}

/* --------------------------------------------------------------------------
   9a. PHOTO ACTION BUTTONS (move between sections, toggle cover)
   -------------------------------------------------------------------------- */

.fb-photo-actions {
    display: flex;
    gap: 3px;
    z-index: 3;
}

.fb-photo-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 5px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.fb-photo-action-btn:hover {
    transform: scale(1.15);
}

.fb-photo-action-btn:active {
    transform: scale(0.92);
}

.fb-action-to-galerie:hover {
    background: rgba(16, 185, 129, 0.85);
    color: #fff;
}

.fb-action-to-nepouzite:hover {
    background: rgba(107, 114, 128, 0.85);
    color: #fff;
}

.fb-action-to-smazane:hover {
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
}

.fb-action-toggle-cover:hover {
    background: rgba(245, 158, 11, 0.85);
    color: #fff;
}

.fb-action-delete-permanently {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.fb-action-delete-permanently:hover {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
}

.fb-action-toggle-cover.fb-cover-active {
    background: #f59e0b;
    color: #fff;
}

.fb-action-toggle-cover.fb-cover-active:hover {
    background: #d97706;
}

@media (hover: none) {
    .fb-photo-action-btn {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
}

/* --------------------------------------------------------------------------
   9b. GREENSCREEN BUTTON ON PHOTO
   -------------------------------------------------------------------------- */

.fb-greenscreen-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.15s ease, background 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.fb-gallery-item:hover .fb-greenscreen-btn,
.fb-gallery-card-img:hover .fb-greenscreen-btn {
    opacity: 1;
}

.fb-greenscreen-btn:hover {
    transform: scale(1.15);
    background: rgba(5, 150, 105, 1);
}

.fb-greenscreen-btn:active {
    transform: scale(0.95);
}

.fb-greenscreen-preview {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.fb-greenscreen-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fb-greenscreen-btn:hover + .fb-greenscreen-preview {
    display: block;
}

@media (hover: none) {
    .fb-greenscreen-btn {
        opacity: 1;
        width: 32px;
        height: 32px;
        font-size: 14px;
        bottom: 6px;
        right: 6px;
    }
}

/* --------------------------------------------------------------------------
   10. GREENSCREEN MODAL
   -------------------------------------------------------------------------- */

.fb-greenscreen-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-greenscreen-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.fb-greenscreen-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.fb-greenscreen-modal-content img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.fb-greenscreen-modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
    z-index: 2;
}

.fb-greenscreen-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .fb-greenscreen-modal-content {
        max-width: 95vw;
    }
    .fb-greenscreen-modal-content img {
        max-width: 95vw;
        max-height: 80vh;
        border-radius: 4px;
    }
    .fb-greenscreen-modal-close {
        top: -8px;
        right: -8px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

/* --------------------------------------------------------------------------
   11. SEARCH FIELD
   -------------------------------------------------------------------------- */

.fb-galerie-search {
    margin-bottom: 0;
}

.fb-galerie-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fb-galerie-search-icon {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1;
}

.fb-galerie-search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 2.25rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fb-galerie-search-input:focus {
    outline: none;
    border-color: #aa8d3f;
    box-shadow: 0 0 0 3px rgba(170, 141, 63, 0.15);
}

.fb-galerie-search-input::placeholder {
    color: #9ca3af;
}

.fb-galerie-search-clear {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.15s ease;
}

.fb-galerie-search-clear:hover {
    background: #e5e7eb;
    color: #374151;
}

.fb-galerie-search-status {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 6px;
    padding-left: 2px;
}

/* --------------------------------------------------------------------------
   11b. SORT BAR
   -------------------------------------------------------------------------- */

.fb-galerie-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.fb-galerie-toolbar .tpa-stats-accordion {
    flex: 1 1 0;
    min-width: 0;
    margin-top: 0;
}

.fb-galerie-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .fb-galerie-toolbar {
        flex-wrap: wrap;
    }
    .fb-galerie-toolbar .tpa-stats-accordion {
        flex-basis: 100%;
    }
}

.fb-sort-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.85rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.fb-sort-toggle i {
    color: #aa8d3f;
    font-size: 0.875rem;
}

.fb-sort-toggle:hover {
    border-color: #aa8d3f;
    background: rgba(170, 141, 63, 0.06);
}

[data-bs-theme=dark] .fb-sort-toggle {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

[data-bs-theme=dark] .fb-sort-toggle:hover {
    border-color: #aa8d3f;
    background: rgba(170, 141, 63, 0.15);
}

/* --------------------------------------------------------------------------
   12. DETAILED STATISTICS ACCORDION (TPA design)
   -------------------------------------------------------------------------- */

.tpa-stats-accordion {
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.tpa-stats-accordion__summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-body-color, #1f2937);
    background: var(--bs-light-bg-subtle, #f8f9fa);
    user-select: none;
    list-style: none;
    transition: background 0.15s ease;
}

.tpa-stats-accordion__summary::-webkit-details-marker {
    display: none;
}

.tpa-stats-accordion__summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    margin-left: auto;
    color: var(--bs-secondary-color, #9ca3af);
    transition: transform 0.2s ease;
}

.tpa-stats-accordion[open] > .tpa-stats-accordion__summary::after {
    transform: rotate(180deg);
}

.tpa-stats-accordion__summary:hover {
    background: var(--bs-tertiary-bg, #f3f4f6);
}

.tpa-stats-accordion__summary > i {
    color: #aa8d3f;
    font-size: 1rem;
}

.tpa-stats-accordion__body {
    padding: 1.25rem;
    border-top: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.06));
}

/* Pozadi thumbnails grid */
.fb-pozadi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.fb-pozadi-item {
    text-align: center;
}

.fb-pozadi-thumb {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.fb-pozadi-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fb-pozadi-thumb--layered {
    position: relative;
}

.fb-pozadi-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.fb-pozadi-layer:first-child {
    position: relative;
    object-fit: cover;
}

.blend-multiply { mix-blend-mode: multiply; }
.blend-screen { mix-blend-mode: screen; }
.blend-overlay { mix-blend-mode: overlay; }
.blend-darken { mix-blend-mode: darken; }
.blend-lighten { mix-blend-mode: lighten; }
.blend-color-dodge { mix-blend-mode: color-dodge; }
.blend-color-burn { mix-blend-mode: color-burn; }
.blend-hard-light { mix-blend-mode: hard-light; }
.blend-soft-light { mix-blend-mode: soft-light; }
.blend-difference { mix-blend-mode: difference; }
.blend-exclusion { mix-blend-mode: exclusion; }
.blend-hue { mix-blend-mode: hue; }
.blend-saturation { mix-blend-mode: saturation; }
.blend-color { mix-blend-mode: color; }
.blend-luminosity { mix-blend-mode: luminosity; }

.fb-pozadi-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1.5rem;
}

.fb-pozadi-count {
    margin-top: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.tpa-stats-accordion__body .tpa-subheading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0.75rem 0;
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--bs-secondary-color, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tpa-stats-accordion__body .tpa-subheading:not(:first-child) {
    margin-top: 1.5rem;
}

.tpa-stats-accordion__body .tpa-subheading > i {
    color: #aa8d3f;
    font-size: 0.85rem;
}

.tpa-stats-accordion__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.tpa-stats-accordion__col .tpa-subheading {
    margin-top: 0 !important;
}

.tpa-info-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

.tpa-info-grid--compact .tpa-info-item {
    padding: 0.5rem 0.75rem;
}

.tpa-info-grid--compact .tpa-info-icon {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
}

.tpa-info-grid--compact .tpa-info-value {
    font-size: 1rem;
}

.tpa-info-grid--compact .tpa-info-label {
    font-size: 0.7rem;
}

.tpa-info-grid--single {
    grid-template-columns: 1fr;
}

.tpa-info-item--highlight {
    background: rgba(170, 141, 63, 0.08);
    border-color: rgba(170, 141, 63, 0.15);
}

.tpa-info-item--highlight .tpa-info-icon {
    background: rgba(170, 141, 63, 0.15);
    color: #aa8d3f;
}

@media (max-width: 600px) {
    .tpa-stats-accordion__row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .tpa-stats-accordion__body {
        padding: 1rem;
    }
    .tpa-info-grid--compact {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

/* --------------------------------------------------------------------------
   13. ZIP EXPORT BUTTON (primary variant)
   -------------------------------------------------------------------------- */

.tpa-btn-action--primary {
    background: #aa8d3f;
    color: #fff;
    border-color: #aa8d3f;
}

.tpa-btn-action--primary:hover {
    background: #9a7f38;
    color: #fff;
    box-shadow: 0 2px 8px rgba(170, 141, 63, 0.3);
}

/* --------------------------------------------------------------------------
   14. DARK MODE SUPPORT
   -------------------------------------------------------------------------- */

[data-bs-theme=dark] .fb-photo-action-btn {
    background: rgba(255, 255, 255, 0.15);
}

[data-bs-theme=dark] .fb-action-toggle-cover.fb-cover-active {
    background: #f59e0b;
    color: #fff;
}

[data-bs-theme=dark] .fb-action-delete-permanently {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

[data-bs-theme=dark] .fb-greenscreen-btn {
    background: rgba(16, 185, 129, 0.85);
}

[data-bs-theme=dark] .fb-greenscreen-btn:hover {
    background: rgba(5, 150, 105, 1);
}

[data-bs-theme=dark] .fb-greenscreen-modal-overlay {
    background: rgba(0, 0, 0, 0.85);
}

[data-bs-theme=dark] .fb-greenscreen-modal-close {
    background: rgba(255, 255, 255, 0.15);
}

[data-bs-theme=dark] .fb-greenscreen-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

[data-bs-theme=dark] .fb-gallery-card {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme=dark] .fb-gallery-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme=dark] .fb-photo-action-btn {
    background: #374151;
    color: #9ca3af;
}

[data-bs-theme=dark] .fb-gallery-card-img {
    background: #111827;
}

[data-bs-theme=dark] .fb-section-galerie {
    background: #064e3b;
    color: #6ee7b7;
}
[data-bs-theme=dark] .fb-section-nepouzite {
    background: #78350f;
    color: #fcd34d;
}
[data-bs-theme=dark] .fb-section-smazane {
    background: #7f1d1d;
    color: #fca5a5;
}

[data-bs-theme=dark] .fb-gallery-card-name {
    color: #e5e7eb;
}

[data-bs-theme=dark] .fb-gallery-card-meta {
    color: #9ca3af;
}

[data-bs-theme=dark] .fb-gallery-card-info {
    border-top-color: rgba(255, 255, 255, 0.06);
}
[data-bs-theme=dark] .fb-gallery-card-emails {
    color: #9ca3af;
}
[data-bs-theme=dark] .fb-gallery-card-email i {
    color: #6b7280;
}

[data-bs-theme=dark] .fb-galerie-search-input {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

[data-bs-theme=dark] .fb-galerie-search-input:focus {
    border-color: #aa8d3f;
    box-shadow: 0 0 0 3px rgba(170, 141, 63, 0.25);
}

[data-bs-theme=dark] .fb-galerie-search-clear {
    background: #374151;
    color: #9ca3af;
}

[data-bs-theme=dark] .tpa-stats-accordion {
    border-color: var(--bs-border-color, rgba(255, 255, 255, 0.08));
}

[data-bs-theme=dark] .tpa-stats-accordion__summary {
    background: var(--bs-dark-bg-subtle, #111827);
    color: var(--bs-body-color, #e5e7eb);
}

[data-bs-theme=dark] .tpa-stats-accordion__summary:hover {
    background: var(--bs-tertiary-bg, #1f2937);
}

[data-bs-theme=dark] .tpa-stats-accordion__body {
    border-top-color: var(--bs-border-color, rgba(255, 255, 255, 0.06));
}

[data-bs-theme=dark] .tpa-stats-accordion__body .tpa-subheading {
    color: var(--bs-secondary-color, #9ca3af);
}

[data-bs-theme=dark] .fb-pozadi-thumb {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme=dark] .fb-pozadi-count {
    color: #9ca3af;
}

[data-bs-theme=dark] .tpa-info-item--highlight {
    background: rgba(170, 141, 63, 0.12);
    border-color: rgba(170, 141, 63, 0.2);
}

[data-bs-theme=dark] .tpa-info-item--highlight .tpa-info-icon {
    background: rgba(170, 141, 63, 0.2);
}

@media (prefers-color-scheme: dark) {
    .fb-gallery-card-header {
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }
    .fb-photo-action-btn {
        background: #374151;
        color: #9ca3af;
    }
    .fb-action-toggle-cover.fb-cover-active {
        background: #f59e0b;
        color: #fff;
    }
    .fb-action-delete-permanently {
        background: rgba(239, 68, 68, 0.25);
        color: #fca5a5;
    }
    .fb-greenscreen-btn {
        background: rgba(16, 185, 129, 0.85);
    }
    .fb-greenscreen-btn:hover {
        background: rgba(5, 150, 105, 1);
    }
    .fb-greenscreen-modal-overlay {
        background: rgba(0, 0, 0, 0.85);
    }
    .fb-greenscreen-modal-close {
        background: rgba(255, 255, 255, 0.15);
    }
    .fb-greenscreen-modal-close:hover {
        background: rgba(255, 255, 255, 0.25);
    }
    .fb-gallery-card {
        background: #1f2937;
        border-color: rgba(255, 255, 255, 0.08);
    }
    .fb-gallery-card-img {
        background: #111827;
    }
    .fb-section-galerie {
        background: #064e3b;
        color: #6ee7b7;
    }
    .fb-section-nepouzite {
        background: #78350f;
        color: #fcd34d;
    }
    .fb-section-smazane {
        background: #7f1d1d;
        color: #fca5a5;
    }
    .fb-gallery-card-name {
        color: #e5e7eb;
    }
    .fb-gallery-card-meta {
        color: #9ca3af;
    }
    .fb-gallery-card-info {
        border-top-color: rgba(255, 255, 255, 0.06);
    }
    .fb-gallery-card-emails {
        color: #9ca3af;
    }
    .fb-gallery-card-email i {
        color: #6b7280;
    }
    .fb-galerie-search-input {
        background: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }
    .fb-galerie-search-input:focus {
        border-color: #aa8d3f;
        box-shadow: 0 0 0 3px rgba(170, 141, 63, 0.25);
    }
    .fb-galerie-search-clear {
        background: #374151;
        color: #9ca3af;
    }
    .fb-sort-toggle {
        background: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }
    .fb-sort-toggle:hover {
        border-color: #aa8d3f;
        background: rgba(170, 141, 63, 0.15);
    }
    .tpa-stats-accordion {
        border-color: rgba(255, 255, 255, 0.08);
    }
    .tpa-stats-accordion__summary {
        background: #111827;
        color: #e5e7eb;
    }
    .tpa-stats-accordion__summary:hover {
        background: #1f2937;
    }
    .tpa-stats-accordion__body {
        border-top-color: rgba(255, 255, 255, 0.06);
    }
    .tpa-stats-accordion__body .tpa-subheading {
        color: #9ca3af;
    }
    .tpa-info-item--highlight {
        background: rgba(170, 141, 63, 0.12);
        border-color: rgba(170, 141, 63, 0.2);
    }
    .tpa-info-item--highlight .tpa-info-icon {
        background: rgba(170, 141, 63, 0.2);
    }
}

/* ==========================================================================
   JUSTIFIED FLEXBOX LAYOUT — public galerie-detail page (restored from backup)
   Scoped under .fb-gallery--justified so it doesn't affect event gallery grid
   ========================================================================== */

.fb-gallery.fb-gallery--justified {
    --row-height: 200px;
    --gap: 4px;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    padding: 8px 0;
    grid-template-columns: none;
}

.fb-gallery--justified .fb-gallery-row {
    display: flex;
    gap: var(--gap);
    width: 100%;
}

.fb-gallery--justified .fb-gallery-item {
    height: var(--row-height);
    flex: 1 1 0%;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    line-height: 0;
    aspect-ratio: auto;
}

.fb-gallery--justified .fb-gallery-item.fb-justified {
    flex: 0 0 auto;
}

.fb-gallery--justified .fb-gallery-item img,
.fb-gallery--justified .fb-gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fb-gallery--justified .fb-gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(170, 141, 63, 0.6);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 1;
}

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

.fb-gallery--justified .fb-gallery-item .fb-icon {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 32px;
    height: 32px;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 2;
    fill: #fff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

.fb-gallery--justified .fb-gallery-item:hover .fb-icon {
    opacity: 1;
}

@media (hover: none) {
    .fb-gallery--justified .fb-gallery-item::after {
        display: none;
    }
    .fb-gallery--justified .fb-gallery-item .fb-icon {
        display: none;
    }
}

@media (max-width: 1024px) {
    .fb-gallery.fb-gallery--justified {
        --row-height: 160px;
        --gap: 3px;
    }
}

@media (max-width: 600px) {
    .fb-gallery.fb-gallery--justified {
        --row-height: 120px;
        --gap: 2px;
    }
    .fb-gallery--justified .fb-gallery-item {
        min-width: 80px;
    }
}

@media (max-width: 400px) {
    .fb-gallery.fb-gallery--justified {
        --row-height: 100px;
    }
}
