/* Gallery Hero */
.gallery-hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pearl) 0%, var(--cream) 100%);
    padding-top: 100px;
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="1" fill="%23d4af37" opacity="0.1"/></svg>');
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.gallery-hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease;
}

.gallery-hero h1 {
    font-family: 'Cormorant', serif;
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 300;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.gallery-hero h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.gallery-hero p {
    font-size: 1.2rem;
    color: var(--gray);
    letter-spacing: 0.1em;
    margin-top: 2rem;
}

/* Gallery Section */
.gallery-section {
    padding: 6rem 3rem;
    max-width: 1800px;
    margin: 0 auto;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 1rem 2.5rem;
    background: transparent;
    border: 2px solid var(--gray);
    color: var(--dark);
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gold);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
    left: 0;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--gold);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    grid-auto-flow: dense;
    perspective: 1000px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    aspect-ratio: 1;
    background: var(--pearl);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    animation: fadeInScale 0.6s ease backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }
.gallery-item:nth-child(9) { animation-delay: 0.9s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:nth-child(3n+1) {
    grid-row: span 1;
}

.gallery-item:nth-child(5n+2) {
    grid-column: span 1;
    aspect-ratio: 4/5;
}

.gallery-item:hover {
    transform: translateY(-20px) scale(1.03);
    box-shadow: 0 25px 70px rgba(212, 175, 55, 0.5);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1) saturate(1);
}

.gallery-item:hover img {
    transform: scale(1.2) rotate(3deg);
    filter: brightness(1.1) saturate(1.2);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    padding: 2.5rem 2rem;
    transform: translateY(calc(100% - 80px));
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 70%, transparent 100%);
}

.gallery-item-title {
    font-family: 'Cormorant', serif;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 0.5rem;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.gallery-item:hover .gallery-item-title {
    transform: translateY(-10px);
    letter-spacing: 0.05em;
}

.gallery-item-category {
    font-size: 0.9rem;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.9;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding-left: 20px;
}

.gallery-item-category::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.gallery-item:hover .gallery-item-category::before {
    width: 16px;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    animation: zoomIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
}

.lightbox-caption {
    text-align: center;
    color: white;
    margin-top: 1.5rem;
    font-size: 1.3rem;
    font-family: 'Cormorant', serif;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.lightbox-close {
    top: 2rem;
    right: 2rem;
    border-radius: 50%;
}

.lightbox-close:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
    transform: rotate(90deg);
}

.lightbox-prev {
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
}

.lightbox-prev:hover {
    background: var(--gold);
    border-color: var(--gold);
    transform: translateY(-50%) translateX(-5px);
}

.lightbox-next {
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
}

.lightbox-next:hover {
    background: var(--gold);
    border-color: var(--gold);
    transform: translateY(-50%) translateX(5px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--gold);
}

@media (max-width: 968px) {
    .gallery-section {
        padding: 4rem 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .lightbox-close {
        width: 50px;
        height: 50px;
        font-size: 2rem;
        top: 1rem;
        right: 1rem;
    }
}


/* Custom Cursor for Gallery */
.custom-cursor {
    width: 40px;
    height: 40px;
    border: 1px solid var(--gray);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, border-color 0.2s ease, width 0.2s ease, height 0.2s ease;
    opacity: 0.5;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    opacity: 0.8;
}

[data-theme="dark"] .custom-cursor {
    border-color: var(--gold-light);
    opacity: 0.7;
}

[data-theme="dark"] .cursor-dot {
    background: var(--gold-light);
}

@media (max-width: 968px) {
    .custom-cursor,
    .cursor-dot {
        display: none;
    }
}

@media (hover: none) and (pointer: coarse) {
    .custom-cursor,
    .cursor-dot {
        display: none;
    }
}

/* Custom Context Menu */
.custom-context-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0;
    min-width: 220px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.2s ease;
}

.custom-context-menu.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--dark);
}

.context-menu-item:hover {
    background: var(--pearl);
}

.context-menu-item svg {
    width: 20px;
    height: 20px;
    fill: var(--gray);
    flex-shrink: 0;
}

.context-menu-item:hover svg {
    fill: var(--gold);
}

.context-menu-item span {
    font-size: 0.9rem;
    color: inherit;
}

.context-menu-divider {
    height: 1px;
    background: var(--pearl);
    margin: 0.5rem 0;
}

[data-theme="dark"] .custom-context-menu {
    background: #2a2a2a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .context-menu-item {
    color: #f5f5f5;
}

[data-theme="dark"] .context-menu-item:hover {
    background: #1a1a1a;
}

[data-theme="dark"] .context-menu-item svg {
    fill: #b0b0b0;
}

[data-theme="dark"] .context-menu-item:hover svg {
    fill: var(--gold);
}

[data-theme="dark"] .context-menu-divider {
    background: rgba(255, 255, 255, 0.1);
}


/* Notification Animation */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}


/* Dark Theme Gallery Enhancements */
[data-theme="dark"] .gallery-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

[data-theme="dark"] .gallery-hero h1 {
    color: var(--pearl);
}

[data-theme="dark"] .gallery-hero p {
    color: #b0b0b0;
}

[data-theme="dark"] .gallery-item {
    background: #2a2a2a;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .gallery-item:hover {
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.6);
}

[data-theme="dark"] .filter-btn {
    border-color: #555;
    color: var(--pearl);
    background: rgba(42, 42, 42, 0.5);
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
    border-color: var(--gold);
    color: white;
    background: var(--gold);
}

