/* ==========================================================================
   Participants / standings table — column widths and supporting styles.
   Single source of truth: never set widths inline on <th>; use these classes.

   Apply width classes (.ptbl-col-*) to <th> elements. With table-layout: fixed
   (compact mode) the matching <td> inherits column width automatically.

   Used by: tournament/includes/participants_table.html
   ========================================================================== */

/* ---- External-ID link (FIDE/NAT profile) -------------------------------- */
.ext-id-link        { color: #6c757d; text-decoration: none; white-space: nowrap; }
.ext-id-link:hover  { color: var(--dc-primary); }
.ext-id-link i      { opacity: .45; transition: opacity .15s; }
.ext-id-link:hover i { opacity: .8; }

/* ---- Column widths --------------------------------------------------------
   Content-driven, measured at .small (.875rem) cell font with .25rem cell
   padding each side. Same content type ⇒ same width (FIDE = NAT rating,
   FIDE ID = NAT ID). Values chosen so the worst-case content fits without
   overflow (FIDE ID = 8 digits + external-link icon ⇒ ~95px = 6rem).
*/
.ptbl-col-rank    { width: 2rem;   } /* # / Pl / seed                          */
.ptbl-col-sr      { width: 3rem;   } /* SR with delta caret                    */
.ptbl-col-title   { width: 3rem;   } /* GM / IM / WGM / WCM                    */
.ptbl-col-fed     { width: 3rem;   } /* 3-letter federation code (header "Fed.") */
.ptbl-col-rating  { width: 3rem;   } /* 4-digit FIDE/NAT rating                */
.ptbl-col-pid     { width: 6rem;   } /* 8-digit FIDE/NAT ID + external icon    */
.ptbl-col-pts     { width: 2.5rem; } /* points up to "21½"                     */
.ptbl-col-tb      { width: 3rem;   } /* tiebreak value (TBn header)            */
.ptbl-col-actions { width: 5rem;   } /* edit / delete icons                    */
.ptbl-col-checkbox{ width: 3rem;   } /* transfer-mode select-all checkbox      */
.ptbl-col-section { width: 6rem;   } /* section name column                    */

/* ---- Sort arrows ---------------------------------------------------------
   Stack ▲▼ vertically and pin to the cell's right edge with absolute
   positioning. Out-of-flow ⇒ does not consume header text width, so column
   widths are driven by the header label alone (and by cell content via the
   width classes). Without this, the inline-flex arrow on the last column
   would visually leak past the table's right edge and add 2-3px to the
   table's scrollWidth, triggering an unwanted horizontal scrollbar.
*/
.ptbl-standings th.sort-th {
    position: relative;
    padding-right: .8rem;   /* reserve space for the absolute sort-arrow */
    font-size: .875rem;     /* match cell .small so header sizing scales with content */
}
.ptbl-standings .sort-arrow {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    flex-direction: column;
    line-height: .55;
    font-size: .7rem;
    margin: 0;
}

/* ---- Compact mode --------------------------------------------------------
   Pin every column width so multiple sibling tables (QT groups, RR sections)
   line up perfectly. Name + Club share the leftover space evenly per table.
   Hide td overflow so any over-long content gets clipped instead of forcing
   a horizontal scrollbar via the .table-responsive wrapper.
*/
table.ptbl-compact { table-layout: fixed; }
table.ptbl-compact td { overflow: hidden; text-overflow: ellipsis; }
table.ptbl-compact td.col-name,
table.ptbl-compact td.col-club { white-space: normal; word-break: break-word; }
