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

:root {
  --white: #ffffff;
  --black: #0F172A;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --blue: #2563EB;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
  z-index: 100;
  padding: 16px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
  background: var(--black);
  color: var(--white);
  padding: 5px 9px;
}

.site-nav { display: flex; gap: 32px; }

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active { color: var(--black); }

/* === SECTION LABELS === */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gray-400);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

/* === HERO === */
.hero {
  padding: 80px 0 64px;
  border-bottom: 1px solid var(--gray-200);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 80px;
  align-items: start;
}

.hero-title {
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-subline {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.4;
}

.hero-body {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.75;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--gray-200);
}

.stat-number {
  display: block;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* === LEADERBOARD === */
.leaderboard {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 24px;
  position: sticky;
  top: 80px;
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
  transition: opacity 0.15s;
}

.lb-item:last-child { border-bottom: none; }
.lb-item:hover { opacity: 0.7; }

.lb-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  min-width: 20px;
  font-variant-numeric: tabular-nums;
}

.lb-info { flex: 1; min-width: 0; }

.lb-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-canton { font-size: 11px; color: var(--gray-400); }

.lb-score {
  font-size: 18px;
  font-weight: 900;
  color: var(--blue);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.view-all-link {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

.view-all-link:hover { text-decoration: underline; }

/* === CONTENT SECTIONS === */
.content-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--gray-200);
}

.bg-light { background: var(--gray-50); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.two-col h2 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.two-col p {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.75;
}

.section-intro {
  font-size: 16px;
  color: var(--gray-600);
  max-width: 640px;
  margin-bottom: 48px;
  line-height: 1.75;
}

/* === RANKING SECTION === */
.ranking-section { padding: 80px 0; }

.ranking-section h2 {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.ranking-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 0;
  padding: 20px 0;
  border-top: 2px solid var(--black);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
  margin-top: 32px;
}

.tab-bar { display: flex; }

.tab-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
  font-family: var(--font);
}

.tab-btn:first-child { border-right: none; }

.tab-btn.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.tab-btn:hover:not(.active) {
  background: var(--gray-100);
  color: var(--black);
}

.filters { display: flex; gap: 12px; align-items: center; }

#search-input,
#canton-filter {
  padding: 8px 14px;
  font-size: 14px;
  font-family: var(--font);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}

#search-input:focus,
#canton-filter:focus { border-color: var(--black); }

#search-input { min-width: 220px; }
#canton-filter { min-width: 140px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }


.tab-content { display: none; }
.tab-content.active { display: block; }

/* === PLACE CARDS === */
#places-list { border-top: 1px solid var(--gray-200); }

.place-card {
  border-bottom: 1px solid var(--gray-200);
  transition: background 0.1s;
}

.place-card:hover { background: var(--gray-50); }
.place-card.expanded { background: var(--gray-50); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  cursor: pointer;
  gap: 16px;
  user-select: none;
}

.card-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-400);
  min-width: 28px;
  font-variant-numeric: tabular-nums;
}

.place-name {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.place-meta {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
  margin-top: 2px;
}

.card-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.total-score {
  font-size: 30px;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: right;
  line-height: 1;
}

.expand-icon {
  font-size: 22px;
  font-weight: 300;
  color: var(--gray-400);
  width: 20px;
  text-align: center;
  line-height: 1;
}

/* === COLLAPSED CARD BARS === */
.card-bars {
  padding: 0 0 14px 48px;
  display: grid;
  gap: 7px;
  cursor: pointer;
}

/* === SCORE BARS === */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 90px;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  max-width: 200px;
}

.bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
}

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  min-width: 24px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* === CARD DETAIL === */
.card-detail {
  margin: 0 0 24px 48px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  overflow: hidden;
}

.detail-loading {
  padding: 32px;
  color: var(--gray-400);
  font-size: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: stretch;
}

.detail-map-col {
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
}
.mini-map { flex: 1; min-height: 240px; width: 100%; }

.detail-info-col { padding: 24px 28px; }

.detail-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.metric-item { display: flex; flex-direction: column; gap: 3px; }
.metric-item--wide { grid-column: 1 / -1; }

.metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}

.metric-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--black);
  font-variant-numeric: tabular-nums;
}

.metric-value--highlights {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.detail-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

.btn-primary,
.btn-secondary {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
  font-family: var(--font);
}

.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: #1E293B; }
.btn-secondary { background: var(--white); color: var(--black); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-100); }

/* === MAP TAB === */
#map {
  height: 580px;
  width: 100%;
  border: 1px solid var(--gray-200);
  margin-top: 24px;
}

.map-score-control {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(15,23,42,0.10);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
  font-family: var(--font);
}
.map-score-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  letter-spacing: 0.02em;
}
.map-score-slider {
  width: 100%;
  accent-color: var(--black);
  cursor: pointer;
  height: 4px;
}

.leaflet-popup-content strong { display: block; font-size: 14px; margin-bottom: 2px; }
.leaflet-popup-content .popup-canton { font-size: 11px; color: var(--gray-400); display: block; }
.leaflet-popup-content .popup-score { font-size: 26px; font-weight: 900; color: var(--blue); margin: 6px 0 4px; display: block; font-variant-numeric: tabular-nums; }
.leaflet-popup-content .popup-link { font-size: 12px; color: var(--blue); text-decoration: none; font-weight: 600; }

.seasonality-label {
  display: block;
  margin-bottom: 8px;
}

