/* ============================================================
   BCFC — SportPress Overrides
   ============================================================ */

/* ── Shared table base (added via PHP filter to both SP tables) ── */

.bcfc-sp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.bcfc-sp-table thead th {
    background: var(--clr-black);
    color: var(--clr-white);
    font-family: var(--ff-ui);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.6rem 0.75rem;
    text-align: center;
    white-space: nowrap;
}

.bcfc-sp-table thead th:first-child { text-align: left; }

.bcfc-sp-table tbody tr {
    border-bottom: 1px solid var(--clr-grey-100);
    transition: background var(--transition);
}

.bcfc-sp-table tbody tr:hover { background: var(--clr-grey-100); }

.bcfc-sp-table tbody td {
    padding: 0.6rem 0.75rem;
    text-align: center;
    vertical-align: middle;
}

.bcfc-sp-table tbody td:first-child { text-align: left; }

/* Highlight own team row */
.bcfc-sp-table .sp-highlight,
.bcfc-sp-table .highlighted td {
    background: rgba(192, 0, 26, 0.07);
    font-weight: var(--fw-bold);
}

/* Position column */
.bcfc-sp-table .data-rank {
    width: 32px;
    color: var(--clr-grey-400);
    font-weight: var(--fw-bold);
}

/* Team name with optional logo */
.bcfc-sp-table .data-name { text-align: left; }
.bcfc-sp-table .team-logo { display: inline-block; vertical-align: middle; margin-right: 6px; }
.bcfc-sp-table .team-logo img { width: 20px; height: 20px; object-fit: contain; }

/* Win / draw / loss form colours */
.sp-form-w { color: #2e7d32; font-weight: var(--fw-bold); }
.sp-form-d { color: #f57c00; font-weight: var(--fw-bold); }
.sp-form-l { color: var(--clr-red); font-weight: var(--fw-bold); }

/* Strip SP's own wrappers */
.sp-template { margin: 0; }
.sp-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sp-table-caption { display: none; }

/* ── League table on homepage (dark background section) ── */

.home-table { background: var(--clr-black); padding: var(--space-3xl) 0; }
.home-table .home-section-header__title { color: var(--clr-white); }
.home-table .home-section-header__link  { color: var(--clr-grey-300); }
.home-table .home-section-header__link:hover { color: var(--clr-white); }
.home-table .sp-template-league-table { margin-top: var(--space-lg); }
.home-table .bcfc-sp-table thead th  { background: #1a1a1a; }
.home-table .bcfc-sp-table tbody tr  { border-bottom-color: #2a2a2a; }
.home-table .bcfc-sp-table tbody tr:hover { background: #1a1a1a; }
.home-table .bcfc-sp-table tbody td  { color: var(--clr-white); }
.home-table .bcfc-sp-table .data-rank { color: var(--clr-grey-400); }
.home-table .bcfc-sp-table .highlighted td { background: rgba(192,0,26,0.15); }

/* ── SP wrapper resets (event-blocks / fixtures-results shortcodes) ── */

/* Strip default SP wrappers that appear around our custom match rows */
.sp-fixtures-results { }
.sp-widget-align-left,
.sp-widget-align-right { width: 100%; }

/* If both fixtures + results show together (sp_fixtures_results shortcode),
   stack them vertically rather than floating side-by-side */
.sp-fixtures-results::after { content: ''; display: table; clear: both; }
.sp-widget-align-left,
.sp-widget-align-right {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Strip entry-content typographic defaults from the fixtures wrapper */
.fixtures-content.entry-content > * { max-width: none; }
.fixtures-content.entry-content p:empty { display: none; }

/* ── Fixtures page layout ── */

.fixtures-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-2xl);
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-3xl);
    align-items: start;
}

@media (max-width: 960px) {
    .fixtures-layout { grid-template-columns: 1fr; }
}

.fixtures-section { margin-bottom: var(--space-2xl); }

.fixtures-section__title {
    font-family: var(--ff-ui);
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--clr-black);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 3px solid var(--clr-red);
    display: inline-block;
}

/* ── Month grouping ── */

.matches-month { margin-bottom: var(--space-xl); }

.matches-month__label {
    font-family: var(--ff-ui);
    font-size: 0.7rem;
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--clr-grey-400);
    padding: 0.5rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--clr-grey-100);
}

