:root {
    --background-color: #121212;
    --text-color: #f0f0f0;
    --accent-color: #E1306C;
    --popup-bg: #141414;
    --animation-speed: 70s;
}

body {
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

.gallery-wrapper {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.gallery-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2vw;
    padding: 2vw 0;
    box-sizing: border-box;
}

.gallery-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 2vw;
    will-change: transform;
    cursor: grab;
}

.gallery-row.grabbing {
    cursor: grabbing;
}

.gallery-row img {
    height: 45vh;
    width: auto;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.4s ease;
    flex-shrink: 0;
    background-color: #222;
    user-select: none;
    -webkit-user-drag: none;
    width: auto;
}

.gallery-row img:hover {
    transform: scale(1.05) !important;
    filter: brightness(1.15);
    z-index: 10;
}

.popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    display: grid; place-items: center; z-index: 1000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s 0.4s linear;
}
.popup-overlay.active { 
    opacity: 1; 
    visibility: visible;
    transition: opacity 0.4s ease;
}
.popup-content {
    width: 90%; height: 90vh; max-width: 1400px;
    display: grid; grid-template-columns: 2fr 1fr;
    background-color: var(--popup-bg); border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease;
    overflow: hidden;
}
.popup-overlay.active .popup-content {
    transform: scale(1) translateY(0);
}

.popup-slider-container { position: relative; overflow: hidden; background-color: #000; }
.popup-slider-track { display: flex; height: 100%; transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1); }
.popup-slider-track .slide { position: relative; flex-shrink: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.popup-slider-track img,
.popup-slider-track video { 
    width: 100%; height: 100%; object-fit: contain; 
}
/* СТИЛІ ДЛЯ ВІДЕО */
.popup-slider-track video {
    cursor: pointer;
}

.slide .play-pause-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.slide .play-pause-icon.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.slide .play-pause-icon svg {
    fill: white;
    width: 30px;
    height: 30px;
}

.popup-slider-nav { position: absolute; top: 50%; left: 15px; right: 15px; transform: translateY(-50%); display: flex; justify-content: space-between; pointer-events: none; }
.popup-slider-nav button { 
    pointer-events: all; background: rgba(255, 255, 255, 0.1); 
    border: none; color: white; border-radius: 50%; width: 44px; height: 44px; 
    cursor: pointer; font-size: 24px; display: none; 
    transition: background 0.3s, transform 0.2s; 
    backdrop-filter: blur(5px);
}
.popup-slider-nav button:hover { background: rgba(255, 255, 255, 0.2); }
.popup-slider-nav button:active { transform: scale(0.9); }

.popup-slider-indicators { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 10; }
.popup-slider-indicators .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); transition: background 0.3s, transform 0.3s; }
.popup-slider-indicators .dot.active { background: white; transform: scale(1.2); }

.popup-info { padding: 30px; display: flex; flex-direction: column; overflow-y: auto; }
.popup-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px; margin-bottom: 25px; flex-shrink: 0; }
.popup-user-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-color); font-weight: 600; font-size: 1.1em; transition: color 0.3s ease; }
.popup-user-link:hover { color: var(--accent-color); }
.popup-user-link svg { width: 28px; height: 28px; }

.popup-close { font-size: 2.5em; cursor: pointer; color: #888; background: none; border: none; transition: color 0.3s, transform 0.3s; line-height: 1; padding: 0; }
.popup-close:hover { color: var(--text-color); transform: rotate(90deg); }

.popup-description { flex-grow: 1; }
.popup-description .main-title { font-size: 1.4em; font-weight: 600; margin-bottom: 15px; line-height: 1.3; }
.popup-description .tags { font-size: 1em; color: #aaa; word-wrap: break-word; line-height: 1.5; }
.popup-description .date { font-size: 0.85em; color: #888; margin-top: 20px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.1); }
.jepr-title-inst {
    color: #FFF;
    font-size: 32px;
    font-style: normal;
    font-weight: 400;
    line-height: 100%;
    text-align: center;
    margin-top: 34px;
    margin-bottom: 54px;
}

.jepr-title-highlight-inst {
    color: #50C440;
    font-size: 32px;
    font-style: normal;
    font-weight: 400;
    line-height: 100%;
}

.instagram-link {
    text-decoration: none;
}
@media (max-width: 768px) {
    .gallery-container { gap: 4vw; }
    .gallery-row { gap: 4vw; }
    .gallery-row img {
        height: 30vh;
        border-radius: 10px;
    }
    .jepr-title-inst {
        margin-top: -50px;
        margin-bottom: 54px;
    }

    .popup-content { 
        grid-template-columns: 1fr; 
        width: 90vw; 
        height: 85vh;
        max-height: 680px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        grid-template-rows: 55% auto;
    }
    .popup-slider-container {
        height: 100%;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }
    .popup-info { 
        padding: 20px 25px 30px; 
        overflow-y: auto;
    }
    .popup-slider-nav button { display: none !important; }
}
p#popup-tags a {
    text-decoration: none;
    color: #fff;
    font-size: 1em;
    color: #aaa;
    word-wrap: break-word;
    line-height: 1.5;
}