/* ==========================================================================
   standings-embed.css   (site root, next to cplStandings.cfc)

   CPL standings tables inside articles. Loaded by:
   - article.cfm
   - the article editor (TinyMCE loads it into its preview, see admin/js/articleEditor.js)

   Built to look like the Standings panel on the CPL page (Grid.js "mermaid" theme
   + gridjs-css.css): grey header row, thin row lines, same column widths, logo sizes,
   colour bars and phone layout. Every rule starts with .tnf-standings-embed so the
   article's own table / image / link styles can't change it.
   ========================================================================== */

.tnf-standings-embed {
    clear: both;
}

/* The panel (same as .panel on the CPL page) */
.tnf-standings-embed .tnf-es {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #000;
    font-size: 14px;
    line-height: 1.42857;
    text-align: left;
}

/* Table frame: same as .gridjs-container (15px padding) + .gridjs-wrapper (top / side borders) */
.tnf-standings-embed .tnf-es-scroll {
    margin: 15px;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    overflow-x: auto;
}

.tnf-standings-embed table.tnf-es-table {
    width: 100%;
    min-width: 600px;          /* like the CPL page: narrower screens scroll sideways */
    margin: 0;
    border: none;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    background: #fff;
    font-size: 16px;
}

.tnf-standings-embed .tnf-es-table th,
.tnf-standings-embed .tnf-es-table td {
    border: none;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Header row (Grid.js th) */
.tnf-standings-embed .tnf-es-table th {
    padding: 10px 5px;
    background: #f9fafb;
    color: #6b7280;
    font-weight: 700;
}

/* Rows (Grid.js td) */
.tnf-standings-embed .tnf-es-table td {
    padding: 9px 2px;
    background: #fff;
    color: #000;
}

/* Column widths: same as the CPL page (# 6%, Team 26%, stats 8%, PTS 10%) */
.tnf-standings-embed .tnf-es-table th            { width: 8%; }
.tnf-standings-embed .tnf-es-table .tnf-es-pos   { width: 6%; position: relative; }
.tnf-standings-embed .tnf-es-table .tnf-es-team  { width: 26%; text-align: left; }
.tnf-standings-embed .tnf-es-table th.tnf-es-pts { width: 10%; }

.tnf-standings-embed .tnf-es-table td.tnf-es-pts {
    font-weight: 900;
}

/* Colour bar on the position cell (same as .tnf-zone on the CPL page) */
.tnf-standings-embed .tnf-es-bar {
    position: absolute;
    top: 50%;
    left: 0;
    width: 4px;
    height: 70%;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    transform: translateY(-50%);
}

/* Team cell: logo + short name */
.tnf-standings-embed .tnf-es-team a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    color: #000 !important;
    text-decoration: none !important;
    border: none !important;
}

.tnf-standings-embed .tnf-es-team span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Article images are usually full width with captions and rounded corners: not the logos */
.tnf-standings-embed .tnf-es-team img {
    width: 40px !important;
    max-width: 40px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: inline-block !important;
    cursor: pointer;
    flex-shrink: 0;
}

/* Legend, range note and date (same as .gridjs-panel-heading / .tnf-legend-item) */
.tnf-standings-embed .tnf-es-foot {
    padding: 10px 15px 20px 15px;
    font-size: 14px;
    color: #000;
}

.tnf-standings-embed .tnf-es-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.tnf-standings-embed .tnf-es-legend-item + .tnf-es-legend-item {
    margin-top: 4px;
}

.tnf-standings-embed .tnf-es-swatch {
    display: inline-block;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

.tnf-standings-embed .tnf-es-range {
    margin-top: 15px;
    color: #4b5563;
}

/* Last line: "2026 season · As of Oct 15, 2026" on the left, "Full standings" button on the right */
.tnf-standings-embed .tnf-es-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-top: 10px;
}

.tnf-standings-embed .tnf-es-range + .tnf-es-bottom {
    margin-top: 4px;
}

