/* style.css — Callejear.at
   Clean, minimal design. Dark-neutral palette.
   Mobile-first responsive. */

:root {
  --bg: #fafafa;
  --bg-card: #fff;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e0e0e0;
  --accent: #c62828;
  --accent-light: #ef5350;
  --link: #1565c0;
  --link-hover: #0d47a1;
  --score-excellent: #2e7d32;
  --score-good: #558b2f;
  --score-average: #f9a825;
  --score-poor: #c62828;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.logo span { color: var(--accent); }
.main-nav { display: flex; align-items: center; gap: 4px; position: relative; }
.main-nav a { color: var(--text-muted); margin-left: 12px; font-size: 0.9rem; }
.nav-toggle {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 12px; font-size: 0.85rem; color: var(--text-muted); cursor: pointer;
  margin-left: 12px;
}
.nav-toggle:hover { background: #f5f5f5; color: var(--text); }
.nav-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1); padding: 8px 0; z-index: 200;
  min-width: 200px; margin-top: 4px;
}
.nav-dropdown a {
  display: block; padding: 6px 16px; margin: 0; font-size: 0.85rem;
  color: var(--text); white-space: nowrap;
}
.nav-dropdown a:hover { background: #f5f5f5; text-decoration: none; }
.nav-toggle[aria-expanded="true"] + .nav-dropdown { display: block; }

/* Breadcrumb */
.breadcrumb { padding: 12px 0; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li:not(:last-child)::after { content: '›'; margin-left: 4px; }

/* Hero */
.hero { padding: 24px 0 16px; }
.hero h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.hero-subtitle { color: var(--text-muted); font-size: 1.05rem; }
.hero-plz { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: #f0f0f0;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text);
}
.hero-home h1 { font-size: 2.2rem; }

/* Metrics strip */
.metrics-strip {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.metric { text-align: center; flex: 1; min-width: 100px; }
.metric-value { display: block; font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.metric-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Map */
.map-section { margin-bottom: 20px; }
.leaflet-map { height: 350px; border-radius: var(--radius); border: 1px solid var(--border); }
.poi-marker { background: none; border: none; }

/* Content grid (main + sidebar) */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin-bottom: 40px;
}
@media (max-width: 768px) {
  .content-grid { grid-template-columns: 1fr; }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.2rem; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.card h3 { font-size: 1rem; margin: 12px 0 8px; }
.interpretation { color: var(--primary); font-size: 1.05rem; margin-bottom: 12px; line-height: 1.5; }
.sidebar-card { padding: 16px; }
.sidebar-card h3 { font-size: 0.95rem; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table td, .data-table th { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table td:last-child, .data-table th:last-child { text-align: right; }
.data-source { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }
.sidebar-table { width: 100%; }
.sidebar-table td { padding: 4px 0; font-size: 0.85rem; border-bottom: 1px solid #f0f0f0; }
.sidebar-table td:last-child { text-align: right; font-weight: 600; }

/* POI grid */
.poi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.poi-item { padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }
.poi-count { font-weight: 700; color: var(--accent); margin-right: 4px; }
.poi-item small { color: var(--text-muted); display: block; font-size: 0.8rem; }

/* Score circles */
.score-grid { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.score-item { text-align: center; }
.score-circle {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; color: #fff;
  margin: 0 auto 4px;
}
.score-circle.excellent { background: var(--score-excellent); }
.score-circle.good { background: var(--score-good); }
.score-circle.average { background: var(--score-average); color: #333; }
.score-circle.poor { background: var(--score-poor); }
.score-item span { font-size: 0.75rem; color: var(--text-muted); }

/* Age bar */
.age-bar { display: flex; height: 28px; border-radius: var(--radius); overflow: hidden; margin-top: 8px; }
.age-segment { display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #fff; }
.age-young { background: #42a5f5; }
.age-adult { background: #66bb6a; }
.age-senior { background: #ffa726; }

/* Lists */
.street-list { list-style: none; columns: 2; column-gap: 16px; }
.street-list li { padding: 3px 0; font-size: 0.9rem; break-inside: avoid; }
.nearby-list { list-style: none; }
.nearby-list li { padding: 4px 0; font-size: 0.85rem; border-bottom: 1px solid #f5f5f5; }
.nearby-list small, .nearby-meta { color: var(--text-muted); font-size: 0.8rem; display: block; }
.gemeinde-list, .bezirk-list { list-style: none; }
.gemeinde-list li, .bezirk-list li { padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.bezirk-type { font-size: 0.8rem; color: var(--text-muted); }
.transit-list { list-style: none; }
.transit-list li { padding: 4px 0; font-size: 0.9rem; }
.stop-type { font-size: 0.8rem; color: var(--text-muted); }

/* FAQ */
.faq-section details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq-section summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.faq-section details p { margin-top: 8px; font-size: 0.9rem; color: var(--text-muted); }

/* Bundesland grid (home) */
.bundesland-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.bundesland-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.2s;
}
.bundesland-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); text-decoration: none; }
.bundesland-card h3 { color: var(--text); margin-bottom: 4px; }
.bundesland-card p { font-size: 0.85rem; color: var(--text-muted); margin: 2px 0; }
.bundesland-capital { font-weight: 600; }

/* Infrastructure tags */
.infra-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.infra-tag {
  display: inline-block;
  padding: 3px 10px;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #2e7d32;
  font-weight: 500;
}

/* Straßen-Score Section */
.strassen-score-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.score-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  justify-content: space-between;
}
.score-hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.score-hero-right {
  flex-shrink: 0;
}
.radar-chart {
  width: 180px;
  height: 180px;
}
.score-big-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.score-big-circle.excellent { background: var(--score-excellent); }
.score-big-circle.good { background: var(--score-good); }
.score-big-circle.average { background: var(--score-average); color: #333; }
.score-big-circle.poor { background: var(--score-poor); }
.score-big-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.score-big-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.9; }
.score-context p { margin: 4px 0; font-size: 0.9rem; color: var(--text-muted); }
.score-percentile strong { color: var(--text); }

/* Score Breakdown */
.score-breakdown h3 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}
.breakdown-row { margin-bottom: 10px; }
.breakdown-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.breakdown-name { font-weight: 600; font-size: 0.85rem; }
.breakdown-weight { font-size: 0.75rem; color: var(--text-muted); }
.breakdown-bar-bg {
  height: 8px; background: #f0f0f0;
  border-radius: 4px; overflow: hidden;
}
.breakdown-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.breakdown-bar.excellent { background: var(--score-excellent); }
.breakdown-bar.good { background: var(--score-good); }
.breakdown-bar.average { background: var(--score-average); }
.breakdown-bar.poor { background: var(--score-poor); }
.breakdown-footer { display: flex; justify-content: space-between; margin-top: 2px; }
.breakdown-desc { font-size: 0.75rem; color: var(--text-muted); }
.breakdown-score { font-size: 0.75rem; font-weight: 600; }

/* Profile Ratings */
.profiles-intro { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 16px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.profile-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.profile-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.profile-icon { font-size: 1.2rem; }
.profile-label { font-weight: 600; font-size: 0.85rem; }
.profile-bar-bg {
  height: 6px; background: #f0f0f0;
  border-radius: 3px; overflow: hidden;
  margin-bottom: 4px;
}
.profile-bar {
  height: 100%;
  border-radius: 3px;
}
.profile-bar.excellent { background: var(--score-excellent); }
.profile-bar.good { background: var(--score-good); }
.profile-bar.average { background: var(--score-average); }
.profile-bar.poor { background: var(--score-poor); }
.profile-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.profile-score { font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.profile-reasons { list-style: none; padding: 0; margin: 0; text-align: right; }
.profile-reasons li { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

/* Walking Times */
.walking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.walking-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.walking-label { color: var(--text); }
.walking-time { font-weight: 600; color: var(--accent); white-space: nowrap; }
.walking-time small { font-weight: 400; color: var(--text-muted); }

/* Comparison Table */
.comparison-table { width: 100%; border-collapse: collapse; }
.comparison-table th, .comparison-table td {
  padding: 8px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.comparison-table th { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.comparison-table td:last-child, .comparison-table th:last-child { text-align: center; }
.comparison-current { background: #f5f5f5; }
.comparison-score {
  display: inline-block;
  width: 32px; height: 32px;
  border-radius: 50%;
  line-height: 32px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}
.comparison-score.excellent { background: var(--score-excellent); }
.comparison-score.good { background: var(--score-good); }
.comparison-score.average { background: var(--score-average); color: #333; }
.comparison-score.poor { background: var(--score-poor); }

/* Entity summary (GEO/AI Overview) */
.entity-summary {
  font-size: 1rem; line-height: 1.6; color: var(--text);
  padding: 16px 20px; margin-bottom: 16px;
  background: #f8f9fa; border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* CTA to Gemeinde */
.cta-gemeinde { margin: 20px 0 8px; text-align: center; }

/* Buttons */
.btn-primary {
  display: inline-block; padding: 12px 28px; background: var(--accent); color: #fff;
  border-radius: var(--radius); text-decoration: none; font-weight: 600;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-light); color: #fff; text-decoration: none; }

/* Footer */
.site-footer {
  background: #1a1a1a;
  color: #ccc;
  padding: 40px 0 20px;
  margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.footer-heading { color: #fff; margin-bottom: 8px; font-size: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { padding: 2px 0; }
.footer-col a { color: #aaa; font-size: 0.85rem; }
.footer-col a:hover { color: #fff; }
.attribution { font-size: 0.75rem; color: #888; }
.footer-bottom { text-align: center; padding-top: 20px; margin-top: 20px; border-top: 1px solid #333; font-size: 0.8rem; }
.footer-links { margin-top: 8px; }
.footer-links a { color: #aaa; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* Static pages (Impressum, Methodik) */
.page-static .card { max-width: 800px; }
.page-static h2 { margin-top: 28px; }
.page-static ul { padding-left: 20px; line-height: 1.8; }
.page-static p { line-height: 1.7; }

@media (max-width: 768px) {
  .hero h1 { font-size: 1.4rem; }
  .hero-home h1 { font-size: 1.6rem; }
  .street-list { columns: 1; }
  .metrics-strip { flex-direction: column; gap: 8px; }
  .leaflet-map { height: 250px; }
  .score-hero { flex-direction: column; text-align: center; }
  .score-hero-left { flex-direction: column; }
  .radar-chart { width: 150px; height: 150px; }
  .profile-grid { grid-template-columns: 1fr; }
  .walking-grid { grid-template-columns: 1fr; }
  /* T7: Sidebar above main on mobile — nearby streets are a discovery signal */
  .content-grid { display: flex; flex-direction: column; }
  .sidebar { order: -1; }
  .nav-dropdown { left: 0; right: auto; }
}

/* Cookie consent banner */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: #1a1a1a; color: #e0e0e0; border-top: 2px solid var(--accent);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.cookie-banner-inner {
  max-width: 900px; margin: 0 auto; padding: 16px 20px;
}
.cookie-banner-inner p { margin: 0 0 8px; font-size: 0.9rem; line-height: 1.5; }
.cookie-banner-links { font-size: 0.8rem; }
.cookie-banner-links a { color: var(--accent); text-decoration: underline; }
.cookie-banner-buttons { display: flex; gap: 10px; margin-top: 12px; }
.btn-cookie {
  padding: 10px 20px; border: none; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.btn-cookie-accept { background: var(--accent); color: #fff; }
.btn-cookie-accept:hover { opacity: 0.9; }
.btn-cookie-reject { background: #333; color: #ccc; border: 1px solid #555; }
.btn-cookie-reject:hover { background: #444; }
@media (max-width: 768px) {
  .cookie-banner-buttons { flex-direction: column; }
  .btn-cookie { width: 100%; text-align: center; }
}

/* Print styles */
@media print {
  .site-header, .site-footer, .nav-toggle, .nav-dropdown,
  .sidebar, .cta-gemeinde, .leaflet-map, .map-section,
  .hero-tags, .infra-tags { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .container { max-width: 100%; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
  .score-big-circle { border: 2px solid #000; }
  .breakdown-bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
