.gallery-browser {
    display: grid;
    gap: 24px;
}

.gallery-hero,
.gallery-controls-panel,
.gallery-card,
.gallery-empty,
.gallery-message {
    background: var(--site-paper);
    border: 1px solid var(--site-line);
    border-radius: 28px;
    box-shadow: var(--site-shadow);
    backdrop-filter: blur(10px);
}

.gallery-hero {
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(109, 166, 29, 0.16), rgba(109, 166, 29, 0) 38%),
        linear-gradient(135deg, rgba(255, 250, 243, 0.96), rgba(244, 248, 240, 0.94));
}

.gallery-hero-copy,
.gallery-controls-panel,
.gallery-empty,
.gallery-message {
    padding: 24px;
}

.gallery-eyebrow {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--site-leaf);
}

.gallery-hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 4.2vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
    color: var(--site-text);
}

.gallery-lede {
    margin: 14px 0 0;
    color: var(--site-muted);
    line-height: 1.7;
}

.gallery-total-hidden {
    display: none;
}

.gallery-controls-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
}

.gallery-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.gallery-field > span,
.gallery-field > legend {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(35, 22, 14, 0.54);
}

.gallery-field > legend {
    padding: 0;
}

.gallery-field-mode {
    margin: 0;
    padding: 0;
    border: 0;
}

.gallery-field input,
.gallery-field select {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(35, 22, 14, 0.12);
    background: white;
    color: var(--site-text);
    padding: 13px 15px;
    font: inherit;
}

.gallery-radio-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
}

.gallery-radio-option {
    position: relative;
    display: inline-flex;
    flex: 1 1 0;
}

.gallery-radio-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.gallery-radio-option input + span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(35, 22, 14, 0.12);
    background: white;
    color: rgba(35, 22, 14, 0.72);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.gallery-radio-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-radio-option input:checked + span {
    background: var(--site-text);
    border-color: var(--site-text);
    color: white;
    box-shadow: 0 12px 24px rgba(35, 22, 14, 0.14);
}

.gallery-radio-option input:focus-visible + span {
    outline: 2px solid rgba(109, 166, 29, 0.34);
    outline-offset: 2px;
}

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

.gallery-card {
    overflow: hidden;
    display: grid;
}

.gallery-card-visual {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(180deg, rgba(109, 166, 29, 0.14), rgba(72, 44, 23, 0.08));
}

.gallery-card-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-card-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--site-muted);
    font-weight: 700;
}

.gallery-badges {
    position: absolute;
    inset: 16px 16px auto 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(17, 24, 39, 0.72);
    color: white;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.gallery-badge.mode-tree {
    background: #2c6a3a;
}

.gallery-badge.mode-cut {
    background: #7c4a2d;
}

.gallery-card-body {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.gallery-card-title {
    margin: 0;
    font-size: 1.38rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.gallery-card-location {
    margin: 0;
    color: var(--site-muted);
    font-size: 0.98rem;
}

.gallery-card-summary {
    margin: 0;
    color: rgba(35, 22, 14, 0.8);
    line-height: 1.65;
}

.gallery-card-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
}

.gallery-stat-label {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(35, 22, 14, 0.48);
}

.gallery-stat-value {
    margin: 5px 0 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--site-text);
}

.gallery-card-link,
.gallery-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 12px 18px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    background: var(--site-text);
    color: white;
}

.gallery-card-link {
    width: fit-content;
}

.gallery-actions {
    display: flex;
    justify-content: center;
}

.gallery-empty,
.gallery-message {
    text-align: center;
    color: var(--site-muted);
}

.gallery-message {
    color: #b42318;
    background: rgba(254, 242, 242, 0.96);
    border-color: rgba(217, 45, 32, 0.18);
}

@media (max-width: 980px) {
    .gallery-controls-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .gallery-hero-copy,
    .gallery-controls-panel,
    .gallery-empty,
    .gallery-message {
        padding: 20px;
    }

    .gallery-card-stats {
        grid-template-columns: 1fr;
    }

    .gallery-radio-option span {
        min-height: 44px;
        padding: 0 12px;
        font-size: 0.86rem;
    }
}
