/* =====================================================================
   CASE STUDIES: detail pages (case-studies/*.html) and the listing cards
   Layout classes (same conditions in script/case-study.js):
   - desktop: 1024px+ wide and landscape (title band in two columns, sticky table of contents)
   - stacked: under 1024px, or up to 1320px wide in portrait (tablets, portrait monitors)
   - phone:   under 768px
   ===================================================================== */

.cs-page,
.cs-cards {
    --cs-navy: #162A66;
    --cs-blue: #1076F1;
    --cs-cyan: #5EF9F9;
    --cs-off: #F5FAFF;
    --cs-light: #EFF7FF;
    --cs-line: rgba(16, 118, 241, 0.35);
    --cs-head: var(--header-height, 77px);
    /* where the fixed navbar sits (same values as style.css / responsive.css), and the band's top margin and gap */
    --cs-nav-top: 53px;
    --cs-hero-mt: 24px;
    --cs-hero-gap: 64px;
    background: #FFFFFF;
}

@media (min-width: 1025px) and (max-width: 1200px) {
    .cs-page {
        --cs-nav-top: 40px;
    }
}

@media (max-width: 1023px) {
    .cs-page {
        --cs-nav-top: 20px;
    }
}

.cs-wrap {
    width: min(1220px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Title band (default look while there is no cover image) ---------- */
.cs-hero {
    margin: var(--cs-hero-mt) 27px 0;
    border-radius: 30px;
    background: linear-gradient(180deg, #007AFF 0%, #162A66 100%);
    color: var(--cs-off);
    /* clear the fixed navbar, which overlaps the top of the band */
    padding: calc(var(--cs-nav-top) - var(--cs-hero-mt) + var(--cs-head) + var(--cs-hero-gap)) 0 64px;
    position: relative;
    overflow: hidden;
}

.cs-band {
    display: flex;
    align-items: center;
    gap: 72px;
}

.cs-band-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cs-eyebrow {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cs-cyan);
}

.cs-title {
    font-size: 56px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.02em;
    color: var(--cs-off);
}

.cs-title::after {
    content: "";
    display: block;
    width: 123px;
    height: 6px;
    margin-top: 18px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--cs-cyan), #007AFF);
}

.cs-partner {
    font-size: 20px;
    line-height: 1.35;
    opacity: 0.92;
}

.cs-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    opacity: 0.92;
}

.cs-location svg {
    flex: 0 0 auto;
    color: var(--cs-cyan);
}

.cs-facts {
    list-style: none;
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cs-facts li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.cs-facts strong {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.15;
    color: var(--cs-cyan);
}

.cs-facts span {
    font-size: 15px;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

/* Tints, one per category (first category); used by the band without a cover and by the card bands.
   Same category map in script/case-study.js and .ignore/tools/cs-build.py. */
.cs-tint-sky {
    --cs-tint: linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 100%);
}

.cs-tint-periwinkle {
    --cs-tint: linear-gradient(180deg, #E0E7FF 0%, #C7D2FE 100%);
}

.cs-tint-mint {
    --cs-tint: linear-gradient(180deg, #CCFBF1 0%, #99F6E4 100%);
}

.cs-tint-lavender {
    --cs-tint: linear-gradient(180deg, #EDE9FE 0%, #DDD6FE 100%);
}

/* No cover: light tint with navy text, content centred, stats (2 or more) in a row under the partner.
   #0B57B8 is a darker brand blue: 4.5:1 or better on all four tints, where #1076F1 is not. */
.cs-hero--tint {
    background: var(--cs-tint, linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 100%));
    color: var(--cs-navy);
}

.cs-hero--tint .cs-band {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 36px;
}

.cs-hero--tint .cs-band-text {
    align-items: center;
    max-width: 900px;
}

.cs-hero--tint .cs-eyebrow,
.cs-hero--tint .cs-location svg {
    color: #0B57B8;
}

.cs-hero--tint .cs-title {
    color: var(--cs-navy);
}

/* separator: 28px above and below (12px margin + the 16px gap) */
.cs-hero--tint .cs-title::after {
    margin: 28px auto 12px;
    background: linear-gradient(90deg, var(--cs-blue), var(--cs-navy));
}

.cs-hero--tint .cs-facts {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: center;
    width: 100%;
    max-width: 920px;
}

.cs-hero--tint .cs-facts li {
    flex: 1 1 0;
    min-width: 0;
    max-width: 224px;
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(22, 42, 102, 0.14);
}

.cs-hero--tint .cs-facts strong {
    color: #0B57B8;
}

/* when a cover image is added later: <figure class="cs-cover"> replaces the stats on the right */
.cs-hero--cover .cs-facts {
    display: none;
}

.cs-cover {
    flex: 0 0 min(508px, 42%);
    border-radius: 20px;
    overflow: hidden;
}

.cs-cover img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Body ---------- */
.cs-main {
    padding: 80px 0 96px;
}

.cs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 321px;
    column-gap: clamp(48px, 11vw, 160px);
    align-items: start;
}

.cs-section {
    margin-bottom: 56px;
    color: var(--cs-navy);
    scroll-margin-top: calc(var(--cs-head) + 22px);
}

.cs-section:last-child {
    margin-bottom: 0;
}

.cs-section h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.27;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cs-blue);
    margin-bottom: 16px;
}

