/**
 * Yabba Gallery Theme - 2025 Edition
 * Modern, immersive gallery experience
 * Original design by Yabba · Reimagined with love
 */

/* ══════════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════════ */
:root {
    /* Colors */
    --bg: #0a0a0c;
    --bg-elevated: #141418;
    --bg-card: #1a1a1f;
    --text: #fafafa;
    --text-dim: rgba(250, 250, 250, 0.6);
    --text-muted: rgba(250, 250, 250, 0.35);
    --accent: #d4a853;
    --accent-hover: #e8bf6a;
    --border: rgba(255, 255, 255, 0.08);
    
    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    
    /* Spacing */
    --gap: clamp(1rem, 3vw, 2rem);
    --radius: 16px;
    
    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.3s;
}

/* ══════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ══════════════════════════════════════════
   HEADER & NAVIGATION
   ══════════════════════════════════════════ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem var(--gap);
    background: linear-gradient(to bottom, var(--bg) 0%, rgba(10,10,12,0.8) 80%, transparent 100%);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-logo {
    display: block;
    height: 160px;
    flex-shrink: 0;
}

.site-logo img {
    height: 100%;
    width: auto;
}

.nav-menu {
    flex: 1;
}

.nav-menu #bloglist {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    flex-wrap: wrap;
}

.nav-menu #bloglist li {
    background: none;
    padding: 0;
}

.nav-menu #bloglist a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all var(--duration) var(--ease);
}

.nav-menu #bloglist a:hover,
.nav-menu #bloglist a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.nav-menu .topr {
    display: contents;
    background: none;
}

/* ══════════════════════════════════════════
   GALLERY LAYOUT
   ══════════════════════════════════════════ */
.gallery-container {
    padding: 12rem var(--gap) 4rem;
    max-width: 1800px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: var(--gap);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* ══════════════════════════════════════════
   ARTWORK CARDS
   ══════════════════════════════════════════ */
.artwork-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--duration) var(--ease), 
                box-shadow var(--duration) var(--ease);
}

.artwork-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(212, 168, 83, 0.1);
}

/* Image Container */
.artwork-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-elevated);
    font-size: 0;
    color: transparent;
}

.artwork-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

/* Hide any text/labels in image container */
.artwork-image p,
.artwork-image span,
.artwork-image a:not(:has(img)) {
    display: none !important;
}

.artwork-card:hover .artwork-image img {
    transform: scale(1.05);
}


/* Info Section */
.artwork-info {
    padding: 1.5rem;
    background: linear-gradient(to top, var(--bg-card) 80%, transparent);
}

.artwork-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.artwork-title a {
    color: var(--text);
}

.artwork-title a:hover {
    color: var(--accent);
}

.artwork-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.artwork-meta a {
    color: inherit;
}

/* Enquire Button */
.btn-enquire {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bg);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 100px;
    transition: transform var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease);
}

.btn-enquire:hover {
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 168, 83, 0.3);
}

.edit-link {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.7rem;
    opacity: 0.4;
}

/* ══════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* Blurred Background Image */
.lightbox-bg {
    position: absolute;
    inset: -100px;
    background-size: cover;
    background-position: center;
    filter: blur(80px) saturate(1.5);
    opacity: 0.5;
    transform: scale(1.2);
}

/* Dark Overlay */
.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, 
        rgba(0,0,0,0.7) 0%, 
        rgba(0,0,0,0.92) 100%);
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 10;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

/* Navigation Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    opacity: 0.6;
    transition: all var(--duration) var(--ease);
}

.lightbox-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

.lightbox-nav svg {
    width: 28px;
    height: 28px;
}

.lightbox-prev { left: 2rem; }
.lightbox-next { right: 2rem; }

/* Content */
.lightbox-content {
    position: relative;
    z-index: 5;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius);
    box-shadow: 0 32px 128px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

/* Caption */
.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    border-radius: 0 0 var(--radius) var(--radius);
}

.lightbox-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    color: white;
}

/* ══════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 4rem;
    padding: 2rem 0;
}

.pagination a {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all var(--duration) var(--ease);
}

.pagination a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.site-footer {
    padding: 3rem var(--gap);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.site-footer a {
    color: var(--text-dim);
}

.site-footer a:hover {
    color: var(--accent);
}

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.artwork-card {
    animation: fadeUp 0.8s var(--ease) backwards;
}

.artwork-card:nth-child(1) { animation-delay: 0.05s; }
.artwork-card:nth-child(2) { animation-delay: 0.1s; }
.artwork-card:nth-child(3) { animation-delay: 0.15s; }
.artwork-card:nth-child(4) { animation-delay: 0.2s; }
.artwork-card:nth-child(5) { animation-delay: 0.25s; }
.artwork-card:nth-child(6) { animation-delay: 0.3s; }
.artwork-card:nth-child(7) { animation-delay: 0.35s; }
.artwork-card:nth-child(8) { animation-delay: 0.4s; }
.artwork-card:nth-child(9) { animation-delay: 0.45s; }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        background: var(--bg);
    }
    
    .site-logo {
        height: 80px;
    }
    
    .nav-menu {
        width: 100%;
    }
    
    .nav-menu #bloglist {
        justify-content: center;
    }
    
    .nav-menu #bloglist a {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .gallery-container {
        padding-top: 10rem;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
    
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
    
    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
    
    .lightbox-title {
        font-size: 1.25rem;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ══════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
