/*
 * site-finder-public.css
 * Lab 01 — Public-facing Site Finder
 * Same layout as admin version, scoped design tokens
 *
 * Path: /projects/yea3d/labs/site-finder-public.css
 * Author: M. Hamilton / Claude collaboration
 * Date: March 2026
 */

/* ================================================================
   SCOPED DESIGN TOKENS
   ================================================================ */

#instrument-workspace {
    --bg-deep: #06070d;
    --bg-panel: #0c0e18;
    --font-mono: 'DM Mono', monospace;
    --font-display: 'Instrument Serif', serif;
    --transition-fast: 0.2s ease;
}

/* ================================================================
   INSTRUMENT HEADER
   ================================================================ */

#instrument-header {
    background: linear-gradient(135deg, #252E22 0%, #2E3C2A 50%, #222A20 100%);
    border-bottom: 3px solid #5c7a3a;
    padding: 0.6rem 2rem;
}

.instrument-header-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.instrument-breadcrumb {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    color: rgba(106, 174, 106, 0.5);
    text-decoration: none;
    letter-spacing: 0.08em;
}
.instrument-breadcrumb:hover {
    color: rgba(106, 174, 106, 0.85);
}

.instrument-id {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: rgba(106, 174, 106, 0.5);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.instrument-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 22px;
    font-weight: normal;
    color: #E8F2E4;
    line-height: 1.2;
    margin: 0;
}

/* ================================================================
   WORKSPACE — three-column
   ================================================================ */

#instrument-workspace {
    display: flex;
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 1.5rem;
    height: 680px;
    gap: 0;
}

/* ================================================================
   LEFT PANEL — warm parchment
   ================================================================ */

#instrument-panel {
    width: 280px;
    min-width: 280px;
    background: #faf8f3;
    border: 1.5px solid #d8d0c4;
    border-right: none;
    border-radius: 5px 0 0 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}

.panel-search-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.panel-search {
    flex: 1;
    padding: 7px 10px;
    font-family: Georgia, serif;
    font-size: 13px;
    color: #2c2416;
    background: #faf8f3;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
}
.panel-search:focus {
    outline: none;
    border-color: #5c7a3a;
}
.panel-search::placeholder {
    color: #a09888;
}

.filter-btn {
    width: 36px;
    height: 36px;
    background: #faf8f3;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a7e6e;
    position: relative;
    transition: all 0.15s;
    flex-shrink: 0;
}
.filter-btn:hover {
    border-color: #5c7a3a;
    color: #5c7a3a;
}
.filter-btn.has-filters {
    border-color: #5c7a3a;
    background: #e8e4d8;
    color: #3e5a2a;
}

.filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #5c7a3a;
    color: #fff;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 4px;
    flex-shrink: 0;
}
.active-filters:empty {
    display: none;
    margin: 0;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 2px 8px;
    background: #e8e4d8;
    border: 1px solid #d8d0c4;
    border-radius: 12px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    color: #3e5a2a;
    line-height: 1;
}

.filter-pill-remove {
    cursor: pointer;
    color: #8a7e6e;
    font-size: 12px;
    line-height: 1;
}
.filter-pill-remove:hover {
    color: #3e5a2a;
}

.panel-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.panel-label {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8a7e6e;
}

.panel-meta {
    font-family: Georgia, serif;
    font-size: 12px;
    color: #6b5d4d;
    padding: 0 2px;
}

.panel-dim {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 10px;
    color: #a09888;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
}

.result-card {
    padding: 6px 7px;
    background: #faf8f3;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.result-card:hover {
    border-color: #5c7a3a;
    background: #f0ede4;
}
.result-card.active {
    border-color: #5c7a3a;
    background: #e8e4d8;
}

.result-card-name {
    font-family: Georgia, serif;
    font-size: 12px;
    color: #2c2416;
    line-height: 1.2;
    margin-bottom: 2px;
}

.result-card-meta {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    color: #a09888;
    line-height: 1.3;
}

.result-card-eco {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    color: #5c7a3a;
    line-height: 1.3;
    margin-top: 2px;
}

/* ================================================================
   CENTER — globe
   ================================================================ */

#instrument-viewport {
    flex: 1;
    position: relative;
    background: #0a0a0a;
    border: 1.5px solid #d8d0c4;
    overflow: hidden;
}