.matches-list { }

/* ── Match row ── */

.match-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem 1.25rem 1rem 1.5rem;
    border-left: 4px solid var(--clr-grey-200);
    border-bottom: 1px solid var(--clr-grey-100);
    background: var(--clr-white);
    transition: background var(--transition), border-left-color var(--transition);
}

.match-row:hover { background: #fafafa; }

/* Result colouring */
.match-row.result--win  { border-left-color: #2e7d32; }
.match-row.result--loss { border-left-color: var(--clr-red); }
.match-row.result--draw { border-left-color: #e65100; }
.match-row--upcoming    { border-left-color: var(--clr-grey-200); }

/* Meta row: date · competition · venue */
.match-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-family: var(--ff-ui);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--clr-grey-400);
}

.match-row__sep { opacity: 0.4; }
.match-row__date { color: var(--clr-grey-600); }

/* Fixture row: home | score | away */
.match-row__fixture {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

/* Team */
.match-row__team {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.match-row__team--home { justify-content: flex-end; }
.match-row__team--away { justify-content: flex-start; }

.match-row__crest {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
}

.match-row__name {
    font-family: var(--ff-ui);
    font-size: clamp(0.9rem, 1.8vw, 1.15rem);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--clr-black);
    line-height: 1.15;
}

/* Score / vs centre block */
.match-row__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 80px;
    text-align: center;
}

.match-row__scoreline {
    font-family: var(--ff-ui);
    font-size: 1.6rem;
    font-weight: var(--fw-bold);
    letter-spacing: 0.04em;
    color: var(--clr-black);
    line-height: 1;
}

.match-row__badge {
    font-family: var(--ff-ui);
    font-size: 0.6rem;
    font-weight: var(--fw-bold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--clr-white);
    padding: 2px 8px;
    background: var(--clr-grey-400);
}

.match-row__badge--w { background: #2e7d32; }
.match-row__badge--l { background: var(--clr-red); }
.match-row__badge--d { background: #e65100; }

.match-row__kickoff {
    font-family: var(--ff-ui);
    font-size: 1.4rem;
    font-weight: var(--fw-bold);
    color: var(--clr-black);
    line-height: 1;
}

.match-row__vs {
    font-family: var(--ff-ui);
    font-size: 0.65rem;
    font-weight: var(--fw-bold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--clr-grey-300);
}

/* Empty state */
.fixtures-empty { padding: var(--space-xl) 0; color: var(--clr-grey-400); }

/* Responsive: stack on small screens */
@media (max-width: 600px) {
    .match-row__fixture {
        grid-template-columns: 1fr auto 1fr;
        gap: 0.5rem;
    }
    .match-row__crest { width: 38px; height: 38px; }
    .match-row__name { font-size: 0.82rem; }
    .match-row__scoreline,
    .match-row__kickoff { font-size: 1.2rem; }
}

/* ── Sidebar league table ── */

.fixtures-sidebar { position: sticky; top: var(--space-xl); }
.fixtures-sidebar .fixtures-section__title { display: block; }
.fixtures-sidebar .sp-template-league-table { margin-top: var(--space-md); }
.fixtures-sidebar .bcfc-sp-table { font-size: var(--fs-xs); }
.fixtures-sidebar .bcfc-sp-table thead th { padding: 0.45rem 0.5rem; }
.fixtures-sidebar .bcfc-sp-table tbody td { padding: 0.45rem 0.5rem; }

/* ── Next Fixture in matchbar ── */

.matchbar__crest {
    display: inline-block;
    width: 36px;
    height: 36px;
    object-fit: contain;
    vertical-align: middle;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* Home team: crest left of name */
.matchbar__team { display: inline-flex; align-items: center; gap: 8px; }

/* Away team: name left of crest (reversed order) */
.matchbar__team--away { flex-direction: row-reverse; }

.matchbar__score--upcoming {
    font-size: var(--fs-sm);
    color: var(--clr-grey-300);
    font-weight: 400;
    padding: 0 0.5rem;
    background: none;
}

.matchbar__time {
    display: inline-block;
    margin-left: 0.4em;
    opacity: 0.7;
}

.matchbar__venue,
.matchbar__competition {
    display: block;
    font-size: var(--fs-xs);
    color: var(--clr-grey-400);
    margin-top: 2px;
    text-align: center;
}

/* ── Fixture sponsor logos (fixtures table) ── */

.fixture-row__sponsors { white-space: nowrap; }

.fixture-sponsors__item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-right: 12px;
    vertical-align: middle;
}

.fixture-sponsors__item:last-child { margin-right: 0; }

.fixture-sponsors__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--clr-grey-400);
    line-height: 1;
}

.fixture-sponsors__logo {
    height: 32px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    display: block;
}

/* ── Matchbar sponsor logos ── */

.matchbar__sponsors {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.matchbar__sponsor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.matchbar__sponsor-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--clr-grey-400);
    line-height: 1;
}

