/*
   summary.css

   Dynamic CSS styling for summary/index page of tournament series in OlimpBase
   Fully customizable via CSS Custom Properties (Variables)
*/

:root {

  /* Non-league table and footer widths. Column widths are listed below. */
  --w-sum-table: 628px;
  --w-sum-footer: 520px;

  --w-sum-no: 30px;
  --w-sum-host-city: 113px;
  --w-sum-host-gap: 16px;
  --w-sum-host-flag: 28px;
  --w-sum-year: 50px;
  --w-sum-winner: 186px;
  --w-sum-winner-flag: 28px;
  --w-sum-system: 50px;
  --w-sum-players: 45px;
  --w-sum-games: 45px;
  --w-sum-pgn: 30px;
  --w-sum-boards: 35px;
  --w-sum-teams: 31px;
  --w-sum-members: 70px;
  --w-sum-remarks: 200px;
  --w-sum-final: 120px;
  --w-sum-place: 33px;
  --w-sum-place-2: 33px;
  --w-sum-place-3: 33px;
  --w-sum-place-4: 33px;
  --w-sum-place-5: 33px;
}

body {
  background-color: #F2F2F2;
}

.section-stats {
  height: 26px;
  background-color: #EEEECC;
}

.layout-table:not(.summary-league) {
  width: var(--w-sum-table);
}

.layout-table {
  margin: 0 auto;
  border-collapse: collapse;
  border-spacing: 0;
}

.layout-table--borderless {
  border: 0;
}

.layout-table--framed {
  border: 1px solid #b9b9b9;
}

.info-cell {
  width: 98%;
  text-align: center;
  vertical-align: bottom;
  font: 11pt Georgia, Arial, sans-serif;
}

.help-cell {
  width: 2%;
}

.summary-header-row {
  height: 30px;
}

.summary-table td {
  border-bottom: 1px solid #b9b9b9;
}

.summary-header-row td {
  border-right: 1px solid #b9b9b9;
}

.summary-header-row td:last-child {
  border-right: 0;
}

.summary-note-row td {
  border-right: 0;
}

.summary-data-row > td:first-child,
.summary-data-row > td.host-city-flag,
.summary-data-row > td.year-col,
.summary-data-row > td.winner-flag,
.summary-data-row > td.system-col,
.summary-data-row > td.boards-col,
.summary-data-row > td.teams-col,
.summary-data-row > td.players-col,
.summary-data-row > td.games-col {
  border-left: 1px solid #b9b9b9;
  border-right: 1px solid #b9b9b9;
}

.summary-data-row > td.winner-name {
  border-right: 0;
}

.note-row {
  border-right: 0;
}

.host-city {
  text-align: left; 
  padding-left: 5px;
  border-right: 0;
}

.host-city-gap {
  text-align: right;
  border-left: 0;
  border-right: 0;
}


/* City and spacer form one visual group, including rows below rowspan. */
.summary-data-row > td.host-city {
  border-right: none;
}

.summary-data-row > td.host-city-gap {
  border-left: none;
  border-right: none;
}

.host-city-flag,
.winner-flag {  border-left: 0;
  padding-right: 1px;
}

.system-col {
  text-align: center;
}

.boards-col {
  text-align: center;
}

.teams-col {
  text-align: center;
}

.players-col {
  text-align: center;
}

.games-col {
  text-align: center;
}

.pgn-col {
  vertical-align: middle;
  text-align: center;
}

.winner-name {
  text-align: left; 
  padding-left: 5px;
  border-right: 0;
}

.footer-table {
  width: var(--w-sum-footer);
  margin: 0 auto;
  border-collapse: collapse;
  border-spacing: 0;
}

.footer-cell {
  width: 25%;
}

.plain-image {
  border: 0;
}

.url-note {
  font: 10px Courier New, monospace;
  color: darkgray;
}

/* Team-event summary variant (for example, Chess Olympiads). */
.summary-switch-table {
  height: 20px;
}

.summary-switch-cell {  padding-left: 2mm;
  text-align: left;
  vertical-align: bottom;
  font: 8pt "Bitstream Vera Sans", Arial, sans-serif;
}

.summary-kind-team .host-city-gap,
.summary-kind-team .host-city-flag {
  padding-left: 0;
  padding-right: 0;
  font-size: 0;
  line-height: 0;
  white-space: nowrap;
}

