/*
 * Tin Cup League - global palette and styling.
 * Loaded after pico.min.css. Change the --tc-* values in :root to re-theme the whole site.
 * Style reference: McMaster-Carr (white page, dark-grey text, green headings, blue links,
 * yellow header rule, thin grey borders, almost no rounding or shadows).
 * Mobile first: base rules are for phones; larger screens are enhanced with min-width queries.
 */

/* ---------- 1. Palette and tokens (edit here) ---------- */
:root {
  --tc-green: #336633;
  --tc-green-dark: #264d26;
  --tc-link: #006699;
  --tc-link-hover: #004466;
  --tc-yellow: #fed700;
  --tc-tee-middle: #f0d060;
  --tc-tee-senior: #e09a3e;
  --tc-text: #333333;
  --tc-text-muted: #666666;
  --tc-border: #c4c4c4;
  --tc-border-light: #dddddd;
  --tc-panel: #efefef;
  --tc-stripe: #f7f7f7;
  --tc-hover: #f3f8f3;
  --tc-highlight: #fff8cc;
  --tc-white: #ffffff;

  --tc-font: Arial, Helvetica, sans-serif;
  --tc-wordmark: Montserrat, Arial, Helvetica, sans-serif;
  --tc-logo-muted: #7a7a7c;
  --tc-radius: 5px;
  --tc-content-max: 72rem;
}

/* ---------- 2. Map the palette onto Pico variables (light scheme only) ---------- */
:root:not([data-theme="dark"]),
[data-theme="light"] {
  --pico-font-family: var(--tc-font);
  --pico-font-family-sans-serif: var(--tc-font);
  --pico-border-radius: var(--tc-radius);
  --pico-block-spacing-vertical: 1rem;
  --pico-block-spacing-horizontal: 1rem;
  --pico-typography-spacing-vertical: 1rem;
  --pico-form-element-spacing-vertical: 0.4rem;
  --pico-form-element-spacing-horizontal: 0.65rem;

  --pico-background-color: var(--tc-white);
  --pico-color: var(--tc-text);
  --pico-muted-color: var(--tc-text-muted);
  --pico-muted-border-color: var(--tc-border);
  --pico-text-selection-color: rgba(254, 215, 0, 0.45);

  --pico-primary: var(--tc-link);
  --pico-primary-hover: var(--tc-link-hover);
  --pico-primary-underline: transparent;
  --pico-primary-background: var(--tc-green);
  --pico-primary-hover-background: var(--tc-green-dark);
  --pico-primary-border: var(--tc-green);
  --pico-primary-hover-border: var(--tc-green-dark);
  --pico-primary-focus: rgba(0, 102, 153, 0.35);
  --pico-primary-inverse: var(--tc-white);

  --pico-h1-color: var(--tc-green);
  --pico-h2-color: var(--tc-green);
  --pico-h3-color: var(--tc-text);
  --pico-h4-color: var(--tc-text);
  --pico-h5-color: var(--tc-text);
  --pico-h6-color: var(--tc-text);

  --pico-card-background-color: var(--tc-white);
  --pico-card-border-color: var(--tc-border);
  --pico-card-box-shadow: none;
  --pico-card-sectioning-background-color: var(--tc-panel);

  --pico-table-border-color: var(--tc-border-light);
  --pico-table-row-stripped-background-color: var(--tc-stripe);

  --pico-form-element-background-color: var(--tc-white);
  --pico-form-element-border-color: var(--tc-border);
  --pico-form-element-color: var(--tc-text);
  --pico-form-element-focus-color: var(--tc-link);
}

/* ---------- 3. Base ---------- */
html { scrollbar-gutter: stable; }
body { background: var(--tc-white); color: var(--tc-text); }

a { text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

h1, h2 {
  font-weight: 700;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--tc-green);
}
h1 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.page-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.page-head h1 { margin: 0; padding: 0; border: 0; flex: 0 0 auto; }
.quick-search {
  margin: 0;
  width: min(11rem, 46%);
  --pico-border-radius: var(--tc-radius);
}
.quick-search input[type="search"] {
  --pico-border-radius: var(--tc-radius);
  margin: 0;
  height: auto;
  padding: 0.1rem 0.4rem 0.1rem 1.35rem;
  border-radius: var(--tc-radius);
  font-size: 0.8rem;
  line-height: 1.2;
  background-position: center left 0.3rem;
  background-size: 0.75rem auto;
}
h2 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; }

.muted { color: var(--tc-text-muted); }

input:not([type="checkbox"], [type="radio"]),
select,
textarea {
  font-size: 0.9rem;
  line-height: 1.3;
}

form label { margin-bottom: 0.4rem; }