/* ================================================================
   RIGHT PANEL — warm parchment detail
   ================================================================ */

#detail-panel {
    width: 280px;
    min-width: 280px;
    background: #faf8f3;
    border: 1.5px solid #d8d0c4;
    border-left: none;
    border-radius: 0 5px 5px 0;
    overflow-y: auto;
    padding: 0.6rem;
}

.detail-content {
    font-family: Georgia, serif;
    font-size: 13px;
    color: #3A3226;
    line-height: 1.5;
}

.detail-empty {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 11px;
    color: #a09888;
    text-align: center;
    padding: 2rem 0.5rem;
    line-height: 1.5;
}

.detail-name {
    font-family: Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: #2c2416;
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.detail-category {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 10px;
    color: #5c7a3a;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.detail-section {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(92, 122, 58, 0.14);
}

.detail-section-label {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8a7e6e;
    margin-bottom: 0.3rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12px;
}

.detail-row-label {
    color: #a09888;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 10px;
}

.detail-row-value {
    color: #3A3226;
    font-family: Georgia, serif;
    font-size: 12px;
    text-align: right;
    max-width: 60%;
}

.detail-row-api {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    color: #a09888;
    text-align: right;
    font-style: italic;
    padding: 0 0 4px;
}

.override-badge {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(92, 122, 58, 0.14);
    color: #3e5a2a;
    border: 1px solid rgba(92, 122, 58, 0.3);
    margin-left: 6px;
    vertical-align: middle;
}

.override-notes {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 10px;
    color: #5c7a3a;
    background: rgba(92, 122, 58, 0.06);
    border-left: 2px solid rgba(92, 122, 58, 0.3);
    padding: 6px 8px;
    margin-top: 6px;
    border-radius: 0 3px 3px 0;
    line-height: 1.4;
}

.detail-actions {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-action {
    display: block;
    padding: 6px 10px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 11px;
    color: #5c7a3a;
    background: transparent;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}
.detail-action:hover {
    background: #f0ede4;
    border-color: #5c7a3a;
}

/* ================================================================
   FILTER DRAWER
   ================================================================ */

.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
}
.filter-overlay.visible {
    display: block;
}

.filter-drawer {
    position: fixed;
    top: 0;
    left: -340px;
    width: 320px;
    height: 100vh;
    background: #faf8f3;
    border-right: 2px solid #d8d0c4;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: left 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}
.filter-drawer.open {
    left: 0;
}

.filter-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #d8d0c4;
    flex-shrink: 0;
}

.filter-drawer-title {
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: #2c2416;
}

.filter-drawer-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #8a7e6e;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.filter-drawer-close:hover {
    color: #3e5a2a;
}

.filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
}

.filter-group {
    margin-bottom: 1.2rem;
}

.filter-group-label {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8a7e6e;
    margin-bottom: 0.4rem;
}

.filter-select {
    width: 100%;
    padding: 8px 10px;
    font-family: Georgia, serif;
    font-size: 13px;
    color: #2c2416;
    background: #faf8f3;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
    cursor: pointer;
}
.filter-select:focus {
    outline: none;
    border-color: #5c7a3a;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(92, 122, 58, 0.14);
}

.filter-apply-btn {
    flex: 1;
    padding: 8px 12px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: #fff;
    background: #5c7a3a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.filter-apply-btn:hover {
    background: #4a6a2e;
}

.filter-clear-btn {
    padding: 8px 12px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: #8a7e6e;
    background: transparent;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-clear-btn:hover {
    background: #f0ede4;
    border-color: #5c7a3a;
}

.filter-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: Georgia, serif;
    font-size: 13px;
    color: #2c2416;
    cursor: pointer;
    padding: 4px 0;
}

.filter-checkbox-row input[type="checkbox"] {
    accent-color: #5c7a3a;
    width: 16px;
    height: 16px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1000px) {
    #instrument-workspace {
        flex-direction: column;
        height: auto;
    }
    #instrument-panel {
        width: 100%;
        min-width: auto;
        border-right: 1.5px solid #d8d0c4;
        border-radius: 5px 5px 0 0;
        max-height: 250px;
    }
    #instrument-viewport {
        height: 400px;
    }
    #detail-panel {
        width: 100%;
        min-width: auto;
        border-left: 1.5px solid #d8d0c4;
        border-radius: 0 0 5px 5px;
        max-height: 300px;
    }
}