.cs-section p,
.cs-list li {
    font-size: 18px;
    line-height: 1.35;
    letter-spacing: 0.02em;
}

.cs-section p + p {
    margin-top: 16px;
}

.cs-group {
    margin-top: 36px;
}

.cs-section h2 + .cs-group,
.cs-section h2 + p + .cs-group {
    margin-top: 24px;
}

.cs-group h3 {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 12px;
}

.cs-list {
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cs-milestones {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.cs-milestones li {
    min-width: 162px;
    padding: 16px 22px;
    border-radius: 10px;
    background: var(--cs-light);
    border: 1px solid var(--cs-blue);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
}

/* links in case study text (EXTRA_PARAS in cs-build.py, e.g. Funding Demystified -> its blog post) */
.cs-section p a {
    color: var(--cs-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* The Startup Network series (2026-11-20): "All Editions" list on the hub page, and previous / all / next
   links at the end of each edition page */
.cs-editions {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cs-editions a,
.cs-series a {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 18px;
    border: 1px solid var(--cs-line);
    border-radius: 12px;
    color: var(--cs-navy);
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.cs-editions strong,
.cs-series strong {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
}

.cs-editions span,
.cs-series a span {
    font-size: 15px;
    line-height: 1.35;
    color: rgba(22, 42, 102, 0.75);
}

@media (hover: hover) {
    .cs-editions a:hover,
    .cs-series a:hover {
        background: var(--cs-light);
        border-color: var(--cs-blue);
    }
}

.cs-series {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-top: 56px;
}

.cs-series .cs-series-next {
    text-align: right;
}

.cs-series a.cs-series-all {
    padding: 10px 18px;
    border-radius: 100px;
    font-size: 16px;
    font-weight: 500;
    color: var(--cs-blue);
    text-align: center;
}

@media (max-width: 767px) {
    .cs-editions {
        grid-template-columns: minmax(0, 1fr);
    }
    .cs-series {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .cs-series .cs-series-all {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .cs-editions strong,
    .cs-series strong {
        font-size: 17px;
    }
}

/* name tiles (no photos or logos yet): name, then organisation */
.cs-tiles {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cs-tile {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--cs-line);
    border-right: 1px solid var(--cs-line);
    overflow-wrap: anywhere;
}

.cs-tile:nth-child(3n) {
    border-right: 0;
}

.cs-tile-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.cs-tiles--orgs .cs-tile-name {
    font-weight: 500;
}

.cs-tile-org {
    font-size: 14px;
    line-height: 1.25;
    color: rgba(22, 42, 102, 0.72);
}

.cs-tile img {
    display: block;
    max-width: 128px;
    max-height: 52px;
    margin-bottom: 8px;
}

.cs-tiles.is-collapsed .cs-tile--extra {
    display: none;
}

.cs-more {
    margin-top: 12px;
    font-size: 16px !important;
    color: rgba(22, 42, 102, 0.7);
}

.cs-show-all {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px auto 0;
    padding: 12px 26px;
    border-radius: 999px;
    border: 1.5px solid var(--cs-blue);
    background: #FFFFFF;
    color: var(--cs-blue);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.cs-show-all svg {
    transition: transform 0.2s ease;
}

.cs-show-all[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

@media (hover: hover) {
    .cs-show-all:hover {
        background: var(--cs-light);
    }
}

/* testimonials */
.cs-quote {
    margin: 0 0 20px;
    padding: 24px 36px 30px;
    border-radius: 16px;
    border-left: 4px solid var(--cs-blue);
    background: var(--cs-light);
}

.cs-quote:last-child {
    margin-bottom: 0;
}

.cs-quote blockquote::before {
    content: "\201C";
    display: block;
    height: 44px;
    font-size: 64px;
    font-weight: 600;
    line-height: 1;
    color: var(--cs-blue);
}

.cs-quote figcaption {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 16px;
}

.cs-quote figcaption strong {
    font-size: 16px;
    font-weight: 600;
}

.cs-quote figcaption span {
    font-size: 15px;
    color: rgba(22, 42, 102, 0.7);
}

/* ---------- Table of contents ---------- */
.cs-aside {
    position: sticky;
    top: calc(var(--cs-head) + 32px);
}

.cs-aside-card {
    background: #FFFFFF;
    border: 1px solid #89A8F2;
    border-radius: 20px;
    padding: 26px 31px 34px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: calc(100vh - var(--cs-head) - 64px);
    /* the title stays put; only a long table of contents scrolls (below) */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cs-aside-card .cs-toc {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.cs-aside-card .cs-toc-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-right: -14px;
    padding-right: 14px;
}

/* thin, rounded scrollbars in brand blue: table of contents, dropdown lists */
.cs-aside-card .cs-toc-list,
.cs-toc-mobile .cs-toc-list,
.cs-cat-menu {
    scrollbar-width: thin;
    scrollbar-color: #B9CCF5 transparent;
}

.cs-aside-card .cs-toc-list::-webkit-scrollbar,
.cs-toc-mobile .cs-toc-list::-webkit-scrollbar,
.cs-cat-menu::-webkit-scrollbar {
    width: 6px;
}

.cs-aside-card .cs-toc-list::-webkit-scrollbar-thumb,
.cs-toc-mobile .cs-toc-list::-webkit-scrollbar-thumb,
.cs-cat-menu::-webkit-scrollbar-thumb {
    background: #B9CCF5;
    border-radius: 3px;
}

.cs-aside-card .cs-toc-list::-webkit-scrollbar-track,
.cs-toc-mobile .cs-toc-list::-webkit-scrollbar-track,
.cs-cat-menu::-webkit-scrollbar-track {
    background: transparent;
}

/* index entries one level down (e.g. the sessions under "How the event unfolded") */
.cs-toc-list li.cs-toc-sub a {
    padding-left: 32px;
    font-size: 15px;
}

.cs-toc-list li.cs-toc-sub a.is-active::before {
    left: 16px;
}

.cs-aside-title {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.03em;
    color: var(--cs-navy);
}

.cs-aside-partner {
    margin-top: 6px;
    font-size: 16px;
    color: rgba(22, 42, 102, 0.7);
}

.cs-toc {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #89A8F2;
}

.cs-toc-head {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cs-blue);
    margin-bottom: 16px;
}

.cs-toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cs-toc-list a {
    position: relative;
    display: block;
    padding-left: 16px;
    font-size: 16px;
    line-height: 1.27;
    letter-spacing: 0.03em;
    color: var(--cs-navy);
}

.cs-toc-list a.is-active {
    color: var(--cs-blue);
}

.cs-toc-list a.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cs-blue);
}

@media (hover: hover) {
    .cs-toc-list a:hover {
        color: var(--cs-blue);
    }
}

.cs-toc-mobile {
    display: none;
}

/* ---------- Cards (related + listing) ---------- */
.cs-related {
    padding-bottom: 96px;
}

.cs-related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.cs-related-head h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cs-blue);
}

.cs-related-all {
    flex: 0 0 auto;
    font-size: 16px;
    font-weight: 500;
    color: var(--cs-blue);
}

.cs-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
}

.cs-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 8px 8px 24px;
    border-radius: 30px;
    border: 1px solid #C4DFFF;
    background: var(--cs-light);
    color: var(--cs-navy);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
    .cs-card:hover {
        box-shadow: 0 10px 28px rgba(16, 118, 241, 0.18);
        transform: translateY(-2px);
    }
}

.cs-card-thumb {
    position: relative;
    /* 16:9 like the thumbnails (800x450), so they show uncropped at every card width (2026-11-23; was 200px tall) */
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    overflow: hidden;
}

.cs-card-band {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 22px 24px;
    text-align: center;
    /* same tint as the case study's own title band (cs-tint-* class) */
    background: var(--cs-tint, linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 100%));
    color: var(--cs-navy);
}

.cs-card-band-title {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.15;
}

.cs-card-band-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    margin: 14px auto 8px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--cs-blue), var(--cs-navy));
}

