/* Header for the public final-ranking page (Events::ranking, "ranking" layout).
   Everything is scoped under .ranking-header so it cannot reach the shared
   .topeventdetails header used by the "entries" layout. */

.ranking-header .ranking-bar {
    background: #000;
    border-bottom: 3px solid #2aaea8;
}

.ranking-header .navbar {
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: nowrap;
    align-items: center;
}

.ranking-header .navbar-brand {
    padding: 0;
    margin-right: 26px;
    flex: 0 0 auto;
}

.ranking-header .navbar-brand img {
    height: 78px;
    width: auto;
    display: block;
}

/* Headline block sits to the right of the logo and fills the remaining width. */
.ranking-header .rank-headline {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

.ranking-header .rank-eyebrow {
    display: block;
    color: #2aaea8;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ranking-header .rank-title {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 27px;
    font-weight: 700;
    line-height: 33px;
    letter-spacing: .4px;
    text-transform: uppercase;
    margin: 0;
}

/* Year sits under the title between two short rules. */
.ranking-header .rank-year {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffe400;
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-top: 7px;
}

.ranking-header .rank-year::before,
.ranking-header .rank-year::after {
    content: "";
    display: block;
    width: 46px;
    height: 1px;
    background: rgba(255, 255, 255, .35);
}

@media only screen and (max-width: 991px) {
    .ranking-header .navbar { flex-wrap: wrap; justify-content: center; }
    .ranking-header .navbar-brand { margin: 0 0 10px; }
    .ranking-header .navbar-brand img { height: 62px; }
    .ranking-header .rank-headline { flex: 1 1 100%; }
    .ranking-header .rank-title { font-size: 20px; line-height: 26px; }
    .ranking-header .rank-year { font-size: 15px; }
    .ranking-header .rank-year::before,
    .ranking-header .rank-year::after { width: 28px; }
}

@media only screen and (max-width: 575px) {
    .ranking-header .rank-title { font-size: 17px; line-height: 23px; }
    .ranking-header .rank-eyebrow { font-size: 9px; letter-spacing: 1.6px; }
}

@media print {
    .ranking-header .ranking-bar { border-bottom: none; }
}


/* ---------------------------------------------------------------------------
   Ranking table. Scoped to .ranking-table so the shared .tabledata styling used
   elsewhere on the site is untouched. This sheet loads after web/style.css, so
   equal-specificity rules here win.
   --------------------------------------------------------------------------- */

/* The table is wider than the card once a season has several tournaments, so it
   scrolls on its own instead of clipping the POSITION column. */
.ranking-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #d8e3e2;
    border-radius: 6px;
}

.ranking-table {
    border-collapse: collapse;
    width: 100%;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

/* ---- head ---- */
.ranking-table thead th {
    background: #118f89;
    color: #fff;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, .18);
    padding: 7px 6px;
    vertical-align: middle;
    text-align: center;
    font-weight: 600;
}

.ranking-table thead tr:first-child th { border-top: none; }
.ranking-table thead th:last-child { border-right: none; }

/* Row 1 - venue. Secondary information, so it is the quietest of the three. The
   two-line clamp lives on the inner span: applying display:-webkit-box to the th
   itself stops it behaving as a table cell and collapses the whole header row.
   The full venue string stays available as a tooltip. */
.ranking-table thead th.ev-venue {
    font-size: 10px;
    font-weight: 500;
    line-height: 13px;
    color: rgba(255, 255, 255, .82);
    text-transform: uppercase;
    letter-spacing: .2px;
    width: 96px;
    max-width: 96px;
}

.ranking-table thead th.ev-venue span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Row 2 - tournament name, the row people actually read. */
.ranking-table thead th.ev-name {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 15px;
    letter-spacing: .2px;
}

/* Row 3 - dates. */
.ranking-table thead th.ev-date {
    font-size: 10.5px;
    font-weight: 500;
    line-height: 14px;
    color: rgba(255, 255, 255, .85);
    white-space: nowrap;
}

.ranking-table thead th.col-sn,
.ranking-table thead th.col-id,
.ranking-table thead th.col-name,
.ranking-table thead th.col-state,
.ranking-table thead th.col-dob {
    font-size: 11.5px;
    letter-spacing: .4px;
    text-transform: uppercase;
    background: #0f807b;
    /* Without this the narrow columns break these short labels mid-word
       ("TSTT / A ID"). */
    white-space: nowrap;
}

.ranking-table thead th.col-points,
.ranking-table thead th.col-position {
    background: #0b6b67;
    font-size: 10px;
    letter-spacing: .3px;
    line-height: 13px;
}

.ranking-table thead th.col-position { width: 58px; }
.ranking-table thead th.col-points   { width: 62px; }

.ranking-table thead th.col-points span {
    display: block;
    font-size: 9.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .8);
}

/* ---- body ---- */
.ranking-table tbody td {
    border: none;
    border-top: 1px solid #e4ecec;
    padding: 7px 6px;
    font-size: 13px;
    font-weight: 500;
    color: #22312f;
    text-align: center;
    vertical-align: middle;
}

.ranking-table tbody tr:nth-child(odd)  { background: #f4f8f8; }
.ranking-table tbody tr:nth-child(even) { background: #fff; }
.ranking-table tbody tr:hover           { background: #e2f2f1; }

.ranking-table td.col-name {
    text-align: left;
    font-weight: 600;
    color: #10302e;
    min-width: 168px;
}

.ranking-table td.col-state {
    font-size: 12px;
    font-weight: 600;
    color: #4a5c5a;
    white-space: nowrap;
}

.ranking-table td.col-sn,
.ranking-table td.col-id {
    font-size: 12px;
    color: #667876;
}

/* A blank tournament cell means "did not score here" - show a quiet dash rather
   than an empty box, so a sparse row still reads as a row. */
.ranking-table td.col-event.is-empty::after {
    content: "\2013";
    color: #c3d2d1;
}

/* Best-4 total is the headline number on this page. */
.ranking-table td.col-points {
    background: rgba(17, 143, 137, .07);
    white-space: nowrap;
}

.ranking-table td.col-points strong {
    font-size: 15px;
    font-weight: 700;
    color: #0f807b;
}

.ranking-table td.col-position {
    font-size: 14px;
    font-weight: 700;
    color: #22312f;
    background: rgba(17, 143, 137, .07);
}

/* Podium places get a medal tint on the position cell. */
.ranking-table tr.rank-1 td.col-position { background: #ffd84d; color: #4a3800; }
.ranking-table tr.rank-2 td.col-position { background: #dfe4e6; color: #33403f; }
.ranking-table tr.rank-3 td.col-position { background: #f0c9a4; color: #4d3520; }

@media only screen and (max-width: 767px) {
    .ranking-table thead th { padding: 6px; }
    .ranking-table tbody td { padding: 6px; font-size: 12px; }
    .ranking-table td.col-points strong { font-size: 14px; }
}

@media print {
    .ranking-table-wrap { overflow: visible; border: none; }
    .ranking-table tbody tr:hover { background: none; }
}
