/**
 * =====================================================
 * PORTFOLIO
 * =====================================================
 */

.portfolio-section {
    position: relative;
    padding: 90px 0;
}

.portfolio-inner {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}


/*
 * =====================================================
 * HEADER
 * =====================================================
 */

.portfolio-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 42px;
}

.portfolio-heading {
    max-width: 620px;
}

.portfolio-kicker,
.portfolio-popup-kicker {
    display: block;
    margin-bottom: 10px;
    color: #cca444;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.portfolio-title {
    margin: 0;
    color: #5c1a4f;
    font-family: Arial, sans-serif;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 700;
}

.portfolio-intro {
    max-width: 560px;
    margin: 14px 0 0;
    color: #5c4b57;
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}


/*
 * =====================================================
 * ФИЛЬТРЫ
 * =====================================================
 */

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 520px;
}

.portfolio-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px 16px;
    border: 1px solid rgba(92, 26, 79, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    color: #5c1a4f;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.portfolio-tag:hover {
    border-color: #cca444;
    transform: translateY(-1px);
}

.portfolio-tag.is-active {
    border-color: #cca444;
    background: #5c1a4f;
    color: #ffffff;
}


/*
 * =====================================================
 * СЕТКА
 * =====================================================
 */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}


/*
 * =====================================================
 * КАРТОЧКА
 * =====================================================
 */

.portfolio-card {
    position: relative;
    min-width: 0;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.portfolio-card.is-hidden {
    display: none;
}

.portfolio-card-image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    background: #eee;
    cursor: pointer;
    box-shadow:
        0 12px 32px rgba(92, 26, 79, 0.12);
}

.portfolio-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.55s ease,
        filter 0.4s ease;
}

.portfolio-card-image:hover img {
    transform: scale(1.045);
    filter: brightness(0.78);
}

.portfolio-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 24px;
    background:
        linear-gradient(
            to top,
            rgba(42, 12, 36, 0.78) 0%,
            rgba(42, 12, 36, 0.22) 45%,
            rgba(42, 12, 36, 0) 75%
        );
    opacity: 0;
    transition: opacity 0.35s ease;
}

.portfolio-card-image:hover .portfolio-card-overlay,
.portfolio-card-image:focus-visible .portfolio-card-overlay {
    opacity: 1;
}

.portfolio-card-overlay-title {
    max-width: 90%;
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 700;
    text-align: left;
}

.portfolio-card-overlay-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    color: #cca444;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.portfolio-card-overlay-more span {
    font-size: 15px;
}


/*
 * =====================================================
 * POPUP
 * =====================================================
 */

.portfolio-popup {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        visibility 0s linear 0.3s,
        opacity 0.3s ease;
}

.portfolio-popup.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition:
        visibility 0s linear 0s,
        opacity 0.3s ease;
}

.portfolio-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(29, 12, 25, 0.78);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.portfolio-popup-dialog {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    width: min(1080px, 100%);
    max-height: min(760px, calc(100vh - 50px));
    overflow: hidden;
    border: 1px solid rgba(204, 164, 68, 0.28);
    border-radius: 22px;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.98),
            rgba(250, 243, 248, 0.98)
        );
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.32);
    transform: translateY(18px) scale(0.98);
    transition: transform 0.3s ease;
}

.portfolio-popup.is-open .portfolio-popup-dialog {
    transform: translateY(0) scale(1);
}


/*
 * =====================================================
 * CLOSE
 * =====================================================
 */

.portfolio-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: rgba(92, 26, 79, 0.86);
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.portfolio-popup-close:hover {
    background: #cca444;
    color: #5c1a4f;
    transform: rotate(5deg);
}


/*
 * =====================================================
 * ГАЛЕРЕЯ
 * =====================================================
 */

.portfolio-popup-gallery {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 22px;
    background:
        linear-gradient(
            145deg,
            #f5edf3,
            #eee3eb
        );
}

.portfolio-popup-main-image {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border-radius: 15px;
    background: #e7dfe5;
}

.portfolio-popup-main-img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 390px;
    max-height: 570px;
    object-fit: contain;
    background: #eee8ed;
}

