/* Shared visual system for the BGP learning hub and lesson pages. */
.bgp-series-page {
    --bgp-blue: #62a8ff;
    --bgp-blue-strong: #3f7ee8;
    --bgp-cyan: #55d7cf;
    --bgp-gold: #e7bd5a;
    --primary-color: var(--bgp-blue);
    --primary-hover: #86beff;
    --secondary-color: var(--bgp-blue-strong);
    --accent-color: var(--bgp-gold);
    --primary-gradient: linear-gradient(135deg, var(--bgp-blue), var(--bgp-blue-strong));
    --bg-primary: #f4f7fb;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #dbe3ee;
    background: var(--bg-primary);
}

html[data-theme='dark'] .bgp-series-page {
    --bg-primary: #0b1220;
    --bg-secondary: #182438;
    --bg-card: #111b2d;
    --border-color: #405466;
}

.bgp-series-page .welcome-section::before {
    background: linear-gradient(90deg, var(--bgp-blue), var(--bgp-cyan) 72%, var(--bgp-gold)) !important;
}

.bgp-hub-page .bgp-hub .welcome-section {
    background:
        linear-gradient(rgba(98, 168, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(98, 168, 255, .045) 1px, transparent 1px),
        radial-gradient(circle at 88% 12%, rgba(85, 215, 207, .18), transparent 34rem),
        linear-gradient(135deg, #0c2238, #0b1d31) !important;
    background-size: 56px 56px, 56px 56px, auto, auto !important;
    border-color: color-mix(in srgb, var(--bgp-blue) 38%, var(--border-color)) !important;
    box-shadow: none;
}

html[data-theme='light'] .bgp-hub-page .bgp-hub .welcome-section {
    background:
        linear-gradient(rgba(51, 112, 202, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 112, 202, .045) 1px, transparent 1px),
        radial-gradient(circle at 88% 12%, rgba(85, 215, 207, .15), transparent 34rem),
        linear-gradient(135deg, #f8fbff, #edf5ff) !important;
    background-size: 56px 56px, 56px 56px, auto, auto !important;
}

.bgp-hub-page .bgp-hub {
    box-sizing: border-box;
    padding-inline: clamp(1rem, 1.5vw, 1.5rem);
}

.bgp-hub-page .bgp-hub > .content-section {
    margin-inline: auto;
    max-width: none;
    width: 100%;
}

.bgp-hub-page .bgp-hub .welcome-section h1,
.bgp-series-page .blog-article .welcome-section h1,
.bgp-series-page .blog-article .content-card h2,
.bgp-series-page .blog-article .content-card h3,
.bgp-series-page .blog-article .content-card h4 {
    background: none !important;
    color: var(--text-primary) !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: currentColor !important;
}

.bgp-hub-page .bgp-hub .welcome-section h1 {
    font-size: clamp(2.25rem, 4vw, 3.35rem);
    line-height: 1.1;
}

.bgp-hub-page .bgp-hub .welcome-section p {
    color: var(--text-secondary);
    font-size: clamp(1.05rem, 1.35vw, 1.2rem);
    line-height: 1.65;
}

.bgp-hub-page .bgp-hub .menu-item :is(h2, h3) {
    font-size: clamp(1.35rem, 1.7vw, 1.7rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.bgp-hub-page .bgp-hub .menu-grid .menu-item {
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--bgp-blue) 8%, transparent), transparent 48%),
        var(--bg-card);
    border-color: var(--border-color);
}

.bgp-hub-page .bgp-hub .menu-grid .menu-item:hover,
.bgp-hub-page .bgp-hub .menu-grid .menu-item:focus-within {
    border-color: var(--bgp-blue);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--bgp-blue) 12%, transparent);
    transform: translateY(-2px);
}

.bgp-hub-page .bgp-hub .menu-item a,
.bgp-hub-page .bgp-hub .menu-item a:visited {
    color: var(--bgp-cyan) !important;
}

.bgp-hub-page .bgp-hub .menu-item a:hover,
.bgp-hub-page .bgp-hub .menu-item a:focus-visible {
    color: var(--bgp-gold) !important;
}