.cs-card-band-partner {
    font-size: 15px;
}

.cs-card-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px;
}

.cs-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cs-card-cats span {
    padding: 4px 12px;
    border-radius: 5px;
    background: #FFFFFF;
    font-size: 14px;
}

.cs-card-title {
    font-size: 22px;
    font-weight: 500;
    line-height: 1.25;
    color: #081022;
}

.cs-card-meta {
    font-size: 15px;
    color: rgba(22, 42, 102, 0.7);
}

.cs-card-summary {
    font-size: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cs-card-link {
    margin-top: auto;
    padding-top: 4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--cs-blue);
}

/* ---------- Blog posts (blogs/*.html): article text inside the case study layout ---------- */
.cs-layout--single {
    grid-template-columns: minmax(0, 820px);
    justify-content: center;
}

.cs-article {
    color: var(--cs-navy);
}

.cs-article .cs-section {
    margin-bottom: 0;
}

.cs-article .cs-section + .cs-section {
    margin-top: 40px;
}

.cs-article .cs-section > * + * {
    margin-top: 18px;
}

.cs-article h2,
.cs-article h3,
.cs-article h4 {
    text-transform: none;
    letter-spacing: 0;
    color: var(--cs-navy);
    font-weight: 600;
}

.cs-article .cs-section h2 {
    font-size: 30px;
    line-height: 1.25;
    margin-bottom: 0;
}

