/* ================================================================ */
/* صفحه جزئیات پروژه                                               */
/* ================================================================ */

/* ================================================================ */
/* هیرو پروژه                                                       */
/* ================================================================ */

.project-hero {
    min-height: 50vh;
    position: relative;
    background: url('/image/single-project-background.png') center/cover no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 72px;
}

.project-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.85) 0%,
        rgba(15, 23, 42, 0.7) 100%
    );
}

.project-hero-content {
    position: relative;
    z-index: 2;
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.project-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    color: var(--accent-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.project-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.project-meta i {
    color: var(--accent);
    margin-left: 5px;
}


/* ================================================================ */
/* اطلاعات پروژه                                                    */
/* ================================================================ */

.project-info-section {
    padding: 60px 0;
    background: var(--bg-white);
}

.project-description {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.project-description h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-right: 4px solid var(--accent);
    padding-right: 1rem;
}

.project-description p {
    color: var(--text-muted);
    line-height: 1.9;
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}


/* ================================================================ */
/* سایدبار                                                          */
/* ================================================================ */

.project-sidebar {
    position: sticky;
    top: 100px;
}

.info-box,
.contact-box {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.info-box h3,
.contact-box h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-right: 3px solid var(--accent);
    padding-right: 0.8rem;
}

.info-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-box li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.info-box li:last-child {
    border-bottom: none;
}

.info-box li span {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 100px;
}

.contact-box input,
.contact-box textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    font-family: inherit;
    transition: var(--transition);
}

.contact-box input:focus,
.contact-box textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.contact-box button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.contact-box button:hover {
    background: var(--accent);
    color: var(--primary-dark);
}


/* ================================================================ */
/* گالری                                                             */
/* ================================================================ */

.gallery-section {
    padding: 60px 0;
    background: #0F172AFF;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title-white {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
}

.section-title .text-accent {
    color: var(--accent);
}

.section-desc {
    color: rgba(255, 255, 255, 0.6);
    max-width: 600px;
    margin: 0 auto;
}

.about-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
    padding: 0.3rem 1.2rem;
    border-radius: 50px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
}


/* ================================================================ */
/* گالری تامبنیل                                                    */
/* ================================================================ */

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.thumb-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    height: 220px;
    background: rgba(255, 255, 255, 0.05);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.thumb-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.3);
}

.thumb-item:hover img {
    transform: scale(1.08);
}


/* ================================================================ */
/* حالت خالی بودن گالری                                             */
/* ================================================================ */

.gallery-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.08);
    min-height: 300px;
}

.gallery-empty i {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.15);
    margin-bottom: 1rem;
}

.gallery-empty p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}


/* ================================================================ */
/* لایت‌باکس مودال - نسخه جدید                                     */
/* ================================================================ */

.lightbox-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 30px;
    box-sizing: border-box;

    overflow: hidden;
}

.lightbox-modal.active {
    display: flex;
}


/* پس‌زمینه */

.lightbox-overlay {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    background: rgba(8, 15, 30, 0.96);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}


/* ================================================================ */
/* کانتینر اصلی مودال                                               */
/* ================================================================ */

.lightbox-container {
    --lightbox-image-height: 620px;

    position: relative;

    width: min(900px, 100%);
    max-width: 900px;

    z-index: 10000;

    display: flex;
    flex-direction: column;
    align-items: center;

    box-sizing: border-box;

    animation: lightboxIn 0.3s ease;
}


/* انیمیشن */

@keyframes lightboxIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* ================================================================ */
/* دکمه بستن                                                        */
/* ================================================================ */

.lightbox-close {
    position: absolute;

    top: -54px;
    left: 0;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.95);

    font-size: 1.7rem;
    line-height: 1;

    cursor: pointer;

    color: var(--text-dark);

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;

    z-index: 30;
}

.lightbox-close:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}


/* ================================================================ */
/* محتوای لایت‌باکس                                                 */
/* ================================================================ */

/*
    خیلی مهم:
    caption داخل همین container است.
    بنابراین باید flex ستونی باشد تا caption
    حتماً زیر عکس قرار بگیرد.
*/

.lightbox-content {
    position: relative;

    width: 100%;
    max-width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;

    box-sizing: border-box;

    overflow: visible;
}


/* ================================================================ */
/* قاب ثابت تصویر                                                    */
/* ================================================================ */

.lightbox-content img,
#lightboxImage {
    display: block;

    width: 100%;
    height: var(--lightbox-image-height);

    min-height: var(--lightbox-image-height);
    max-height: var(--lightbox-image-height);

    flex: 0 0 var(--lightbox-image-height);

    object-fit: contain;

    box-sizing: border-box;

    padding: 12px;

    border-radius: 20px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.025)
        );

    border: 1px solid rgba(255, 255, 255, 0.12);

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.55);
}


/* ================================================================ */
/* کپشن - همیشه دقیقاً زیر عکس                                      */
/* ================================================================ */

.lightbox-caption {
    position: static !important;

    display: block;

    width: 100%;
    max-width: 100%;

    box-sizing: border-box;

    margin-top: 12px;

    padding: 10px 16px;

    border-radius: 12px;

    background: rgba(15, 23, 42, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.1);

    color: rgba(255, 255, 255, 0.92);

    text-align: center;

    font-size: 0.86rem;
    line-height: 1.6;

    word-break: break-word;
    overflow-wrap: anywhere;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


/* ================================================================ */
/* فلش‌های قبلی و بعدی                                              */
/* ================================================================ */

/*
    فلش‌ها داخل lightbox-container هستند.
    دیگر از مودال بیرون نمی‌روند.
*/

.lightbox-prev,
.lightbox-next {
    position: absolute;

    top: calc(var(--lightbox-image-height) / 2);

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.15);

    border-radius: 50%;

    background: rgba(15, 23, 42, 0.82);

    color: white;

    font-size: 0.95rem;

    cursor: pointer;

    z-index: 20;

    transform: translateY(-50%);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}


