/*
 * climate-public.css
 * Lab 02 — Public-facing Climate Analyst
 * Warm parchment palette under YEA site header
 *
 * Path: /projects/yea3d/labs/climate-public.css
 * Author: M. Hamilton / Claude collaboration
 * Date: March 2026
 */

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

#instrument-workspace {
    --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', 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', 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, serif; font-size: 22px; font-weight: normal;
    color: #E8F2E4; line-height: 1.2; margin: 0;
}

/* ================================================================
   WORKSPACE
   ================================================================ */

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

/* ================================================================
   LEFT PANEL
   ================================================================ */

#instrument-panel {
    width: 240px; min-width: 240px; background: #faf8f3;
    border: 1.5px solid #d8d0c4; border-right: none;
    border-radius: 5px 0 0 5px; overflow: hidden;
    display: flex; flex-direction: column;
}
.panel-section {
    display: flex; flex-direction: column; flex: 1;
    overflow: hidden; padding: 0.6rem 0.5rem;
}
.panel-label {
    font-family: 'SF Mono', monospace; font-size: 10px; letter-spacing: 0.15em;
    text-transform: uppercase; color: #8a7e6e; margin-bottom: 0.35rem;
    padding: 0 2px; flex-shrink: 0;
}
.panel-meta { font-family: Georgia, serif; font-size: 12px; color: #6b5d4d; padding: 0 2px; }
.panel-dim { color: #a09888; font-weight: normal; }

.panel-search-row { display: flex; gap: 4px; margin-bottom: 4px; flex-shrink: 0; }
.panel-search {
    flex: 1; padding: 6px 8px; font-family: Georgia, serif; font-size: 12px;
    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', 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', 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;
}

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

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

.place-card-dot { width: 8px; height: 8px; border-radius: 50%; background: #5c7a3a; flex-shrink: 0; }
.place-card-info { overflow: hidden; flex: 1; }
.place-card-name {
    font-family: Georgia, serif; font-size: 11px; color: #2c2416;
    line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.place-card-sub {
    font-family: 'SF Mono', monospace; font-size: 9px; color: #a09888;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ================================================================
   CENTER — charts
   ================================================================ */

#instrument-viewport {
    flex: 1; position: relative; background: #faf8f3;
    border: 1.5px solid #d8d0c4; overflow-y: auto;
}
.charts-container { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.charts-empty {
    font-family: 'SF Mono', monospace; font-size: 12px; color: #a09888;
    text-align: center; padding: 4rem 1rem; line-height: 1.5;
}
.chart-card {
    background: #fff; border: 1px solid #d8d0c4; border-radius: 6px;
    padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.chart-title {
    font-family: 'SF Mono', monospace; font-size: 10px; letter-spacing: 0.12em;
    text-transform: uppercase; color: #8a7e6e; margin-bottom: 0.5rem;
}
.chart-canvas-wrap { position: relative; height: 200px; }
.chart-canvas-wrap canvas { width: 100% !important; height: 100% !important; }

.annual-strip { display: flex; gap: 1rem; padding: 0.6rem 0; flex-wrap: wrap; }
.annual-cell {
    flex: 1; min-width: 100px; text-align: center;
    padding: 0.5rem; background: #f0ede4; border-radius: 4px;
}
.annual-value { font-family: Georgia, serif; font-size: 20px; font-weight: 700; color: #2c2416; }
.annual-label {
    font-family: 'SF Mono', monospace; font-size: 9px; letter-spacing: 0.1em;
    text-transform: uppercase; color: #8a7e6e; margin-top: 2px;
}
.annual-unit { font-family: 'SF Mono', monospace; font-size: 10px; color: #a09888; }

.charts-loading {
    text-align: center; padding: 4rem 1rem;
    font-family: 'SF Mono', monospace; font-size: 12px; color: #8a7e6e;
}

/* ================================================================
   RIGHT PANEL — current conditions
   ================================================================ */

#conditions-panel {
    width: 220px; min-width: 220px; background: #faf8f3;
    border: 1.5px solid #d8d0c4; border-left: none;
    border-radius: 0 5px 5px 0; overflow-y: auto; padding: 0.6rem;
}
.conditions-content { font-family: Georgia, serif; color: #3A3226; }
.conditions-empty {
    font-family: 'SF Mono', monospace; font-size: 11px; color: #a09888;
    text-align: center; padding: 2rem 0.5rem; line-height: 1.5;
}
.conditions-place-name {
    font-family: Georgia, serif; font-size: 14px; font-weight: 700;
    color: #2c2416; margin-bottom: 0.3rem; line-height: 1.2;
}
.conditions-source {
    font-family: 'SF Mono', monospace; font-size: 9px; color: #5c7a3a;
    letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.8rem;
}
.conditions-temp {
    font-family: Georgia, serif; font-size: 36px; font-weight: 700;
    color: #2c2416; line-height: 1; margin-bottom: 0.2rem;
}
.conditions-feels { font-family: 'SF Mono', monospace; font-size: 10px; color: #a09888; margin-bottom: 0.8rem; }

.conditions-section {
    margin-top: 0.6rem; padding-top: 0.5rem;
    border-top: 1px solid rgba(92,122,58,0.14);
}
.conditions-section-label {
    font-family: 'SF Mono', monospace; font-size: 9px; letter-spacing: 0.12em;
    text-transform: uppercase; color: #8a7e6e; margin-bottom: 0.3rem;
}
.conditions-row { display: flex; justify-content: space-between; padding: 3px 0; }
.conditions-row-label { font-family: 'SF Mono', monospace; font-size: 10px; color: #a09888; }
.conditions-row-value { font-family: Georgia, serif; font-size: 12px; color: #2c2416; }

.conditions-vs-normal {
    margin-top: 0.8rem; padding: 0.6rem;
    background: rgba(92,122,58,0.06); border-radius: 4px;
    border-left: 3px solid #5c7a3a;
}
.conditions-vs-label {
    font-family: 'SF Mono', monospace; font-size: 9px; letter-spacing: 0.1em;
    text-transform: uppercase; color: #8a7e6e; margin-bottom: 4px;
}
.conditions-vs-value { font-family: Georgia, serif; font-size: 14px; font-weight: 700; color: #2c2416; }
.conditions-vs-sub { font-family: 'SF Mono', monospace; font-size: 10px; color: #a09888; margin-top: 2px; }

/* ================================================================
   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', 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', 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', 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; }

/* ================================================================
   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: 200px; }
    #instrument-viewport { height: auto; min-height: 500px; }
    #conditions-panel { width: 100%; min-width: auto; border-left: 1.5px solid #d8d0c4; border-radius: 0 0 5px 5px; max-height: 300px; }
}
