/* ==========================================================================
   Blog styles — the ONLY stylesheet for the blog (loaded in blog.php).
   Scoped to the blog markup only. Does not affect casino pages, home,
   or any other template.
   Sections:
     1) Base layout (container, index listing, pagination)
     2) Premium single-article styling (typography, tables, callouts)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800;900&display=swap');

/* ==========================================================================
   1) BASE LAYOUT
   ========================================================================== */

.blog-container {
    --pb-navy: #0b1228;
    --pb-ink: #111827;
    --pb-accent: #005bff;
    --pb-accent-soft: rgba(0, 91, 255, 0.08);
    --pb-line: rgba(11, 18, 40, 0.10);
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    padding: clamp(18px, 4vw, 40px);
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(11, 18, 40, 0.10);
}

/* ---- Index listing cards ---- */
.blog-post-card {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.blog-post-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.blog-post-card .blog-title {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 10px;
}

.blog-post-card .blog-title a {
    color: var(--pb-navy);
    text-decoration: none;
}

.blog-post-card .blog-title a:hover {
    color: var(--pb-accent);
}

.blog-excerpt {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    color: var(--pb-accent);
    font-weight: 600;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.page-link {
    padding: 8px 12px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}

.page-link.active {
    background: var(--pb-accent);
    color: #fff;
}

.page-link:hover:not(.active) {
    background: #e0e0e0;
}

/* ---- Lead image on single post ---- */
.blog-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 22px;
    max-height: 400px;
    object-fit: cover;
}

/* ==========================================================================
   2) PREMIUM SINGLE-ARTICLE STYLING
   ========================================================================== */

/* ---- Title & meta ---- */
.blog-container .blog-title {
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--pb-navy);
    font-size: clamp(26px, 5.2vw, 38px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}

.blog-container .blog-meta {
    font-family: "DM Sans", system-ui, sans-serif;
    color: #8a93a6;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--pb-line);
}

/* ---- Body typography ---- */
.blog-container .single-post-content {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 17px;
    line-height: 1.75;
    color: #2b3346;
}

/* Lead paragraph (first paragraph in the body — a match-hero may precede it) */
.blog-container .single-post-content > p:first-of-type {
    font-size: clamp(18px, 2.4vw, 20px);
    line-height: 1.6;
    color: var(--pb-ink);
    font-weight: 500;
    margin-bottom: 26px;
}

.blog-container .single-post-content p {
    margin: 0 0 16px;
}

.blog-container .single-post-content strong,
.blog-container .single-post-content b {
    color: var(--pb-navy);
    font-weight: 800;
}

/* ---- Section headings ---- */
.blog-container .single-post-content h2 {
    font-family: "DM Sans", system-ui, sans-serif;
    color: var(--pb-navy);
    font-size: clamp(21px, 3.6vw, 27px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin: 40px 0 16px;
    padding: 0 0 0 16px;
    border-left: 5px solid var(--pb-accent);
}

.blog-container .single-post-content h3 {
    font-family: "DM Sans", system-ui, sans-serif;
    color: var(--pb-navy);
    font-size: clamp(17px, 2.6vw, 20px);
    font-weight: 800;
    margin: 26px 0 10px;
}

/* ---- Lists ---- */
.blog-container .single-post-content ul {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.blog-container .single-post-content ul li {
    position: relative;
    padding: 0 0 0 26px;
    margin: 0 0 11px;
}

.blog-container .single-post-content ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.62em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pb-accent);
    box-shadow: 0 0 0 4px var(--pb-accent-soft);
}

/* ---- Tables (premium centrepiece) ---- */
/* Wrapping <div> around each table becomes a horizontal scroll container on mobile */
.blog-container .single-post-content div:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0 24px;
    border-radius: 14px;
    border: 1px solid var(--pb-line);
    box-shadow: 0 10px 30px rgba(11, 18, 40, 0.07);
}

.blog-container .single-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 15.5px;
    background: #fff;
    overflow: hidden;
}

