/* ── INDEPENDENT GALLERY STYLES ── */
:root {
    --g-bg: #0d0d0d;
    --g-surface: #1a1a1a;
    --g-surface2: #242424;
    --g-accent: #c9a84c;
    --g-accent2: #e8c97a;
    --g-text: #f0ece4;
    --g-text-muted: #888;
    --g-border: #2e2e2e;
}

.gallery-wrapper {
    background: var(--g-bg);
    color: var(--g-text);
    font-family: 'Georgia', serif;
    min-height: 100vh;
    padding-top: 1px; /* Prevents margin collapse */
}

/* ── HERO ── */
.gallery-hero {
    text-align: center;
    padding: 72px 24px 48px;
}

.gallery-hero h1 {
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--g-text);
    margin-bottom: 12px;
}

.gallery-hero p {
    color: var(--g-text-muted);
    font-size: 1rem;
    letter-spacing: 0.06em;
}

.gallery-divider {
    width: 60px;
    height: 1px;
    background: var(--g-accent);
    margin: 20px auto;
}

/* ── FILTER BAR ── */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 24px 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--g-border);
    color: var(--g-text-muted);
    padding: 8px 20px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.3s;
    font-family: 'Georgia', serif;
}

.filter-btn:hover, .filter-btn.active {
    border-color: var(--g-accent);
    color: var(--g-accent);
    background: rgba(201, 168, 76, 0.06);
}

/* ── GALLERY GRID ── */
.gallery-section {
    padding: 0 40px 80px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.art-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 2px;
    background: var(--g-surface2); /* Fallback block color */
    border: 1px solid var(--g-border);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    aspect-ratio: 3/4;
    min-height: 250px; /* Fallback height if images fail */
    display: flex;
    align-items: center;
    justify-content: center;
}

.art-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.art-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.art-card:hover img {
    transform: scale(1.05);
}

.art-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
    opacity: 0; /* Hover to see if image is missing */
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.art-card:hover .art-card-overlay {
    opacity: 1;
}

.art-card-overlay h3 {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #fff;
    margin-bottom: 4px;
}

.art-card-overlay p {
    font-size: 0.75rem;
    color: var(--g-accent2);
    letter-spacing: 0.08em;
    margin-bottom: 0;
}

.view-btn {
    margin-top: 12px;
    display: inline-block;
    background: var(--g-accent);
    color: #000;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 7px 16px;
    border-radius: 1px;
    font-family: 'Georgia', serif;
    width: fit-content;
}

/* ── LIGHTBOX / FULL VIEW ── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.96);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.lightbox.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox-inner {
    display: flex;
    gap: 48px;
    align-items: center;
    max-width: 1200px;
    width: 95%;
    padding: 24px;
    animation: slideUp 0.35s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.lightbox-img-wrap {
    flex: 1;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 30px 100px rgba(0,0,0,0.8);
}

.lightbox-info {
    width: 280px;
    flex-shrink: 0;
    text-align: left;
}

.lightbox-info .tag {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--g-accent);
    margin-bottom: 12px;
}

.lightbox-info h2 {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    line-height: 1.3;
    color: var(--g-text);
}

.lightbox-info .artist {
    font-size: 0.9rem;
    color: var(--g-text-muted);
    margin-bottom: 24px;
    font-style: italic;
}

.lightbox-divider {
    width: 40px;
    height: 1px;
    background: var(--g-accent);
    margin-bottom: 24px;
}

.lightbox-info .description {
    font-size: 0.88rem;
    color: var(--g-text-muted);
    line-height: 1.8;
    margin-bottom: 28px;
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.meta-item label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--g-text-muted);
    margin-bottom: 4px;
}

.meta-item span {
    font-size: 0.85rem;
    color: var(--g-text);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    background: none;
    border: 1px solid var(--g-border);
    color: var(--g-text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.lightbox-close:hover {
    border-color: var(--g-accent);
    color: var(--g-accent);
}

.nav-arrows {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.nav-arrow {
    background: transparent;
    border: 1px solid var(--g-border);
    color: var(--g-text-muted);
    width: 40px;
    height: 40px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.nav-arrow:hover {
    border-color: var(--g-accent);
    color: var(--g-accent);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gallery-hero h1 { font-size: 1.8rem; }
    .lightbox-inner { flex-direction: column; gap: 24px; overflow-y: auto; max-height: 100vh;}
    .lightbox-img-wrap { max-height: 50vh; }
    .lightbox-info { width: 100%; padding-bottom: 40px;}
    .gallery-section { padding: 0 16px 60px; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}