
/* =========================================
   PORTFOLIO POPUP
   Обновленная версия
========================================= */

/* ОВЕРЛЕЙ */

.pp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pp-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* САМО ОКНО */

.pp-modal {
    position: fixed;
    top: 0;
    right: -75%;
    width: 70%;
    height: 100vh;
    height: 100dvh;
    background-color: #34404e;
    color: #fff;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 30px 40px;
    box-sizing: border-box;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pp-overlay.active .pp-modal {
    right: 0;
}

/* КНОПКА ЗАКРЫТИЯ */

.pp-close {
    position: absolute;
    top: 15px;
    right: 25px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

/* ШАПКА */

.pp-header {
    flex-shrink: 0;
    margin-bottom: 20px;
}

.pp-header h2 {
    margin: 0;
    font-size: 28px;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.pp-header p {
    margin: 5px 0 0;
    color: #a0aab5;
    font-size: 16px;
}

/* КАТЕГОРИИ */

.pp-tabs-container {
    flex-shrink: 0;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    padding-bottom: 5px;
}

.pp-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 10px;
    width: 100%;
}

.pp-tab {
    min-width: 0;
    box-sizing: border-box;
    background: transparent;
    color: #fff;
    border: 1px solid #566573;
    border-radius: 30px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: normal;
    line-height: 1.25;
}

.pp-tab:hover {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4CAF50;
}

.pp-tab.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

/* ОБЕРТКА СЛАЙДЕРА */

.pp-slider-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    margin: 0 -10px;
}

/* СЛАЙДЕР */

.pp-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 10px;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    align-items: stretch;
    min-height: 0;
}

.pp-slider::-webkit-scrollbar {
    display: none;
}

/* КАРТОЧКА ПРОЕКТА */

.pp-card {
    flex: 0 0 calc(25% - 15px);
    min-width: 240px;
    background: #2c3a47;
    border-radius: 8px;
    overflow: hidden;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 560px;
}

/* ВЕРТИКАЛЬНЫЕ ФОТОГРАФИИ */

.pp-card-img {
    height: clamp(260px, 34vh, 360px);
    flex-shrink: 0;
    overflow: hidden;
}

.pp-card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s;
}

.pp-card:hover .pp-card-img img {
    transform: scale(1.04);
}

/* СОДЕРЖИМОЕ КАРТОЧКИ */

.pp-card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.pp-card-content h3 {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.3;
    color: #fff;

    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;

    white-space: normal;
    overflow-wrap: anywhere;
}

.pp-card-content p {
    color: #a0aab5;
    font-size: 13px;
    margin: 0 0 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* КНОПКА ПОДРОБНЕЕ */

.pp-card-btn {
    align-self: flex-start;
    padding: 8px 16px;
    border: 1px solid #566573;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s;
    margin-top: auto;
}

.pp-card-btn:hover {
    background: #4CAF50;
    border-color: #4CAF50;
}

/* КНОПКИ НАВИГАЦИИ */

.pp-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.pp-nav:hover {
    background: #4CAF50;
}

.pp-prev {
    left: -10px;
}

.pp-next {
    right: -10px;
}

/* ТОЧКИ */

.pp-dots {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    height: 10px;
}

.pp-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #566573;
    cursor: pointer;
    transition: background 0.3s;
}

.pp-dot.active {
    background: #fff;
}

/* ЗАГРУЗКА */

.pp-loader {
    width: 100%;
    text-align: center;
    padding: 30px 0;
    color: #a0aab5;
    font-size: 16px;
}

.pp-no-posts {
    width: 100%;
    text-align: center;
    padding: 30px 0;
    color: #a0aab5;
    font-size: 15px;
}

.pp-error {
    color: #ff7777;
}

/* =========================================
   ПЛАНШЕТЫ
========================================= */

@media (max-width: 1024px) {

    .pp-modal {
        width: 85%;
        right: -85%;
        padding: 30px 20px;
    }

    .pp-card {
        flex: 0 0 calc(33.333% - 14px);
    }

    .pp-card-img {
        height: clamp(250px, 32vh, 330px);
    }

}

/* =========================================
   МОБИЛЬНЫЕ УСТРОЙСТВА
========================================= */

@media (max-width: 768px) {

    /* Окно */

    .pp-modal {
        width: 100%;
        right: -100%;
        padding: 20px 15px;
    }

    /* Шапка */

    .pp-header {
        margin-bottom: 15px;
    }

    .pp-header h2 {
        font-size: 22px;
    }

    /* КАТЕГОРИИ — ДВЕ КОЛОНКИ */

    .pp-tabs-container {
        width: 100%;
        box-sizing: border-box;

        overflow-x: hidden;
        overflow-y: auto;

        max-height: 180px;

        margin-bottom: 15px;
        padding: 3px 5px 8px 0;

        scrollbar-width: thin;
        scrollbar-color: #4CAF50 #2c3a47;
    }

    .pp-tabs-container::-webkit-scrollbar {
        display: block;
        width: 5px;
    }

    .pp-tabs-container::-webkit-scrollbar-track {
        background: #2c3a47;
        border-radius: 5px;
    }

    .pp-tabs-container::-webkit-scrollbar-thumb {
        background: #4CAF50;
        border-radius: 5px;
    }

    .pp-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .pp-tab {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;

        white-space: normal;
        text-align: center;

        padding: 10px 7px;
        font-size: 13px;
        line-height: 1.3;
    }

    /* СЛАЙДЕР */

    .pp-nav {
        display: none;
    }

    /* Карточка занимает большую часть экрана.
       Следующая карточка частично видна сбоку. */

    .pp-card {
        flex: 0 0 82%;
        min-width: 0;
        max-height: 500px;
    }

    /* Вертикальные фотографии на телефоне */

    .pp-card-img {
        height: clamp(220px, 32vh, 290px);
    }

    .pp-card-content {
        padding: 13px;
    }

    .pp-card-content h3 {
        font-size: 15px;
    }

    .pp-card-content p {
        font-size: 13px;
    }

    .pp-slider {
        padding: 10px 5px;
        gap: 15px;
    }

    /* Кнопка закрытия */

    .pp-close {
        top: 10px;
        right: 15px;
    }

}

/* =========================================
   ТЕЛЕФОНЫ В ГОРИЗОНТАЛЬНОМ ПОЛОЖЕНИИ
========================================= */

@media (max-width: 768px) and (orientation: landscape) {

    .pp-tabs-container {
        max-height: 110px;
    }

    .pp-card-img {
        height: 200px;
    }

}