.summary-kind-team .year-col,
.summary-kind-team .place-col {  padding-left: 0;
  padding-right: 0;
  white-space: nowrap;
}

.summary-kind-team .system-col {
  white-space: nowrap;
}

.summary-kind-team .pgn-col {  padding-left: 0;
  padding-right: 0;
  white-space: nowrap;
}

.summary-kind-team .cancellation-note {
  text-align: left;
  padding-left: 5px;
}

.summary-kind-team .summary-data-row > td.place-col,
.summary-kind-team .summary-data-row > td.boards-col,
.summary-kind-team .summary-data-row > td.teams-col {
  border-right: 1px solid #b9b9b9;
}

.summary-kind-club .host-city-gap,
.summary-kind-club .host-city-flag,
.summary-kind-club .winner-flag {
  padding-left: 0;
  padding-right: 0;
  font-size: 0;
  line-height: 0;
  white-space: nowrap;
}

.summary-kind-club .year-col {  padding-left: 0;
  padding-right: 0;
  white-space: nowrap;
}

.summary-kind-club .system-col {
  white-space: nowrap;
}

.summary-kind-club .pgn-col {  padding-left: 0;
  padding-right: 0;
  white-space: nowrap;
}

.summary-kind-club .cancellation-note {
  text-align: left;
  padding-left: 5px;
}

/* Remove the text baseline gap below PGN icons. */
.summary-table .pgn-col img {
  display: block;
  margin: 0 auto;
}

.summary-kind-qualification .host-city {
  line-height: 15px;
}

.summary-kind-qualification .host-city-flag img {
  display: block;
  margin: 1.5px auto;
}

.summary-kind-qualification .host-city-flag br {
  display: none;
}

/* Width ownership: this file = non-league; ob-league-other.css = leagues. */
.summary-table.summary-css-grid { table-layout: fixed; }
.summary-table.summary-css-grid:not(.summary-league) {
  min-width: var(--w-sum-table);
}
.summary-css-grid .year-col { white-space: nowrap; }
.summary-css-grid .winner-name { white-space: normal; overflow-wrap: break-word; }

