/* Стили для страницы конкретной работы портфолио */

.portfolio-item-page {
    padding: 40px 0 80px 0;
}

.breadcrumbs {
    font-size: 0.95rem;
    margin-bottom: 30px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.breadcrumbs a {
    color: #E85A2D;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .separator {
    color: #999;
    margin: 0 8px;
}

.portfolio-header {
    margin-bottom: 40px;
}

.portfolio-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portfolio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #6c757d;
    font-size: 0.95rem;
    min-width: 0;
}

.portfolio-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.portfolio-meta i {
    color: #E85A2D;
}

.portfolio-meta a {
    color: #E85A2D;
    text-decoration: none;
}

.portfolio-meta a:hover {
    color: #D14A1F;
    text-decoration: underline;
}

.portfolio-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 40px;
}

.portfolio-description p {
    margin-bottom: 15px;
}

.portfolio-site-link {
    margin: 0 0 40px;
}

.portfolio-series-section {
    margin: 0 0 48px;
    padding-top: 8px;
}

.portfolio-series-header {
    margin-bottom: 24px;
}

.portfolio-series-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portfolio-series-header h2 i {
    color: #E85A2D;
}

.portfolio-series-description {
    color: #555;
    margin-bottom: 12px;
    max-width: 720px;
}

.portfolio-series-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #E85A2D;
    text-decoration: none;
    font-weight: 500;
}

.portfolio-series-all-link:hover {
    text-decoration: underline;
}

.portfolio-series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.portfolio-series-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portfolio-series-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.portfolio-series-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.portfolio-series-card-placeholder {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 2rem;
    background: #f1f3f5;
}

.portfolio-series-card-meta {
    padding: 12px 14px;
}

.portfolio-series-card-meta strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.portfolio-series-card-meta span {
    font-size: 0.85rem;
    color: #6c757d;
}

.portfolio-description + .portfolio-site-link {
    margin-top: -16px;
}

.portfolio-site-link .site-visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: #E85A2D;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 999px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.portfolio-site-link .site-visit-btn:hover {
    background: #D14A1F;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(232, 90, 45, 0.35);
}

.portfolio-site-link .site-visit-btn:focus-visible {
    outline: 2px solid #E85A2D;
    outline-offset: 3px;
}

.gallery-section {
    margin-top: 10px;
    margin-bottom: 20px;
    min-width: 0;
    max-width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    min-width: 0;
    width: 100%;
}

.gallery-grid-item {
    border: none;
    padding: 0;
    margin: 0;
    background: none;
    border-radius: var(--card-radius, 6px);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    aspect-ratio: 1 / 1;
    display: block;
    width: 100%;
    position: relative;
    line-height: 0;
}

.gallery-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gallery-grid-item:focus-visible {
    outline: 2px solid #E85A2D;
    outline-offset: 3px;
}

.gallery-grid-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
}

.navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.nav-spacer {
    min-width: 0;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.nav-item-link:hover {
    border-color: #E85A2D;
    color: #E85A2D;
    transform: translateY(-2px);
}

.nav-item-link > i {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1;
}

.nav-item-link .nav-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.nav-item-link .nav-label {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.nav-item-link .nav-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.nav-item-link.prev {
    text-align: left;
}

.nav-item-link.next {
    text-align: right;
    justify-content: flex-end;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #E85A2D;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #D14A1F;
}

.cta-section {
    background: linear-gradient(135deg, #E85A2D 0%, #C2451A 100%);
    color: white;
    padding: 60px 40px;
    border-radius: 12px;
    text-align: center;
    margin-top: 60px;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.95;
}

.cta-section .btn {
    background: white;
    color: #E85A2D;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.cta-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    color: #C2451A;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 60px 20px 40px;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    box-sizing: border-box;
    width: min(1200px, 92vw);
    max-width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.lightbox-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(85vh - 40px);
    object-fit: contain;
    border-radius: var(--card-radius, 6px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.22);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .portfolio-header h1 {
        font-size: 1.8rem;
    }
    .gallery-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
    .navigation {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
    .nav-spacer {
        display: none;
    }
    .nav-item-link .nav-title {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    .cta-section {
        padding: 40px 20px;
    }
    .lightbox {
        padding: 56px 12px 24px;
    }
    .lightbox-content {
        width: min(100%, 92vw);
    }
    .lightbox-content img {
        max-height: calc(85vh - 56px);
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close {
        top: 12px;
        right: 12px;
    }
}

.portfolio-video-section {
    margin: 0 0 32px;
}

.portfolio-video-section .content-video-embed {
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    border-radius: var(--card-radius, 6px);
    overflow: hidden;
    background: #111;
}

.portfolio-video-section .content-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}