.blog-container .single-post-content thead th {
    background: linear-gradient(180deg, #111827 0%, #0b1228 100%);
    color: #f9fafb;
    font-family: "DM Sans", system-ui, sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    padding: 13px 16px;
    white-space: nowrap;
}

.blog-container .single-post-content tbody td,
.blog-container .single-post-content tbody th {
    padding: 12px 16px;
    border-top: 1px solid var(--pb-line);
    text-align: left;
    vertical-align: top;
}

.blog-container .single-post-content tbody tr:nth-child(even) td,
.blog-container .single-post-content tbody tr:nth-child(even) th {
    background: #f6f8fc;
}

.blog-container .single-post-content tbody tr:hover td,
.blog-container .single-post-content tbody tr:hover th {
    background: var(--pb-accent-soft);
}

/* Label / value tables (Match Information) — first column emphasised */
.blog-container .single-post-content tbody td:first-child,
.blog-container .single-post-content tbody th:first-child {
    color: var(--pb-navy);
    font-weight: 700;
    white-space: nowrap;
}

/* ---- Prediction / score callout (<em> line) ---- */
.blog-container .single-post-content p em {
    display: block;
    margin: 8px 0 4px;
    padding: 14px 18px;
    background: linear-gradient(145deg, #ffffff 0%, #f3f6fb 55%, #eef2f9 100%);
    border: 1px solid var(--pb-line);
    border-left: 5px solid var(--pb-accent);
    border-radius: 12px;
    font-style: normal;
    font-weight: 700;
    color: var(--pb-navy);
    box-shadow: 0 8px 22px rgba(11, 18, 40, 0.06);
}

/* ---- 18+ disclaimer (last paragraph) ---- */
.blog-container .single-post-content > p:last-child {
    margin-top: 34px;
    padding: 12px 16px;
    background: #f4f7fb;
    border: 1px dashed var(--pb-line);
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

.blog-container .single-post-content > p:last-child strong {
    color: #6b7280;
    font-weight: 700;
}

/* ---- Links inside articles ---- */
.blog-container .single-post-content a {
    color: var(--pb-accent);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--pb-accent-soft);
}

.blog-container .single-post-content a:hover {
    border-bottom-color: var(--pb-accent);
}

/* ==========================================================================
   3) STICKY TABLE OF CONTENTS (single post, blog only)
   ========================================================================== */

/* Smooth anchor jumps + offset so headings aren't hidden under the top edge.
   Scoped to blog because this stylesheet only loads on blog pages. */
html {
    scroll-behavior: smooth;
}

.blog-container .single-post-content h2 {
    scroll-margin-top: 24px;
}

/* Wider shell + tighter side padding on desktop so the article reads roomier */
@media (min-width: 980px) {
    .blog-container--single {
        max-width: 1180px;
        padding-left: 30px;
        padding-right: 30px;
    }
}

.blog-layout {
    margin-top: 8px;
}

@media (min-width: 980px) {
    .blog-layout:not(.blog-layout--no-toc) {
        display: grid;
        grid-template-columns: 250px minmax(0, 1fr);
        gap: 36px;
        align-items: start;
    }
}

/* ---- The ToC panel ---- */
.blog-toc {
    margin: 0 0 26px;
    border: 1px solid var(--pb-line);
    border-radius: 14px;
    background: linear-gradient(145deg, #ffffff 0%, #f3f6fb 55%, #eef2f9 100%);
    box-shadow: 0 10px 30px rgba(11, 18, 40, 0.07);
    overflow: hidden;
}

@media (min-width: 980px) {
    .blog-toc {
        position: sticky;
        top: 20px;
        margin: 0;
        max-height: calc(100vh - 40px);
        overflow: auto;
    }

    /* On desktop the panel stays open (open attribute + JS keeps it so).
       Summary acts as a static header — not collapsible. */
    .blog-toc__summary {
        pointer-events: none;
    }

    .blog-toc__summary::after {
        display: none;
    }
}

.blog-toc__summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pb-navy);
    background: rgba(11, 18, 40, 0.03);
    border-bottom: 1px solid var(--pb-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog-toc__summary::-webkit-details-marker {
    display: none;
}

.blog-toc__summary::after {
    content: "▾";
    font-size: 12px;
    color: var(--pb-accent);
    transition: transform 0.2s ease;
}

.blog-toc[open] .blog-toc__summary::after {
    transform: rotate(180deg);
}

.blog-toc__list {
    list-style: none;
    margin: 0;
    padding: 6px;
}

.blog-toc__list li {
    margin: 0;
}

.blog-toc__link {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    color: #5b6478;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.blog-toc__link:hover {
    background: var(--pb-accent-soft);
    color: var(--pb-navy);
}

.blog-toc__link.is-active {
    background: var(--pb-accent-soft);
    color: var(--pb-navy);
    border-left-color: var(--pb-accent);
    font-weight: 700;
}

/* ---- Match hero (two flags + VS + date/venue) at top of article ---- */
.blog-container .single-post-content .match-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 30px;
    padding: 22px 16px;
    background: linear-gradient(135deg, #0b1228 0%, #16213f 60%, #1c2a52 100%);
    border-radius: 16px;
    box-shadow: 0 14px 38px rgba(11, 18, 40, 0.28);
    text-align: center;
}

.blog-container .single-post-content .match-hero__side {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.blog-container .single-post-content .match-hero__flag {
    width: clamp(48px, 13vw, 74px);
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.blog-container .single-post-content .match-hero__team {
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: clamp(14px, 3.2vw, 20px);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
}

.blog-container .single-post-content .match-hero__mid {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
}

.blog-container .single-post-content .match-hero__vs {
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: clamp(20px, 5vw, 30px);
    font-weight: 900;
    color: #ffd166;
    letter-spacing: 0.04em;
    line-height: 1;
}

.blog-container .single-post-content .match-hero__meta {
    font-size: clamp(11px, 2.4vw, 13px);
    font-weight: 600;
    color: #cdd6ea;
    white-space: nowrap;
}

.blog-container .single-post-content .match-hero__tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8ea0c9;
    white-space: nowrap;
}