.cs-article h3 {
    font-size: 23px;
    line-height: 1.3;
}

.cs-article h4 {
    font-size: 19px;
    line-height: 1.35;
}

.cs-article .cs-section > h2 + *,
.cs-article .cs-section > h3 + *,
.cs-article .cs-section > h4 + * {
    margin-top: 12px;
}

.cs-article .cs-section > * + h3,
.cs-article .cs-section > * + h4 {
    margin-top: 32px;
}

.cs-article .cs-section p,
.cs-article li {
    font-size: 18px;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

.cs-article ul,
.cs-article ol {
    padding-left: 24px;
}

.cs-article ul {
    list-style: disc;
}

.cs-article ol {
    list-style: decimal;
}

.cs-article li + li {
    margin-top: 8px;
}

.cs-article li > ul,
.cs-article li > ol {
    margin-top: 8px;
}

.cs-article a {
    color: var(--cs-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.cs-article strong {
    font-weight: 600;
}

.cs-article hr {
    border: 0;
    border-top: 1px solid var(--cs-line);
}

.cs-article blockquote {
    border-left: 4px solid var(--cs-blue);
    padding: 4px 0 4px 20px;
    font-style: italic;
}

.cs-figure img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto; /* the page sets max-width to the image's real width, so it is never stretched */
    border-radius: 16px;
}

/* in-article filter bar (startup schemes guide, script/scheme-filter.js): the listings' bar inside the text column */
.cs-article .cs-filterbar--article {
    /* 16px of padding on each side, pulled out by the same amount so the controls still line up with the text */
    margin: 8px -16px 28px;
    padding: 12px 16px;
}

.cs-article .cs-filterbar--article .cs-search {
    flex: 1 1 auto;
}

.cs-article .cs-filterbar--article .cs-cat {
    flex: 0 0 230px;
}

/* sections after the pinned bar: the browser's own jump to #section (page opened with an anchor) lands
   below the bar as well; --cs-pinbar is the bar's height (set by case-study.js; fallbacks per layout) */
.cs-article .cs-filterbar--article ~ .cs-section {
    scroll-margin-top: calc(var(--cs-head) + 22px + var(--cs-pinbar, 76px));
}

@media (max-width: 767px) {
    .cs-article .cs-filterbar--article ~ .cs-section {
        scroll-margin-top: calc(var(--cs-head) + 22px + var(--cs-pinbar, 118px));
    }
}

.cs-filter-count {
    margin-left: auto;
    white-space: nowrap;
    font-size: 15px;
    color: var(--cs-navy);
}

.cs-filter-empty {
    padding: 24px 0;
    font-size: 18px;
    color: var(--cs-navy);
}

.cs-article .cs-section[hidden],
.cs-toc-list li[hidden],
.cs-filter-empty[hidden] {
    display: none;
}

.cs-video {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #0B1538;
}

.cs-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* byline + date line in the post's title band */
.cs-byline {
    font-size: 20px;
    line-height: 1.35;
}

@media (max-width: 767px) {
    .cs-article .cs-section h2 {
        font-size: 24px;
    }
    .cs-article h3 {
        font-size: 20px;
    }
    .cs-article .cs-section p,
    .cs-article li {
        font-size: 17px;
    }
    .cs-byline {
        font-size: 16px;
    }
}

/* the guide's bar on phones: search on its own row, regions + count below (as the listings) */
@media (max-width: 767px) {
    .cs-article .cs-filterbar--article .cs-search {
        flex: 1 1 100%;
    }
    .cs-article .cs-filterbar--article .cs-cat {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* listing page grid */
.cs-cards--listing {
    margin-top: 8px;
}

/* ---------- Listing filter bar: search, categories, pagination ----------
   Sticks just below the navbar (which sits at the top once the page is scrolled) while the cards scroll
   underneath; while pinned it gets a white band that also fills the space behind the navbar. */
.cs-filterbar {
    position: sticky;
    top: var(--header-height, 77px);
    z-index: 60;
    margin: 30px 0 43px;
    padding: 14px 0;
}

.cs-filterbar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(-1 * var(--header-height, 77px));
    bottom: 0;
    z-index: -1;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(22, 42, 102, 0.10);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.cs-filterbar.is-pinned::before {
    opacity: 1;
}

.cs-filterbar-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cs-search {
    flex: 0 1 380px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 25px;
    border: 2px solid #1076F1;
    border-radius: 100px;
    background: #F1F8FF;
}

.cs-search:focus-within,
.cs-cat-btn:focus-visible {
    outline: 2px solid #162A66;
    outline-offset: 2px;
}

.cs-search input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: #162A66;
}

.cs-search input::placeholder {
    color: #69738A;
}

/* categories: dropdown with checkboxes (several can be selected) */
.cs-cat {
    position: relative;
    flex: 0 0 260px;
}

.cs-cat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px 44px 10px 25px;
    border: 2px solid #1076F1;
    border-radius: 100px;
    background: #F1F8FF url("../assets/icons/blue-dropdown.svg") no-repeat right 15px center / 20px 8px;
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    color: #69738A;
    text-align: left;
    cursor: pointer;
}

.cs-cat-btn.has-selection {
    color: #162A66;
}

.cs-cat-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cs-cat-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 100%;
    padding: 8px;
    border: 1px solid #C4DFFF;
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 12px 32px rgba(22, 42, 102, 0.16);
}

.cs-cat-menu[hidden] {
    display: none;
}

/* opens upwards when there isn't room below the button (set by the listing script) */
.cs-cat-menu--up {
    top: auto;
    bottom: calc(100% + 8px);
}

.cs-cat-menu label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 16px;
    color: #162A66;
    white-space: nowrap;
    cursor: pointer;
}

