.gallery-page {
    padding: 42px 0 24px;
    background: #070707;
    color: var(--text);
}

.gallery-page .container,
.gallery-results .container {
    width: min(100%, 1560px);
    padding-inline: 24px;
}

.gallery-page__head {
    margin-bottom: 24px;
}

.gallery-page__eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 700;
}

.gallery-page__title {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(2.1rem, 4vw, 3rem);
    line-height: 1.05;
    color: var(--text);
}

.gallery-filters {
    display: grid;
    gap: 18px;
    margin-bottom: 26px;
}

.gallery-filters__top {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) 260px 180px 180px;
    gap: 16px;
    align-items: end;
}

.gallery-filter-field {
    display: grid;
    gap: 8px;
    align-self: start;
    position: relative;
}

.gallery-filter-field label {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gallery-filter-field--tags {
    z-index: 40;
}

.gallery-tag-picker {
    min-height: 54px;
    border-radius: 16px;
    border: 1px solid rgba(211, 189, 145, 0.16);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    padding-right: 52px;
    position: relative;
}

.gallery-tag-picker__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-tag-picker__input {
    background: transparent;
    border: 0;
    outline: none;
    color: var(--text);
    min-width: 140px;
    flex: 1 1 auto;
    font: inherit;
}

.gallery-tag-picker__input::placeholder {
    color: var(--text-muted);
}

.gallery-tag-picker__toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(211, 189, 145, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    z-index: 5;
}

.gallery-tag-picker__toggle:hover {
    background: rgba(211, 189, 145, 0.08);
    border-color: rgba(211, 189, 145, 0.28);
}

.gallery-tag-chip {
    border: 1px solid rgba(211, 189, 145, 0.24);
    background: rgba(211, 189, 145, 0.08);
    color: var(--text);
    border-radius: 999px;
    min-height: 34px;
    padding: 0 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
}

.gallery-tag-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 40;
    display: grid;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
    border-radius: 14px;
    background: #111;
    border: 1px solid rgba(211, 189, 145, 0.16);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
    scrollbar-width: thin;
    scrollbar-color: rgba(211, 189, 145, 0.42) rgba(255, 255, 255, 0.04);
}

.gallery-tag-suggestions[hidden] {
    display: none !important;
}

.gallery-tag-suggestions::-webkit-scrollbar {
    width: 10px;
}

.gallery-tag-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.gallery-tag-suggestions::-webkit-scrollbar-thumb {
    background: rgba(211, 189, 145, 0.34);
    border-radius: 999px;
    border: 2px solid #111;
}

.gallery-tag-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(211, 189, 145, 0.52);
}

.gallery-tag-suggestion {
    border: 0;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    text-align: left;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
}

.gallery-tag-suggestion:hover {
    background: rgba(211, 189, 145, 0.08);
}

.gallery-select {
    position: relative;
    z-index: 20;
}

.gallery-select.is-open {
    z-index: 35;
}

.gallery-select__trigger {
    width: 100%;
    min-height: 54px;
    border-radius: 16px;
    border: 1px solid rgba(211, 189, 145, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    font: inherit;
}

.gallery-select__trigger:hover {
    border-color: rgba(211, 189, 145, 0.28);
}

.gallery-select__label {
    color: var(--text);
    text-align: left;
}

.gallery-select__chevron {
    color: var(--accent);
    transition: transform 180ms ease;
}

.gallery-select.is-open .gallery-select__chevron {
    transform: rotate(180deg);
}

.gallery-select__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 36;
    display: grid;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
    border-radius: 14px;
    background: #111;
    border: 1px solid rgba(211, 189, 145, 0.16);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
    scrollbar-width: thin;
    scrollbar-color: rgba(211, 189, 145, 0.42) rgba(255, 255, 255, 0.04);
}

.gallery-select__menu[hidden] {
    display: none !important;
}

.gallery-select__menu::-webkit-scrollbar {
    width: 10px;
}

.gallery-select__menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.gallery-select__menu::-webkit-scrollbar-thumb {
    background: rgba(211, 189, 145, 0.34);
    border-radius: 999px;
    border: 2px solid #111;
}

.gallery-select__menu::-webkit-scrollbar-thumb:hover {
    background: rgba(211, 189, 145, 0.52);
}

.gallery-select__option {
    border: 0;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    text-align: left;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
}

.gallery-select__option:hover {
    background: rgba(211, 189, 145, 0.08);
}

.gallery-select__option.is-selected {
    background: rgba(211, 189, 145, 0.14);
    color: var(--text);
}

.gallery-results {
    padding: 10px 0 68px;
    background: #070707;
}

.gallery-results__head {
    margin-bottom: 18px;
    color: var(--text-muted);
}

.gallery-results__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.gallery-card {
    min-width: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(211, 189, 145, 0.10);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    will-change: transform, opacity;
}

.gallery-card:hover {
    transform: translateY(-3px);
    border-color: rgba(211, 189, 145, 0.24);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.25);
}

.gallery-card__thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #111;
}

.gallery-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    z-index: 2;
}

.gallery-card__badge.is-premium {
    background: rgba(211, 189, 145, 0.92);
    color: #17140f;
}

.gallery-card__badge.is-free {
    background: rgba(255, 255, 255, 0.88);
    color: #111;
}

.gallery-card__body {
    padding: 12px 12px 14px;
}

.gallery-card__meta {
    margin: 0 0 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gallery-card__title {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.3;
}

.gallery-card__title a {
    color: var(--text);
}

.gallery-card__title a:hover {
    color: var(--accent);
}

.gallery-results__empty {
    grid-column: 1 / -1;
    padding: 36px 0;
}

@media (max-width: 1400px) {
    .gallery-results__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1160px) {
    .gallery-filters__top {
        grid-template-columns: 1fr 1fr;
    }

    .gallery-filter-field--tags {
        grid-column: 1 / -1;
    }

    .gallery-results__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .gallery-results__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .gallery-page {
        padding-top: 28px;
    }

    .gallery-page .container,
    .gallery-results .container {
        padding-inline: 20px;
    }

    .gallery-filters__top {
        grid-template-columns: 1fr;
    }

    .gallery-results__grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}