/* FiveThirtyEight-inspired styling for World Cup ELO blog series */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #fff;
  color: #222;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Site Header */
.site-header {
  border-bottom: 1px solid #e5e5e5;
  padding: 16px 0;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: #222;
  text-decoration: none;
}

.site-logo:hover {
  text-decoration: none;
}

/* Navigation */
.site-nav {
  border-bottom: 1px solid #e5e5e5;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 32px;
}

.nav-inner a {
  font-size: 14px;
  color: #222;
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.nav-inner a:hover {
  text-decoration: none;
  border-bottom-color: #222;
}

.nav-inner a.active {
  border-bottom-color: #ed1c24;
}

/* Article container */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Site Footer */
.site-footer {
  border-top: 1px solid #e5e5e5;
  padding: 30px 20px;
  text-align: center;
  background: #fff;
}

.site-footer p {
  font-size: 13px;
  color: #999;
  margin: 0;
}

/* Header styling */
.header {
  margin-bottom: 30px;
}

.kicker {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #e74c3c;
  margin-bottom: 8px;
}

h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px 0;
  color: #222;
}

.subtitle {
  font-size: 18px;
  color: #666;
  margin-bottom: 20px;
}

.byline {
  font-size: 13px;
  color: #999;
  border-top: 1px solid #ddd;
  padding-top: 12px;
}

/* Prose sections for narrative content */
.prose {
  margin: 40px 0;
  font-size: 17px;
  line-height: 1.8;
  color: #333;
}

.prose p {
  margin-bottom: 16px;
}

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

.prose .lead {
  font-size: 19px;
  color: #222;
  font-weight: 400;
}

.prose strong {
  color: #222;
  font-weight: 600;
}

.prose em {
  font-style: italic;
  color: #555;
}

/* Chart container */
.chart-container {
  background: #fff;
  border-radius: 4px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.chart-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 5px;
  color: #222;
}

.chart-subtitle {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

/* Legend */
.legend {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  font-size: 13px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

.legend-color.brazil {
  background-color: #009c3b;
}

.legend-color.germany {
  background-color: #222;
}

/* Team selector */
.team-selector {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.team-selector label {
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.team-selector select {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.team-selector select:focus {
  outline: none;
  border-color: #e74c3c;
}

/* Footer text */
.footer-text {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.footer-text h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-text p {
  font-size: 15px;
  color: #444;
  margin-bottom: 16px;
}

.methodology {
  font-size: 13px;
  color: #888;
  font-style: italic;
}

/* Era toggle buttons */
.era-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.era-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid #ddd;
  background: #fff;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.era-btn:hover {
  border-color: #999;
}

.era-btn.active {
  background: #222;
  color: #fff;
  border-color: #222;
}

/* Analysis summary boxes */
.analysis-summary {
  margin-top: 24px;
  padding: 20px;
  background: #f7f7f7;
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.7;
}

.analysis-summary .stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.analysis-summary .stat-box {
  text-align: center;
  padding: 12px;
  background: #fff;
  border-radius: 4px;
}

.analysis-summary .stat-value {
  font-size: 28px;
  font-weight: 900;
  color: #222;
}

.analysis-summary .stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analysis-summary .insight {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  color: #555;
}

/* Viz tabs for alternative views */
.viz-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.viz-tab:hover {
  border-color: #999;
  background: #f7f7f7;
}

.viz-tab.active {
  background: #222;
  color: #fff;
  border-color: #222;
}

/* Your Team's Chances section */
.team-picker {
  margin-bottom: 20px;
}

.team-picker select {
  width: 100%;
  max-width: 280px;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.team-picker select:focus {
  outline: none;
  border-color: #222;
}

.team-result.hidden {
  display: none;
}

.team-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e5e5;
}

.team-flag {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.team-header h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.team-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.team-stat {
  text-align: center;
  padding: 14px 10px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
}

.team-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #222;
}

.team-stat-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.verdict-box {
  padding: 16px 0 0;
  border-top: 1px solid #e5e5e5;
}

.verdict-emoji {
  display: none;
}

.verdict-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
}

.verdict-text {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-inner {
    gap: 20px;
    overflow-x: auto;
  }

  .nav-inner a {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 28px 12px;
  }

  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 16px;
  }

  .prose {
    margin: 30px 0;
    font-size: 16px;
    line-height: 1.7;
  }

  .prose .lead {
    font-size: 17px;
  }

  .chart-container {
    padding: 18px 12px;
    margin: 24px 0;
  }

  .chart-title {
    font-size: 17px;
  }

  .chart-subtitle {
    font-size: 13px;
  }

  .legend {
    gap: 10px 16px;
    flex-wrap: wrap;
  }

  .team-selector {
    gap: 12px;
  }

  .team-selector > div,
  .team-selector select,
  .team-picker select {
    width: 100%;
    max-width: none;
  }

  .era-toggle {
    overflow-x: visible;
    padding-bottom: 2px;
    flex-wrap: wrap;
  }

  .analysis-summary .stat-grid {
    grid-template-columns: 1fr;
  }

  .team-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-stat-value {
    font-size: 24px;
  }

  .team-header h3 {
    font-size: 22px;
  }
}
