/* ===== اسکرول سمت راست - هماهنگ با سایت اصلی ===== */
html {
    direction: ltr;
    scrollbar-width: thin;
    scrollbar-color: #8b5cf6 #0a0612;
    overflow-x: hidden;
}
html::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track { background: #0a0612; }
html::-webkit-scrollbar-thumb { background: #8b5cf6; border-radius: 8px; }
body {
    direction: rtl;
    overflow-x: hidden;
}

*, button, a, input, textarea, select, .shot, .shots-nav, .side-cta {
    -webkit-tap-highlight-color: transparent;
}

button:focus, a:focus, input:focus, textarea:focus, select:focus {
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.shot:focus-visible {
    outline: 2px solid rgba(168, 85, 247, .75);
    outline-offset: 3px;
}

/* ==================== صفحه جزئیات پروژه ==================== */
.project-page {
    padding: 130px 0 80px;
    min-height: 70vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
.project-page .container { max-width: 1200px; }

.proj-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-2);
    font-size: 13px;
    margin-bottom: 28px;
    transition: var(--transition);
}
.proj-back:hover { border-color: var(--purple); color: var(--text); }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--text-3);
    font-size: 12.5px;
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-2); transition: var(--transition); }
.breadcrumb a:hover { color: var(--purple-light); }
.breadcrumb span:last-child { color: var(--text-3); }

.proj-head { margin-bottom: 35px; }

.proj-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.proj-badge {
    padding: 6px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 12.5px;
    color: var(--text-2);
}
.proj-badge.accent {
    background: var(--grad-btn);
    border-color: transparent;
    color: #fff;
}

.proj-title {
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 900;
    margin-bottom: 12px;
    line-height: 1.4;
}

.proj-lead {
    font-size: 16px;
    color: var(--text-2);
    max-width: 780px;
    line-height: 2;
}

/* کاور */
.proj-cover {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 45px;
    box-shadow: 0 25px 70px rgba(139, 92, 246, 0.22);
    overflow: hidden;
}
.proj-cover img { width: 100%; height: auto; display: block; }

/* چیدمان دو ستونه */
.proj-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 35px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}
.proj-layout > * { min-width: 0; }

.proj-section { margin-bottom: 45px; min-width: 0; max-width: 100%; }

.proj-h {
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.proj-h::before {
    content: '';
    width: 5px;
    height: 22px;
    background: var(--grad);
    border-radius: 3px;
}

.proj-text {
    font-size: 15px;
    color: var(--text-2);
    line-height: 2.1;
    white-space: pre-line;
}

/* ==================== گالری به سبک Google Play ==================== */
.shots-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.shots-scroller {
    display: flex;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 16px;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-width: thin;
    scrollbar-color: #8b5cf6 transparent;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.shots-scroller.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
}
.shots-scroller.dragging .shot { pointer-events: none; }
.shots-scroller img { -webkit-user-drag: none; user-select: none; }
.shots-scroller::-webkit-scrollbar { height: 7px; }
.shots-scroller::-webkit-scrollbar-track { background: rgba(139,92,246,.08); border-radius: 8px; }
.shots-scroller::-webkit-scrollbar-thumb { background: #8b5cf6; border-radius: 8px; }

.shot {
    position: relative;
    flex: 0 0 auto;
    scroll-snap-align: start;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}
.shot.desktop { width: min(480px, 72vw); aspect-ratio: 16 / 9; }
.shot.mobile  { width: min(180px, 34vw); aspect-ratio: 9 / 16; }

.shot img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .45s ease;
}
.shot:hover {
    border-color: var(--purple);
    box-shadow: 0 16px 38px rgba(139,92,246,.28);
    transform: translateY(-3px);
}
.shot:hover img { transform: scale(1.05); }
.shot:active { transform: scale(.985); }
.shot:focus-visible {
    outline: 2px solid var(--purple-light);
    outline-offset: 3px;
}



/* دکمه‌های پیمایش */
.shots-nav {
    position: absolute;
    top: calc(50% - 10px);
    transform: translateY(-50%);
    width: 46px; height: 46px;
    border-radius: 50%;
    background: rgba(26,18,40,.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(168,85,247,.35);
    color: #fff;
    font-size: 26px; line-height: 1;
    cursor: pointer;
    z-index: 5;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .25s ease, visibility .25s ease, background .25s ease, transform .25s ease;
    box-shadow: 0 8px 26px rgba(0,0,0,.5);
    padding: 0;
    direction: ltr;
}
.shots-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
.shots-nav:hover {
    background: var(--purple);
    border-color: transparent;
    transform: translateY(-50%) scale(1.08);
}
.shots-nav:active { transform: translateY(-50%) scale(.96); }
.shots-nav.prev { right: 4px; }
.shots-nav.next { left: 4px; }
.shots-nav.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* سایدبار اطلاعات */
.proj-side {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 22px;
    position: sticky;
    top: 100px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.side-block { margin-bottom: 22px; }
.side-block:last-child { margin-bottom: 0; }

.side-label {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 7px;
    display: block;
}
.side-value { font-size: 15px; font-weight: 700; }

.tech-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: var(--bg-2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 50px;
    font-size: 12.5px;
    color: var(--text);
    direction: ltr;
    transition: var(--transition);
}
.tech-item:hover { border-color: var(--purple); transform: translateY(-2px); }
.tech-item::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--purple-light);
    box-shadow: 0 0 8px var(--purple-light);
}

.side-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.side-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 48px;
    padding: 13px 16px;
    background: var(--grad-btn);
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    transition: var(--transition);
}
.side-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(139,92,246,.4); }

