body {
    background: #f5f5f3;
    color: #1a1a1a;
    min-height: 100vh;
}

/* Header */
.archive-header {
    background: rgba(245, 245, 243, 0.9);
    backdrop-filter: blur(12px);
}

.archive-header .home-logo img {
    filter: none;
}

.archive-header .nav-link {
    color: rgba(0, 0, 0, 0.4);
}

.archive-header .nav-link:hover {
    color: #1a1a1a;
}

.archive-header .nav-link.active {
    color: #1a1a1a;
    border-color: #1a1a1a;
}

/* Controls */
.controls {
    padding: 7rem 2.5rem 0;
}

.controls-top {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.controls-top h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-right: auto;
}

.photo-count {
    font-size: 0.78rem;
    color: rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(0, 0, 0, 0.3);
    margin-right: 0.15rem;
}

.sort-btn {
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;

}

.sort-btn:hover {
    border-color: rgba(0, 0, 0, 0.3);
    color: #1a1a1a;
}

.sort-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

/* Filter row with dropdowns */
.filter-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.filter-dropdown {
    position: relative;
}

.filter-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;

    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-dropdown-trigger:hover {
    border-color: rgba(0, 0, 0, 0.3);
    color: #1a1a1a;
}

.filter-dropdown-trigger.has-selection {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.filter-dropdown-trigger .arrow {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.filter-dropdown.open .filter-dropdown-trigger .arrow {
    transform: rotate(180deg);
}

.filter-dropdown-trigger .count-badge {
    background: white;
    color: #1a1a1a;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    line-height: 1.3;
}

.filter-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 22rem;
    max-height: 260px;
    overflow-y: auto;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: 50;
    padding: 0.35rem 0;
}

.filter-dropdown.open .filter-dropdown-menu {
    display: block;
}

.filter-dropdown-menu::-webkit-scrollbar {
    width: 4px;
}

.filter-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.filter-option:hover {
    background: rgba(0, 0, 0, 0.04);
}

.filter-option .checkbox {
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(0, 0, 0, 0.25);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.filter-option.selected .checkbox {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.filter-option.selected .checkbox::after {
    content: '';
    width: 6px;
    height: 3px;
    border-left: 1.5px solid white;
    border-bottom: 1.5px solid white;
    transform: rotate(-45deg) translateY(-1px);
}

.filter-option .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-option .option-label {
    flex: 1;
}

.filter-option .option-count {
    font-size: 0.65rem;
    color: rgba(0, 0, 0, 0.3);
}

.clear-filters {
    background: none;
    border: none;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.25);
    cursor: pointer;

    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.2s ease;
    padding: 0.35rem 0;
}

.clear-filters:hover {
    color: #1a1a1a;
}

.clear-filters.hidden {
    display: none;
}

/* Masonry grid */
.masonry {
    padding: 1.5rem 2.5rem 4rem;
    column-count: 4;
    column-gap: 1.5rem;
}

.archive-card {
    break-inside: avoid;
    margin-bottom: 1.8rem;
    cursor: pointer;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
}

.archive-card img {
    width: 100%;
    display: block;
}

/* Hover overlay */
.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.archive-card:hover .card-overlay {
    opacity: 1;
}

.overlay-event {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.3rem;
}

.overlay-caption {
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    line-height: 1.35;
    margin-bottom: 0.3rem;
}

.overlay-credit {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Group dividers */
.group-divider {
    column-span: all;
    padding: 2rem 0 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.group-divider h2 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.group-divider .group-count {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.no-results {
    column-span: all;
    text-align: center;
    padding: 6rem 2rem;
    color: rgba(0, 0, 0, 0.3);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .masonry {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry {
        column-count: 2;
        padding: 1rem 1.5rem 3rem;
        column-gap: 1rem;
    }

    .controls {
        padding: 6rem 1.5rem 0;
    }

    .controls-top h1 {
        font-size: 1.4rem;
    }

    .filter-row {
        gap: 0.5rem;
    }

    .lightbox-main img {
        max-width: 90vw;
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .masonry {
        column-count: 1;
    }
}

/* KRC mode */
body.krc-mode {
    background: #211f20;
    color: #e92b2b;
}

body.krc-mode .archive-header {
    background: rgba(33, 31, 32, 0.9);
}

body.krc-mode .archive-header .home-logo img {
    filter: brightness(0) saturate(100%) invert(24%) sepia(95%) saturate(2000%) hue-rotate(345deg) brightness(95%) contrast(90%);
}

body.krc-mode .archive-header .nav-link {
    color: rgba(233, 43, 43, 0.4);
}

body.krc-mode .archive-header .nav-link:hover {
    color: #e92b2b;
}

body.krc-mode .archive-header .nav-link.active {
    color: #e92b2b;
    border-color: #e92b2b;
}

body.krc-mode .controls-top h1 {
    color: #e92b2b;
}

body.krc-mode .photo-count {
    color: rgba(233, 43, 43, 0.4);
}

body.krc-mode .control-label {
    color: rgba(233, 43, 43, 0.3);
}

body.krc-mode .sort-btn {
    border-color: rgba(233, 43, 43, 0.2);
    color: rgba(233, 43, 43, 0.5);
}

body.krc-mode .sort-btn:hover {
    border-color: rgba(233, 43, 43, 0.4);
    color: #e92b2b;
}

body.krc-mode .sort-btn.active {
    background: #e92b2b;
    border-color: #e92b2b;
    color: #211f20;
}

body.krc-mode .filter-dropdown-trigger {
    border-color: rgba(233, 43, 43, 0.2);
    color: rgba(233, 43, 43, 0.5);
}

body.krc-mode .filter-dropdown-trigger:hover {
    border-color: rgba(233, 43, 43, 0.4);
    color: #e92b2b;
}

body.krc-mode .filter-dropdown-trigger.has-selection {
    background: #e92b2b;
    border-color: #e92b2b;
    color: #211f20;
}

body.krc-mode .filter-dropdown-trigger .count-badge {
    background: #211f20;
    color: #e92b2b;
}

body.krc-mode .filter-dropdown-menu {
    background: #2a2728;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(233, 43, 43, 0.1);
}

body.krc-mode .filter-option {
    color: rgba(233, 43, 43, 0.7);
}

body.krc-mode .filter-option:hover {
    background: rgba(233, 43, 43, 0.08);
}

body.krc-mode .filter-option .checkbox {
    border-color: rgba(233, 43, 43, 0.3);
}

body.krc-mode .filter-option.selected .checkbox {
    background: #e92b2b;
    border-color: #e92b2b;
}

body.krc-mode .filter-option .option-count {
    color: rgba(233, 43, 43, 0.3);
}

body.krc-mode .clear-filters {
    color: rgba(233, 43, 43, 0.3);
}

body.krc-mode .clear-filters:hover {
    color: #e92b2b;
}

body.krc-mode .filter-row {
    border-bottom-color: rgba(233, 43, 43, 0.1);
}

body.krc-mode .group-divider {
    border-bottom-color: rgba(233, 43, 43, 0.1);
}

body.krc-mode .group-divider h2 {
    color: #e92b2b;
}

body.krc-mode .group-divider .group-count {
    color: rgba(233, 43, 43, 0.3);
}

body.krc-mode .no-results {
    color: rgba(233, 43, 43, 0.3);
}

body.krc-mode .overlay-caption {
    color: #e92b2b;
}

body.krc-mode .overlay-event {
    color: rgba(233, 43, 43, 0.5);
}

body.krc-mode .overlay-credit {
    color: rgba(233, 43, 43, 0.5);
}

body.krc-mode .filter-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(233, 43, 43, 0.2);
}

/* BTG mode */
body.btg-mode {
    background: #a0a0a0;
    color: #313131;
}

body.btg-mode .archive-header {
    background: rgba(160, 160, 160, 0.9);
}

body.btg-mode .archive-header .home-logo img {
    filter: brightness(0) invert(0.19);
}

body.btg-mode .archive-header .nav-link {
    color: rgba(49, 49, 49, 0.4);
}

body.btg-mode .archive-header .nav-link:hover {
    color: #313131;
}

body.btg-mode .archive-header .nav-link.active {
    color: #313131;
    border-color: #313131;
}

body.btg-mode .controls-top h1 {
    color: #313131;
}

body.btg-mode .photo-count {
    color: rgba(49, 49, 49, 0.4);
}

body.btg-mode .control-label {
    color: rgba(49, 49, 49, 0.3);
}

body.btg-mode .sort-btn {
    border-color: rgba(49, 49, 49, 0.2);
    color: rgba(49, 49, 49, 0.5);
}

body.btg-mode .sort-btn:hover {
    border-color: rgba(49, 49, 49, 0.4);
    color: #313131;
}

body.btg-mode .sort-btn.active {
    background: #313131;
    border-color: #313131;
    color: #a0a0a0;
}

body.btg-mode .filter-dropdown-trigger {
    border-color: rgba(49, 49, 49, 0.2);
    color: rgba(49, 49, 49, 0.5);
}

body.btg-mode .filter-dropdown-trigger:hover {
    border-color: rgba(49, 49, 49, 0.4);
    color: #313131;
}

body.btg-mode .filter-dropdown-trigger.has-selection {
    background: #313131;
    border-color: #313131;
    color: #a0a0a0;
}

body.btg-mode .filter-dropdown-trigger .count-badge {
    background: #a0a0a0;
    color: #313131;
}

body.btg-mode .filter-dropdown-menu {
    background: #8a8a8a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(49, 49, 49, 0.1);
}

body.btg-mode .filter-option {
    color: rgba(49, 49, 49, 0.8);
}

body.btg-mode .filter-option:hover {
    background: rgba(49, 49, 49, 0.08);
}

body.btg-mode .filter-option .checkbox {
    border-color: rgba(49, 49, 49, 0.3);
}

body.btg-mode .filter-option.selected .checkbox {
    background: #313131;
    border-color: #313131;
}

body.btg-mode .filter-option .option-count {
    color: rgba(49, 49, 49, 0.3);
}

body.btg-mode .clear-filters {
    color: rgba(49, 49, 49, 0.3);
}

body.btg-mode .clear-filters:hover {
    color: #313131;
}

body.btg-mode .filter-row {
    border-bottom-color: rgba(49, 49, 49, 0.1);
}

body.btg-mode .group-divider {
    border-bottom-color: rgba(49, 49, 49, 0.1);
}

body.btg-mode .group-divider h2 {
    color: #313131;
}

body.btg-mode .group-divider .group-count {
    color: rgba(49, 49, 49, 0.3);
}

body.btg-mode .no-results {
    color: rgba(49, 49, 49, 0.3);
}

body.btg-mode .overlay-caption {
    color: #a0a0a0;
}

body.btg-mode .overlay-event {
    color: rgba(160, 160, 160, 0.6);
}

body.btg-mode .overlay-credit {
    color: rgba(160, 160, 160, 0.5);
}

body.btg-mode .filter-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(49, 49, 49, 0.2);
}
