/* Role sizes from the publisher-approved TSP Code 1 Home. */
:root {
    --tsp-code1-hero: 1.75rem;
    --tsp-code1-section: 1.25rem;
    --tsp-code1-lead: 1.4375rem;
    --tsp-code1-pair-heading: 1.25rem;
    --tsp-code1-pair-headline: 1.1875rem;
    --tsp-code1-headline: 1rem;
    --tsp-code1-score: 1.75rem;
    --tsp-code1-team: 1rem;
    --tsp-code1-data: .9375rem;
    --tsp-code1-control: .875rem;
    --tsp-code1-detail: .8125rem;
}

@media (min-width: 761px) {
    /* Phone testers that render in the current document still use phone sizes. */
    :root:not(:has(body[data-device="mobile"], #tsp-fantasy-preview-shell[data-device="phone"])) {
        --tsp-code1-hero: 2.125rem;
        --tsp-code1-section: 1.375rem;
        --tsp-code1-lead: 1.6875rem;
        --tsp-code1-pair-heading: 1.75rem;
        --tsp-code1-pair-headline: 1.6875rem;
        --tsp-code1-headline: 1.0625rem;
        --tsp-code1-score: 1.875rem;
        --tsp-code1-data: 1rem;
        --tsp-code1-control: .9375rem;
    }
}

/* Approved Home roles. Phone values follow the 390 px Home preview. */
:root {
    --tsp-approved-hero: 1.75rem;
    --tsp-approved-hero-leading: 1.12;
    --tsp-approved-lead-weight: 800;
    --tsp-approved-section: 1.25rem;
    --tsp-approved-section-weight: 800;
    --tsp-approved-lead: 1.4375rem;
    --tsp-approved-pair-heading: 1.25rem;
    --tsp-approved-pair-headline: 1.1875rem;
    --tsp-approved-headline: 1rem;
    --tsp-approved-latest-heading: 1.25rem;
    --tsp-approved-latest-link: 1rem;
    --tsp-approved-latest-link-weight: 650;
    --tsp-approved-quick-link: .875rem;
    --tsp-approved-quick-link-weight: 650;
    --tsp-approved-score: 1.75rem;
    --tsp-approved-team: 1rem;
    --tsp-approved-data: .9375rem;
    --tsp-approved-control: .875rem;
    --tsp-approved-detail: .8125rem;
    --tsp-approved-copy: 1rem;
}

@media (min-width: 761px) {
    :root:not(:has(body[data-device="mobile"], #tsp-fantasy-preview-shell[data-device="phone"])) {
        --tsp-approved-hero: 1.375rem;
        --tsp-approved-hero-leading: 1.22;
        --tsp-approved-lead-weight: 700;
        --tsp-approved-section: 1.125rem;
        --tsp-approved-section-weight: 750;
        --tsp-approved-lead: 1.25rem;
        --tsp-approved-pair-heading: 1.125rem;
        --tsp-approved-pair-headline: 1.25rem;
        --tsp-approved-headline: .90625rem;
        --tsp-approved-latest-link: .78125rem;
        --tsp-approved-latest-link-weight: 400;
        --tsp-approved-quick-link: .78125rem;
        --tsp-approved-quick-link-weight: 400;
        --tsp-approved-score: 1.25rem;
        --tsp-approved-team: .875rem;
        --tsp-approved-data: .875rem;
        --tsp-approved-control: .875rem;
        --tsp-approved-detail: .75rem;
        --tsp-approved-copy: 1.0625rem;
    }
}

#tsp-fantasy-preview-shell { --tsp-preview-font: "TSP Inter",Arial,sans-serif; }
/* The Fantasy review uses the Home type roles, white cards and text-only related rows. */
.tsp-fantasy-page {
    --fantasy-ink: #161c21;
    --fantasy-muted: #4b565f;
    --fantasy-rule: #dce1e5;
    --fantasy-hero: var(--tsp-approved-hero, var(--tsp-code1-hero));
    --fantasy-section: var(--tsp-approved-section, var(--tsp-code1-section));
    --fantasy-lead: var(--tsp-approved-lead, var(--tsp-code1-lead));
    --fantasy-headline: var(--tsp-approved-headline, var(--tsp-code1-headline));
    --fantasy-data: var(--tsp-approved-data, var(--tsp-code1-data));
    --fantasy-control: var(--tsp-approved-control, var(--tsp-code1-control));
    --fantasy-detail: var(--tsp-approved-detail, var(--tsp-code1-detail));
}

/* Unify the page title, section heads, and editorial card geometry with Home. */
body:has(> #tsp-fantasy-preview-shell) {
    background: #fff;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page {
    background: #fff;
    color: var(--fantasy-ink);
    font-family: var(--tsp-preview-font);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fd-wrap,.fb-wrap,.tsp-fantasy-inner,.fh-wrap,.fpl-wrap,.fp-wrap) {
    max-inline-size: 1100px;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fd-title,.fb-title,.tf-heading,.fh-title,.fpl-title,.fp-title) {
    background: #fff;
    border: 1px solid var(--fantasy-rule);
    border-radius: 8px;
    color: var(--fantasy-ink);
    padding: 14px 16px 0;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fd-title,.fb-title,.tf-heading,.fh-title,.fpl-title,.fp-title)::after,
#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fd-section-head,.fb-head,.tf-section-head,.fh-head,.fpl-card-head,.fp-head)::before {
    content: none;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fd-title,.fb-title,.tf-heading,.fh-title,.fpl-title,.fp-title) :is(a,em,h1 span) {
    color: inherit;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fd-title,.fb-title,.tf-heading,.fh-title,.fpl-title,.fp-title) nav {
    border-color: var(--fantasy-rule);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fb-card,.tf-section,.fh-card,.fpl-card,.fp-card,.fd-archive,.fd-pulse,.fhg) {
    background: #fff;
    border: 1px solid var(--fantasy-rule);
    border-radius: 8px;
    box-shadow: none;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fd-section-head,.fb-head,.tf-section-head,.fh-head,.fhg-head,.fpl-card-head,.fp-head) {
    background: #fff;
    border-color: var(--fantasy-rule);
    padding: 12px 14px;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fb-story img,.tf-week-image,.tf-feature img,.fh-notebook-lead img) {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #fff;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page .tf-stories-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.tf-story-item,.fpl-news-row) {
    display: block;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.tf-story-item,.fpl-news-row) > img {
    display: none;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page .fantasy-current-headlines {
    list-style: none;
    margin: 0;
    padding: 0 14px 12px;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page .fantasy-current-headlines li {
    border-top: 1px solid var(--fantasy-rule);
    padding-block: 10px;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page .fantasy-current-headlines a {
    color: var(--fantasy-ink);
    font-weight: 650;
}

/* White surfaces also extend to roster tools, disclosures, active rows, and player cards. */
#tsp-fantasy-preview-shell .tsp-fantasy-page :is(
    .fd-sports a,.fd-pulse a,.fp-update header,.fp-title > p,.tf-strategy,
    .tf-action,.tf-week-label,.fpl-gameweek,.fpl-gameweek-info > div,
    .td-controls,.td-views,.td-team-badge,.td-group-header,.tsp-depth-tool,
    .fh-depth > div,.fh-coverage a,.fh-search-results,.fh-empty,.fhg-status,
    .fpls-bench,.fpls-list,.fpls-card,.fpls-role,.fpl-bench > summary,
    .fb-segment,.tf-segment,.fh-segment,.fpl-segment,.fh-profile-switch,.fb-detail-tabs,
    .fb-players-header,.fb-avatar,.fh-avatar,.fpl-player-avatar,.td-pin-photo,
    .fb-player-detail,.fh-panel,.td-anchored-profile,.fpl-player-card,.fpls-detail,
    table th,table td
) {
    background-color: #fff !important;
    color: var(--fantasy-ink);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fpl-gameweek,.fpl-gameweek-info,.fpl-gameweek-info > div,.fh-profile-switch,.fb-detail-tabs) {
    border-color: var(--fantasy-rule);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fb-player-detail,.fh-panel,.td-anchored-profile,.fpl-player-card,.fpls-detail) {
    border: 1px solid var(--fantasy-rule);
    box-shadow: 0 6px 16px rgb(22 28 33 / 12%);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(
    .fb-player-detail,.fh-panel,.td-anchored-profile,.fpl-player-card,.fpls-detail,.fpl-gameweek,
    .td-group-header,.td-team-badge,.fpls-card,.fpls-role,.tf-action,.fd-pulse
) :is(a,button,h2,h3,h4,p,span,strong,small,dt,dd) {
    color: inherit;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(
    .fb-player-trigger,.fpl-player-trigger,.fh-player,.td-depth-player,
    .td-player-search button,.fpls-card,.fb-rank-table tbody tr
):is(:hover,[aria-expanded="true"],:has(> td button[aria-expanded="true"])) {
    background: #fff !important;
    box-shadow: inset 0 0 0 1px var(--fantasy-muted);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(
    button[aria-pressed="true"],button[aria-selected="true"],.fpl-bench[open] > summary
) {
    background: #fff !important;
    color: var(--fantasy-ink) !important;
    box-shadow: inset 0 -2px var(--fantasy-ink);
    text-decoration: underline;
    text-underline-offset: .2em;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.tf-action,.fd-pulse a,.fc-list a) {
    border: 1px solid var(--fantasy-rule);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fpl-title,.td-depth-map) {
    background-image: none;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.td-field,.fpl-pitch,.fpls-pitch,.fh-rink) {
    background: #fff;
    border-color: var(--fantasy-rule);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fpls-lines,.fpl-pitch)::before,
#tsp-fantasy-preview-shell .tsp-fantasy-page .fpls-lines {
    border-color: #a0a9b0;
    background: none;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.td-field,.fpl-pitch,.fpls-pitch,.fh-rink) :is(h3,small,p) {
    color: var(--fantasy-ink);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(button,a,select,input,summary):focus-visible {
    outline: 2px solid var(--fantasy-ink);
    outline-offset: 2px;
}

@layer tsp-preview-typography {
    #tsp-fantasy-preview-shell .tsp-fantasy-page h1 {
        font-size: var(--fantasy-hero) !important;
        line-height: var(--tsp-approved-hero-leading, 1.22) !important;
        font-weight: var(--tsp-approved-lead-weight, 700) !important;
        letter-spacing: -.025em;
    }

    #tsp-fantasy-preview-shell .tsp-fantasy-page h2 {
        font-size: var(--fantasy-section) !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
        letter-spacing: normal;
    }

    #tsp-fantasy-preview-shell .tsp-fantasy-page :is(h3,.fb-story b,.tf-story-item h3,.tf-strategy a,
        .fpl-news-row a,.fh-story-row strong,.fh-coverage a,.fp-archive-item summary,.fantasy-current-headlines a) {
        font-size: var(--fantasy-headline) !important;
        line-height: 1.4 !important;
    }

    #tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fb-story-title,.tf-week-story h3,.tf-feature h3,
        .fh-notebook-lead h3,.fp-update h3) {
        font-size: var(--fantasy-lead) !important;
        line-height: 1.25 !important;
        font-weight: var(--tsp-approved-lead-weight, 700) !important;
        letter-spacing: normal;
    }

    #tsp-fantasy-preview-shell .tsp-fantasy-page :is(td,dd,p,.td-depth-player,.fh-player-name,.fp-copy li) {
        font-size: var(--fantasy-data) !important;
        line-height: 1.35 !important;
    }

    #tsp-fantasy-preview-shell .tsp-fantasy-page :is(button,label,summary,select,nav a,.fb-foot a,.tf-text-link,
        .fh-card-foot a,.fpl-foot a,.fp-footer a,.fd-pulse a,.fb-back,.tf-back,.fh-back,.fpl-back,.fp-back) {
        font-size: var(--fantasy-control) !important;
        line-height: 1.35 !important;
    }

    #tsp-fantasy-preview-shell .tsp-fantasy-page :is(time,small,.fb-meta,.tf-story-meta,.tf-context,.fh-sub,
        .fh-profile-position,.fhg-status,.fpl-meta,.fpls-role,.fp-date,.fd-count,.tf-week-label) {
        font-size: var(--fantasy-detail) !important;
        line-height: 1.35 !important;
    }

    #tsp-fantasy-preview-shell .tsp-fantasy-page button:is(.fb-detail-close,.fh-profile-close,.fpl-player-close,.fpls-close) {
        font-size: var(--fantasy-section) !important;
        line-height: 1 !important;
    }
}

