/* Shared reset + index page styles only. Draw page uses draw.css. */

:root {
  --slam-color: #1a5c38;
  --bg: #f7f6f2;
  --text: #1a1a1a;
  --text-muted: #777;
  --border: #e0ddd6;
  --shadow-hover: 0 3px 12px rgba(0,0,0,0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── Page inner (max-width container) ── */
.page-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ── Index page ── */

.site-header {
  background: linear-gradient(to right, #0057a8, #b94c11, #1a5c38, #002868);
  color: white;
  border-bottom: 3px solid rgba(0,0,0,0.15);
}

.site-header .page-inner {
  padding: 20px 28px 16px;
}

.site-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.site-header p {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 2px;
}

.filter-bar {
  border-bottom: 1px solid var(--border);
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.filter-bar .page-inner {
  display: flex;
  gap: 8px;
  padding: 16px 28px;
  flex-wrap: wrap;
}

.tour-toggle {
  display: flex;
  border: 2px solid #003D7A;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.tour-toggle[data-active="wta"] { border-color: #2D0046; }

.tour-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  white-space: nowrap;
}

.tour-btn + .tour-btn {
  border-left: 1.5px solid #d0ccc5;
}

.tour-btn[data-tour="atp"].active {
  background: #003D7A;
  color: white;
  cursor: default;
}

.tour-btn[data-tour="wta"].active {
  background: #2D0046;
  color: white;
  cursor: default;
}

.tour-btn:not(.active):hover {
  background: #f0ede8;
  color: #333;
}
.tour-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.filter-sep {
  width: 1px;
  background: #e0ddd6;
  align-self: stretch;
  margin: 2px 4px;
  flex-shrink: 0;
}

.filter-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.filter-select-label {
  font-size: 12px;
  font-weight: 600;
  color: #999;
}

.filter-select {
  border: 2px solid #d0ccc5;
  border-radius: 20px;
  background: white;
  color: #444;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.filter-select:hover  { border-color: #999; }
.filter-select:focus  { border-color: #555; }
.filter-select:focus-visible { outline: 2px solid #555; outline-offset: 2px; }

.grid-wrap {
  overflow-x: auto;
}

.grid-wrap .page-inner {
  padding: 20px 28px 40px;
}

/* Draws table (all-slams view) */
.draws-table {
  width: 100%;
  border-collapse: collapse;
}

.draws-table thead th {
  text-align: left;
  padding: 0 20px 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
}
.draws-table thead th:first-child {
  padding-left: 0;
  width: 56px;
  color: transparent;
}

.draws-table tbody tr {
  border-bottom: 1px solid #eceae5;
  transition: background 0.1s;
}
.draws-table tbody tr:hover { background: white; }
.draws-table tbody tr:last-child { border-bottom: none; }

.draws-table td { padding: 10px 20px; font-size: 13.5px; }

.draws-year {
  font-size: 12px;
  font-weight: 700;
  color: #bbb;
  padding-left: 0 !important;
}

.draws-champion {
  font-weight: 600;
  white-space: nowrap;
}

.draws-champion-line {
  cursor: pointer;
  display: inline;
  color: inherit;
  text-decoration: none;
}
.draws-champion-line:hover { text-decoration: underline; }
.draws-champion-line:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }

.draws-multi-sep {
  display: block;
  height: 1px;
  background: currentColor;
  opacity: 0.12;
  margin: 5px 0;
}

.draws-slam-seq {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.72;
  margin-left: 4px;
}

.draws-career-slam {
  font-size: 11px;
  margin-left: 8px;
  opacity: 0.8;
  cursor: default;
}

.grid-legend {
  display: flex;
  gap: 16px;
  padding: 10px 0 20px;
  font-size: 12px;
  color: #999;
}

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

.draws-cancelled {
  color: #bbb;
  font-size: 12px;
  font-style: italic;
  cursor: default;
}

.draws-empty { color: #ddd; }


/* Loading / error */
.loading-msg {
  padding: 60px 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

.error-msg {
  padding: 60px 28px;
  text-align: center;
  color: #c0392b;
  font-size: 15px;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.site-footer .page-inner {
  padding: 18px 28px;
  font-size: 12px;
  color: #aaa;
}

.site-footer a {
  color: #888;
  text-decoration: none;
}
.site-footer a:hover { color: #555; text-decoration: underline; }

/* ── Mobile ── */
@media (max-width: 600px) {
  .site-header h1     { font-size: 18px; }
  .site-header .page-inner { padding: 14px 16px 12px; }

  .filter-bar .page-inner { padding: 10px 14px; gap: 8px; }
  .tour-btn           { padding: 4px 11px; font-size: 11px; }
  .filter-select      { font-size: 12px; padding: 3px 8px; }
  .filter-select-label { font-size: 11px; }

  .grid-wrap .page-inner  { padding: 12px 12px 32px; overflow-x: auto; }

  /* Draws table */
  .draws-table thead th { padding: 0 8px 10px; font-size: 9.5px; }
  .draws-table thead th:first-child { width: 36px; }
  .draws-table td       { padding: 7px 8px; font-size: 11px; }
  .draws-year           { font-size: 10px; }

}