.cs-cat-menu label:first-child {
    border-bottom: 1px solid #E3EEFC;
    border-radius: 12px 12px 0 0;
    margin-bottom: 4px;
}

.cs-cat-menu input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #1076F1;
    flex: 0 0 auto;
}

@media (hover: hover) {
    .cs-cat-menu label:hover {
        background: #F1F8FF;
    }
}

/* pagination in the bar, aligned right */
.cs-pager {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cs-pager[hidden] {
    display: none;
}

/* space above the footer belongs to the listing, not the bottom pager, so it stays when the pager is
   hidden (one page of results, or none): same 60px + 120px as before when the pager shows */
.cs-filterbar ~ .container-large {
    padding-bottom: 120px;
}

#bottomPager {
    padding-bottom: 0;
}

.cs-pager .page-btn {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
}

/* arrows: same proportion as the bottom pager (12x21 icon in a 47px circle) */
.cs-pager .page-btn img {
    width: auto;
    height: 18px;
}

.cs-pager .page-numbers {
    gap: 4px;
}

/* both pagers (bar and below the cards): current page in a filled circle, arrows fill on hover */
.cs-pager .page-number,
#bottomPager .page-number {
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    font-family: inherit; /* buttons don't inherit the page font (Outfit) */
    transition: background-color 0.2s ease;
}

