﻿/* Mud & Meaning — Gallery Page (scoped) */
.gallery-page {
    /* Palette */
    --mud-900: #1E130D;
    --mud-800: #24170F;
    --mud-700: #2C1E1A;
    --clay-600: #6B3F2E;
    --terracotta-500: #B6503A;
    --leaf-700: #2E5D37;
    --leaf-500: #5FA35B;
    --leaf-400: #74B86F;
    --sand-100: #F6F1E6;
    --amber-400: #C9A46C;
    /* Text & Radii */
    --text: #F6F1E6;
    --muted: #D8D2C6;
    --text-soft: #e8e1d7;
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    /* Motion */
    --ease: 700ms cubic-bezier(.2,.8,.2,1);
    --ease-fast: 350ms cubic-bezier(.2,.8,.2,1);
    /* Layout */
    --grid-gap: 18px;
    /* Shadows */
    --shadow-deep: 0 24px 40px -12px rgba(0,0,0,0.5), 0 8px 16px -6px rgba(0,0,0,0.45);
    --shadow-med: 0 16px 24px -10px rgba(0,0,0,0.45), 0 6px 12px -6px rgba(0,0,0,0.35);
    --shadow-soft: 0 8px 14px -8px rgba(0,0,0,0.3);
    /* Reusable tokens (DRY) */
    --glass-06: rgba(246,241,230,0.06);
    --glass-08: rgba(246,241,230,0.08);
    --glass-12: rgba(246,241,230,0.12);
    --glass-16: rgba(246,241,230,0.16);
    --white-06: rgba(255,255,255,0.06);
    --white-08: rgba(255,255,255,0.08);
    --white-12: rgba(255,255,255,0.12);
    --white-16: rgba(255,255,255,0.16);
    --panel-deep: #0e0a08;
    --leaf-border-strong: rgba(117,184,111,0.6);
    --grad-leaf-weak: linear-gradient(180deg, rgba(95,163,91,0.11), rgba(46,93,55,0.08));
    --grad-leaf-btn: linear-gradient(180deg, rgba(95,163,91,0.18), rgba(46,93,55,0.16));
    --grad-amber-alt: linear-gradient(180deg, rgba(201,164,108,0.22), rgba(107,63,46,0.18));
    background: radial-gradient(1200px 600px at 10% 0%, rgba(95,163,91,0.08), transparent 55%), radial-gradient(1200px 600px at 90% 100%, rgba(201,164,108,0.08), transparent 55%), linear-gradient(180deg, var(--mud-900), var(--mud-800));
    color: var(--text);
    min-height: 60vh;
}

    .gallery-page a {
        color: var(--leaf-400);
        text-decoration: none;
    }

        .gallery-page a:hover {
            color: var(--leaf-500);
        }

    /* Header */
    .gallery-page .page-header {
        position: relative;
        padding: 54px 24px 28px;
        overflow: hidden;
    }

        .gallery-page .page-header .bg {
            position: absolute;
            inset: 0;
            background: linear-gradient(180deg, rgba(46,93,55,0.25), rgba(46,93,55,0.05)), url("/assets/textures/clay-noise.png");
            mix-blend-mode: soft-light;
            pointer-events: none;
        }

    .gallery-page .title-row {
        max-width: 1200px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        gap: 18px;
    }

    .gallery-page .title-icon {
        width: 64px;
        height: 64px;
        border-radius: 16px;
        background: radial-gradient(120% 120% at 25% 25%, rgba(95,163,91,0.5), transparent 60%), linear-gradient(135deg, rgba(201,164,108,0.5), rgba(107,63,46,0.5));
        box-shadow: var(--shadow-med);
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .gallery-page .title-icon svg {
            filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
        }

    .gallery-page .page-title h1 {
        margin: 0;
        font-size: clamp(28px, 4vw, 44px);
        letter-spacing: -0.5px;
    }

    .gallery-page .page-title p {
        margin: 6px 0 0;
        color: var(--muted);
    }

    /* Floating leaves */
    .gallery-page .leaf {
        position: absolute;
        width: 28px;
        height: 28px;
        opacity: 0.18;
        animation: floatUp 12s ease-in-out infinite;
        filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4));
    }

    .gallery-page .page-header .leaf:nth-of-type(1) {
        top: 10%;
        left: 6%;
        animation-delay: 0s;
    }

    .gallery-page .page-header .leaf:nth-of-type(2) {
        top: 30%;
        left: 92%;
        animation-delay: 3s;
    }

    .gallery-page .page-header .leaf:nth-of-type(3) {
        top: 78%;
        left: 4%;
        animation-delay: 5s;
    }

    .gallery-page .page-header .leaf:nth-of-type(4) {
        top: 65%;
        left: 85%;
        animation-delay: 7s;
    }

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-16px) rotate(8deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

/* Filters bar */
.gallery-page .filters {
    max-width: 1200px;
    margin: 12px auto 0;
    background: var(--grad-leaf-weak);
    border: 1px solid var(--white-06);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 18px 18px;
    backdrop-filter: blur(6px);
}

    .gallery-page .filters .row {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
    }

.gallery-page .chip-group,
.gallery-page .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
}

.gallery-page .chip {
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    background: var(--glass-06);
    border: 1px solid var(--white-08);
    color: var(--text);
    transition: transform var(--ease-fast), background var(--ease-fast), box-shadow var(--ease-fast);
}

    .gallery-page .chip:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-soft);
    }

    .gallery-page .chip.active {
        background: linear-gradient(180deg, rgba(95,163,91,0.28), rgba(46,93,55,0.22));
        border-color: var(--leaf-border-strong);
    }

