/* Small additions to Bootstrap for the public pages (loaded by base.html). */

/* Touch screens (phones, tablets): small buttons and links get a fingertip-sized area of at
   least 44 x 44 px, the usual minimum for tapping. With a mouse they stay compact. */
@media (pointer: coarse) {
  .tap-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* A piece of text that may move to the next line as a whole but never breaks inside, e.g. one
   set of a score ("7-6(5)") or a time ("15:30"); see the score_parts template filter. */
.keep-together { white-space: nowrap; }

/* Phones (narrower than Bootstrap's "sm", 576 px): slightly smaller text in the results and
   head-to-head tables, so their columns fit the screen. */
@media (max-width: 575.98px) {
  .phone-small { font-size: 0.875rem; }
}

/* Tournament list: each tournament's summary of all categories (a <details> box, closed by
   default). Its <summary> is a small round chevron at the row's left edge (absolutely placed,
   so a closed box adds no height); open, the table appears under the tournament and the
   chevron points down. Rows keep room on the left so every tournament name lines up. */
.tournament-row { position: relative; padding-left: 3rem; }
.summary-box > summary { list-style: none; }
.summary-box > summary::-webkit-details-marker { display: none; }
.summary-box .when-open, .summary-box[open] .when-closed { display: none; }
.summary-box[open] .when-open { display: inline; }
.summary-toggle { position: absolute; left: .75rem; top: .42rem; width: 28px; height: 28px; border-radius: 50%;
                  display: flex; align-items: center; justify-content: center; cursor: pointer;
                  color: var(--bs-success); border: 1px solid var(--bs-success); background: var(--bs-body-bg);
                  transition: background .15s, color .15s; }
.summary-toggle:hover, .summary-toggle:focus-visible { background: var(--bs-success); color: #fff; }
.summary-toggle svg { transition: transform .15s; }
.summary-box[open] .summary-toggle svg { transform: rotate(90deg); }
.summary-box[open] > .table-responsive { margin-top: .5rem; }
@media (pointer: coarse) {      /* touch screens: a fingertip-sized icon */
  .tournament-row { padding-left: 3.5rem; }
  .summary-toggle { width: 44px; height: 44px; left: .4rem; top: .3rem; }
}
/* the tournament name is underlined under the mouse (the row is no longer one big button) */
.list-group-item a:hover .text-decoration-underline-hover { text-decoration: underline; }

/* Player names are links to the player's page. They keep the colour of the text around them
   (user's request); only under the mouse they turn link-coloured and underlined. */
.player-link { color: inherit; text-decoration: none; }
.player-link:hover, .player-link:focus-visible { color: var(--bs-link-hover-color); text-decoration: underline; }
