/* EnvCnslt County Ordinances Page
 * Inherits base styles from screen.css (body, nav, reset).
 */

.container { max-width: 1000px; margin: 0 auto; padding: 2rem; }

/* --- County list --- */

.county-search {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.county-search h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.county-search input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
}

.county-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.county-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.county-card {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.county-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.county-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.county-card-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.county-card-meta span { margin-right: 0.75rem; }

/* --- County detail --- */

.back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--color-primary);
    text-decoration: none;
    margin-bottom: 1rem;
}

.back-link:hover { text-decoration: underline; }

.county-header {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.county-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.county-header .county-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* --- Ordinance cards --- */

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-border);
}

.ordinance-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--color-primary);
}

.ordinance-card.not-applicable {
    border-left-color: var(--color-border);
    opacity: 0.7;
}

.ordinance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.ordinance-type {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.ordinance-status {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.status-active { background: #d1fae5; color: #059669; }
.status-none { background: var(--color-border-light); color: var(--color-text-muted); }

.ordinance-citation {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
    font-style: italic;
}

.ordinance-notes {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.ordinance-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.topic-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #dbeafe;
    color: #1d4ed8;
}

/* --- Detail grid (thresholds) --- */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.detail-item {
    background: #f8fafc;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.detail-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.detail-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text);
}

/* List-type details */
.detail-list {
    margin-top: 0.4rem;
    padding-left: 1.2rem;
    font-size: 0.82rem;
    color: #475569;
}

.detail-list li { margin-bottom: 0.15rem; }

/* --- Air district / habitat plans / transportation sections --- */

.info-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    margin-bottom: 0.75rem;
}

.info-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.threshold-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.threshold-table th {
    text-align: left;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.threshold-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
    color: #334155;
}

.threshold-table td:last-child {
    font-weight: 600;
    text-align: right;
}

/* --- Loading / Error --- */

.loading { text-align: center; padding: 3rem; color: var(--color-text-secondary); display: none; }
.loading.visible { display: block; }

.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error { background: #fee2e2; color: #dc2626; padding: 1rem 1.5rem; border-radius: 8px; display: none; }
.error.visible { display: block; }

/* --- Responsive --- */

@media (max-width: 768px) {
    .county-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .county-header .county-stats { flex-direction: column; gap: 0.3rem; }
}
