/* Grand Slams and majors (sports/majors-box.js): the year's four at the top of a sport's front page,
   a tile each, in a box tinted with the Slam and major badges' green. Tiles are four across, two by
   two in a narrower box; 1 px rules between them (the list's own color showing through the gaps).
   Names give way (they wrap, short ones in a narrow box); scores never do. */

.mjb {
  --mjb-bg: color-mix(in srgb, var(--major) 5%, var(--surface));
  --mjb-hover: color-mix(in srgb, var(--major) 9%, var(--surface));
  container: mjb / inline-size;
  margin-bottom: 16px;
  border-color: var(--line-strong);
  background: var(--mjb-bg);
}
.mjb-h {
  margin: 0;
  padding: 10px 14px;
  font: 700 20px/1.1 var(--display);
  color: var(--major);
  border-bottom: 1px solid var(--line-strong);
}
.mjb-h-sub { margin-left: 6px; font: 500 13px var(--body); color: var(--muted); }

.mjb-l {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line-strong); /* the rules between tiles: the page's neutral rule color */
}
.mjb-t {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 11px 14px 13px;
  background: var(--mjb-bg);
  cursor: pointer;
}
.mjb-t.is-bare { cursor: default; }
.mjb-t:not(.is-bare):hover { background: var(--mjb-hover); }

.mjb-n { margin: 0; font: 700 22px/1.05 var(--display); letter-spacing: .005em; }
.mjb-n a { text-decoration: none; }
.mjb-n a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.mjb-n a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
.mjb-d { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.mjb-nw { white-space: nowrap; }
.mjb-dot { margin: 0 6px; color: var(--faint); }
.mjb-d .mjb-tag { white-space: nowrap; }

/* A result line: a name, then numbers as wide as they are */
.mjb-f { display: flex; flex-direction: column; }
.mjb-s {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.mjb-s.is-win { color: var(--ink); }
.mjb-who { flex: 1; min-width: 0; overflow-wrap: break-word; }
.mjb-s.is-win .mjb-who { font-weight: 700; }
.mjb-sets, .mjb-par, .mjb-tot { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mjb-sets { display: flex; }
.mjb-set { width: 19px; text-align: center; } /* room for a tiebreak's superscript, so the two lines' sets align */
.mjb-set.is-won { font-weight: 700; color: var(--ink); }
.mjb-set sup { margin-left: 1px; font-size: 10px; line-height: 0; }
.mjb-par { font-weight: 700; }
.mjb-tot { min-width: 3ch; text-align: right; color: var(--muted); }
.mjb-x { margin: 0; font-size: 13px; color: var(--muted); }

/* Where it stands: the Live marker and the round, or a word */
.mjb-st { margin: 0; min-height: 21px; }
.mjb-st.lv-row { gap: 2px 8px; }
.mjb-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mjb-k { margin: 2px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mjb-kn { margin-left: 4px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.mjb-prev { display: flex; flex-direction: column; margin: auto 0 0; padding-top: 4px; font-size: 14px; }
.mjb-prev .mjb-k { margin: 0; }
.mjb-pn { font-weight: 600; }

.mjb-sm { display: none; }

/* Tennis's sets need more room than golf's numbers: two by two sooner */
@container mjb (max-width: 879px) {
  .mjb-tennis .mjb-l { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container mjb (max-width: 679px) {
  .mjb-l { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container mjb (max-width: 459px) {
  .mjb-t { padding: 10px 11px 11px; }
  .mjb-n { font-size: 19px; }
  .mjb-d { font-size: 12.5px; }
  .mjb-s { gap: 6px; font-size: 13.5px; }
  .mjb-set { width: 17px; }
  /* tennis's names give their room to the sets: the short ones */
  .mjb-tennis .mjb-lg { display: none; }
  .mjb-tennis .mjb-sm { display: inline; }
}

@media (max-width: 600px) {
  .mjb { margin-bottom: 12px; }
  .mjb-h { padding: 9px 12px; font-size: 19px; }
}
