/* ——— Projelerimiz — premium editorial gallery ——— */
.projects-gallery {
    position: relative;
    padding: calc(var(--header-h) + var(--marquee-h) + 48px) 0 clamp(72px, 12vw, 120px);
    min-height: 60vh;
    overflow-x: clip;
    background:
        radial-gradient(ellipse 90% 50% at 50% -10%, rgba(212, 175, 55, 0.09), transparent 55%),
        linear-gradient(180deg, #060606 0%, #0c0c0c 40%, #050505 100%);
}

.projects-gallery::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(212, 175, 55, 0.03) 1px, transparent 1px);
    background-size: 100% 48px;
    opacity: 0.35;
    pointer-events: none;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

.projects-gallery__hero {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 640px;
    margin: 0 auto clamp(48px, 8vw, 72px);
    scroll-margin-top: calc(var(--header-h) + var(--marquee-h) + 20px);
    padding-top: 8px;
}

.projects-gallery__hero::after {
    content: '';
    display: block;
    width: 72px;
    height: 2px;
    margin: 22px auto 0;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.projects-gallery__eyebrow {
    margin: 0 0 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
}

.projects-gallery__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(2.25rem, 6vw, 3.35rem);
    font-weight: 600;
    color: #f2e8d8;
    line-height: 1.08;
    letter-spacing: 0.02em;
}

.projects-gallery__empty {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 24px;
    color: rgba(245, 245, 245, 0.65);
    font-size: 1.05rem;
    border: 1px dashed rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
}

.projects-gallery__shell {
    position: relative;
    z-index: 1;
    width: min(1240px, 100%);
}

.projects-gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(22px, 3.5vw, 36px);
    align-items: stretch;
}

.projects-gallery__item {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--pg-i, 0) * 0.08s);
}

.projects-gallery__item.visible,
.projects-gallery__item.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Büyük kartlar: 1. ve 4. öğe tam genişlik (editoryal ritim) */
@media (min-width: 769px) {
    .projects-gallery__item:nth-child(3n + 1) {
        grid-column: 1 / -1;
    }

    .projects-gallery__item:nth-child(3n + 1) .projects-gallery__frame {
        aspect-ratio: 21 / 9;
        min-height: 280px;
    }
}

.projects-gallery__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(165deg, rgba(28, 26, 22, 0.95) 0%, rgba(12, 12, 12, 0.98) 100%);
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow:
        0 4px 0 rgba(212, 175, 55, 0.06),
        0 20px 48px rgba(0, 0, 0, 0.45);
    transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.projects-gallery__item:hover .projects-gallery__card,
.projects-gallery__item:focus-within .projects-gallery__card {
    border-color: rgba(212, 175, 55, 0.48);
    box-shadow:
        0 4px 0 rgba(212, 175, 55, 0.12),
        0 28px 56px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(212, 175, 55, 0.08);
    transform: translateY(-6px);
}

.projects-gallery__open {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.projects-gallery__frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    min-height: 200px;
    background: #0a0a0a;
}

.projects-gallery__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}

.projects-gallery__item:hover .projects-gallery__media {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.projects-gallery__media--video {
    pointer-events: none;
}

.projects-gallery__hover {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.05) 0%,
        rgba(0, 0, 0, 0.55) 100%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
}

.projects-gallery__item:hover .projects-gallery__hover,
.projects-gallery__open:focus-visible .projects-gallery__hover {
    opacity: 1;
}

.projects-gallery__hover-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.75);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    position: relative;
}

.projects-gallery__hover-icon::before,
.projects-gallery__hover-icon::after {
    content: '';
    position: absolute;
    background: var(--gold);
    border-radius: 1px;
}

.projects-gallery__hover-icon::before {
    width: 18px;
    height: 2px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.projects-gallery__hover-icon::after {
    width: 2px;
    height: 18px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.projects-gallery__hover-text {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    padding: 8px 14px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(212, 175, 55, 0.45);
    line-height: 1.2;
}

.projects-gallery__play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.9);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        opacity 0.3s ease,
        visibility 0.3s ease;
    pointer-events: none;
}

