/* --- GALLERY MODULE v14.0 --- */
.gallery-layout { display: flex; width: 100%; position: relative; background-color: #111; min-height: 100vh; }

/* 1. FILTER STRIP (Permanent sidebar links) */
.filter-strip { 
    width: 70px; background: #262624; border-right: 1px solid #333; 
    display: flex; flex-direction: column; align-items: center; padding-top: 25px; gap: 20px; 
    flex-shrink: 0; position: fixed; left: 0; 
    top: var(--hf-header-offset, calc(var(--nav-height) + var(--topbar-height)));
    height: var(--hf-filter-height, calc(100vh - (var(--nav-height) + var(--topbar-height))));
    z-index: 4500 !important; 
}

.filter-toggle-btn { width: 50px; height: 50px; border-radius: 50%; border: none; background: var(--hf-accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.filter-toggle-btn.active { background: #fff; color: var(--hf-primary); transform: rotate(180deg); }
.hf-filter-icon { width: 26px; height: 26px; fill: currentColor; }

/* Search Button - Circle, White Border, No BG, Rounded */
.search-toggle-btn { 
    width: 44px !important; height: 44px !important; border-radius: 50% !important; 
    border: 1.5px solid #fff !important; background: transparent !important; 
    color: #fff !important; cursor: pointer; 
    display: flex !important; align-items: center !important; justify-content: center !important; 
    transition: all 0.2s; margin-top: 10px;
}
.search-toggle-btn:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }

/* 2. FILTER SIDEBAR (Fixed & Flex-Layout for Scroll isolation) */
.filter-sidebar { 
    position: fixed !important; 
    top: var(--hf-header-offset, calc(var(--nav-height) + var(--topbar-height))) !important; 

    left: 70px !important; 
    width: 380px !important; 
    background: #1e1e1e !important; 
    border-right: 1px solid #333 !important; 
    display: flex !important; 
    flex-direction: column !important; 
    z-index: 4000 !important; 
    transform: translateX(-120%); 
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
    box-shadow: 15px 0 50px rgba(0,0,0,0.8); 
    height: var(--hf-filter-height, calc(100vh - (var(--nav-height) + var(--topbar-height)))) !important;
    overflow: hidden !important; 
}
.filter-sidebar.open { transform: translateX(0); }

.filter-header { 
    height: 70px; display: flex; align-items: center; justify-content: space-between; 
    padding: 0 25px; border-bottom: 1px solid #333; background: #262624; 
    flex-shrink: 0; 
}
.filter-header h3 { margin: 0; color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 900; }

/* DER SCROLL-BEREICH */
.filter-scroll-area { 
    flex: 1 !important; 
    overflow-y: auto !important; 
    padding: 0; 
    scrollbar-width: thin; 
    scrollbar-color: #444 #1e1e1e; 
}

.filter-footer { 
    padding: 25px; border-top: 1px solid #333; background: #262624; 
    flex-shrink: 0; text-align: center; 
}
.btn-filter-apply { 
    width: 100%; background: var(--hf-accent); color: #fff; padding: 16px; 
    border: none; border-radius: 4px; font-weight: 800; cursor: pointer; 
    text-transform: uppercase; letter-spacing: 1.5px; 
}
.btn-reset-link { display: block; margin-top: 15px; color: #666; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.btn-reset-link:hover { color: #fff; }

/* PANEL & WIDGET STYLES (RESTORED) */
.slide-in__panel__group { border-bottom: 1px solid #2a2a2a; }
.slide-in__panel__title { 
    padding: 20px 25px; cursor: pointer; display: flex; justify-content: space-between; 
    align-items: center; font-size: 0.85rem; font-weight: 700; color: #ccc; 
    text-transform: uppercase; letter-spacing: 1px; transition: background 0.2s;
}
.slide-in__panel__title:hover { background: #252525; color: #fff; }
.slide-in__panel__title .icon { width: 16px; height: 16px; margin-right: 12px; opacity: 0.7; }
.slide-in__panel__group.expanded .arrow { transform: rotate(90deg); color: #fff; }
.slide-in__panel__content { display: none; padding: 5px 25px 25px 25px; }
.slide-in__panel__group.expanded .slide-in__panel__content { display: block; }

.hf-region-tree { list-style: none; padding: 0; margin: 0; }
.hf-region-tree ul { padding-left: 18px; border-left: 1px solid #333; margin-left: 6px; margin-top: 5px; }
.hf-region-node { margin: 8px 0; color: #aaa; font-size: 0.9rem; }
.tree-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tree-row:hover { color: #fff; }
.hf-tree-toggle { cursor: pointer; color: #555; transition: transform 0.2s; }
.hf-tree-toggle.open { transform: rotate(90deg); color: var(--hf-accent); }
.hidden { display: none !important; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item input { display: none; }
.tag-box { padding: 8px 14px; background: #2a2a2a; border: 1px solid #444; border-radius: 20px; font-size: 0.85rem; color: #ccc; cursor: pointer; transition: all 0.2s; }
.tag-item input:checked + .tag-box { background: var(--hf-accent); color: #fff; border-color: var(--hf-accent); font-weight: 700; }

.segmented-control { display: flex; background: #111; border-radius: 6px; padding: 4px; border: 1px solid #333; }
.segment-item { flex: 1; text-align: center; cursor: pointer; }
.segment-item input { display: none; }
.segment-box { display: block; padding: 8px 0; font-size: 0.85rem; color: #888; border-radius: 4px; transition: all 0.2s; }
.segment-item input:checked + .segment-box { background: #333; color: #fff; font-weight: 700; }

/* 3. MAIN GALLERY AREA */
.gallery-main { flex: 1; display: flex; flex-direction: column; background: #111; width: calc(100% - 70px); margin-left: 70px; }
.gallery-top-bar { padding: 20px 40px; display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 20px; }
.active-pills-area { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; }
.gallery-count { color: #666; font-size: 0.9rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; }

/* PILLS VISIBILITY */
.filter-pill { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 6px 14px; border-radius: 30px; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 10px; transition: all 0.2s; }
.filter-pill:hover { border-color: var(--hf-accent); background: rgba(121, 156, 75, 0.15); }
.remove-pill { cursor: pointer; color: #888; font-weight: bold; }

/* MASONRY GRID */
.masonry-wrapper { width: 100%; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); grid-auto-rows: 250px; grid-auto-flow: dense; gap: 20px; padding: 0 40px 80px 40px; }
.masonry-item { position: relative; background: #151515; padding: 5px; border-radius: 2px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.masonry-item.span-2 { grid-column: span 2; }
.masonry-item img { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 1; }
.masonry-item:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 5; background: #222; }
.item-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 40%); opacity: 0; transition: opacity 0.3s ease; display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; pointer-events: none; }
.masonry-item:hover .item-overlay { opacity: 1; }
.ov-title { color: #fff; font-weight: 700; font-size: 1rem; }
.ov-meta { color: var(--hf-accent); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