#bottomPager .page-number {
    min-width: 36px;
    height: 36px;
}

#bottomPager .page-numbers {
    gap: 10px;
}

.cs-pager .page-number.active,
#bottomPager .page-number.active {
    background: #E3EEFC;
    color: #1076F1;
    font-weight: 600;
}

.cs-pager .page-btn,
#bottomPager .page-btn {
    transition: background-color 0.2s ease;
}

.cs-pager .page-btn img,
#bottomPager .page-btn img {
    transition: filter 0.2s ease;
}

.cs-pager .page-btn:focus-visible,
#bottomPager .page-btn:focus-visible,
.cs-pager .page-number:focus-visible,
#bottomPager .page-number:focus-visible {
    outline: 2px solid #162A66;
    outline-offset: 2px;
}

@media (hover: hover) {
    .cs-pager .page-btn:not(:disabled):hover,
    #bottomPager .page-btn:not(:disabled):hover {
        background: #1076F1;
    }
    .cs-pager .page-btn:not(:disabled):hover img,
    #bottomPager .page-btn:not(:disabled):hover img {
        filter: brightness(0) invert(1);
    }
    .cs-pager .page-number:not(.active):hover,
    #bottomPager .page-number:not(.active):hover {
        background: #F1F8FF;
    }
}

.cs-pager-count {
    display: none;
    min-width: 52px;
    text-align: center;
    font-size: 15px;
    color: #162A66;
}

/* tablets and small laptops: search takes the free space */
@media (max-width: 1023px), (max-width: 1320px) and (orientation: portrait) {
    .cs-filterbar {
        margin: 24px 0 32px;
        padding: 12px 0;
    }
    .cs-filterbar-inner {
        gap: 14px;
    }
    .cs-search {
        flex: 1 1 auto;
    }
    .cs-cat {
        flex: 0 0 230px;
    }
}

/* phones: search on its own row; categories and a compact "2 / 5" pager below */
@media (max-width: 767px) {
    .cs-filterbar {
        margin: 20px 0 24px;
        padding: 10px 0;
    }
    .cs-filterbar-inner {
        flex-wrap: wrap;
        gap: 10px;
    }
    .cs-search {
        flex: 1 1 100%;
        padding: 8px 20px;
    }
    .cs-cat {
        flex: 1 1 0;
        min-width: 0;
    }
    .cs-cat-btn {
        padding: 8px 40px 8px 20px;
    }
    .cs-cat-menu {
        right: auto;
        min-width: 100%;
        max-width: calc(100vw - 40px);
    }
    .cs-cat-menu label {
        white-space: normal;
    }
    .cs-pager {
        gap: 6px;
    }
    .cs-pager .page-btn {
        width: 40px;
        height: 40px;
    }
    .cs-pager .page-numbers {
        display: none;
    }
    .cs-pager-count {
        display: block;
    }
}

/* ---------- Large laptops 1025-1200: navbar sits 40px from the top ---------- */
@media (min-width: 1025px) and (max-width: 1200px) and (orientation: landscape) {
    .cs-title {
        font-size: 50px;
    }
}