@font-face {
  font-family: Montserrat;
  src: url("/static/fonts/montserrat-wordmark.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 4. Header and tab navigation ---------- */
.site-header {
  padding-block: 0;
  border-bottom: 3px solid var(--tc-yellow);
  background: var(--tc-white);
}
.site-header .container { position: relative; }
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.4rem 0 0.15rem;
  color: var(--tc-green);
  line-height: 1;
  text-decoration: none;
}
.site-header .brand:hover,
.site-header .brand:focus-visible {
  color: var(--tc-green-dark);
  text-decoration: none;
}
.site-header .brand:focus-visible {
  outline: 2px solid var(--tc-link);
  outline-offset: 3px;
}
.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: clamp(3.15rem, 14vw, 5rem);
  color: inherit;
}
.brand-words {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.22em;
  min-width: 0;
  margin-top: 0.28rem;
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--tc-yellow);
  font-family: var(--tc-wordmark);
}
.brand-name {
  font-size: clamp(1.25rem, 4.7vw, 2.15rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.82;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-sub {
  color: var(--tc-logo-muted);
  font-size: clamp(0.54rem, 1.7vw, 0.7rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.tabs { margin: calc(0.45rem + 5px) 0 0; background: var(--tc-panel); }
.tabs ul { margin: 0; padding: 0; gap: 0; justify-content: flex-start; }
.tabs li { padding: 0; margin: 0; }
.tabs a {
  display: block;
  margin: 0;
  padding: 0.2rem 0.55rem;
  min-height: 1.85rem;
  color: var(--tc-text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border-bottom: 3px solid transparent;
  text-decoration: none;
}
.tabs a:hover, .tabs a:focus-visible {
  color: var(--tc-green-dark);
  background: var(--tc-border);
  text-decoration: none;
}
.tabs a[aria-current="page"] {
  color: var(--tc-white);
  background: var(--tc-green);
  border-bottom-color: var(--tc-green-dark);
  text-decoration: none;
}
.hole-input { width: 3.2rem; margin-bottom: 0; }
.matchup-gap td { height: 0.75rem; padding: 0; border: 0; background: transparent; }
table tbody tr.matchup-gap:hover { background: transparent; }

/* ---------- 5. Content ---------- */
main { padding-block: 1rem 2rem; }

article {
  margin-bottom: 1rem;
  border: 1px solid var(--tc-border);
  box-shadow: none;
}
article > header { background: var(--tc-panel); font-weight: 700; }

/* Tables: dense, thin rules, first column pinned while scrolling sideways. */
table { width: 100%; font-size: 0.95rem; margin-bottom: 0; }
thead th {
  background: var(--tc-panel);
  color: var(--tc-text);
  border-bottom: 1px solid var(--tc-green);
  white-space: nowrap;
}
th, td { padding: 0.28rem 0.4rem; }
tbody tr:hover { background: var(--tc-hover); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sticky-col { position: sticky; left: 0; width: 1%; white-space: nowrap; background: var(--tc-white); }
thead .sticky-col { background: var(--tc-panel); }
.striped tbody tr:nth-child(odd) .sticky-col { background: var(--tc-stripe); }

.col-extra { display: none; }

/* Key/value details list */
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
dl.details dt { color: var(--tc-text-muted); }
dl.details dd { margin: 0; font-weight: 700; }

/* ---------- 6. Footer ---------- */
.site-footer {
  padding-block: 0.75rem;
  border-top: 1px solid var(--tc-border);
  color: var(--tc-text-muted);
  font-size: 0.8rem;
}

/* ---------- 7. Larger screens (mobile first: only min-width) ---------- */
@media (min-width: 576px) {
  .site-header .brand { gap: 0.85rem; }
  .you-bar { max-width: 42%; }
}

@media (min-width: 768px) {
  .col-extra { display: table-cell; }
  h1 { font-size: 1.75rem; }
  .tabs a { padding-inline: 1.25rem; font-size: 0.9rem; }
}

@media (min-width: 1024px) {
  table { font-size: 1rem; }
}

tr[hidden] { display: none; }

/* Starred player ("You"): local only, pinned by site.js */
.you-bar {
  position: static;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  gap: 0.15rem;
  max-width: 34%;
  height: auto;
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
}
.you-bar[hidden] { display: none; }
.you-bar a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.you-clear {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 2rem;
  min-height: 2rem;
  cursor: pointer;
  color: var(--tc-text);
}
.icon { width: 1.25rem; height: 1.25rem; }
.you-clear:hover { color: var(--tc-green); }
.you-clear:focus-visible { outline: 2px solid var(--tc-link); outline-offset: 2px; }

/* Sub badge */
.badge-sub {
  display: inline-block;
  padding: 0 0.4rem;
  border: 1px solid var(--tc-yellow);
  background: var(--tc-highlight);
  color: var(--tc-text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  vertical-align: middle;
  border-radius: var(--tc-radius);
}