/* === SEASONALITY WIDGET === */
.seasonality-widget {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.sbar-month-label {
  font-size: 6.5px;
  font-weight: 500;
  fill: var(--gray-400);
  opacity: 0.6;
  font-family: inherit;
}

/* === METHODOLOGY (about page) === */
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--gray-200);
  margin-top: 48px;
  border: 1px solid var(--gray-200);
}

.method-card { background: var(--white); padding: 32px 24px; }

.method-weight {
  font-size: 38px;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1;
}

.method-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.method-card p { font-size: 14px; color: var(--gray-600); line-height: 1.65; }

/* === SOURCES (about page) === */
.sources-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
  margin-top: 48px;
}

.source-item strong { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.source-item p { font-size: 14px; color: var(--gray-600); line-height: 1.65; }

.content-block { max-width: 680px; }
.content-block p { font-size: 16px; color: var(--gray-600); margin-bottom: 16px; line-height: 1.75; }

/* === FOOTER === */
.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  margin-top: 80px;
}

.footer-inner { display: flex; flex-direction: column; gap: 10px; }
.site-footer p { font-size: 14px; color: var(--gray-600); }
.site-footer a { color: var(--black); font-weight: 600; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-note { font-size: 12px; color: var(--gray-400); }
.footer-nav { display: flex; gap: 24px; margin-top: 8px; }
.footer-nav a { font-size: 13px; color: var(--gray-500); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { color: var(--black); }

.no-results { padding: 48px 0; color: var(--gray-400); font-size: 15px; }

/* === PAGE HERO (inner pages) === */
.page-hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--gray-200);
}

.page-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 20px;
}

/* === TEXT LINK === */
.text-link {
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
}

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


/* === FEEDBACK LINKS === */
.feedback-links {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* === READ MORE STRIP === */
.read-more-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.read-more-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  margin-top: 28px;
}

.read-more-card {
  background: var(--white);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.read-more-card h3 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--black);
  letter-spacing: -0.01em;
}

.read-more-card p {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.6;
  flex: 1;
}

.card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
  margin-top: 4px;
}

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

/* === RESPONSIVE === */
@media (max-width: 960px) {
  .hero-layout { grid-template-columns: 1fr; gap: 0; }
  .hero-right { display: none; }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .methodology-grid { grid-template-columns: 1fr 1fr; }
  .sources-list { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-map-col { border-right: none; border-bottom: 1px solid var(--gray-200); }
  .read-more-grid { grid-template-columns: 1fr 1fr; }
}

/* === FAQ TEASER (homepage) === */
.faq-teaser-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--gray-200);
}

.faq-teaser-heading {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.faq-teaser-intro {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 36px;
  line-height: 1.75;
}

.faq-teaser-cta {
  display: inline-block;
  margin-top: 28px;
}

/* === FAQ ACCORDION (shared: homepage teaser + faq page) === */
.faq-list,
.faq-group {
  border-top: 1px solid var(--gray-200);
}

.faq-item {
  border-bottom: 1px solid var(--gray-200);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 18px 0;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  cursor: pointer;
  gap: 16px;
  line-height: 1.4;
  transition: color 0.15s;
}

.faq-question:hover { color: var(--blue); }

.faq-question:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--gray-400);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.15s, transform 0.2s;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: var(--gray-500);
  border-radius: 1px;
  transition: opacity 0.2s, transform 0.2s;
}

/* horizontal bar */
.faq-icon::before {
  width: 8px; height: 1.5px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* vertical bar */
.faq-icon::after {
  width: 1.5px; height: 8px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.faq-question[aria-expanded="true"] .faq-icon::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq-question[aria-expanded="true"] .faq-icon {
  border-color: var(--black);
}

.faq-answer {
  padding: 0 0 20px;
  max-width: 680px;
}

.faq-answer p {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.75;
  margin-bottom: 12px;
}

.faq-answer p:last-child { margin-bottom: 0; }

/* === FAQ PAGE LAYOUT === */
.faq-page-layout {
  max-width: 720px;
}

.faq-group {
  margin-bottom: 0;
}

.faq-group-heading {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  padding: 40px 0 4px;
}

/* === FAQ PAGE CLOSING CTA === */
.faq-cta-heading {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  margin-top: 12px;
}

.faq-cta-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
}

.faq-cta-card {
  background: var(--white);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  transition: background 0.1s;
}

.faq-cta-card:hover { background: var(--gray-100); }

.faq-cta-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
}

.faq-cta-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

@media (max-width: 960px) {
  .faq-cta-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .faq-teaser-section { padding: 48px 0; }
  .faq-cta-grid { grid-template-columns: 1fr; }
  .faq-group-heading { padding-top: 28px; }
  .ranking-controls { flex-direction: column; align-items: stretch; }
  .filters { flex-direction: column; }
  #search-input { min-width: unset; width: 100%; }
  #canton-filter { width: 100%; }
  .methodology-grid { grid-template-columns: 1fr; }
  .detail-metrics { grid-template-columns: 1fr; }
  .place-name { font-size: 16px; }
  .total-score { font-size: 24px; }
  .card-detail { margin-left: 0; }
  .detail-actions { flex-direction: column; }
  .hero { padding: 48px 0 40px; }
  .ranking-section, .content-section { padding: 48px 0; }
  .seasonality-widget { width: 100%; }
  .read-more-grid { grid-template-columns: 1fr; }
  .feedback-links { flex-direction: column; }
}