/* Keep formation and rink diagrams readable in white and gray. */
#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.td-field,.fpl-pitch,.fpls-pitch,.fh-rink) {
    --fpls-lines: #a0a9b0;
    background-image: linear-gradient(0deg, transparent calc(50% - .5px), #a0a9b0 calc(50% - .5px),
        #a0a9b0 calc(50% + .5px), transparent calc(50% + .5px));
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(
    .td-team-badge,.td-player-pin,.td-empty-pin,.td-card-switch,.td-profile-photo,
    .fh-player,.fh-avatar-hires,.fpls-player-info,.fpl-player-trigger
) {
    background-color: #fff !important;
    border-color: var(--fantasy-rule);
    color: var(--fantasy-ink);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(
    .fp-title,.fb-player-detail,.td-anchored-profile,.fh-panel,.fpl-player-card,.fpls-detail,
    .td-player-pin,.td-depth-map,.td-group-header,.fpl-gameweek,.tf-action
) :is(button,a,h1,h2,h3,h4,p,span,strong,small,dt,dd,li) {
    color: var(--fantasy-ink) !important;
}

#tsp-fantasy-preview-shell .tsp-fantasy-page :is(.fb-detail-stats,.td-profile-facts,.fh-metrics,.fpl-player-stats,.fpls-facts) > div {
    border-color: var(--fantasy-rule);
}

#tsp-fantasy-preview-shell .tsp-fantasy-page .td-card-switch {
    border-color: var(--fantasy-rule);
}