.matchbar__sponsor-logo {
    height: 30px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* ── Home media section (videos + table) ── */

.home-media {
    background: var(--clr-black);
    padding: var(--space-3xl) 0;
}

.home-media__inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

@media (max-width: 960px) {
    .home-media__inner {
        grid-template-columns: 1fr;
    }
}

/* Videos column header */
.home-media__videos .home-section-header,
.home-media__table  .home-section-header {
    margin-bottom: var(--space-md);
}

.home-media__empty {
    color: var(--clr-grey-400);
    font-size: var(--fs-sm);
    padding: var(--space-xl) 0;
}

/* YouTube grid: featured large top, 3 smaller below */
.yt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-sm);
}

.yt-card--featured {
    grid-column: 1 / -1; /* full width */
}

.yt-card {
    display: block;
    text-decoration: none;
    color: var(--clr-white);
    transition: opacity var(--transition);
}

.yt-card:hover { opacity: 0.85; }

.yt-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111;
}

.yt-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.yt-card:hover .yt-card__thumb img { transform: scale(1.03); }

.yt-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.25);
    transition: background var(--transition);
}

.yt-card:hover .yt-card__play { background: rgba(0,0,0,0.1); }

.yt-card__play svg {
    width: 52px;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
    transition: transform var(--transition);
}

.yt-card--featured .yt-card__play svg { width: 68px; }
.yt-card:hover .yt-card__play svg { transform: scale(1.1); }

