/* ===== Gallery Page ===== */
.gallery-page {
    --gallery-bronze: #9A6B3C;
    --gallery-bronze-light: #B8895A;
    --gallery-cream: #FAF8F5;
    --gallery-charcoal: #1E1C19;
    --gallery-body: #6A645C;
    --gallery-border: #E8E2D8;
}

/* ===== Hero ===== */
.gallery-hero {
    position: relative;
    margin-top: var(--header-height);
    min-height: 300px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.gallery-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.gallery-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 45%;
}

.gallery-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(18, 16, 14, 0.58);
}

.gallery-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    width: 100%;
    min-height: 300px;
}

.gallery-hero-content {
    max-width: 520px;
}

.gallery-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 16px;
}

.gallery-breadcrumb a,
.gallery-breadcrumb .sep {
    color: rgba(255, 255, 255, 0.75);
}

.gallery-breadcrumb a:hover {
    color: #FFFFFF;
}

.gallery-breadcrumb .current {
    color: #FFFFFF;
}

.gallery-hero-content h1 {
    font-family: var(--font-serif);
    font-size: 44px;
    font-weight: 500;
    color: #FFFFFF;
    line-height: 1.1;
    letter-spacing: -0.3px;
    margin-bottom: 12px;
}

.gallery-hero-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.75;
    max-width: 480px;
}

.gallery-hero-script {
    position: absolute;
    right: 40px;
    bottom: 36px;
    font-family: var(--font-script);
    font-size: 28px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.12;
    text-align: right;
    pointer-events: none;
}

/* ===== Main Layout ===== */
.gallery-main {
    background: var(--gallery-cream);
    padding: 52px 0 56px;
}

.gallery-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 36px;
    align-items: start;
}

/* ===== Sidebar ===== */
.sidebar-card {
    background: #FFFFFF;
    border: 1px solid var(--gallery-border);
    border-radius: 6px;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(40, 32, 22, 0.04);
}

.categories-card h2 {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 600;
    color: var(--gallery-charcoal);
    padding: 18px 18px 14px;
    border-bottom: 1px solid #F0EBE4;
}

.category-list li {
    border-bottom: 1px solid #F0EBE4;
}

.category-list li:last-child {
    border-bottom: none;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gallery-charcoal);
    transition: color 0.2s ease, background 0.2s ease;
}

.category-link:hover {
    color: var(--gallery-bronze);
}

.category-link.active {
    background: var(--gallery-bronze);
    color: #FFFFFF;
}

.category-link.active .cat-arrow {
    color: rgba(255, 255, 255, 0.85);
}

.cat-arrow {
    font-size: 16px;
    color: #A39B91;
    line-height: 1;
}

.help-card {
    padding: 24px 20px;
    text-align: center;
    background: var(--gallery-cream);
    border-color: #EDE6DC;
}

.help-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gallery-bronze);
}

.help-icon svg {
    width: 26px;
    height: 26px;
}

.help-card h3 {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--gallery-charcoal);
    margin-bottom: 8px;
}

.help-card p {
    font-size: 12px;
    color: var(--gallery-body);
    line-height: 1.55;
    margin-bottom: 16px;
}

.help-card .btn-primary {
    width: 100%;
    min-height: 38px;
    font-size: 12px;
    border-radius: 5px;
}

/* ===== Gallery Content ===== */
.gallery-content {
    background: #FFFFFF;
    border: 1px solid var(--gallery-border);
    border-radius: 6px;
    padding: 28px 28px 32px;
    box-shadow: 0 2px 10px rgba(40, 32, 22, 0.04);
}

.gallery-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    gap: 24px 32px;
    margin-bottom: 28px;
    align-items: start;
}

.gallery-tag {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--gallery-bronze);
    margin-bottom: 8px;
}

.gallery-header-left h2 {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 500;
    color: var(--gallery-charcoal);
    line-height: 1.2;
    margin-bottom: 10px;
    letter-spacing: -0.2px;
}

.title-underline {
    width: 44px;
    height: 2px;
    background: var(--gallery-bronze-light);
    border-radius: 1px;
}

.gallery-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.gallery-filter {
    position: relative;
    width: 100%;
    max-width: 200px;
}

.gallery-filter select {
    width: 100%;
    padding: 9px 34px 9px 14px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--gallery-charcoal);
    background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236A645C' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--gallery-border);
    border-radius: 5px;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.gallery-filter select:focus {
    border-color: var(--gallery-bronze);
}

.gallery-header-text {
    font-size: 13px;
    color: var(--gallery-body);
    line-height: 1.65;
    text-align: right;
}

/* ===== Gallery Grid ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 4 / 3;
    cursor: pointer;
}

.gallery-item.hidden {
    display: none;
}

.gallery-empty {
    grid-column: 1 / -1;
    padding: 48px 24px;
    text-align: center;
    font-size: 15px;
    color: var(--gallery-body);
    background: var(--gallery-cream);
    border-radius: 4px;
    border: 1px dashed var(--gallery-border);
}

.gallery-empty code {
    font-size: 13px;
    color: var(--gallery-bronze);
}

.gallery-empty.hidden {
    display: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
}

.gallery-zoom {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover .gallery-zoom {
    transform: scale(1.05);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.gallery-zoom svg {
    width: 14px;
    height: 14px;
    color: var(--gallery-charcoal);
}

/* ===== Pagination ===== */
.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.page-btn,
.page-num {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--gallery-body);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.page-btn:hover,
.page-num:hover {
    color: var(--gallery-bronze);
}

.page-num.active {
    background: var(--gallery-bronze);
    color: #FFFFFF;
}

.page-btn {
    font-size: 15px;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 1;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .gallery-header {
        grid-template-columns: 1fr;
    }

    .gallery-header-right {
        align-items: flex-start;
    }

    .gallery-header-text {
        text-align: left;
    }

    .gallery-filter {
        max-width: 220px;
    }
}

@media (max-width: 1024px) {
    .gallery-layout {
        grid-template-columns: 1fr;
    }

    .gallery-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    .sidebar-card {
        margin-bottom: 0;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-hero-inner {
        padding: 0 20px;
        min-height: 300px;
    }

    .gallery-hero-script {
        display: none;
    }

    .gallery-hero-content h1 {
        font-size: 34px;
    }

    .gallery-sidebar {
        grid-template-columns: 1fr;
    }

    .gallery-content {
        padding: 22px 18px 26px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 520px) {
    .gallery-main {
        padding: 40px 0 48px;
    }

    .gallery-header-left h2 {
        font-size: 26px;
    }
}
