/* /domains/gromadan.com/public_html/css/user/photo_popup/style.css .pp-sidebar
   Попап просмотра фото профиля. Подключается один раз из
   view_photo_popup/index.php вместе с попапом. */

.pp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(10,10,16,0.72);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}
.pp-overlay.is-open { display: flex; }
body.pp-locked { overflow: hidden; }

.pp-close {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.95);
    color: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}

.pp-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}
.pp-nav-arrow:hover { background: rgba(255,255,255,0.28); }
.pp-nav-arrow--prev { left: 24px; }
.pp-nav-arrow--next { right: 24px; }

.pp-box {
    width: min(96vw, 1180px);
    height: min(92vh, 860px);
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.pp-stage { width: 100%; height: 100%; position: relative; }

.pp-slide {
    display: none;
    height: 100%;
    grid-template-columns: 1fr 420px;
    grid-template-rows: 100%;   /* трек не растягивается по контенту сайдбара */
}
.pp-slide.is-active { display: grid; }

.pp-media {
    position: relative;
    background: #000;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 0;   /* иначе grid-строка растёт по контенту соседней колонки */
}
/* object-fit: cover — фото всегда заполняет блок целиком, без чёрных
   полос; при несовпадении пропорций обрезаются края (как в Instagram),
   а не остаётся пустое место. Размер блока при этом фиксированный
   и не меняется при переключении между фото. */
.pp-media img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 1300px) {
    .pp-slide { grid-template-columns: auto 340px; }
}

/* Внутренние стрелки/точки — задел на несколько фото в одном посте.
   Сейчас у поста всегда одно фото, поэтому декоративные, без обработчиков. */
.pp-media-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.85);
    color: #1a1a2e;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.pp-media-arrow--prev { left: 14px; }
.pp-media-arrow--next { right: 14px; }
.pp-dots {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}
.pp-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.5);
}
.pp-dot.is-active { background: #fff; }

/* Блок ленты (лайки/подпись/ссылка на коментарі под фото) — виден
   только на мобилке (см. @media ниже). На десктопе не участвует
   в гриде .pp-slide, иначе ломает 2-колоночную раскладку сайдбара. */
.pp-feed-info { display: none; }

.pp-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    min-height: 0;   /* ключевое: без этого flex-колонка растягивается по контенту */
    border-left: 1px solid rgba(0,0,0,0.08);
    background: var(--surface);
}

.pp-sb-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.pp-sb-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.pp-sb-head-info { display: flex; flex-direction: column; min-width: 0; }
.pp-sb-name { font-weight: 700; font-size: 0.92rem; color: var(--text-primary); text-decoration: none; }
.pp-sb-loc { font-size: 0.78rem; color: var(--text-secondary); }
.pp-sb-more { margin-left: auto; background: none; border: none; font-size: 1.2rem; color: var(--text-secondary); cursor: default; }
.pp-sheet-close { display: none; } /* видна только на мобилке, см. @media ниже */