.yt-card__title {
    font-family: var(--ff-ui);
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.35;
    color: var(--clr-grey-200);
    margin-top: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-card--featured .yt-card__title {
    font-size: var(--fs-sm);
    color: var(--clr-white);
}

@media (max-width: 600px) {
    .yt-grid {
        grid-template-columns: 1fr 1fr;
    }
    .yt-card--featured {
        grid-column: 1 / -1;
    }
}

/* ── Home page league table ── */

.home-table__wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.home-lt {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.home-lt thead tr {
    background: #1a1a1a;
}

.home-lt thead th {
    padding: 0.6rem 0.75rem;
    font-family: var(--ff-ui);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clr-grey-400);
    text-align: center;
    white-space: nowrap;
}

.home-lt thead th.home-lt__col--club { text-align: left; color: var(--clr-grey-200); }
.home-lt thead th.home-lt__col--pts  { color: var(--clr-white); }

.home-lt tbody tr {
    border-bottom: 1px solid #2a2a2a;
    transition: background var(--transition);
}

.home-lt tbody tr:hover { background: #1a1a1a; }

.home-lt tbody tr.home-lt__row--us {
    background: rgba(192,0,26,0.15);
    border-left: 3px solid var(--clr-red);
}

.home-lt tbody tr.home-lt__row--us:hover { background: rgba(192,0,26,0.2); }

.home-lt tbody td {
    padding: 0.6rem 0.75rem;
    color: var(--clr-white);
    text-align: center;
    vertical-align: middle;
}

.home-lt tbody td.home-lt__col--club { text-align: left; }
.home-lt tbody td.home-lt__col--pts  { font-weight: var(--fw-bold); }

.home-lt__col--pos {
    width: 36px;
    font-family: var(--ff-ui);
    font-weight: var(--fw-bold);
    color: var(--clr-grey-400);
}

.home-lt__row--us .home-lt__col--pos { color: var(--clr-red); }

.home-lt__crest {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
}

.home-lt__name {
    vertical-align: middle;
    font-family: var(--ff-ui);
}

.home-lt__row--us .home-lt__name { font-weight: var(--fw-bold); }

/* ── Full-page league table (single-table.php) ── */

.league-table-page {
    padding: var(--space-2xl) 0 var(--space-3xl);
}

.league-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 2px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

.league-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

/* Header */
.league-table thead tr {
    background: var(--clr-black);
}

.league-table thead th {
    padding: 0.75rem 1rem;
    font-family: var(--ff-ui);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clr-grey-300);
    white-space: nowrap;
    text-align: center;
}

.league-table thead th.lt-col--pos  { width: 44px; }
.league-table thead th.lt-col--club { text-align: left; color: var(--clr-white); }
.league-table thead th.lt-col--pts  { color: var(--clr-white); }

/* Body rows */
.league-table tbody tr {
    border-bottom: 1px solid var(--clr-grey-100);
    background: var(--clr-white);
    transition: background var(--transition);
}

.league-table tbody tr:hover { background: #f7f7f7; }

/* Highlighted own-team row */
.league-table tbody tr.lt-row--us {
    background: rgba(192, 0, 26, 0.05);
    border-left: 4px solid var(--clr-red);
}

.league-table tbody tr.lt-row--us:hover { background: rgba(192, 0, 26, 0.09); }

/* Cells */
.league-table tbody td {
    padding: 0.75rem 1rem;
    text-align: center;
    vertical-align: middle;
    color: var(--clr-black);
}

.league-table tbody td.lt-col--club {
    text-align: left;
}

.league-table tbody td.lt-col--pts {
    font-weight: var(--fw-bold);
}

/* Club cell */
.lt-col--club {
    display: table-cell; /* ensure normal cell flow */
}

.league-table tbody td.lt-col--club {
    display: table-cell;
}

/* Crest + name inside club cell */
.lt-crest {
    width: 32px;
    height: 32px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 10px;
}

.lt-name {
    font-family: var(--ff-ui);
    font-size: var(--fs-sm);
    font-weight: 500;
    vertical-align: middle;
}

.lt-name--us {
    font-weight: var(--fw-bold);
    color: var(--clr-red);
}

/* Position cell */
.lt-col--pos {
    font-family: var(--ff-ui);
    font-weight: var(--fw-bold);
    color: var(--clr-grey-400);
    width: 44px;
}

.lt-row--us .lt-col--pos {
    color: var(--clr-red);
}

/* Stat cells */
.lt-col--stat {
    font-variant-numeric: tabular-nums;
    min-width: 44px;
}

/* GD: colour negative red, positive green */
.lt-col--gd { color: var(--clr-grey-600); }

@media (max-width: 600px) {
    .league-table thead th,
    .league-table tbody td {
        padding: 0.6rem 0.5rem;
    }
    .lt-crest { width: 24px; height: 24px; margin-right: 6px; }
    /* Hide GD on small screens */
    .lt-col--gd { display: none; }
}

/* ── SP event-list shortcode (used via do_shortcode elsewhere) ── */

.sp-event-list table { width: 100%; border-collapse: collapse; }
.sp-event-list td,
.sp-event-list th { padding: 0.5rem 0.75rem; font-size: var(--fs-sm); }
.sp-event-list thead th {
    background: var(--clr-black);
    color: var(--clr-white);
    font-family: var(--ff-ui);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.sp-event-list tbody tr { border-bottom: 1px solid var(--clr-grey-100); }
.sp-event-list tbody tr:hover { background: var(--clr-grey-100); }