.summary-kind-league .summary-data-row:nth-child(odd) { background-color: #f8f8f5; }
.summary-kind-league .summary-data-row:hover { background-color: #eef3e7; }

.summary-css-grid:not(.summary-league) .sum-col-no { width: var(--w-sum-no); }
.summary-css-grid:not(.summary-league) .sum-col-host-city { width: var(--w-sum-host-city); }
.summary-css-grid:not(.summary-league) .sum-col-host-gap { width: var(--w-sum-host-gap); }
.summary-css-grid:not(.summary-league) .sum-col-host-flag { width: var(--w-sum-host-flag); }
.summary-css-grid:not(.summary-league) .sum-col-year { width: var(--w-sum-year); }
.summary-css-grid:not(.summary-league) .sum-col-winner { width: var(--w-sum-winner); }
.summary-css-grid:not(.summary-league) .sum-col-winner-flag { width: var(--w-sum-winner-flag); }
.summary-css-grid:not(.summary-league) .sum-col-system { width: var(--w-sum-system); }
.summary-css-grid:not(.summary-league) .sum-col-players { width: var(--w-sum-players); }
.summary-css-grid:not(.summary-league) .sum-col-games { width: var(--w-sum-games); }
.summary-css-grid:not(.summary-league) .sum-col-pgn { width: var(--w-sum-pgn); }
.summary-css-grid:not(.summary-league) .sum-col-boards { width: var(--w-sum-boards); }
.summary-css-grid:not(.summary-league) .sum-col-teams { width: var(--w-sum-teams); }
.summary-css-grid:not(.summary-league) .sum-col-members { width: var(--w-sum-members); }
.summary-css-grid:not(.summary-league) .sum-col-remarks { width: var(--w-sum-remarks); }
.summary-css-grid:not(.summary-league) .sum-col-final { width: var(--w-sum-final); }
.summary-css-grid:not(.summary-league) .sum-col-place { width: var(--w-sum-place); }
.summary-css-grid:not(.summary-league) .sum-col-place-2 { width: var(--w-sum-place-2); }
.summary-css-grid:not(.summary-league) .sum-col-place-3 { width: var(--w-sum-place-3); }
.summary-css-grid:not(.summary-league) .sum-col-place-4 { width: var(--w-sum-place-4); }
.summary-css-grid:not(.summary-league) .sum-col-place-5 { width: var(--w-sum-place-5); }

/* summary-layout-club: column total 583px. */
.summary-layout-club {
  --w-sum-no: 25px;
  --w-sum-host-city: 89px;
  --w-sum-year: 28px;
  --w-sum-winner: 158px;
  --w-sum-system: 55px;
  --w-sum-players: 31px;
  --w-sum-games: 31px;
  --w-sum-pgn: 28px;
}

/* summary-layout-individual: column total 621px. */

/* summary-layout-organization: column total 507px. */

/* summary-layout-world-championship: column total 681px. */
.summary-layout-world-championship {
  --w-sum-no: 60px;
  --w-sum-system: 80px;
}

/* summary-layout-team: column total 571px. */
.summary-layout-team {
  --w-sum-no: 20px;
  --w-sum-host-city: 115px;
  --w-sum-host-flag: 26px;
  --w-sum-year: 30px;
  --w-sum-system: 55px;
  --w-sum-boards: 45px;
  --w-sum-teams: 45px;
}

/* summary-layout-qualification: column total 567px. */
.summary-layout-qualification {
  --w-sum-host-city: 115px;
  --w-sum-host-flag: 26px;
  --w-sum-year: 34px;
  --w-sum-system: 37px;
  --w-sum-boards: 36px;
  --w-sum-teams: 36px;
  --w-sum-players: 36px;
  --w-sum-games: 36px;
}

.summary-size-01 { width: 520px; }
.summary-size-02 { width: 25%; }
.summary-size-03 { width: 596px; }
.summary-size-04 { width: 55px; }
.summary-size-05 { width: 135px; }
.summary-size-06 { width: 120px; }
.summary-size-07 { width: 628px; }
.summary-size-08 { width: 98%; }
.summary-size-09 { width: 2%; }

/* ger: additional category column for the German championship summary only.
   80% transparent backgrounds = 20% colour opacity. */
.summary-layout-ger {
  --w-sum-winner: 156px;
}

.summary-layout-ger .sum-col-ger {
  width: var(--w-sum-no);
}

.summary-layout-ger .ger-col {
  color: gray;
  width: var(--w-sum-no);
  padding-left: 0;
  padding-right: 0;
  border-left: 1px solid #b9b9b9;
  border-right: 1px solid #b9b9b9;
}

.summary-layout-ger .bg-dsb { background-color: rgba(0, 0, 0, 0.07); }
.summary-layout-ger .bg-nazi { background-color: rgba(139, 69, 19, 0.07); }
.summary-layout-ger .bg-bz { background-color: rgba(255, 0, 255, 0.07); }
.summary-layout-ger .bg-allg { background-color: rgba(255, 165, 0, 0.07); }
.summary-layout-ger .bg-intl { background-color: rgba(0, 0, 255, 0.07); }
.summary-layout-ger .bg-ger { background-color: rgba(255, 255, 0, 0.07); }
.summary-layout-ger .bg-gdr { background-color: rgba(255, 0, 0, 0.07); }
.summary-layout-ger .bg-gm { background-color: rgba(127, 255, 127, 0.07); }
.summary-layout-ger .bg-vio { background-color: rgba(128, 0, 255, 0.07); }



/* WCC: WWCC proportions within the original 628px frame (nine columns).
   Scoped to this page; other series keep their own column profiles. */
.summary-page-world-championship .summary-layout-world-championship {
  --w-sum-table: 628px;
  --w-sum-no: 66px;
  --w-sum-host-city: 103px;
  --w-sum-host-gap: 0px;
  --w-sum-host-flag: 26px;
  --w-sum-year: 44px;
  --w-sum-winner-flag: 26px;
  --w-sum-final: 120px;
  --w-sum-system: 96px;
}
.summary-page-world-championship .summary-table td {
  box-sizing: border-box;
  overflow-wrap: break-word;
}
.summary-page-world-championship .cycle-col {
  white-space: nowrap;
  border-left: 1px solid #b9b9b9;
  border-right: 1px solid #b9b9b9;
}
.summary-page-world-championship .host-city,
.summary-page-world-championship .winner-name,
.summary-page-world-championship .final-col {
  text-align: left;
  padding-left: 4px;
}
.summary-page-world-championship .host-city-gap,
.summary-page-world-championship .host-city-flag,
.summary-page-world-championship .winner-flag {
  padding-left: 0;
  padding-right: 0;
  font-size: 0;
  line-height: 0;
  white-space: nowrap;
}
.summary-page-world-championship .host-city-gap {
  border-left: 0;
  border-right: 0;
}
.summary-page-world-championship .summary-data-row > .host-city-flag,
.summary-page-world-championship .summary-data-row > .winner-flag {
  border-left: 0;
  border-right: 1px solid #b9b9b9;
}
.summary-page-world-championship .final-col {
  border-left: 1px solid #b9b9b9;
  border-right: 1px solid #b9b9b9;
}
.summary-page-world-championship .system-col {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* WCC/WWCC: the winner uses remaining width; keep hover bolding. */
.summary-page-world-championship .summary-layout-world-championship .sum-col-winner {
  width: auto;
}
.summary-page-world-championship .summary-data-row > td.host-city,
.summary-page-world-championship .summary-data-row > td.host-city-gap {
  border-right: 0;
}
.summary-page-world-championship .summary-data-row > td.host-city-gap,
.summary-page-world-championship .summary-data-row > td.host-city-flag {
  border-left: 0;
}
.summary-page-world-championship .summary-data-row > td.final-col {
  text-align: left;
}


/* 1957 World Championship cycle: retain measured 628px tables / 520px footer. */
table.cycle-table {
  width: 628px;
  table-layout: fixed;
  border-collapse: collapse;
}
table.cycle-table td {
  border: 1px solid #b9b9b9;
  vertical-align: middle;
}
table.cycle-table .cycle-section-row { height: 22px; }
table.cycle-table .summary-header-row { height: auto; }
table.cycle-table .host-city { border-right: 0; }
table.cycle-table .host-city-gap { border-left: 0; border-right: 0; }
table.cycle-table .host-city-flag { border-left: 0; }
table.cycle-table .winner-name { border-right: 0; text-align: left; padding-left: 2mm; }
table.cycle-table .winner-flag { border-left: 0; }
table.cycle-table .host-city-flag,
table.cycle-table .winner-flag { padding: 0; font-size: 0; line-height: 0; }
table.cycle-table .cycle-note { white-space: normal; }
table.cycle-table .cycle-note-gap { border-right: 0; }
table.cycle-footer { width: 520px; border-collapse: separate; border-spacing: 2px; }
table.cycle-table.cycle-match .cycle-col-1 { width: 30px; }
table.cycle-table.cycle-match .cycle-col-2 { width: 118.609375px; }
table.cycle-table.cycle-match .cycle-col-3 { width: 16.5px; }
table.cycle-table.cycle-match .cycle-col-4 { width: 28.890625px; }
table.cycle-table.cycle-match .cycle-col-5 { width: 34px; }
table.cycle-table.cycle-match .cycle-col-6 { width: 210px; }
table.cycle-table.cycle-match .cycle-col-7 { width: 28px; }
table.cycle-table.cycle-match .cycle-col-8 { width: 40px; }
table.cycle-table.cycle-match .cycle-col-9 { width: 30px; }
table.cycle-table.cycle-match .cycle-col-10 { width: 30px; }
table.cycle-table.cycle-match .cycle-col-11 { width: 30px; }
table.cycle-table.cycle-match .cycle-col-12 { width: 30px; }
table.cycle-table.cycle-event .cycle-col-1 { width: 30px; }
table.cycle-table.cycle-event .cycle-col-2 { width: 118.609375px; }
table.cycle-table.cycle-event .cycle-col-3 { width: 16.5px; }
table.cycle-table.cycle-event .cycle-col-4 { width: 28.890625px; }
table.cycle-table.cycle-event .cycle-col-5 { width: 34px; }
table.cycle-table.cycle-event .cycle-col-6 { width: 200px; }
table.cycle-table.cycle-event .cycle-col-7 { width: 28px; }
table.cycle-table.cycle-event .cycle-col-8 { width: 50px; }
table.cycle-table.cycle-event .cycle-col-9 { width: 45px; }
table.cycle-table.cycle-event .cycle-col-10 { width: 45px; }
table.cycle-table.cycle-event .cycle-col-11 { width: 30px; }