.pp-sb-caption {
    padding: 12px 18px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.pp-sb-comments-title {
    padding: 12px 18px 6px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    flex-shrink: 0;
}
.pp-cm-count { color: var(--text-secondary); font-weight: 500; }

.pp-sb-comments {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 18px;
    overscroll-behavior: contain;
}
.pp-sb-empty { color: var(--text-secondary); font-size: 0.85rem; padding: 10px 0; }

.pp-cm { display: flex; gap: 10px; padding: 8px 0; }
.pp-cm-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.pp-cm-body { flex: 1; min-width: 0; }
.pp-cm-text { font-size: 0.86rem; line-height: 1.4; color: var(--text-primary); margin: 0; }
.pp-cm-name { font-weight: 700; text-decoration: none; color: var(--text-primary); }
.pp-cm-meta { display: flex; gap: 12px; margin-top: 3px; }
.pp-cm-date { font-size: 0.72rem; color: var(--text-secondary); }
.pp-cm-like {
    align-self: flex-start;
    background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--text-secondary);
}
.pp-cm-like.is-liked { color: var(--like-bg, #ff4757); }
.pp-cm-like-count { font-size: 0.68rem; }

.pp-sb-form-wrap { padding: 10px 18px; border-top: 1px solid rgba(0,0,0,0.06); flex-shrink: 0; }
.pp-sb-form { display: flex; align-items: flex-end; gap: 8px; }
.pp-sb-textarea {
    flex: 1; resize: none; border: none; outline: none;
    font-size: 0.88rem; font-family: inherit; color: var(--text-primary);
    max-height: 140px; padding: 6px 0;
}
.pp-sb-submit {
    background: none; border: none; color: var(--primary);
    font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.pp-sb-submit:disabled { opacity: 0.4; cursor: default; }
.pp-sb-auth { font-size: 0.85rem; color: var(--text-secondary); text-align: center; }
.pp-sb-auth a { color: var(--primary); font-weight: 700; text-decoration: none; }

.pp-sb-foot {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.pp-like-btn, .pp-comment-icon, .pp-bookmark-btn {
    display: flex; align-items: center; gap: 6px;
    background: none; border: none; color: var(--text-primary);
    font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.pp-like-btn.is-liked { color: var(--like-bg, #ff4757); }
.pp-like-btn.is-liked svg { fill: currentColor; }
.pp-bookmark-btn { margin-left: auto; cursor: default; }

@media (max-width: 900px) {
    .pp-nav-arrow { display: none; }
    .pp-close { display: none; } /* на мобилке — свайп/системная кнопка "назад" */

    .pp-overlay { background: #000; align-items: stretch; justify-content: stretch; }

    .pp-box {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        box-shadow: none;
    }

    /* Обычная вертикальная лента: все фото стоят одно под другим,
       скролл — обычный документный скролл контейнера, без snap. */
    .pp-stage { overflow-y: auto; -webkit-overflow-scrolling: touch; }

    .pp-slide {
        display: block !important; /* показываем ВСЕ фото сразу, не только "активное" */
        grid-template-columns: none;
        height: auto;
        position: relative;
        border-bottom: 8px solid #000; /* разделитель между постами, как в Instagram */
    }

    .pp-media {
        position: relative;
        width: 100%;
        aspect-ratio: 4 / 5;
        height: auto;
    }

    /* Блок инфо ПОД фото (обычный поток, не поверх картинки) */
    .pp-feed-info {
        display: block;
        background: var(--surface);
        color: var(--text-primary);
        padding: 10px 14px 14px;
    }
    .pp-feed-actions {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 6px;
    }
    .pp-feed-actions .pp-like-btn,
    .pp-feed-actions .pp-mobile-comment-btn {
        background: none;
        border: none;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        padding: 0;
    }
    .pp-feed-actions .pp-like-btn.is-liked { color: var(--like-bg, #ff4757); }
    .pp-feed-actions .pp-like-btn.is-liked svg { fill: currentColor; }

    .pp-feed-likes { font-size: 0.86rem; margin-bottom: 4px; }
    .pp-feed-caption { font-size: 0.86rem; line-height: 1.4; margin-bottom: 4px; }
    .pp-feed-caption-text.is-clamped {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .pp-feed-caption-more {
        display: none;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-weight: 700;
        font-size: 0.82rem;
        padding: 2px 0 0;
        cursor: pointer;
    }
    .pp-feed-comments-link.pp-feed-comments-link {
        display: block;
        background: none;
        border: none;
        padding: 0;
        color: var(--text-secondary);
        font-size: 0.84rem;
        cursor: pointer;
        text-align: left;
    }

    .pp-sb-foot { display: none; } /* дублирует .pp-feed-info на мобиле */

    /* сайдбар-комментарии превращаются в bottom sheet поверх ленты */
    .pp-sidebar {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        height: 78%;
        border-left: none;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.25s ease;
        box-shadow: 0 -8px 24px rgba(0,0,0,0.3);
        z-index: 1004;
    }
    .pp-sidebar.is-sheet-open { transform: translateY(0); }

    .pp-sheet-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 1003;
    }
    .pp-sheet-backdrop.is-visible { display: block; }

    .pp-sheet-close {
        display: flex;
        margin-left: auto;
        background: none;
        border: none;
        font-size: 1.1rem;
        color: var(--text-secondary);
        cursor: pointer;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
    }

    .pp-sb-more { display: none; }

    /* Шапка шторки: ручка для свайпа вниз */
    .pp-sheet-handle {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: rgba(0,0,0,0.2);
        margin: 8px auto 0;
        flex-shrink: 0;
        touch-action: none;
    }

    /* iOS зумит страницу при фокусе на инпуте с font-size < 16px — фиксируем 16px */
    .pp-sb-textarea { font-size: 16px; }
}








.pp-cm--flash { animation: pp-cm-flash 2s ease; border-radius: 8px; }

.pp-cm-reply {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.pp-cm-reply:hover { color: var(--primary); }

.pp-cm-thread {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-decoration: none;
}
.pp-cm-thread:hover { color: var(--primary); }

.pp-cm-back {
    display: block;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 0 10px;
}

.pp-cm-quote {
    display: block;
    text-decoration: none;
    background: rgba(0,0,0,0.035);
    border-left: 2px solid var(--primary);
    border-radius: 6px;
    padding: 4px 8px;
    margin-bottom: 4px;
}
.pp-cm-quote-name { display: block; font-size: 0.7rem; font-weight: 700; color: var(--primary); }
.pp-cm-quote-text {
    display: block;
    font-size: 0.74rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pp-sb-reply-chip {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.pp-sb-reply-cancel { cursor: pointer; font-weight: 700; }

@keyframes pp-cm-flash { 0%, 100% { background: transparent; } 15% { background: var(--primary-light); } }