/* Golfers (sports/golf-players.js): a name's link and card on hover, and a golfer's page. */

/* ─── Names ─── */

a.gp-a { color: inherit; text-decoration: none; }
a.gp-a:hover { text-decoration: underline; text-underline-offset: 3px; }
a.gp-a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-radius: 2px; }

.gp-flag {
  display: inline-block;
  width: auto;
  height: .8em;
  aspect-ratio: 4 / 3;
  margin-right: .4em;
  vertical-align: -.06em;
  outline: 1px solid var(--line);
}

/* A portrait, or the golfer's initials where there is none */
.gp-pic, .gp-ph {
  display: block;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
}
.gp-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gp-ph {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--display);
  font-weight: 600;
  user-select: none;
}

/* ─── The card ─── */

.gpk {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  width: 300px;
  max-width: calc(100vw - 16px);
  padding: 10px 12px 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
.gpk-top { display: flex; align-items: center; gap: 10px; }
.gpk-pic { width: 56px; height: 56px; font-size: 22px; }
.gpk-id { min-width: 0; }
.gpk-n { margin: 0; font: 600 20px/1.1 var(--display); }
.gpk-c { margin: 2px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.gpk-d { display: grid; gap: 3px; margin: 9px 0 0; }
.gpk-d div { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 8px; }
.gpk-d dt { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; line-height: 1.8; text-transform: uppercase; }
.gpk-d dd { margin: 0; font-weight: 500; line-height: 1.35; font-variant-numeric: tabular-nums; }
.gpk-sub { display: block; color: var(--muted); font-weight: 400; }
.gpk-l { display: block; }
.gpk-d a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.gpk-d a:hover { text-decoration-color: currentColor; }

/* ─── The page ─── */

.gp-page { display: grid; gap: 22px; }
.gp-page > * { min-width: 0; }

.gp-head { display: flex; align-items: center; gap: 20px; padding: 18px; }
.gp-hpic { width: 132px; height: 132px; font-size: 44px; }
.gp-hid { min-width: 0; flex: 1; }
.gp-hn { margin: 0; font: 700 34px/1.05 var(--display); }
.gp-hc { margin: 5px 0 0; color: var(--muted); font-size: 15px; font-weight: 500; }
/* The headline: his major titles */
.gp-hmj { margin: 10px 0 0; font: 500 19px/1.25 var(--display); }
.gp-hmj b { color: var(--major); font-weight: 700; }
.gp-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; }
.gp-facts dt { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.gp-facts dd { margin: 1px 0 0; font-size: 15px; font-weight: 500; }

.gp-hd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 2px 8px; }
.gp-hd h2 { margin: 0; font: 600 17px/1.2 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.gp-note { font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }

/* The top achievements, the chess and football capsule's form */
.gp-cap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px 28px;
  margin: 0;
  padding: 16px 18px;
  list-style: none;
}
.gp-cap li { min-width: 0; }
.gp-cap b { display: block; font: 600 19px/1.2 var(--display); }
.gp-cap span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--muted); }
/* An event named in the headline or the capsule: its page */
.gp-cap a, .gp-hmj a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.gp-cap a:hover, .gp-hmj a:hover { text-decoration-color: currentColor; }
.gp-cap a:focus-visible, .gp-hmj a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* Tables: every number in full, its column as wide as its widest value */
.gp-t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.gp-t caption {
  padding: 12px 14px 2px;
  text-align: left;
  font: 600 15px/1.2 var(--display);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.gp-t caption .gp-note { margin-left: 6px; }
.gp-t + .gp-t caption { padding-top: 18px; }
.gp-t thead th {
  padding: 9px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.gp-t td, .gp-t tbody th, .gp-t tfoot th { padding: 7px 8px; border-top: 1px solid var(--line); text-align: left; font-weight: 400; }
.gp-t tfoot td, .gp-t tfoot th { font-weight: 600; }
.gp-t th:first-child, .gp-t td:first-child { padding-left: 14px; }
.gp-t th:last-child, .gp-t td:last-child { padding-right: 14px; }
.gp-t a { color: inherit; text-decoration: none; }
.gp-t a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gp-t a:focus-visible, .gp-ws a:focus-visible, .gp-grid a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.gp-y { width: 1px; white-space: nowrap; font-weight: 600; }
.gp-t tbody .gp-y a { font-weight: 600; }
.gp-n, .gp-r, .gp-tot, .gp-par, .gp-earn, .gp-money { width: 1px; text-align: right !important; white-space: nowrap; }
.gp-r { color: var(--muted); }
.gp-par { font-weight: 700; }
.gp-earn, .gp-money { color: var(--muted); }
.gp-f, .gp-bf, .gp-best { white-space: nowrap; }
.gp-f { width: 1px; }
.gp-none, .gp-zero { color: var(--faint); font-weight: 400; }
.gp-out { color: var(--muted); }
.gp-am { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
tr.is-won td, tr.is-won th { background: var(--surface-2); }

/* A green jacket, a title: the majors' green */
.gp-won {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--major);
  color: #fff;
  font: 700 11px/1.6 var(--body);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.gp-foot { margin: 0; padding: 9px 14px 11px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

/* The majors: every title, then titles, starts, cuts, top 10s, best in each */
.gp-mws .gp-mw { grid-template-columns: 40px minmax(0, 1fr) auto; }
.gp-mw .gp-w-e { font-weight: 600; }
.gp-mw.is-wk .gp-w-e { font-weight: 500; } /* before the archive: no page to link */
.gp-mw-t { color: var(--muted); font-weight: 400; }
.gp-mws + .gp-mjt, .gp-mws + .gp-foot + .gp-mjt { border-top: 1px solid var(--line); }
.gp-mjt .gp-mj { font-weight: 600; }
.gp-by { color: var(--muted); }
.gp-sm { display: none; }

/* Every major start round by round: all four, or one */
.gp-mf { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 4px; }
.gp-mf button {
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 12.5px/1.4 var(--body);
  cursor: pointer;
}
.gp-mf button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.gp-mf button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.gp-mt td.gp-mj { white-space: nowrap; }
.gp-mt td.gp-mj a { font-weight: 600; }

/* Every major start by year. The scroller has no left padding: the majors' names are pinned at its
   very edge, opaque, the card's inset inside them, so a scrolled cell passes under them and never
   shows beside them (golf-players.js opens it on the latest years, on a column's edge). */
.gp-grid-w { overflow-x: auto; padding: 4px 14px 14px 0; border-top: 1px solid var(--line); scroll-snap-type: x proximity; }
.gp-grid thead th:not(:first-child) { scroll-snap-align: start; }
.gp-grid { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.gp-grid th, .gp-grid td { padding: 3px; text-align: center; white-space: nowrap; }
.gp-grid thead th { padding-top: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.gp-grid th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 3px 10px 3px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}
.gp-grid thead th:first-child { padding-top: 8px; }
.gp-grid tbody th { font-weight: 600; }
.gp-grid td:nth-child(2), .gp-grid thead th:nth-child(2) { padding-left: 6px; }
.gp-g {
  display: block;
  min-width: 40px;
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.gp-g.is-out { color: var(--muted); font-weight: 500; }
.gp-g.is-won { background: var(--major); color: #fff; }
a.gp-g:hover { background: var(--surface-2); }
a.gp-g.is-won:hover { background: #2b6a40; }
.gp-g-none { color: var(--faint); }

/* Wins, newest first */
.gp-ws { margin: 0; padding: 0 14px; list-style: none; }
.gp-w {
  display: grid;
  grid-template-columns: 40px 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
}
.gp-w + .gp-w { border-top: 1px solid var(--line); }
.gp-w-y { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.gp-tag {
  display: block;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  font: 700 10.5px/1.6 var(--body);
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.gp-tag.is-major { background: var(--major); border-color: var(--major); color: #fff; }
.gp-w-e { min-width: 0; }
.gp-w-e a { font-weight: 600; color: inherit; text-decoration: none; }
.gp-w-e a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gp-w-s { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gp-w.is-x .gp-w-e a { font-weight: 500; color: var(--muted); }
.gp-x { color: var(--muted); font-size: 12px; }

@media (max-width: 600px) {
  .gp-page { gap: 18px; }
  .gp-head { align-items: flex-start; gap: 14px; padding: 14px 12px; }
  .gp-hpic { width: 88px; height: 88px; font-size: 32px; }
  .gp-hn { font-size: 27px; }
  .gp-hc { font-size: 14px; }
  .gp-facts { gap: 6px 18px; margin-top: 10px; }
  .gp-facts dd { font-size: 14px; }
  .gp-cap { grid-template-columns: 1fr; gap: 9px; padding: 12px 12px; }
  .gp-cap b { display: inline; font-size: 17px; }
  .gp-cap span { display: inline; margin: 0 0 0 4px; }

  .gp-t { font-size: 13px; }
  .gp-t thead th { padding: 8px 4px; font-size: 10px; letter-spacing: .04em; }
  .gp-t td, .gp-t tbody th, .gp-t tfoot th { padding: 6px 4px; }
  .gp-t th:first-child, .gp-t td:first-child { padding-left: 12px; }
  .gp-t th:last-child, .gp-t td:last-child { padding-right: 12px; }
  .gp-t caption { padding: 10px 12px 2px; }
  .gp-earn { display: none; }
  .gp-mt .gp-par { padding-right: 12px; }
  .gp-lg { display: none; }
  .gp-sm { display: inline; }
  .gp-grid-w { padding: 4px 12px 12px 0; }
  .gp-grid th:first-child { padding-left: 12px; }
  .gp-foot { padding: 8px 12px 10px; }
  .gp-ws { padding: 0 12px; }
  .gp-hmj { margin-top: 8px; font-size: 17px; }
  .gp-mf { padding: 10px 12px 2px; }
  .gp-w { grid-template-columns: 34px 46px minmax(0, 1fr) auto; gap: 8px; }
}