.tnf-standings-embed .tnf-es-foot > .tnf-es-range:first-child,
.tnf-standings-embed .tnf-es-foot > .tnf-es-bottom:first-child {
    margin-top: 0;
}

.tnf-standings-embed .tnf-es-date {
    color: #4b5563;
}

/* Same look as the buttons on the CPL page (.panel-button) */
.tnf-standings-embed a.tnf-es-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e5e7eb !important;
    background: #f9fafb;
    color: #000 !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.tnf-standings-embed a.tnf-es-link:hover,
.tnf-standings-embed a.tnf-es-link:focus-visible {
    background: #8bee68;
    border-color: #8bee68 !important;
}

.tnf-standings-embed .tnf-es-empty {
    padding: 20px 15px;
    color: #6b7280;
}

/* Tablets and phones: smaller text and logos. The table always fits the width, no sideways scrolling */
@media (max-width: 768px) {
    .tnf-standings-embed table.tnf-es-table {
        min-width: 0;
    }

    .tnf-standings-embed .tnf-es-table th,
    .tnf-standings-embed .tnf-es-table td {
        font-size: 12px;
    }

    .tnf-standings-embed .tnf-es-table th {
        padding: 10px 4px;
    }

    .tnf-standings-embed .tnf-es-team img {
        width: 30px !important;
        max-width: 30px !important;
    }
}

/* Phones: GF and GA are hidden so every column, points included, fits on screen
   (#, Team, GP, W, D, L, GD, PTS). Long club names go onto a second line instead of being cut */
@media (max-width: 540px) {
    .tnf-standings-embed .tnf-es-scroll {
        margin: 10px;
        overflow-x: visible;
    }

    .tnf-standings-embed .tnf-es-table .tnf-es-hide-sm {
        display: none;
    }

    .tnf-standings-embed .tnf-es-table th,
    .tnf-standings-embed .tnf-es-table td {
        font-size: 11px;
    }

    .tnf-standings-embed .tnf-es-table th {
        padding: 8px 2px;
    }

    .tnf-standings-embed .tnf-es-table td {
        padding: 7px 2px;
    }

    /* Widths for 8 columns: # 8%, Team 32%, five stats 10% each, PTS 10% */
    .tnf-standings-embed .tnf-es-table th            { width: 10%; }
    .tnf-standings-embed .tnf-es-table .tnf-es-pos   { width: 8%; }
    .tnf-standings-embed .tnf-es-table .tnf-es-team  { width: 32%; white-space: normal; padding-left: 4px; }
    .tnf-standings-embed .tnf-es-table th.tnf-es-pts { width: 10%; }

    .tnf-standings-embed .tnf-es-team a {
        gap: 5px;
    }

    .tnf-standings-embed .tnf-es-team span {
        min-width: 0;
        line-height: 1.2;
    }

    .tnf-standings-embed .tnf-es-team img {
        width: 22px !important;
        max-width: 22px !important;
    }

    .tnf-standings-embed .tnf-es-foot {
        padding: 5px 10px 15px 10px;
        font-size: 12px;
    }

    /* Button on its own line, full width, easy to tap */
    .tnf-standings-embed a.tnf-es-link {
        width: 100%;
        justify-content: center;
        padding: 9px 12px;
    }
}

/* Very narrow phones (320-360px): a bit more room for the club names */
@media (max-width: 360px) {
    .tnf-standings-embed .tnf-es-table th,
    .tnf-standings-embed .tnf-es-table td {
        font-size: 10px;
    }

    .tnf-standings-embed .tnf-es-table th            { width: 9%; }
    .tnf-standings-embed .tnf-es-table .tnf-es-pos   { width: 7%; }
    .tnf-standings-embed .tnf-es-table .tnf-es-team  { width: 38%; }
    .tnf-standings-embed .tnf-es-table th.tnf-es-pts { width: 10%; }

    .tnf-standings-embed .tnf-es-team a {
        gap: 4px;
    }

    .tnf-standings-embed .tnf-es-team img {
        width: 18px !important;
        max-width: 18px !important;
    }
}