/* Hover’da tek kontrol: overlay’deki oynat + “Büyüt” (çift ikon olmasın) */
.projects-gallery__item--video:hover .projects-gallery__play-badge,
.projects-gallery__item--video:focus-within .projects-gallery__play-badge {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.92);
}

.projects-gallery__item--video:not(:hover):not(:focus-within) .projects-gallery__play-badge {
    opacity: 1;
    visibility: visible;
}

.projects-gallery__item--video:hover .projects-gallery__hover,
.projects-gallery__item--video:focus-within .projects-gallery__hover {
    background: rgba(0, 0, 0, 0.5);
}

.projects-gallery__item--video .projects-gallery__hover-icon {
    width: 56px;
    height: 56px;
    border-width: 2px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.projects-gallery__play-badge::after {
    content: '';
    position: absolute;
    left: 54%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent var(--gold);
}

.projects-gallery__item--video .projects-gallery__hover-icon::before,
.projects-gallery__item--video .projects-gallery__hover-icon::after {
    display: none;
}

.projects-gallery__item--video .projects-gallery__hover-icon {
    border-radius: 50%;
}

.projects-gallery__item--video .projects-gallery__hover-icon::after {
    display: block;
    width: 0;
    height: 0;
    left: 54%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent var(--gold);
    border-radius: 0;
}

.projects-gallery__item--video .projects-gallery__hover {
    gap: 14px;
}

.projects-gallery__item--video .projects-gallery__hover-text {
    margin-top: 0;
}

.projects-gallery__meta {
    padding: clamp(16px, 2.5vw, 22px) clamp(18px, 3vw, 24px) clamp(18px, 2.5vw, 24px);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    background: rgba(0, 0, 0, 0.25);
}

.projects-gallery__caption {
    margin: 0 0 8px;
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    font-weight: 500;
    line-height: 1.45;
    color: rgba(242, 232, 216, 0.95);
}

.projects-gallery__date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.9);
}

.projects-gallery__date::before {
    content: '';
    width: 20px;
    height: 1px;
    background: rgba(212, 175, 55, 0.55);
}

/* Lightbox */
.projects-lightbox {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 28px);
    box-sizing: border-box;
}

.projects-lightbox[hidden] {
    display: none !important;
}

.projects-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.projects-lightbox__panel {
    position: relative;
    z-index: 1;
    width: min(1000px, 100%);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    animation: projects-lightbox-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes projects-lightbox-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.projects-lightbox__close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.85);
    color: var(--gold);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.projects-lightbox__close:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--gold);
    transform: scale(1.06);
}

.projects-lightbox__stage {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: #000;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    max-height: calc(92vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.projects-lightbox__stage img,
.projects-lightbox__stage video {
    max-width: 100%;
    max-height: calc(92vh - 72px);
    width: auto;
    height: auto;
    display: block;
}

.projects-lightbox__caption {
    margin: 16px 0 0;
    padding: 0 12px;
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(245, 245, 245, 0.92);
}

@media (max-width: 768px) {
    .projects-gallery__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .projects-gallery__item:nth-child(3n + 1) .projects-gallery__frame {
        aspect-ratio: 16 / 10;
        min-height: 200px;
    }

    .projects-gallery__card {
        border-radius: 12px;
    }

    .projects-gallery__hover {
        opacity: 1;
        background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
    }

    .projects-gallery__hover-icon,
    .projects-gallery__hover-text {
        display: none;
    }
}

@media (min-width: 1100px) {
    .projects-gallery__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .projects-gallery__item:nth-child(3n + 1) {
        grid-column: span 2;
    }

    .projects-gallery__item:nth-child(3n + 1) .projects-gallery__frame {
        aspect-ratio: 2.2 / 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .projects-gallery__item,
    .projects-gallery__media,
    .projects-gallery__card,
    .projects-gallery__hover {
        transition: none !important;
    }

    .projects-gallery__item {
        opacity: 1;
        transform: none;
    }
}
