/* Styles for the apartments-per-permit distribution page (apartment-distribution.html). */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

h1 {
    color: #333;
    margin-bottom: 10px;
}

.stats {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px;
}

.stats-column {
    flex: 1;
}

.stats-column p {
    margin: 5px 0;
    color: #666;
}

.chart-container-outer {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: relative;
}

/* Height is set from the number of bars once the data arrives; this keeps the box a stable
   size while it loads so nothing jumps. */
.chart-container {
    height: 1200px;
}

.chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.chart-head h2 {
    color: #333;
    font-size: 1.15em;
    margin: 0 0 4px;
}

.chart-description {
    color: #666;
    margin: 0;
    max-width: 62ch;
    line-height: 1.45;
}

.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid #d8dee8;
    background: #fff;
    color: #445;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
    border-color: #2a78d6;
}

.chip.is-active {
    background: #152033;
    border-color: #152033;
    color: #fff;
}

/* The quarterly mix has one bar per quarter, so it keeps a fixed, modest height. */
.chart-container--mix {
    height: 380px;
}

.chart-message {
    color: #666;
    padding: 20px 0;
}

.chart-note {
    color: #999;
    font-size: 0.85em;
    margin: 0 0 20px;
    line-height: 1.4;
}

.chart-note--inline {
    margin: 12px 0 0;
}

.click-results {
    display: none;
}

.click-results.show {
    display: block;
}

.click-results h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.2em;
}

.click-results .result-item {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.click-results .result-item strong {
    color: #2563eb;
}

.click-results .bar-label {
    font-weight: bold;
    color: #666;
    margin-bottom: 10px;
}

.back-btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 8px;
    background: #152033;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    transition: opacity 0.15s ease;
}

.back-btn:hover {
    opacity: 0.82;
}

@media (max-width: 640px) {
    .stats {
        flex-direction: column;
        gap: 10px;
    }
}
