/* --- GRID (UNVERÄNDERT) --- */
.hfl-gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 20px; width: 100%; }
@media (max-width: 900px) { .hfl-gallery-grid { grid-template-columns: repeat(2, 1fr); } }

.hfl-gallery-filters { display: flex; gap: 8px; margin-bottom: 15px; justify-content: flex-end; }
.hfl-filter-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 6px 16px; border-radius: 20px; font-size: 11px; cursor: pointer; transition: all 0.2s; font-weight: 700; text-transform: uppercase; }
.hfl-filter-btn:hover, .hfl-filter-btn.active { background: #fff; color: #111; }

.hfl-grid-item { aspect-ratio: 1 / 1; cursor: pointer; transition: transform 0.2s ease; }
.hfl-grid-item:hover { transform: translateY(-4px); }

.hfl-glass-card { width: 100%; height: 100%; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 16px; position: relative; overflow: hidden; padding: 6px; box-sizing: border-box; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

.hfl-media-wrapper { width: 100%; height: 100%; border-radius: 12px; overflow: hidden; position: relative; background: #000; }
.hfl-media-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hfl-grid-item:hover .hfl-media-wrapper img { transform: scale(1.08); }

.hfl-content-curtain { position: absolute; bottom: 6px; left: 6px; right: 6px; height: 65%; background: linear-gradient(to top, rgba(0,0,0,0.85) 10%, rgba(0,0,0,0.4) 70%, transparent 100%); border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; pointer-events: none; z-index: 1; }
.hfl-content-info { position: absolute; inset: 6px; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; padding: 12px; }
.hfl-snippet { color: #fff; font-size: 13px; font-weight: 600; margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.hfl-date { font-size: 9px; color: rgba(255,255,255,0.75); text-transform: uppercase; font-weight: 700; align-self: flex-end; margin-top: 4px; }

/* --- CUSTOM MODAL CONTAINER (NEW SPLIT VIEW) --- */
.hfl-gallery-modal { 
    position: fixed; inset: 0; z-index: 1000000; 
    display: flex; align-items: center; justify-content: center; 
    pointer-events: none; 
}

.hfl-gallery-modal.is-open { pointer-events: auto; }

/* Backdrop */
.hfl-modal-backdrop { 
    position: absolute; inset: 0; 
    background: rgba(0, 0, 0, 0); 
    backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
    transition: all 0.5s ease;
}
.hfl-gallery-modal.is-open .hfl-modal-backdrop { 
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px);
}

/* Modal Box - Desktop: Wide & Fixed Height */
.hfl-modal-content-wrap { 
    position: relative; 
    width: 95vw; max-width: 1200px; /* Wide for split view */
    height: 90vh; max-height: 900px; /* Fixed height so we can scroll inside */
    background: #fff;
    border-radius: 8px; /* Slightly sharper, more cinematic */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden; 
    z-index: 2; 
    opacity: 0; transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
}

.hfl-gallery-modal.is-open .hfl-modal-content-wrap { opacity: 1; transform: scale(1); }

.hfl-modal-close { 
    position: absolute; top: 15px; left: 15px; /* Links oben für bessere Erreichbarkeit auf Desktop */
    background: rgba(0,0,0,0.5); border: none; color: #fff; 
    width: 36px; height: 36px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 24px; cursor: pointer; z-index: 9999; 
    transition: background 0.2s; backdrop-filter: blur(4px);
}
.hfl-modal-close:hover { background: rgba(0,0,0,0.8); }

/* --- INTERNAL LAYOUT (SPLIT VIEW) --- */
.hfl-modal-body { height: 100%; width: 100%; }

.hfl-lb-wrapper {
    display: flex; width: 100%; height: 100%;
    flex-direction: row; /* Desktop: Side by Side */
    background: #000;
}

/* 1. Media Column (Left) */
.hfl-lb-media-col {
    flex: 1; /* Takes all available space */
    background: #000;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
}

.hfl-lb-main-media {
    max-width: 100%; max-height: 100%;
    width: auto; height: auto;
    object-fit: contain; /* Ensures full image is visible */
    display: block;
}

/* Audio Cover specific styling */
img.hfl-audio-cover {
    width: 100%; max-width: 500px; 
    aspect-ratio: 1/1; object-fit: cover; 
    border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* 2. Sidebar Column (Right) */
.hfl-lb-sidebar-col {
    width: 400px; /* Fixed width sidebar */
    min-width: 350px;
    background: #fff;
    display: flex; flex-direction: column;
    border-left: 1px solid rgba(0,0,0,0.1);
}

/* Sidebar: Header */
.hfl-lb-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex; align-items: center; gap: 12px;
    background: #fff; flex: 0 0 auto;
}
.hfl-lb-avatar-img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(0,0,0,0.1); }
.hfl-lb-meta { display: flex; flex-direction: column; line-height: 1.2; }
.hfl-lb-username { font-weight: 700; color: #111; text-decoration: none; font-size: 14px; }
.hfl-lb-time { font-size: 11px; color: #888; margin-top: 2px; }

/* Sidebar: Body (Scrollable Text) */
.hfl-lb-body {
    flex: 1; /* Fills remaining height */
    overflow-y: auto; /* SCROLL HERE */
    padding: 20px;
    color: #333; font-size: 14px; line-height: 1.5;
}

.hfl-lb-text { white-space: pre-wrap; word-wrap: break-word; }
.hfl-lb-text p { margin-bottom: 12px; }
.hfl-lb-text a { color: #0056b3; text-decoration: none; }

.hfl-lb-audio-player { margin-top: 20px; width: 100%; }

/* --- MOBILE LAYOUT (VERTICAL SCROLL) --- */
@media (max-width: 900px) {
    .hfl-modal-content-wrap {
        width: 100%; height: 100%; max-width: 100%; max-height: none;
        border-radius: 0;
    }
    
    .hfl-modal-close { top: 15px; left: 15px; background: rgba(0,0,0,0.4); }

    .hfl-lb-wrapper {
        flex-direction: column; /* Stack vertically */
        overflow-y: auto; /* Scroll the whole page container */
        height: 100%;
        background: #fff;
    }

    .hfl-lb-media-col {
        flex: 0 0 auto; /* Don't stretch */
        width: 100%;
        min-height: 50vh; /* At least half screen */
        background: #000;
    }
    
    .hfl-lb-main-media {
        /* On mobile, either contain (safe) or cover (full bleed) */
        width: 100%; height: auto; max-height: 80vh; 
    }

    .hfl-lb-sidebar-col {
        width: 100%; min-width: 100%;
        border-left: none;
        flex: 0 0 auto; /* Allow it to grow with content */
    }
    
    .hfl-lb-body {
        overflow: visible; /* Let the main wrapper handle scroll */
        padding-bottom: 80px; /* Space for bottom navs usually */
    }
}

/* Custom Scrollbar for Desktop Sidebar */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f9f9f9; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #aaa; }

.hfl-emoji-loader { font-size: 50px; animation: spin 1s infinite linear; display: inline-block; }
.hfl-lb-error { color: #fff; text-align: center; padding: 50px; }