/* Overview - the league at a glance (leagues/overview.php).

   Cards in rows: Prizes and Rules, the memo, and the wrap-up side by side, then the standings and
   this week's Board, then the viewer's picks across the full width. Each card
   is a short look with a link in its corner to the page that has the rest, so
   everything here is kept to a few lines or a few rows. */

.overviewPage{
    box-sizing: border-box;
    /* The dashboard panel centres its text; these cards read left to right. */
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0 auto;
    max-width: 1100px;
    width: 100%;
}

.overviewRow{
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overviewRow--notes{
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overviewCard{
    background: var(--c-surface);
    border: 1px solid var(--c1-n5);
    border-radius: var(--r3);
    box-sizing: border-box;
    min-width: 0;
    padding: 14px 16px 16px;
}

/* Every card's title starts at the same height, whether it has a link
   beside it or not and however many lines it takes: the head's parts sit at
   its top rather than centred, and the title is set 3px down - half of what
   the link's 24px is taller than its own 18px line - so a title of one line
   stays level with the link's text. */
.overviewCardHead{
    align-items: flex-start;
    display: flex;
    gap: var(--g3);
    justify-content: space-between;
    margin-bottom: 10px;
}

.overviewCardTitle{
    align-items: center;
    color: var(--c-text-primary);
    display: flex;
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    font-weight: var(--fw4);
    gap: var(--g2);
    margin: 0;
    min-width: 0;
    padding: 3px 0;
}

.overviewCardTitle > i{
    color: var(--c-league-theme-ink, var(--c2));
}

/* The week a card is about, after its title and a step quieter than it -
   and in the Prizes and Rules card's title, the word not chosen. */
.overviewCardWeek,
.overviewInfoView[aria-pressed="false"]{
    color: var(--c-text-muted);
    font-weight: var(--fw1);
}

/* The Prizes and Rules card's Full prizes or Full rules, whichever view is
   showing. */
.overviewCardLink[hidden]{
    display: none;
}

/* The Prizes and Rules card's title is its toggle: each word a button, set
   as the title is, the chosen one in its ink and the other a step quieter
   (above). */
.overviewInfoView{
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

/* The way to the rest: a link to a page, or for the memo and wrap-up a button
   that opens their window. The two look the same. */
.overviewCardLink{
    align-items: center;
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    border-radius: var(--r2);
    color: var(--c-league-theme-ink, var(--c2));
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-family: var(--ff-body);
    font-size: var(--fs-small1);
    font-weight: var(--fw3);
    gap: var(--g1);
    padding: 4px 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 60ms linear;
}

.overviewCardLink:hover,
.overviewCardLink:focus-visible{
    background: var(--c1-n4);
}

.overviewCardSubject{
    color: var(--c-text-primary);
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    font-weight: var(--fw3);
    margin: 0 0 4px;
}

/* A few lines of the memo or the wrap-up, cut off with an ellipsis: enough to
   say what it is about, and the link above has the rest. */
.overviewCardExcerpt{
    /* The memo's line breaks are in the text (see overview.php). */
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    color: var(--c-text-muted);
    display: -webkit-box;
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    line-height: 1.45;
    margin: 0;
    overflow: hidden;
}

.overviewCardEmpty{
    color: var(--c-text-muted);
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    margin: 0;
}

/* --- The tables ------------------------------------------------------------- */
.overviewTable{
    border-collapse: collapse;
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    font-variant-numeric: tabular-nums;
    width: 100%;
}

.overviewTable thead th{
    border-bottom: 1px solid var(--c1-n7);
    color: var(--c-text-muted);
    font-size: var(--fs-small2);
    font-weight: var(--fw3);
    letter-spacing: var(--ls3);    padding: 0 8px 6px;
    text-transform: uppercase;
}

.overviewTable tbody td{
    color: var(--c-text-primary);
    padding: 5px 8px;
}

.overviewTable tbody tr:nth-child(even){
    background: var(--c1-n3);
}

.overviewRankCol{
    color: var(--c-text-muted);
    text-align: right;
    width: 1%;
}

.overviewTable tbody .overviewRankCol{
    color: var(--c-text-muted);
}

.overviewEntryCol{
    max-width: 0;
    text-align: left;
    width: 100%;
}

.overviewEntryCol .entryProfileContent{
    gap: 10px;
}

.overviewEntryCol .entryProfileLink{
    --size: 1.55rem;
}

.overviewNumberCol{
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

/* The viewer's own rows: the navy line down the left edge the standings, the
   Board and the Splits tables give them, and the name alone in bold. */
.overviewTable tbody tr.overviewRow--own > td:first-child{
    box-shadow: inset 3px 0 0 var(--c1);
}

.overviewTable tbody tr.overviewRow--own .entryProfileName{
    font-weight: var(--fw4);
}

/* Between the top of the table and the viewer's own entries further down. */
.overviewTable tbody tr.overviewGapRow{
    background: none;
}

.overviewTable tbody tr.overviewGapRow td{
    color: var(--c1-n7);
    padding: 0;
    text-align: center;
}

/* --- The picks card ------------------------------------------------------- */
/* A full slate is wider than the card on a narrow screen; the table scrolls
   sideways inside it rather than widening the page. */
.overviewPicksScroll{
    overflow-x: auto;
}

.overviewPicksTable{
    width: auto;
}

.overviewPicksTable .overviewEntryCol{
    max-width: 200px;
    min-width: 120px;
    width: auto;
}

.overviewPicksTable .overviewEntryCol .entryProfileName{
    display: block;
}

/* A game's two teams, away over home, as the Board heads its columns. */
.overviewGameCol{
    padding-left: 3px !important;
    padding-right: 3px !important;
    text-align: center;
}

/* Every selection column one fixed width, whatever its game's header holds: a
   selection cell's, the width the entry picks modal gives its columns too
   (.modalPickHistoryWeekTable in modals.css). */
.overviewPicksTable .overviewGameCol,
.overviewPicksTable .overviewPickCell{
    box-sizing: border-box;
    max-width: var(--board-fixed-col-width);
    min-width: var(--board-fixed-col-width);
    width: var(--board-fixed-col-width);
}

/* The rows as tall as their selection cells and no taller, so the cells stand
   as far apart as they do on the Board. The first and last rows' cells take one
   cell edge more against the table's ends, so they stand as far from those as from
   each other. Every cell of those rows takes it, which keeps the names and the
   points level with the selections. The entry picks modal's first row follows its
   week's label. */
.overviewPicksTable tbody td{
    padding-block: 0;
}

.overviewPicksTable tbody tr:not(.modalPickHistoryWeekRuleRow):is(:first-child, .modalPickHistoryWeekRuleRow + tr) > *{
    padding-top: var(--board-cell-edge);
}

.overviewPicksTable tbody tr:last-child > *{
    padding-bottom: var(--board-cell-edge);
}

.overviewGameTeam{
    display: block;
    line-height: 1.3;
}

/* The spread between the two teams, as the Board prints it, with the triangle
   marking the favourite - .spreadFavoriteMark in board.css, which the
   dashboard loads alongside this file. It takes the header's own size, weight
   and ink, as the Board's spread takes its teams'. */
.overviewGameSpread{
    align-items: center;
    display: flex;
    justify-content: center;
    line-height: 1.3;
}

/* The Board's selection cell, its size, spacing, and colours board.css's alone. A
   game with no pick has no cell, and holds its row's height all the same. It opens
   nothing here, so it takes no lift under the pointer. */
.overviewPicksTable .overviewPickCell{
    padding: 0;
}

.overviewPickCell{
    height: calc(var(--pick-pill-height) + 2 * var(--board-cell-edge));
}

.overviewPickCell .teamInTD:hover{
    transform: none;
}

/* Prizes and Rules: League Settings' rows (modals.css) in a card a third of the
   row wide rather than a modal that takes their width. The names' column is
   only as wide as the longest name, a form row's 16px beside it in place of
   the modal's 36px, and a value too long for what is left wraps, its name
   level with its first line. The type is the modal's own (.modal in
   modals.css), which the rows take from the window around them. */
.overviewCard .leagueSettingsList{
    color: var(--c-text-primary);
    font-family: var(--ff-body);
    font-size: var(--fs-small1);
}

.overviewCard .leagueSettingsList > div:has(> .modalSection){
    --settings-column-gap: 16px;
    grid-template-columns: max-content minmax(var(--payout-places-width), max-content) max-content minmax(0, 1fr);
}

.overviewCard .leagueSettingsList .modalSection{
    padding-bottom: 0;
}

.overviewCard .leagueSettingsList .modalRow{
    align-items: start;
}

.overviewCard .leagueSettingsList .settingValue{
    white-space: normal;
}

/* Entries, buy-in, and pot across the top of Prizes, each its name over
   its value, in three equal columns. The buy-in's never narrows below its
   one line (see .overviewInfoStat--buyIn below), so on a narrow card the
   other two give way rather than the buy-in spilling into the pot. */
.overviewInfoStats{
    display: grid;
    gap: var(--g3);
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(max-content, 1fr) minmax(0, 1fr);
}

.overviewInfoStat{
    display: flex;
    flex-direction: column;
    gap: var(--g1);
    background: var(--c1-n3);
    /*font-size: var(--fs-big1);*/
}

.overviewInfoStatPerEntry{
    font-size: var(--fs-small4);
    color: var(--c-text-muted);
}

/* The buy-in on one line, its "/entry" kept with the amount. */
.overviewCard .leagueSettingsList .overviewInfoStat--buyIn .settingValue{
    white-space: nowrap;
}

.overviewInfoStat--entries,
.overviewInfoStat--buyIn,
.overviewInfoStat--pot{
    text-align: center;
    border-radius: var(--r2);
    /*border: 1px solid var(--c1-n6);*/
    padding: var(--g1);
}

.overviewInfoStat--pot{
}

.overviewInfoStat--entries .settingLabel,
.overviewInfoStat--buyIn .settingLabel,
.overviewInfoStat--pot .settingLabel{
    font-size: var(--fs-small2);
}

/* By the page's column rather than the window, so the chat panel beside it
   counts - see #leagueDashboardMain. */
@container dashboard-main (max-width: 800px){
    .overviewRow{
        grid-template-columns: minmax(0, 1fr);
    }
}
