/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f8f9fa;
}

a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 800px; margin: 0 auto; padding: 0 1rem; }

/* === Header === */
.site-header {
    background: #0a2540;
    color: #fff;
    padding: 0.75rem 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-logo { color: #fff; font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.site-logo:hover { text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.site-nav a { color: #a0c4e8; font-size: 0.9rem; }
.site-nav a:hover { color: #fff; }

/* === Footer === */
.site-footer { padding: 2rem 0; text-align: center; font-size: 0.8rem; color: #666; margin-top: 3rem; border-top: 1px solid #e0e0e0; }
.site-footer a { color: #666; }

/* === Breadcrumb === */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; font-size: 0.85rem; color: #666; padding: 1rem 0 0.5rem; }
.breadcrumb li:not(:last-child)::after { content: " \203A"; margin-left: 0.25rem; }

/* === Page Header === */
.page-header { margin-bottom: 0.75rem; }
.page-header h1 { font-size: 1.75rem; line-height: 1.2; margin-bottom: 0.35rem; }
.header-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.meta-chip {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    font-size: 0.75rem;
    background: #f0f0f0;
    color: #555;
}
.subtitle { color: #666; margin-top: 0.25rem; }

/* === Type Badges === */
.type-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    background: #e8e8e8;
    color: #555;
}
.type-town_centre { background: #e3f2fd; color: #1565c0; }
.type-railway_station { background: #f3e5f5; color: #7b1fa2; }
.type-hospital { background: #fce4ec; color: #c62828; }
.type-supermarket { background: #e8f5e9; color: #2e7d32; }
.type-park_and_ride { background: #fff3e0; color: #e65100; }
.type-retail_park { background: #fff8e1; color: #f57f17; }
.type-leisure_tourist { background: #e0f7fa; color: #00838f; }
.type-generic { background: #f5f5f5; color: #616161; }

/* === Availability Card (hero) === */
.availability-card {
    padding: 1.25rem;
    background: #fff;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    margin-bottom: 1rem;
}
.avail-loading { color: #999; font-size: 0.9rem; }

.avail-border-very_likely { border-color: #2e7d32; }
.avail-border-likely { border-color: #66bb6a; }
.avail-border-possible { border-color: #f57f17; }
.avail-border-unlikely { border-color: #e74c3c; }
.avail-border-very_unlikely { border-color: #7f1d1d; }
.avail-border-full { border-color: #1a1a1a; }

.avail-headline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}
.avail-label { font-size: 1.15rem; font-weight: 700; flex: 1; }
.avail-pct { font-size: 0.85rem; color: #666; white-space: nowrap; }

.avail-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}
.avail-dot.avail-very_likely { background: #2e7d32; }
.avail-dot.avail-likely { background: #66bb6a; }
.avail-dot.avail-possible { background: #f57f17; }
.avail-dot.avail-unlikely { background: #e74c3c; }
.avail-dot.avail-very_unlikely { background: #7f1d1d; }
.avail-dot.avail-full { background: #1a1a1a; }

.avail-numbers {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.85rem;
}
.avail-stat { display: flex; flex-direction: column; }
.avail-stat-primary .avail-stat-value { font-size: 1.5rem; }
.avail-stat-value { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.avail-stat-label { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 0.04em; }

.avail-bar-wrap {
    height: 6px;
    background: #d4edda;
    border-radius: 3px;
    overflow: hidden;
}
.avail-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.avail-bg-very_likely { background: #2e7d32; }
.avail-bg-likely { background: #66bb6a; }
.avail-bg-possible { background: #f57f17; }
.avail-bg-unlikely { background: #e74c3c; }
.avail-bg-very_unlikely { background: #7f1d1d; }
.avail-bg-full { background: #1a1a1a; }

/* === Times Bar (compact) === */
.times-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 1.25rem;
}

/* === Map === */
#carpark-map {
    height: 300px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 1.5rem;
    z-index: 0;
}

/* === Busyness Heatmap === */
.busyness-section { margin-bottom: 1.5rem; position: relative; }
.busyness-section h2 { margin-bottom: 0.75rem; font-size: 1.1rem; }

.heatmap-wrapper { overflow-x: auto; }

.heatmap-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.7rem;
    min-width: 600px;
}
.heatmap-table th, .heatmap-table td {
    padding: 0.35rem 0.25rem;
    text-align: center;
    border: 1px solid #f0f0f0;
}
.heatmap-table th { font-weight: 600; background: #fafafa; white-space: nowrap; font-size: 0.65rem; }
.heatmap-table .day-label { text-align: left; font-weight: 600; min-width: 2.5rem; }

.heatmap-cell { border-radius: 2px; cursor: default; }
.heatmap-cell.now-cell { outline: 2px solid #1a1a1a; outline-offset: -1px; }

/* Busyness colours (green = many free, red = few free) */
.busy-0  { background: #f0f4f0; }
.busy-10 { background: #d4edda; }
.busy-20 { background: #b8e0c0; }
.busy-30 { background: #a3d4a8; }
.busy-40 { background: #fff3cd; }
.busy-50 { background: #ffe69c; }
.busy-60 { background: #ffd966; }
.busy-70 { background: #ffb347; }
.busy-80 { background: #ff8c42; }
.busy-90 { background: #e74c3c; color: #fff; }
.busy-100 { background: #c0392b; color: #fff; }

/* Heatmap floating tooltip */
.heatmap-tooltip {
    position: absolute;
    background: #1a1a1a;
    color: #fff;
    padding: 0.4rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    line-height: 1.4;
    pointer-events: none;
    transform: translate(-50%, -100%);
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.heatmap-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a1a;
}

.heatmap-caption { font-size: 0.75rem; color: #999; margin-top: 0.5rem; }

/* === About Section (SEO content) === */
.about-section {
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 1.5rem;
}
.about-section h2, .about-section h3 { margin: 0.75rem 0 0.5rem; }
.about-section p { margin-bottom: 0.5rem; }

/* === Nearby === */
.nearby-section { margin-bottom: 1.5rem; }
.nearby-section h2 { margin-bottom: 0.75rem; }
.nearby-list { display: flex; flex-direction: column; gap: 0.5rem; }
.nearby-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    color: #1a1a1a;
}
.nearby-card:hover { border-color: #0066cc; text-decoration: none; }
.nearby-name { font-weight: 600; }
.nearby-distance { font-size: 0.85rem; color: #666; }

/* === Town Page: Car Park List === */
.carpark-list { margin-bottom: 1.5rem; }
.carpark-list h2 { margin-bottom: 0.75rem; }
.carpark-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}
.carpark-card:hover { border-color: #0066cc; text-decoration: none; }
.card-main h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.card-meta { display: flex; gap: 0.75rem; font-size: 0.85rem; color: #666; align-items: center; }

/* === Availability Badges (town index) === */
.avail-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.avail-badge:empty { display: none; }
.avail-badge.avail-very_likely { background: #d4edda; color: #155724; }
.avail-badge.avail-likely { background: #d4edda; color: #1b5e20; }
.avail-badge.avail-possible { background: #fff3cd; color: #856404; }
.avail-badge.avail-unlikely { background: #f8d7da; color: #721c24; }
.avail-badge.avail-very_unlikely { background: #f8d7da; color: #4a0e0e; }
.avail-badge.avail-full { background: #1a1a1a; color: #fff; }

/* === Homepage === */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}
.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: #555;
    max-width: 540px;
    margin: 0 auto 1.5rem;
}
.hero-cta {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background: #0a2540;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
}
.hero-cta:hover { background: #163a5c; text-decoration: none; }

.home-section { margin-bottom: 2rem; }
.home-section h2 { margin-bottom: 1rem; font-size: 1.25rem; }

.features { display: flex; flex-direction: column; gap: 1rem; }
.feature {
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}
.feature strong { display: block; margin-bottom: 0.25rem; }
.feature p { color: #555; font-size: 0.9rem; margin: 0; }

/* === Responsive === */
@media (max-width: 600px) {
    .page-header h1 { font-size: 1.35rem; }
    .avail-numbers { gap: 1rem; }
    .avail-stat-primary .avail-stat-value { font-size: 1.25rem; }
    .carpark-card { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}