@layer tsp-preview-typography {
    #tsp-fantasy-preview-shell .tsp-fantasy-page :is(h4,h5,h6) {
        font-size: var(--fantasy-headline) !important;
        line-height: 1.4 !important;
    }

    #tsp-fantasy-preview-shell .tsp-fantasy-page :is(.td-depth-player strong,.fh-player b,.fpls-name,th) {
        font-size: var(--fantasy-data) !important;
        line-height: 1.35 !important;
    }

    #tsp-fantasy-preview-shell .tsp-fantasy-page :is(
        .td-depth-rank,.td-depth-share,.td-field-label,.td-profile-tag,.td-game-week,.td-profile-note,
        .fh-panel-date,.fh-rink-key,.fpls-opponent,.fpl-gameweek-info span,.fpl-player-stats dt
    ) {
        font-size: var(--fantasy-detail) !important;
        line-height: 1.35 !important;
    }
}

body.tsp-code1-fantasy-v97.tsp-shared-quick-links .tsp-site-layout,
body.tsp-code1-fantasy-v97.tsp-shared-quick-links .tsp-site-mainflow { display:block!important;width:100%!important;max-width:none!important }
body.tsp-code1-fantasy-v97.tsp-shared-quick-links .tsp-site-layout > .tsp-home-rail { display:none!important }
body.tsp-code1-fantasy-v97 #tsp-stories:is(.tsp-fd-main,.tsp-pulse-main) {
    max-width: none !important;
    width: 100% !important;
    margin-inline: auto !important;
    padding: 0 !important;
}
#tsp-fantasy-preview-shell :is(#code1-fantasy-native-tool,#code1-fantasy-native-leaders,#code1-fantasy-native-archive) {
    min-width: 0;
}
#tsp-fantasy-preview-shell #code1-fantasy-native-tool .tsp-flt {
    padding: 0;
    margin: 0;
}

/* Keep the linked headings below the sticky site navigation. */
#tsp-fantasy-football :is(#tf-stories, #fantasy-football-stories),
#tsp-fantasy-department #fantasy-analysis {
    scroll-margin-block-start: calc(72px + var(--wp-admin--admin-bar--height, 0px));
}
