/* ============================================================
   ГК Две столицы — Портфолио (portfolio page)
   Секции объектов, спецификации, фото-сетка и полноэкранный
   просмотр (лайтбокс, контракт js/page-gallery.js).
   Глобально: main.css (.hero, .breadcrumbs, .section-*,
   .contact-cta-*, .gallery-card-базис, .blog-from-site).
   ============================================================ */

/* ===== Секция объекта ===== */
.pf-project {
    position: relative;
    padding: 80px 0;
    border-top: 1px solid hsla(0, 0%, 100%, 0.06);
}

.pf-project--alt {
    background: linear-gradient(180deg, var(--black) 0%, var(--bg-section) 50%, var(--black) 100%);
}

.pf-project .section-subtitle {
    display: block;
}

.pf-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1.6fr);
    gap: 40px;
    align-items: stretch;
    margin-top: 36px;
}

.pf-project--alt .pf-gallery {
    order: -1;
}

/* В чётных секциях галерея слева — широкая колонка 1.6fr должна
   достаться ей (иначе карточки не влезают по 2 на узкую 1fr). */
@media (min-width: 1025px) {
    .pf-project--alt .pf-layout {
        grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    }
}

/* Инфо-колонка растягивается на высоту секции (равные высоты) */
.pf-info {
    display: flex;
    flex-direction: column;
}

/* ===== Характеристики объекта ===== */
.pf-specs {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    justify-content: space-evenly;
    gap: 0;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    background: linear-gradient(160deg, hsla(0, 0%, 100%, 0.05), hsla(0, 0%, 100%, 0.015));
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.pf-spec {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) 1.4fr;
    gap: 14px;
    padding: 13px 20px;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.07);
}

.pf-spec:last-child {
    border-bottom: 0;
}

.pf-spec dt {
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    align-self: center;
}

.pf-spec dd {
    font-size: 15px;
    line-height: 1.55;
    color: var(--white);
    font-weight: 600;
    margin: 0;
}

.pf-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    transition: gap 0.3s var(--ease-pop), color 0.3s ease;
}

.pf-link:hover {
    gap: 12px;
    color: var(--blue-light);
}

.pf-link svg {
    flex-shrink: 0;
}

/* Надзаголовок-ссылка на категорию объекта (во всех карточках) */
.pf-project .section-subtitle a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.pf-project .section-subtitle a:hover {
    color: var(--white);
}

/* Кнопка «Открыть проект» (pf-1): отдельная строка сетки .pf-layout —
   нижний правый угол под сеткой фото. Таблица при этом остаётся
   ровно по высоте блока миниатюр (высота строки 1). */
.pf-actions {
    grid-column: 2;
    justify-self: end;
}

/* В чётных карточках фото слева — кнопка уходит под него,
   левый край кнопки = левый край блока миниатюр. */
.pf-project--alt .pf-actions {
    grid-column: 1;
    justify-self: start;
}

.pf-project-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 1px solid rgba(46, 123, 255, 0.45);
    border-radius: var(--btn-radius);
    background: transparent;
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.35s var(--ease-pop);
}

.pf-project-btn:hover {
    background: hsla(0, 0%, 100%, 0.08);
    border-color: var(--blue);
    transform: translateY(-2px);
}

.pf-project-btn svg {
    flex-shrink: 0;
}

/* ===== Фото-сетка объекта ===== */
.pf-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    grid-auto-rows: minmax(195px, 1fr);
    height: 100%;
    gap: 14px;
}

.pf-gallery .gallery-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--dark-grey);
    cursor: pointer;
    transition: transform 0.35s var(--ease-pop), border-color 0.3s ease, box-shadow 0.35s ease;
}

.pf-gallery .gallery-card:hover {
    transform: translateY(-4px);
    border-color: rgba(46, 123, 255, 0.45);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}

.pf-gallery .gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-smooth), filter 0.35s ease;
    filter: brightness(0.92);
}

.pf-gallery .gallery-card:hover img {
    transform: scale(1.06);
    filter: brightness(1);
}

.gallery-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 14px 16px;
    background: linear-gradient(180deg, transparent 55%, rgba(5, 5, 10, 0.82) 100%);
    pointer-events: none;
}

.gallery-card-title {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.2px;
    color: var(--white);
}

/* ===== Полноэкранный просмотр (лайтбокс) ===== */
.fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 76px;
    background: rgba(5, 5, 8, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fullscreen-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid hsla(0, 0%, 100%, 0.22);
    border-radius: 50%;
    background: hsla(0, 0%, 100%, 0.07);
    color: var(--white);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.fullscreen-close:hover {
    background: rgba(46, 123, 255, 0.25);
    border-color: rgba(46, 123, 255, 0.6);
    transform: rotate(90deg);
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid hsla(0, 0%, 100%, 0.22);
    border-radius: 50%;
    background: hsla(0, 0%, 100%, 0.07);
    color: var(--white);
    transform: translateY(-50%);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.fullscreen-nav:hover {
    background: rgba(46, 123, 255, 0.25);
    border-color: rgba(46, 123, 255, 0.6);
}

.fullscreen-prev {
    left: 16px;
}

.fullscreen-next {
    right: 16px;
}

.fullscreen-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 1180px;
    max-height: 100%;
}

.fullscreen-container > img {
    max-width: 100%;
    max-height: 68vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}

.fullscreen-info {
    width: 100%;
    max-width: 860px;
    padding: 18px 26px 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, hsla(0, 0%, 100%, 0.1), hsla(0, 0%, 100%, 0.03));
    text-align: center;
}

.fullscreen-info-content h3 {
    font-family: var(--font-head);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--white);
}

.fs-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 30px;
    margin-top: 10px;
}

.fs-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fs-label {
    font-size: 10px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fs-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-light);
    overflow-wrap: anywhere;
}

.fs-description {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ===== Адаптив ===== */
@media (max-width: 1024px) {
    .pf-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .pf-gallery {
        height: auto;
        grid-auto-rows: auto;
    }

    .pf-actions {
        grid-column: auto;
    }

    .pf-project--alt .pf-gallery {
        order: 0;
    }

    .fullscreen-overlay {
        padding: 60px 60px 40px;
    }
}

@media (max-width: 768.98px) {
    .pf-project {
        padding: 56px 0;
    }

    .pf-spec {
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 11px 16px;
    }

    .pf-gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .fullscreen-overlay {
        padding: 56px 12px 24px;
    }

    .fullscreen-nav {
        width: 42px;
        height: 42px;
        top: auto;
        bottom: 14px;
        transform: none;
    }

    .fullscreen-prev {
        left: 14px;
    }

    .fullscreen-next {
        right: 14px;
    }

    .fullscreen-container > img {
        max-height: 55vh;
    }

    .fullscreen-info {
        padding: 14px 16px 16px;
    }

    .fullscreen-info-content h3 {
        font-size: 16px;
    }
}
