/* v246 safe polish
   This file is intentionally conservative:
   - no homepage hero redesign
   - no gallery hero redesign
   - no JavaScript sticky fallback
   - only safe spacing, sidebar sizing, prediction card polish, sitemap-visible page polish
*/

:root {
    --kisure-sticky-top: 94px;
    --kisure-layout-gap: clamp(1.1rem, 1.7vw, 1.8rem);
    --kisure-sidebar-width: clamp(270px, 22vw, 330px);
}

/* Keep header above all sticky sidebars and content. */
.site-header,
.site-header__bar,
header.site-header {
    z-index: 1040 !important;
}

@media (min-width: 992px) {
    /* CSS-only sticky sidebars. No fixed positioning, no internal scrollbars. */
    .sticky-sidebar,
    aside.sticky-sidebar,
    .sidebar-stack.sticky-sidebar,
    .article-rail.sticky-sidebar,
    .football-sidebar-stack.sticky-sidebar,
    .football-match-sidebar-stack.sticky-sidebar,
    .football-side-panel.sticky-sidebar,
    [data-kisure-sticky-sidebar] {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: var(--kisure-sticky-top) !important;
        align-self: flex-start !important;
        justify-self: stretch !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
        will-change: auto !important;
        z-index: 3 !important;
    }

    .sticky-sidebar.is-js-sticky-fixed,
    .sticky-sidebar.is-kisure-sticky-fixed,
    .sticky-sidebar.is-kisure-sticky-bottom,
    .is-js-sticky-fixed,
    .is-kisure-sticky-fixed,
    .is-kisure-sticky-bottom,
    [data-kisure-sticky-sidebar][data-kisure-sticky-mode] {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: var(--kisure-sticky-top) !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
        will-change: auto !important;
        z-index: 3 !important;
    }

    .kisure-sticky-placeholder,
    .kisure-js-sticky-placeholder,
    [data-kisure-sticky-placeholder] {
        display: none !important;
        height: 0 !important;
        width: 0 !important;
        visibility: hidden !important;
    }

    .sidebar-stack.sticky-sidebar,
    .article-rail.sticky-sidebar,
    .football-sidebar-stack.sticky-sidebar,
    .football-match-sidebar-stack.sticky-sidebar {
        display: grid !important;
        gap: clamp(.9rem, 1.25vw, 1.15rem) !important;
        align-content: start !important;
    }

    /* Restore normal two-column layouts without allowing the sidebar to become main-container width. */
    .content-grid,
    .home-news-layout,
    .category-news-layout,
    .tag-news-layout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) var(--kisure-sidebar-width) !important;
        gap: var(--kisure-layout-gap) !important;
        align-items: start !important;
    }

    .football-layout,
    .football-layout--wide-main,
    .football-layout--match-page,
    .football-prediction-layout,
    .football-main-grid,
    .football-content-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) clamp(280px, 23vw, 340px) !important;
        gap: var(--kisure-layout-gap) !important;
        align-items: start !important;
    }

    .article-shell,
    .article-main-section,
    .main-content-wrapper {
        gap: var(--kisure-layout-gap) !important;
        align-items: start !important;
    }

    .content-grid > section,
    .content-grid > main,
    .content-grid > div,
    .content-grid > aside,
    .football-layout > section,
    .football-layout > div,
    .football-layout > aside,
    .football-prediction-main,
    .football-match-main-column {
        min-width: 0 !important;
    }
}

@media (min-width: 992px) and (max-width: 1240px) {
    :root {
        --kisure-sticky-top: 88px;
        --kisure-sidebar-width: clamp(250px, 24vw, 300px);
    }
}

/* Match and prediction pages: clear vertical breathing room only. */
.football-match-main-column,
.football-prediction-main {
    display: grid !important;
    gap: clamp(1.25rem, 2vw, 1.85rem) !important;
    align-content: start !important;
}

.football-match-main-column > .football-section,
.football-prediction-main > .football-section,
.football-prediction-main > .football-prediction-day,
.football-prediction-detail-page .football-prediction-result-card,
.football-prediction-detail-page .football-prediction-market-grid,
.football-prediction-detail-page .football-prediction-analysis-grid {
    margin-block: 0 !important;
}

.football-section--match-stats-inline,
.football-section--match-lineups,
.football-section--match-stories,
.football-match-main-column > .football-section + .football-section {
    margin-top: 0 !important;
}