.gallery-page .search {
    flex: 1;
    min-width: 220px;
    position: relative;
}

    .gallery-page .search input {
        width: 100%;
        padding: 10px 36px 10px 12px;
        background: var(--glass-08);
        border: 1px solid var(--white-12);
        border-radius: var(--radius-lg);
        color: var(--text);
        outline: none;
        transition: box-shadow var(--ease-fast), border-color var(--ease-fast);
    }

        .gallery-page .search input::placeholder {
            color: #cfc8bc;
        }

        .gallery-page .search input:focus {
            box-shadow: var(--shadow-soft);
            border-color: rgba(117,184,111,0.5);
        }

    .gallery-page .search .icon {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.7;
    }

.gallery-page .select,
.gallery-page .range {
    background: var(--glass-08);
    border: 1px solid var(--white-12);
    color: var(--text);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    outline: none;
    cursor: pointer;
}

    .gallery-page .range input {
        width: 160px;
    }

/* Masonry gallery */
.gallery-page .gallery {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 6px;
}

.gallery-page .grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
}

.gallery-page .card {
    grid-column: span 3;
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    background: #140d0a;
}
/* removed: .card.tall { grid-column: span 3; } as duplicate of default */

@media (min-width: 740px) {
    .gallery-page .card {
        grid-column: span 4;
    }

        .gallery-page .card.wide {
            grid-column: span 6;
        }

        .gallery-page .card.tall {
            grid-row: span 2;
        }
}

@media (min-width: 1040px) {
    .gallery-page .card {
        grid-column: span 3;
    }

        .gallery-page .card.wide {
            grid-column: span 6;
        }
}

.gallery-page .media {
    position: relative;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform var(--ease);
}

.gallery-page .card:hover .media {
    transform: perspective(800px) rotateX(2deg) rotateY(-2deg) translateZ(8px);
}

.gallery-page .media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.05) contrast(0.98);
    transform: translateZ(0);
}

.gallery-page .overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(140% 90% at 50% 10%, rgba(201,164,108,0.18), transparent 60%), linear-gradient(180deg, rgba(0,0,0,0.0) 50%, rgba(0,0,0,0.55)), linear-gradient(180deg, rgba(46,93,55,0.12), rgba(46,93,55,0.24));
    pointer-events: none;
}

.gallery-page .badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(180deg, rgba(246,241,230,0.92), rgba(246,241,230,0.75));
    color: #2a211a;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* Icon round buttons — unified */
.gallery-page .fav,
.gallery-page .lb-btn {
    border-radius: 999px;
    border: 1px solid var(--white-16);
    background: var(--glass-08);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--ease-fast), background var(--ease-fast);
}

.gallery-page .fav {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
}

    .gallery-page .fav:hover {
        transform: translateY(-1px);
    }

    .gallery-page .fav.active {
        background: rgba(181,80,58,0.35);
        border-color: rgba(181,80,58,0.6);
    }

.gallery-page .info {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateZ(12px);
}

    .gallery-page .info .title {
        font-size: 16px;
        font-weight: 700;
        letter-spacing: -0.2px;
    }

    .gallery-page .info .meta {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        color: var(--text-soft);
        opacity: 0.9;
        font-size: 13px;
    }

    .gallery-page .info .actions {
        display: flex;
        gap: 8px;
        margin-top: 6px;
    }

.gallery-page .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--white-16);
    background: var(--grad-leaf-btn);
    color: var(--text);
    cursor: pointer;
    transition: transform var(--ease-fast), box-shadow var(--ease-fast), background var(--ease-fast);
}

    .gallery-page .btn:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-soft);
    }

    .gallery-page .btn.alt {
        background: var(--grad-amber-alt);
        border-color: rgba(201,164,108,0.5);
    }

/* Lightbox */
.gallery-page .lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    z-index: 999;
}

    .gallery-page .lightbox.active {
        display: flex;
    }

.gallery-page .lb-wrap {
    width: min(92vw, 1080px);
    height: min(88vh, 780px);
    background: linear-gradient(180deg, rgba(30,19,13,0.92), rgba(44,30,26,0.92));
    border: 1px solid var(--white-08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-deep);
    display: grid;
    grid-template-columns: 62% 38%;
    overflow: hidden;
}

@media (max-width: 900px) {
    .gallery-page .lb-wrap {
        grid-template-columns: 1fr;
        height: min(92vh, 820px);
    }
}

.gallery-page .lb-media {
    position: relative;
    background: var(--panel-deep);
}

    .gallery-page .lb-media img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.gallery-page .lb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.35));
    pointer-events: none;
}

.gallery-page .lb-controls {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.gallery-page .lb-btn {
    width: 42px;
    height: 42px;
}

    .gallery-page .lb-btn:hover {
        transform: scale(1.03);
        background: var(--glass-16);
    }

.gallery-page .lb-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 14px 16px;
    overflow: auto;
}

    .gallery-page .lb-info h3 {
        margin: 4px 0 0;
    }

.gallery-page .lb-meta {
    color: var(--muted);
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-page .lb-desc {
    font-size: 14px;
    color: var(--text-soft);
}

.gallery-page .lb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.gallery-page .lb-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

/* Reveal on scroll */
.gallery-page .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease, transform 600ms ease;
}

    .gallery-page .reveal.in {
        opacity: 1;
        transform: translateY(0);
    }

/* Keyboard focus */
.gallery-page .focus-ring:focus {
    outline: 2px solid var(--leaf-400);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-page .leaf {
        animation: none;
    }

    .gallery-page .card:hover .media {
        transform: none;
    }

    .gallery-page .reveal {
        transition: none;
    }
}