.portfolio-popup-prev,
.portfolio-popup-next {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(92, 26, 79, 0.82);
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 29px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.portfolio-popup-prev {
    left: 14px;
}

.portfolio-popup-next {
    right: 14px;
}

.portfolio-popup-prev:hover,
.portfolio-popup-next:hover {
    background: #cca444;
    color: #5c1a4f;
}

.portfolio-popup-thumbs {
    display: flex;
    gap: 9px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 3px;
}

.portfolio-popup-thumb {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    opacity: 0.65;
    transition:
        border-color 0.2s ease,
        opacity 0.2s ease;
}

.portfolio-popup-thumb:hover {
    opacity: 1;
}

.portfolio-popup-thumb.is-active {
    border-color: #cca444;
    opacity: 1;
}

.portfolio-popup-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/*
 * =====================================================
 * ПРАВАЯ ЧАСТЬ
 * =====================================================
 */

.portfolio-popup-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 58px 42px 42px;
    overflow-y: auto;
}

.portfolio-popup-title {
    margin: 0 0 26px;
    color: #5c1a4f;
    font-family: Arial, sans-serif;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
}

.portfolio-popup-meta {
    padding: 13px 0;
    border-top: 1px solid rgba(92, 26, 79, 0.11);
}

.portfolio-popup-meta:last-of-type {
    border-bottom: 1px solid rgba(92, 26, 79, 0.11);
}

.portfolio-popup-meta-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
}

.portfolio-popup-meta-label {
    color: #806d79;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
}

.portfolio-popup-meta-value {
    color: #5c1a4f;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
    text-align: right;
}

.portfolio-popup-description {
    margin-top: 25px;
    color: #443640;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
}

.portfolio-popup-description p {
    margin: 0 0 13px;
}

.portfolio-popup-description p:last-child {
    margin-bottom: 0;
}

.portfolio-popup-description h2,
.portfolio-popup-description h3,
.portfolio-popup-description h4 {
    margin: 18px 0 8px;
    color: #5c1a4f;
    font-family: Arial, sans-serif;
    line-height: 1.3;
}

.portfolio-popup-description ul,
.portfolio-popup-description ol {
    margin: 10px 0 14px;
    padding-left: 20px;
}

.portfolio-popup-description li {
    margin-bottom: 5px;
}


/*
 * =====================================================
 * КНОПКА
 * =====================================================
 */

.portfolio-popup-actions {
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    padding-top: 30px;
    padding-right: 8px;
}
.portfolio-popup-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: calc(100% - 8px);
    box-sizing: border-box;
    min-height: 50px;
    padding: 12px 20px;
    border-radius: 11px;
    background:
        linear-gradient(
            135deg,
            #5c1a4f,
            #70245f
        );
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow:
        0 9px 25px rgba(92, 26, 79, 0.2);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.portfolio-popup-contact:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow:
        0 13px 30px rgba(92, 26, 79, 0.28);
}

.portfolio-popup-contact span {
    color: #cca444;
    font-size: 17px;
}


/*
 * =====================================================
 * BODY
 * =====================================================
 */

body.portfolio-popup-open {
    overflow: hidden;
}


/*
 * =====================================================
 * АДАПТИВ
 * =====================================================
 */

@media (max-width: 900px) {

    .portfolio-header {
        display: block;
    }

    .portfolio-tags {
        justify-content: flex-start;
        margin-top: 25px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portfolio-popup-dialog {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 30px);
        overflow-y: auto;
    }

    .portfolio-popup-gallery {
        min-height: 440px;
    }

    .portfolio-popup-main-image {
        min-height: 350px;
    }

    .portfolio-popup-content {
        padding: 32px 30px 30px;
        overflow: visible;
    }

    .portfolio-popup-actions {
        margin-top: 25px;
    }

}