/* پروژه‌های دیگر */
.more-projects {
    border-top: 1px solid var(--border);
    padding-top: 45px;
    margin-top: 20px;
}
.more-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 20px;
    margin-top: 22px;
    width: 100%;
    max-width: 100%;
}
.more-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.more-card:hover { transform: translateY(-4px); border-color: var(--purple); }
.more-card img { width: 100%; height: 150px; object-fit: cover; }
.more-card div { padding: 15px; }
.more-card h4 { font-size: 15px; margin-bottom: 5px; }
.more-card span { font-size: 12.5px; color: var(--text-3); }

/* حالت خالی */
.proj-empty {
    text-align: center;
    padding: 90px 20px;
}
.proj-empty h2 { font-size: 24px; margin-bottom: 12px; }
.proj-empty p { color: var(--text-2); margin-bottom: 25px; }

/* ==================== لایت‌باکس ==================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(5, 3, 10, .95);
    backdrop-filter: blur(10px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}
.lightbox.open { display: flex; animation: lbFade .25s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

.lightbox img {
    max-width: 92vw;
    max-height: 82vh;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
    object-fit: contain;
    animation: lbZoom .32s cubic-bezier(.22,1,.36,1);
}
@keyframes lbZoom {
    from { opacity: 0; transform: scale(.85); }
    to   { opacity: 1; transform: scale(1); }
}
.lightbox img.lb-mobile {
    max-width: min(420px, 86vw);
    max-height: 84vh;
}
.lb-close, .lb-nav {
    position: absolute;
    background: rgba(30, 20, 48, .85);
    border: 1px solid var(--border);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}
.lb-close {
    top: 24px; left: 24px;
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 24px;
}
.lb-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 50px; height: 50px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
}
.lb-prev { right: 24px; }
.lb-next { left: 24px; }
.lb-close:hover, .lb-nav:hover { background: var(--purple); border-color: transparent; }
.lb-counter {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 20, 48, .85);
    border: 1px solid var(--border);
    padding: 7px 18px;
    border-radius: 50px;
    font-size: 13px;
    color: var(--text-2);
}

/* ==========================================================
   ریسپانسیو صفحه پروژه
   ========================================================== */

@media (max-width: 1200px) {
    .proj-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; }
    .shot.desktop { width: min(440px, 60vw); }
}