.bgp-hub-page .protocol-article-card { max-width: none; }

.bgp-series-page .bgp-page-container {
    gap: clamp(1rem, 1.5vw, 1.5rem);
    padding-inline: clamp(1rem, 1.5vw, 1.5rem);
}

.bgp-series-page .blog-article .welcome-section h1 {
    font-size: clamp(2.15rem, 4vw, 3.35rem) !important;
    line-height: 1.1 !important;
}

.bgp-series-page .blog-article .welcome-section > p {
    font-size: clamp(1.02rem, 1.25vw, 1.16rem) !important;
    line-height: 1.7 !important;
}

.bgp-series-page .blog-article .content-card {
    border-radius: .85rem;
}

.bgp-series-page .blog-article .content-card > p,
.bgp-series-page .blog-article .content-card > ul,
.bgp-series-page .blog-article .content-card > ol,
.bgp-series-page .blog-article .content-card td {
    font-size: 1rem !important;
    line-height: 1.72 !important;
}

.bgp-series-page .blog-article .content-card h2 {
    font-size: clamp(1.4rem, 2.2vw, 1.9rem) !important;
    line-height: 1.25;
}

.bgp-series-page .blog-article .content-card h3 {
    font-size: clamp(1.12rem, 1.7vw, 1.34rem) !important;
    line-height: 1.35;
}

.bgp-series-page .article-kicker {
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.bgp-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.bgp-tag-row .tag {
    background: linear-gradient(135deg, var(--bgp-blue), var(--bgp-blue-strong));
    border: 1px solid color-mix(in srgb, var(--bgp-blue) 65%, white);
    border-radius: 999px;
    color: #fff;
    font-size: .78rem;
    font-weight: 750;
    padding: .42rem .78rem;
}

.bgp-series-page .bgp-side-menu {
    max-height: min(62vh, 34rem);
    overflow-y: auto;
    scrollbar-width: thin;
}

.bgp-series-page .bgp-side-menu a {
    font-size: .88rem;
    padding: .72rem .8rem;
}

.bgp-series-page .sidebar > .content-card:has(.bgp-side-menu) {
    margin-bottom: 0;
    order: 99;
}

.bgp-series-page .sidebar {
    display: flex;
    flex-direction: column;
}

.bgp-series-page .main-content :is(section, h2, h3)[id] {
    scroll-margin-top: 6.25rem;
}

.bgp-series-page .lesson-outline-card .toc-list {
    column-gap: 2rem;
    columns: 2 18rem;
    margin-bottom: 0;
}

.bgp-series-page .protocol-summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    margin: 1.25rem 0;
}

.bgp-series-page .protocol-summary-panel,
.bgp-series-page .packet-type {
    background: color-mix(in srgb, var(--bgp-blue) 5%, var(--bg-secondary));
    border: 1px solid color-mix(in srgb, var(--bgp-blue) 28%, var(--border-color));
    border-radius: .8rem;
    padding: 1rem;
}

.bgp-series-page .ospf-lesson-pagination { margin-top: 1.25rem; }

@media (min-width: 1201px) {
    .bgp-series-page .bgp-page-container > .sidebar {
        align-self: stretch;
        max-height: none;
        overflow: visible;
        position: static !important;
    }

    .bgp-series-page .sidebar > .content-card:has(.bgp-side-menu) {
        align-self: stretch;
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 7rem);
        overflow: hidden;
        position: sticky !important;
        top: 5.75rem;
        z-index: 10;
    }
}

@media (max-width: 1200px) {
    .bgp-series-page .bgp-page-container > .main-content { order: 1; }
    .bgp-series-page .bgp-page-container > .sidebar { order: 2; }
    .bgp-series-page .sidebar > .content-card:has(.bgp-side-menu) {
        max-height: none;
        position: static !important;
    }
}

@media (max-width: 760px) {
    .bgp-series-page .bgp-page-container { padding-inline: .75rem; }
    .bgp-series-page .blog-article .welcome-section h1 { font-size: clamp(1.8rem, 9vw, 2.45rem) !important; }
    .bgp-series-page .lesson-outline-card .toc-list { columns: 1; }
}