@media (max-width: 600px) {

    .portfolio-section {
        padding: 65px 0;
    }

    .portfolio-inner {
        width: min(100% - 28px, 1200px);
    }

    .portfolio-title {
        font-size: 30px;
    }

    .portfolio-intro {
        font-size: 14px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .portfolio-card-image {
        border-radius: 14px;
    }

    .portfolio-card-overlay {
        padding: 20px;
        opacity: 1;
    }

    .portfolio-popup {
        padding: 10px;
    }

    .portfolio-popup-dialog {
        max-height: calc(100vh - 20px);
        border-radius: 16px;
    }

    .portfolio-popup-gallery {
        min-height: 330px;
        padding: 12px;
    }

    .portfolio-popup-main-img {
        min-height: 270px;
    }

    .portfolio-popup-content {
        padding: 35px 22px 24px;
    }

    .portfolio-popup-title {
        font-size: 25px;
        margin-bottom: 20px;
    }

}

/*
 * =====================================================
 * АРХИВ ПОРТФОЛИО
 * =====================================================
 */

.portfolio-archive-section {
    width: 100%;
    padding: 92px 0 105px;
}

.portfolio-archive-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.portfolio-archive-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 42px;
}

.portfolio-archive-heading {
    max-width: 620px;
}

.portfolio-archive-title {
    margin: 0;
    color: #5c1a4f;
    font-family: Arial, sans-serif;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 700;
}

.portfolio-archive-intro {
    max-width: 700px;
    margin: 14px 0 0;
    color: #5c4b57;
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}


/*
 * =====================================================
 * ФИЛЬТРЫ АРХИВА
 * =====================================================
 */

.portfolio-archive-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 520px;
    flex-shrink: 0;
}


/*
 * =====================================================
 * СЕТКА АРХИВА
 * =====================================================
 */

.portfolio-archive-grid {
    width: 100%;
}


/*
 * =====================================================
 * ПАГИНАЦИЯ
 * =====================================================
 */

.portfolio-pagination {
    margin-top: 50px;
}

.portfolio-pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.portfolio-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    box-sizing: border-box;

    border: 1px solid #5e1d53;
    border-radius: 4px;

    color: #5e1d53;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease;
}

.portfolio-pagination .page-numbers:hover {
    background: #5e1d53;
    color: #ffffff;
}

.portfolio-pagination .page-numbers.current {
    background: #5e1d53;
    color: #ffffff;
}

.portfolio-pagination .page-numbers.dots {
    border-color: transparent;
}

.portfolio-pagination .page-numbers.dots:hover {
    background: transparent;
    color: #5e1d53;
}


/*
 * =====================================================
 * ПУСТОЙ АРХИВ
 * =====================================================
 */

.portfolio-empty {
    padding: 40px 0;
    color: #666666;
    font-family: Arial, sans-serif;
    font-size: 15px;
}

.portfolio-empty p {
    margin: 0;
}


/*
 * =====================================================
 * АДАПТИВ АРХИВА
 * =====================================================
 */

@media (max-width: 900px) {

    .portfolio-archive-section {
        padding: 70px 0 82px;
    }

    .portfolio-archive-header {
        display: block;
    }

    .portfolio-archive-tags {
        justify-content: flex-start;
        max-width: none;
        margin-top: 25px;
    }

}


@media (max-width: 600px) {

    .portfolio-archive-section {
        padding: 52px 0 64px;
    }

    .portfolio-archive-inner {
        padding: 0 15px;
    }

    .portfolio-archive-title {
        font-size: 30px;
    }

    .portfolio-archive-intro {
        font-size: 14px;
    }

    .portfolio-pagination {
        margin-top: 35px;
    }

}

/*
 * =====================================================
 * ССЫЛКА «СМОТРЕТЬ ВСЕ»
 * =====================================================
 */

.portfolio-title-row {
    display: flex;
    align-items: center;
    gap: 30px;
}

.portfolio-all-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #5e1d53;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-decoration: none;
    transition:
        color 0.3s ease,
        transform 0.3s ease;
}

.portfolio-all-link:hover {
    color: #cca444;
}

.portfolio-all-link-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #cca444;
    border-radius: 50%;
    color: #cca444;
    font-size: 16px;
    line-height: 1;
    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}

.portfolio-all-link:hover .portfolio-all-link-arrow {
    background-color: #cca444;
    color: #ffffff;
    transform: translate(3px, -3px);
}


/*
 * =====================================================
 * АДАПТИВ
 * =====================================================
 */

@media (max-width: 700px) {

    .portfolio-title-row {
        gap: 15px;
    }

    .portfolio-all-link span:first-child {
        display: none;
    }

}