@media (max-width: 1024px) {
    .project-page { padding: 118px 0 66px; }
    .proj-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; }
    .shot.desktop { width: min(400px, 58vw); }
    .shot.mobile  { width: min(160px, 26vw); }
    .proj-cover { margin-bottom: 36px; }
}

@media (max-width: 900px) {
    .proj-layout { grid-template-columns: 1fr; gap: 8px; }
    .proj-side { position: static; }
    .side-cta { font-size: 15px; min-height: 52px; }
    .proj-section { margin-bottom: 36px; }
}

@media (max-width: 768px) {
    .project-page { padding: 96px 0 50px; }

    .proj-back { font-size: 12.5px; padding: 8px 15px; margin-bottom: 22px; }
    .proj-head { margin-bottom: 26px; }
    .proj-title { font-size: clamp(21px, 5.6vw, 30px); line-height: 1.55; }
    .proj-lead { font-size: 14.5px; line-height: 1.95; }
    .proj-badge { font-size: 11.5px; padding: 5px 13px; }
    .proj-badges { gap: 7px; margin-bottom: 12px; }

    .proj-cover { border-radius: var(--radius); margin-bottom: 30px; }
    .proj-h { font-size: 18.5px; }
    .proj-h::before { height: 19px; }
    .proj-text { font-size: 14.2px; line-height: 2; }

    /* گالری - دکمه‌ها روی موبایل هم فعال بمانند */
    .shots-nav { width: 38px; height: 38px; font-size: 21px; }
    .shots-nav.prev { right: 2px; }
    .shots-nav.next { left: 2px; }
    .shots-scroller { gap: 11px; padding-bottom: 12px; }
    .shot.desktop { width: 82vw; }
    .shot.mobile  { width: 42vw; }

    /* سایدبار */
    .proj-side { padding: 20px 16px; }
    .side-cta { padding: 14px 12px; font-size: 14.5px; }
    .tech-item { font-size: 12px; padding: 6px 12px; }

    /* پروژه‌های دیگر */
    .more-projects { padding-top: 34px; }
    .more-grid { grid-template-columns: 1fr; gap: 14px; }
    .more-card img { height: 165px; }

    /* لایت‌باکس */
    .lightbox { padding: 56px 12px; }
    .lb-nav { width: 40px; height: 40px; font-size: 23px; }
    .lb-prev { right: 8px; }
    .lb-next { left: 8px; }
    .lb-close { top: 14px; left: 14px; width: 40px; height: 40px; font-size: 22px; }
    .lb-counter { bottom: 16px; font-size: 12px; padding: 6px 15px; }
    .lightbox img { max-width: 94vw; max-height: 74vh; }
    .lightbox img.lb-mobile { max-width: 76vw; max-height: 76vh; }
}

@media (max-width: 480px) {
    .project-page { padding: 88px 0 42px; }
    .proj-title { font-size: 20px; }
    .proj-lead { font-size: 13.8px; }
    .shot.desktop { width: 88vw; }
    .shot.mobile  { width: 48vw; }
    .proj-side { padding: 18px 14px; }
    .side-block { margin-bottom: 18px; }
    .more-card img { height: 150px; }
}

@media (max-width: 400px) {
    .side-cta { font-size: 13.5px; padding: 13px 8px; letter-spacing: -0.2px; }
    .proj-h { font-size: 17px; }
    .tech-item { font-size: 11.5px; padding: 6px 10px; }
}

/* موبایل افقی */
@media (max-height: 520px) and (orientation: landscape) {
    .project-page { padding: 86px 0 40px; }
    .lightbox img { max-height: 78vh; }
    .shot.desktop { width: 46vw; }
    .shot.mobile  { width: 20vw; }
}

/* دستگاه لمسی */
@media (hover: none) {
    .shot:hover { transform: none; box-shadow: none; }
    .shot:hover img { transform: none; }
    .more-card:hover { transform: none; }
    .tech-item:hover { transform: none; }
    .side-cta:hover { transform: none; }
}