/* Responsive Gallery Improvements */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 4rem 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .gallery-item:nth-child(5n+2) {
        aspect-ratio: 1;
    }
    
    .filter-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.75rem;
    }
}


/* Dark Theme Body and Background */
[data-theme="dark"] body {
    background: #0a0a0a;
    color: var(--cream);
}

[data-theme="dark"] .gallery-section {
    background: #0a0a0a;
}

[data-theme="dark"] .gallery-item-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.85) 50%, transparent 100%);
}

[data-theme="dark"] .gallery-item:hover .gallery-item-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.9) 70%, transparent 100%);
}

/* 2026 editorial gallery refinement */
.gallery-hero {
    min-height: clamp(430px, 62vh, 660px);
    display: grid;
    place-items: center;
    padding: 8rem 2rem 5rem;
    background: linear-gradient(180deg, rgba(20,16,13,.36), rgba(20,16,13,.62)), url('arkaplan.webp') center 54% / cover no-repeat;
    color: #fff;
}
.gallery-hero::before {
    animation: none;
    background: radial-gradient(circle at 50% 42%, transparent, rgba(12,9,7,.22) 82%), linear-gradient(90deg, rgba(255,255,255,.1), transparent 22%, transparent 78%, rgba(255,255,255,.06));
}
.gallery-hero-content {
    max-width: 820px;
    padding: 2.6rem clamp(1.2rem, 4vw, 3rem);
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 24px;
    background: rgba(24,19,15,.18);
    box-shadow: 0 24px 70px rgba(10,8,6,.18);
    backdrop-filter: blur(5px);
}
.gallery-hero h1 { color: #fffaf2; font-size: clamp(3.3rem, 8vw, 6.5rem); text-shadow: 0 8px 30px rgba(0,0,0,.2); }
.gallery-hero h1::after { width: 72px; background: linear-gradient(90deg, transparent, #d8bd84, transparent); }
.gallery-hero p { max-width: 610px; margin-inline: auto; color: rgba(255,250,242,.88); line-height: 1.8; }

.gallery-section {
    padding: clamp(5rem, 8vw, 8rem) clamp(1.25rem, 4vw, 4rem);
    background: radial-gradient(circle at 90% 8%, rgba(205,171,102,.11), transparent 25%), linear-gradient(180deg, #fbf8f2, #f4eee5);
}
.gallery-filters { gap: .65rem; margin-bottom: clamp(2.8rem, 6vw, 5rem); }
.gallery-filter, .filter-btn {
    padding: .8rem 1.35rem;
    border: 1px solid rgba(34,28,23,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.66);
    box-shadow: 0 7px 22px rgba(34,28,23,.04);
}
.gallery-filter:hover, .gallery-filter.active, .filter-btn:hover, .filter-btn.active {
    transform: translateY(-2px);
    border-color: var(--gold);
    background: var(--dark);
    color: #fff;
    box-shadow: 0 12px 26px rgba(34,28,23,.12);
}
.gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr));
    gap: clamp(1rem, 2vw, 1.6rem);
    max-width: 1500px;
    margin-inline: auto;
}
.gallery-item, .gallery-item:nth-child(3n+1), .gallery-item:nth-child(5n+2) {
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 5;
    border: 1px solid rgba(180,145,86,.18);
    border-radius: 21px;
    box-shadow: 0 16px 45px rgba(34,28,23,.1);
    animation-duration: .65s;
    transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease;
}
.gallery-item::before {
    inset: auto 0 0;
    height: 55%;
    z-index: 1;
    opacity: 1;
    transform: none;
    background: linear-gradient(180deg, transparent, rgba(20,16,13,.78));
}
.gallery-item:hover { transform: translateY(-7px); box-shadow: 0 28px 70px rgba(34,28,23,.18); }
.gallery-item img { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.gallery-item:hover img { transform: scale(1.055); }
.gallery-item-overlay, .gallery-item:hover .gallery-item-overlay {
    z-index: 2;
    transform: translateY(0);
    padding: 1.6rem;
    background: transparent;
}
.gallery-item-title, .gallery-item:hover .gallery-item-title {
    transform: none;
    color: #fffaf2;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
}
.gallery-item-category { color: rgba(255,250,242,.76); }

.gallery-empty {
    grid-column: 1 / -1;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 5rem) clamp(1.5rem, 5vw, 4rem);
    border: 1px solid rgba(180,145,86,.22);
    border-radius: 24px;
    background: rgba(255,255,255,.7);
    box-shadow: 0 20px 55px rgba(34,28,23,.07);
    text-align: center;
}

[data-theme="dark"] .gallery-hero {
    background: linear-gradient(180deg, rgba(20,16,13,.42), rgba(20,16,13,.7)), url('arkaplan.webp') center 54% / cover no-repeat;
}

[data-theme="dark"] .gallery-empty {
    border-color: rgba(205,171,102,.25);
    background: rgba(28,24,21,.78);
}

@media (max-width: 640px) {
    .gallery-hero { min-height: 470px; padding-inline: 1rem; }
    .gallery-hero-content { width: 100%; border-radius: 18px; }
    .gallery-section { padding-inline: 1rem; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .gallery-item-overlay, .gallery-item:hover .gallery-item-overlay { padding: 1rem; }
    .gallery-item-title, .gallery-item:hover .gallery-item-title { font-size: 1.15rem; }
    .gallery-item-category { font-size: .62rem; }
}