/* فلش سمت راست */

.lightbox-prev {
    right: 18px;
}


/* فلش سمت چپ */

.lightbox-next {
    left: 18px;
}


/* هاور */

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--accent);
    border-color: var(--accent);

    transform: translateY(-50%) scale(1.08);
}


/* ================================================================ */
/* پروژه‌های مرتبط                                                  */
/* ================================================================ */

.related-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.related-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.related-image {
    height: 200px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-info {
    padding: 1.2rem;
}

.related-info h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.related-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
}

.related-link:hover {
    gap: 14px;
    color: var(--primary);
}


/* ================================================================ */
/* ریسپانسیو - تبلت                                                 */
/* ================================================================ */

@media (max-width: 992px) {

    .project-description {
        margin-bottom: 2rem;
    }

    .project-sidebar {
        position: static;
    }

    .lightbox-container {
        --lightbox-image-height: 560px;

        width: min(820px, 100%);
    }

    .lightbox-prev {
        right: 14px;
    }

    .lightbox-next {
        left: 14px;
    }
}


/* ================================================================ */
/* ریسپانسیو - موبایل                                               */
/* ================================================================ */

@media (max-width: 768px) {

    .project-hero {
        margin-top: 65px;
        min-height: 40vh;
        background-attachment: scroll;
    }

    .project-info-section {
        padding: 40px 0;
    }

    .gallery-section {
        padding: 40px 0;
    }

    .gallery-thumbs {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .thumb-item {
        height: 160px;
    }


    /* -------------------- لایت‌باکس -------------------- */

    .lightbox-modal {
        padding: 20px 12px;
    }

    .lightbox-container {
        --lightbox-image-height: 68vh;

        width: 100%;
        max-width: 100%;
    }

    .lightbox-content {
        width: 100%;
    }

    .lightbox-content img,
    #lightboxImage {
        width: 100%;
        height: var(--lightbox-image-height);

        min-height: var(--lightbox-image-height);
        max-height: var(--lightbox-image-height);

        flex-basis: var(--lightbox-image-height);

        padding: 9px;

        border-radius: 17px;
    }


    /* کپشن */

    .lightbox-caption {
        width: 100%;

        margin-top: 10px;

        padding: 8px 12px;

        border-radius: 10px;

        font-size: 0.78rem;
        line-height: 1.55;
    }


    /* فلش‌ها */

    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 36px;

        top: calc(var(--lightbox-image-height) / 2);

        font-size: 0.8rem;
    }

    .lightbox-prev {
        right: 10px;
    }

    .lightbox-next {
        left: 10px;
    }


    /* دکمه بستن */

    .lightbox-close {
        top: -45px;

        left: 0;

        width: 35px;
        height: 35px;

        font-size: 1.5rem;
    }
}


/* ================================================================ */
/* ریسپانسیو - موبایل کوچک                                          */
/* ================================================================ */

@media (max-width: 576px) {

    .gallery-thumbs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.8rem;
    }

    .thumb-item {
        height: 140px;
    }


    /* -------------------- لایت‌باکس -------------------- */

    .lightbox-modal {
        padding: 16px 8px;
    }

    .lightbox-container {
        --lightbox-image-height: 62vh;

        width: 100%;
    }

    .lightbox-content img,
    #lightboxImage {
        height: var(--lightbox-image-height);

        min-height: var(--lightbox-image-height);
        max-height: var(--lightbox-image-height);

        flex-basis: var(--lightbox-image-height);

        padding: 7px;

        border-radius: 15px;
    }


    /* کپشن */

    .lightbox-caption {
        margin-top: 8px;

        padding: 7px 10px;

        border-radius: 9px;

        font-size: 0.74rem;
    }


    /* فلش‌ها */

    .lightbox-prev,
    .lightbox-next {
        width: 32px;
        height: 32px;

        top: calc(var(--lightbox-image-height) / 2);

        font-size: 0.72rem;
    }

    .lightbox-prev {
        right: 7px;
    }

    .lightbox-next {
        left: 7px;
    }


    /* دکمه بستن */

    .lightbox-close {
        top: -39px;

        left: 0;

        width: 30px;
        height: 30px;

        font-size: 1.2rem;
    }


    /* متادیتای پروژه */

    .project-meta {
        gap: 0.8rem;
        font-size: 0.85rem;
    }

    .info-box li {
        flex-direction: column;
        gap: 4px;
    }

    .info-box li span {
        min-width: auto;
    }
}


/* ================================================================ */
/* موبایل خیلی کوچک                                                 */
/* ================================================================ */

@media (max-width: 380px) {

    .lightbox-modal {
        padding-left: 6px;
        padding-right: 6px;
    }

    .lightbox-container {
        --lightbox-image-height: 58vh;
    }

    .lightbox-prev {
        right: 5px;
    }

    .lightbox-next {
        left: 5px;
    }

    .lightbox-content img,
    #lightboxImage {
        padding: 5px;
        border-radius: 13px;
    }

    .lightbox-caption {
        font-size: 0.7rem;
        padding: 6px 8px;
    }
}