/* ---------- Stacked: tablets, portrait screens, phones ---------- */
@media (max-width: 1023px), (max-width: 1320px) and (orientation: portrait) {
    .cs-page {
        --cs-hero-mt: 16px;
        --cs-hero-gap: 48px;
    }
    .cs-hero {
        margin-left: 16px;
        margin-right: 16px;
        padding-bottom: 48px;
    }
    .cs-wrap {
        width: calc(100% - 80px);
    }
    .cs-hero .cs-wrap {
        width: calc(100% - 48px);
    }
    .cs-band {
        flex-direction: column;
        align-items: stretch;
        gap: 28px;
    }
    .cs-title {
        font-size: 44px;
    }
    .cs-facts {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 12px;
    }
    .cs-facts li {
        flex: 1 1 0;
        min-width: 0;
    }
    .cs-cover {
        flex: 0 0 auto;
        width: 100%;
        max-width: 720px;
    }
    .cs-main {
        padding: 28px 0 56px;
    }
    .cs-layout {
        display: block;
    }
    .cs-aside {
        display: none;
    }
    .cs-toc-mobile {
        display: block;
        margin-bottom: 36px;
        border: 1px solid #89A8F2;
        border-radius: 14px;
        background: #FFFFFF;
    }
    .cs-toc-mobile summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 18px;
        list-style: none;
        cursor: pointer;
        font-size: 15px;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--cs-blue);
    }
    .cs-toc-mobile summary::-webkit-details-marker {
        display: none;
    }
    .cs-toc-mobile[open] summary svg {
        transform: rotate(180deg);
    }
    .cs-toc-mobile .cs-toc-list {
        padding: 4px 18px 18px;
        /* long indexes (the schemes guide) scroll inside the bar */
        max-height: min(60vh, 520px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .cs-section p,
    .cs-list li,
    .cs-milestones li {
        font-size: 17px;
    }
    .cs-section h2 {
        font-size: 22px;
    }
    .cs-related {
        padding-bottom: 56px;
    }
    /* related cards scroll sideways */
    .cs-cards--related {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
        margin-right: -40px;
        padding-right: 40px;
    }
    .cs-cards--related .cs-card {
        flex: 0 0 340px;
        scroll-snap-align: start;
    }
    .cs-cards--listing {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {
    .cs-page {
        --cs-hero-mt: 10px;
        --cs-hero-gap: 36px;
    }
    .cs-hero {
        margin-left: 10px;
        margin-right: 10px;
        border-radius: 20px;
        padding-bottom: 32px;
    }
    .cs-wrap {
        width: calc(100% - 40px);
    }
    .cs-hero .cs-wrap {
        width: calc(100% - 28px);
    }
    .cs-band-text {
        gap: 12px;
    }
    .cs-eyebrow {
        font-size: 12px;
    }
    .cs-title {
        font-size: 34px;
    }
    .cs-title::after {
        width: 96px;
        height: 5px;
        margin-top: 14px;
    }
    .cs-partner {
        font-size: 16px;
    }
    .cs-location {
        font-size: 15px;
    }
    .cs-band {
        gap: 20px;
    }
    .cs-hero--tint .cs-band {
        gap: 24px;
    }
    /* separator: 20px above and below on phones (8px margin + the 12px gap) */
    .cs-hero--tint .cs-title::after {
        margin: 20px auto 8px;
    }
    .cs-facts {
        gap: 8px;
    }
    /* four or more stats don't fit in one row on a phone (labels overflow at 360-393px): two per row */
    .cs-facts {
        flex-wrap: wrap; /* boxes with a 0 basis (2-3 stats) still share one row */
    }
    .cs-facts li:first-child:nth-last-child(n+4),
    .cs-facts li:first-child:nth-last-child(n+4) ~ li {
        flex: 1 1 calc(50% - 4px);
        max-width: none;
    }
    .cs-facts li {
        padding: 10px 12px;
    }
    .cs-facts strong {
        font-size: 24px;
    }
    .cs-facts span {
        font-size: 13px;
    }
    .cs-main {
        padding-top: 20px;
    }
    .cs-toc-mobile {
        margin-bottom: 28px;
    }
    .cs-section {
        margin-bottom: 40px;
    }
    .cs-section h2 {
        font-size: 20px;
    }
    .cs-section p,
    .cs-list li {
        font-size: 16px;
    }
    .cs-milestones {
        gap: 10px;
    }
    .cs-milestones li {
        min-width: 0;
        padding: 12px 16px;
        font-size: 16px;
    }
    .cs-group {
        margin-top: 32px;
    }
    .cs-group h3 {
        font-size: 17px;
    }
    .cs-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cs-tile {
        padding: 12px 10px;
    }
    .cs-tile:nth-child(3n) {
        border-right: 1px solid var(--cs-line);
    }
    .cs-tile:nth-child(2n) {
        border-right: 0;
    }
    .cs-tile-name {
        font-size: 15px;
    }
    .cs-tile-org {
        font-size: 13px;
    }
    .cs-quote {
        padding: 20px 20px 24px;
    }
    .cs-quote blockquote p {
        font-size: 16px;
    }
    .cs-related-head h2 {
        font-size: 18px;
    }
    .cs-related-all {
        font-size: 14px;
    }
    .cs-cards--related {
        margin-right: -20px;
        padding-right: 20px;
    }
    .cs-cards--related .cs-card {
        flex: 0 0 min(300px, 82%);
    }
    .cs-cards--listing {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* phones in landscape: keep the title band short */
@media (max-height: 500px) and (orientation: landscape) {
    .cs-hero {
        padding-bottom: 28px;
    }
}