/* Homepage and category card grids: do not squeeze article cards into tiny columns beside the sidebar. */
@media (min-width: 992px) and (max-width: 1499.98px) {
    .content-grid .news-grid,
    .content-grid .news-grid--cards {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1500px) {
    .content-grid .news-grid,
    .content-grid .news-grid--cards {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Gallery list cards: title below image, not squeezed beside it. This does NOT target the homepage hero. */
.home-gallery-rail__item,
.media-section .home-gallery-rail__item {
    align-content: start !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .7rem !important;
    padding: .75rem !important;
}

.home-gallery-rail__media,
.media-section .home-gallery-rail__media {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
}

.home-gallery-rail__body,
.media-section .home-gallery-rail__body {
    padding: .15rem .15rem .25rem !important;
}

.home-gallery-rail__body h3,
.media-section .home-gallery-rail__body h3 {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
}

@media (min-width: 1200px) {
    .home-gallery-showcase__grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(15rem, .65fr) !important;
    }
}

/* Prediction list redesign: league title once, teams with club logos. */
.football-prediction-league-list {
    display: grid;
    gap: clamp(1rem, 1.6vw, 1.45rem);
}

.football-prediction-league-group {
    background: linear-gradient(135deg, rgba(14,165,164,.06), rgba(255,255,255,.74));
    border: 1px solid rgba(14,165,164,.16);
    border-radius: 26px;
    display: grid;
    gap: 1rem;
    padding: clamp(.85rem, 1.4vw, 1.15rem);
}

.football-prediction-league-group__head {
    align-items: center;
    display: flex;
    gap: .8rem;
}

.football-prediction-league-group__logo {
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.football-prediction-league-group__logo img {
    height: 38px;
    object-fit: contain;
    width: 38px;
}

.football-prediction-league-group__head h3 {
    color: var(--bg-contrast);
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    line-height: 1.05;
    margin: 0;
}

.football-prediction-league-group__head p {
    color: var(--text-soft);
    font-weight: 800;
    margin: .2rem 0 0;
}

.football-prediction-grid--league {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.football-prediction-card--club {
    gap: .9rem;
    padding: 1rem;
}

.football-prediction-card__teams {
    align-items: center;
    display: grid;
    gap: .65rem;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    text-align: center;
}

.football-prediction-card__teams > span {
    align-items: center;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 18px;
    display: grid;
    gap: .45rem;
    min-height: 112px;
    min-width: 0;
    padding: .8rem .6rem;
}

.football-prediction-card__teams img,
.football-prediction-card__teams b {
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    height: 46px;
    justify-content: center;
    margin: 0 auto;
    object-fit: contain;
    padding: 4px;
    width: 46px;
}

.football-prediction-card__teams strong {
    color: var(--bg-contrast);
    font-size: .92rem;
    line-height: 1.16;
    overflow-wrap: anywhere;
}

.football-prediction-card__teams > em {
    background: var(--primary);
    border-radius: 999px;
    color: #fff;
    font-size: .72rem;
    font-style: normal;
    font-weight: 900;
    padding: .4rem .5rem;
    text-transform: uppercase;
}

.football-prediction-card__top span {
    align-items: center;
    display: inline-flex;
    gap: .35rem;
}

/* Single prediction page polish, without moving the sidebar into the main column. */
.football-prediction-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin: .85rem 0 0;
}

.football-prediction-detail-meta span {
    align-items: center;
    background: rgba(14,165,164,.10);
    border: 1px solid rgba(14,165,164,.18);
    border-radius: 999px;
    color: var(--primary-strong);
    display: inline-flex;
    font-size: .82rem;
    font-weight: 900;
    gap: .4rem;
    padding: .5rem .72rem;
}

.football-prediction-detail-page .football-prediction-match-hero {
    gap: clamp(1rem, 2vw, 1.6rem);
}

.football-prediction-detail-page .football-prediction-result-card {
    border-color: rgba(14,165,164,.18);
    box-shadow: 0 18px 46px rgba(15,23,42,.07);
}

.football-prediction-detail-page .football-prediction-scoreline {
    border-radius: 28px;
    padding: clamp(1.2rem, 2.8vw, 2rem);
}

.football-prediction-detail-page .football-prediction-scoreline strong {
    letter-spacing: -.06em;
}

@media (max-width: 991.98px) {
    .content-grid,
    .home-news-layout,
    .category-news-layout,
    .tag-news-layout,
    .football-layout,
    .football-layout--wide-main,
    .football-layout--match-page,
    .football-prediction-layout,
    .football-main-grid,
    .football-content-grid {
        grid-template-columns: 1fr !important;
    }

    .football-prediction-card__teams {
        grid-template-columns: 1fr;
    }

    .football-prediction-card__teams > em {
        justify-self: center;
    }
}

@media (max-width: 767.98px) {
    .home-gallery-rail__item,
    .media-section .home-gallery-rail__item {
        grid-template-columns: 1fr !important;
    }
}

html[data-theme="dark"] .football-prediction-league-group {
    background: linear-gradient(135deg, rgba(14,165,164,.12), rgba(15,23,42,.74));
    border-color: rgba(45,212,191,.16);
}

html[data-theme="dark"] .football-prediction-league-group__logo,
html[data-theme="dark"] .football-prediction-card__teams img,
html[data-theme="dark"] .football-prediction-card__teams b {
    background: rgba(255,255,255,.92);
}
