:root {
    /* Define the primary blue color from the logo */
    --primary-blue: #34689C;
    --dark-grey: #333333;
    --light-bg: #F3F3F3;
}

/* Stop iOS Safari enlarging what it judges to be body text when a phone is
   rotated to landscape (the long paragraphs of the playbook set it off). */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', sans-serif;
    /* Recommended font or similar sans-serif */
    background-color: var(--light-bg);
    color: var(--dark-grey);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

p {
    margin: 0;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 20px;
}

header {
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}

footer {
    text-align: center;
    font-size: 12px;
    color: var(--primary-blue);
    padding: 20px;
    margin-top: 40px;
    /* Add margin to separate from content */
    border-top: 1px solid #ccc;
}

footer a {
    margin: 0 5px;
    color: var(--primary-blue);
}

.logo-container {
    display: flex;
    align-items: flex-end;
    font-size: 24px;
    font-weight: 700;
}

h1 {
    font-size: 30px;
    color: var(--dark-grey);
    font-weight: 700;
    margin-bottom: 10px;
}

h2 {
    color: var(--primary-blue);
    margin-top: 30px;
}

h3 {
    color: var(--primary-blue);
    font-size: 20px;
    margin-top: 0;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 10px;
}

.subtitle {
    font-size: 20px;
    font-weight: 400;
    color: #666;
    margin-bottom: 40px;
    border-left: 4px solid var(--primary-blue);
    padding-left: 15px;
}

/* Service List Styles (retained from index.html) */
.service-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(315px, 1fr));
    gap: 30px;
    /* Don't stretch: opening one card shouldn't grow its neighbours (see equaliseServiceCards) */
    align-items: start;
}

.service-item {
    background: white;
    padding: 25px 25px 12px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.service-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    transform: translateY(-5px);
}

.service-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.service-icon {
    flex-shrink: 0;
    color: var(--primary-blue);
}

.service-item h3 {
    color: var(--primary-blue);
    font-size: 20px;
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.expand-toggle {
    display: block;
    margin: 12px auto 0;
    padding: 6px 6px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--primary-blue);
    line-height: 0;
    transition: color 0.2s ease;
}

.expand-toggle:hover {
    color: #2a537d;
}

.chevron {
    display: block;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-item.open .chevron {
    transform: rotate(180deg);
}

.expanded-text {
    margin-top: 0px;
    padding-top: 0px;
    border-top: 1px dashed #ccc;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out, padding 0.4s ease-in-out;
}

.expanded-text ul {
    padding-left: 0;
}

.expanded-text li {
    margin-top: 8px;
}

.service-item.open .expanded-text {
    max-height: 500px;
    opacity: 1;
    padding-top: 0px;
}


/* How I Work steps (homepage and Tech for Good) */
.section-intro {
    margin-bottom: 20px;
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
}

.step-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    color: white;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 15px;
}

.step-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

/* Tech for Good */
.tfg-teaser {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    background: white;
    padding: 30px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.tfg-icon {
    flex-shrink: 0;
    color: var(--primary-blue);
}

.tfg-teaser p {
    margin-bottom: 15px;
}

.tfg-quote {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-blue);
}

.button-link {
    display: inline-block;
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 25px;
    border-radius: 7px;
    font-weight: 700;
    transition: background-color 0.5s;
}

.button-link:hover {
    background-color: #2a537d;
    text-decoration: none;
}

.help-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
    gap: 20px;
}

.help-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

@media (max-width: 600px) {
    .tfg-teaser {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
}


/* Bio + Experience Styles (retained from index.html) */
.bio-exp {
    display: grid;
    grid-template-columns: auto 25%;
    gap: 30px;
    place-items: center;
    align-items: start;
}

.experience {
    margin-top: 20px;
}

.experience ul {
    list-style: none;
    padding-left: 0;
}

.experience li {
    margin-bottom: 8px;
}

/* CTA Styles (retained from index.html) */
.cta {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cta a {
    display: inline-block;
    background-color: var(--primary-blue);
    color: white;
    margin: 10px;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 7px;
    font-weight: 700;
    transition: background-color 0.5s;
}

.cta a:hover {
    background-color: #2a537d;
}

/* New styles for the subpages (Contact & Privacy) */
.content-section {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Tech for Good intro box with Tech4Good SW badge (badge right on desktop, above text on mobile) */
.intro-with-badge {
    display: flex;
    align-items: center;
    gap: 30px;
}

.intro-with-badge p {
    flex: 1;
    min-width: 0;
}

.t4g-badge {
    order: 2;
    flex-shrink: 0;
    display: block;
    padding-left: 30px;
    border-left: 1px solid #eee;
}

.t4g-badge img {
    display: block;
    width: 100px;
    height: auto;
}

@media (max-width: 600px) {
    .intro-with-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .t4g-badge {
        order: 0;
        padding-left: 0;
        border-left: none;
    }

    .t4g-badge img {
        width: 80px;
    }
}

.contact-item {
    margin-bottom: 0px;
    padding: 15px;
    border-left: 4px solid var(--primary-blue);
    background-color: var(--light-bg);
}

.contact-item strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--primary-blue);
}

.privacy-section {
    margin-bottom: 25px;
}

.privacy-section h3 {
    font-size: 20px;
    color: var(--dark-grey);
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-top: 20px;
}



/* Navigation & Header Styles */
/* Sticky, shrinking header.
   The sticky lives on #header-placeholder, not on <header> itself: the header
   is generated into that div by generate.py, and a sticky element can only
   stick within its own parent's box. The placeholder is exactly as tall as the
   header, so sticking <header> there would scroll it straight off screen.
   The placeholder IS a direct child of .container, so it sticks properly. */
#header-placeholder {
    position: sticky;
    top: 0;
    z-index: 900;
}

/* Bleeds over the .container gutters so the background covers the full
   content width as the page scrolls under it. */
header {
    justify-content: space-between;
    align-items: center;
    position: relative;
    background-color: var(--light-bg);
    border-bottom: 2px solid rgba(52, 104, 156, 0.2);
    margin: 0 -20px 30px;
    padding: 0 20px 15px;
    transition: padding 0.28s ease, box-shadow 0.28s ease;
}

header.shrunk {
    padding: 8px 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Reading-progress line, sat on the header's bottom border.
   Width is driven by site.js. */
.scroll-progress {
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 0;
    background-color: var(--primary-blue);
    box-shadow: 0 0 8px rgba(52, 104, 156, 0.45);
}

/* Cursor spotlight. Multiplied over the page so it tints the white cards as
   it passes, not just the grey background. The element is created by
   site.js, and only on fine-pointer, non-reduced-motion devices. */
.cursor-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
    mix-blend-mode: multiply;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.logo-img {
    width: 270px;
    max-width: 100%;
    height: auto;
    transition: width 0.28s ease;
}

header.shrunk .logo-img {
    width: 190px;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}

nav a {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--dark-grey);
    padding: 5px 0;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--primary-blue);
    text-decoration: none;
    border-bottom: 2px solid var(--primary-blue);
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-blue);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile Navigation Styles */
@media (max-width: 840px) {
    .logo-img {
        width: 240px;
    }

    header.shrunk .logo-img {
        width: 150px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(12px) saturate(140%);
        -webkit-backdrop-filter: blur(12px) saturate(140%);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
        border-bottom: 1px solid rgba(52, 104, 156, 0.12);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        z-index: 1000;
    }

    /* Solid fallback for browsers without backdrop-filter */
    @supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
        .nav-menu {
            background: white;
        }
    }

    .nav-menu.active {
        max-height: 300px;
        padding: 20px 0;
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .nav-menu a {
        font-size: 18px;
    }

    /* Animate Hamburger to X */
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}



/* Insights Styles (blog-* classes date from when the page held only blogs) */
.insights-section-title {
    margin: 50px 0 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-blue);
}

.insights-section-title:first-child {
    margin-top: 0;
}

/* Section titles link to themselves, so a visitor can copy the anchor */
.insights-section-title a {
    color: inherit;
}

/* Anchor targets stop below the sticky header rather than under it */
.insights-section-title,
.blog-card,
.partner-card {
    scroll-margin-top: 130px;
}

/* Brief glow on the card an #anchor link points at */
.blog-card:target,
.partner-card:target {
    animation: insight-target-glow 2.5s ease-out;
}

@keyframes insight-target-glow {
    0%, 40% {
        box-shadow: 0 0 0 4px var(--primary-blue), 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }
}

/* auto-fill (not auto-fit) so a section with one card keeps a normal card
   width instead of stretching across the page */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 25px;
}

.blog-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.blog-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-link-wrapper:hover {
    text-decoration: none;
}

.blog-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.insight-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-blue);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.blog-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-image {
    transform: scale(1.05);
}

.blog-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-date {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blog-title {
    font-size: 18px;
    color: var(--primary-blue);
    margin-bottom: 10px;
    line-height: 1.4;
    border-bottom: none;
    padding-bottom: 0;
}

.blog-snippet {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-top: auto;
}


/* Partners Page Styles */
.partner-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 30px;
}

.partner-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: center;
    gap: 30px;
    padding: 25px;
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.partner-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.partner-logo {
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.partner-content {
    display: flex;
    flex-direction: column;
}

.partner-name {
    font-size: 22px;
    margin: 0 0 10px 0;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 8px;
}

.partner-name a {
    color: var(--primary-blue);
    font-weight: 700;
}

.partner-description {
    color: #555;
    font-size: 15px;
    margin-bottom: 15px;
}

.partner-visit {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-blue);
    align-self: flex-start;
}

@media (max-width: 600px) {
    .partner-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .partner-logo {
        max-height: 90px;
    }

    .partner-visit {
        align-self: center;
    }

    .partner-name {
        text-align: center;
    }
}


/* Testimonials Styles */
.testimonial-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(315px, 1fr));
    gap: 30px;
}

.testimonial-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.testimonial-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    transform: translateY(-5px);
}

.testimonial-quote {
    position: relative;
    padding: 15px 0 0 34px;
    color: #444;
    font-style: italic;
    font-size: 15px;
}

.testimonial-quote::before {
    content: "\201C";
    position: absolute;
    top: 8px;
    left: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 55px;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px var(--primary-blue);
    text-stroke: 1px var(--primary-blue);
    font-style: normal;
    font-weight: 700;
    pointer-events: none;
}

.testimonial-quote p {
    margin: 0;
}

.testimonial-attribution {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-blue);
}

.testimonial-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 110px;
    height: 75px;
}

.testimonial-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.testimonial-person {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.3;
}

.testimonial-person strong {
    color: var(--primary-blue);
    font-size: 15px;
}

.testimonial-person span {
    color: #666;
}


/* Reveal-on-scroll animation */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

    .reveal,
    .reveal.reveal-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
/* Homepage hero image: a frame 25% shorter than the image, which pans inside
   it as the page scrolls (initHeroPan in site.js sets --pan from 0 to
   1). The image is 800x266, so the frame is 800 x (266 x 0.75). */
.hero-frame {
    aspect-ratio: 800 / 199.5;
    overflow: hidden;
}

.hero-frame img {
    display: block;
    width: 100%;
    height: auto;
    transform: translateY(calc(var(--pan, 0.5) * -25%));
    will-change: transform;
}


/* ---------------------------------------------------------------------------
   Insights published as pages of their own (the playbook). The markup comes
   from article.py: a navy cover, a contents list beside the text, and the
   chapters as cards, most of them collapsible <details>. */
:root {
    --navy: #18304A;
    --blue-light: #7EA2C6;
    --blue-soft: #E1E8F0;
    --ink-muted: #5C6166;
}

.breadcrumb {
    font-size: 14px;
    margin-bottom: 18px;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #666;
}

.breadcrumb li + li::before {
    content: "\203A";
    margin-right: 8px;
    color: #999;
}

.eyebrow {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-blue);
}

/* Cover */
.article-cover {
    position: relative;
    overflow: hidden;
    background: var(--navy);
    color: white;
    border-radius: 10px;
    padding: 48px 48px 44px;
    margin-bottom: 30px;
}

.article-cover > * {
    position: relative;
}

.article-cover .eyebrow {
    color: var(--blue-light);
}

.article-cover h1 {
    color: white;
    font-size: 40px;
    line-height: 1.15;
    margin: 10px 0 18px;
    max-width: 18em;
    text-wrap: balance;
}

.cover-standfirst {
    max-width: 34em;
    font-size: 20px;
    line-height: 1.5;
    padding-left: 16px;
    border-left: 4px solid #5685B3;
    margin-bottom: 24px;
}

.cover-byline {
    font-size: 14px;
    color: #C8D3DF;
    margin-bottom: 26px;
}

.cover-byline span:first-child {
    color: white;
    font-weight: 700;
}

.cover-byline span + span::before {
    content: "\00B7";
    margin: 0 10px;
}

.cover-mark {
    position: absolute;
    right: -40px;
    bottom: -70px;
    width: 340px;
    height: auto;
    pointer-events: none;
}

/* Contents beside the text */
.article-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.article-toc {
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    font-size: 14px;
    border-top: 2px solid var(--primary-blue);
}

.article-toc summary {
    list-style: none;
    cursor: default;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 6px;
}

.article-toc summary::-webkit-details-marker {
    display: none;
}

.article-toc summary .section-chevron {
    display: none;
}

.toc-list,
.toc-stages {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 0;
}

/* "nav a" above styles the site menu; this list is plain text */
.article-toc nav a {
    text-transform: none;
    font-size: 14px;
    border-bottom: none;
}

.toc-list a {
    display: block;
    padding: 6px 10px 6px 12px;
    color: var(--dark-grey);
    font-weight: 600;
    line-height: 1.35;
    border-left: 3px solid transparent;
}

.toc-list a:hover {
    color: var(--primary-blue);
    text-decoration: none;
}

.toc-list a.current {
    color: var(--primary-blue);
    border-left: 3px solid var(--primary-blue);
    background: rgba(52, 104, 156, 0.07);
}

.toc-num {
    display: inline-block;
    min-width: 1.5em;
    color: var(--primary-blue);
}

.toc-stages {
    padding-left: 1.5em;
    margin-bottom: 4px;
}

.toc-stages a {
    font-weight: 400;
    font-size: 13px;
    padding: 4px 10px 4px 12px;
}

.expand-all {
    display: block;
    width: 100%;
    margin: 14px 0 0;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid var(--primary-blue);
    border-radius: 6px;
    color: var(--primary-blue);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.expand-all:hover {
    background: var(--primary-blue);
    color: white;
}

.toc-download {
    display: block;
    margin-top: 12px;
    padding: 0 10px;
    font-size: 13px;
}

/* The text */
.article-body {
    min-width: 0;
    font-size: 17px;
    line-height: 1.65;
}

.article-body p {
    margin: 0 0 1em;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.1em;
    padding-left: 1.3em;
}

.article-body li {
    margin-bottom: 0.5em;
}

.article-body li::marker {
    color: var(--primary-blue);
}

.article-body strong {
    color: #1D1F21;
}

.article-body a.xref {
    font-weight: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(52, 104, 156, 0.4);
    text-underline-offset: 2px;
}

.article-body h3,
.article-body h4 {
    color: var(--navy);
    border: none;
    padding: 0;
    margin: 1.6em 0 0.5em;
    font-size: 20px;
    line-height: 1.3;
}

.article-body h4 {
    font-size: 17px;
    color: var(--dark-grey);
}

.article-body h3 .num,
.article-body h4 .num {
    color: var(--primary-blue);
    margin-right: 4px;
}

.section-body > h3:first-child {
    margin-top: 0.3em;
}

.article-body [id] {
    scroll-margin-top: 120px;
}

/* Chapters as cards */
.section-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 28px 16px;
}

details.section-card > summary,
.stage-head {
    cursor: pointer;
    list-style: none;
}

details.section-card > summary::-webkit-details-marker,
.stage-head::-webkit-details-marker {
    display: none;
}

details.section-card > summary:hover h2,
.stage-head:hover h3 {
    color: var(--primary-blue);
}

.section-num {
    flex: 0 0 auto;
    min-width: 1.2em;
    padding-top: 2px;
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-blue);
}

.section-title {
    flex: 1 1 auto;
    min-width: 0;
}

.section-title h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    color: var(--navy);
    transition: color 0.2s;
}

.section-desc {
    display: block;
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--ink-muted);
}

.section-chevron {
    flex: 0 0 auto;
    align-self: center;
    display: inline-flex;
    color: var(--primary-blue);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

details[open] > summary .section-chevron {
    transform: rotate(180deg);
}

.section-body {
    padding: 0 28px 28px;
}

/* The lifecycle stages, inside their chapter */
.stages {
    margin-top: 12px;
    border-top: 1px solid #E3E6EA;
}

.stage {
    border-bottom: 1px solid #E3E6EA;
}

.stage-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 4px;
}

.stage-num {
    min-width: 2.2em;
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-blue);
}

.stage-head h3 {
    flex: 1;
    margin: 0;
    font-size: 19px;
    color: var(--navy);
    transition: color 0.2s;
}

.stage-body {
    padding: 4px 4px 20px;
}

/* Key takeaways */
.takeaways {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: takeaway;
}

.takeaways li {
    counter-increment: takeaway;
    position: relative;
    padding: 0 0 14px 56px;
    margin: 0 0 14px;
    border-bottom: 1px solid #E3E6EA;
}

.takeaways li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.takeaways li::before {
    content: counter(takeaway, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--primary-blue);
}

.takeaways strong {
    color: var(--navy);
}

/* Figures: drawings laid out in fixed pixels. The frame has the drawing's
   aspect ratio; site.js sets --figure-scale so the drawing fills it, and
   without script the frame scrolls instead. */
.figure {
    width: 100%;
    margin: 1.6em auto;
    container-type: inline-size;
}

/* A figure with a drawing made for phones shows that one in a narrow column */
.figure-narrow {
    display: none;
    max-width: 384px;
    margin: 0 auto;
}

@container (max-width: 480px) {
    .has-narrow .figure-wide {
        display: none;
    }

    .has-narrow .figure-narrow {
        display: block;
    }
}

.figure-frame {
    position: relative;
    width: 100%;
    overflow: auto;
}

.figure-frame.fitted {
    overflow: hidden;
}

.figure-art {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    transform: scale(var(--figure-scale, 1));
}

.figure figcaption {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink-muted);
}

.figure figcaption b {
    color: var(--primary-blue);
}

/* Tables */
.table-scroll {
    overflow-x: auto;
    margin: 1.2em 0 1.6em;
}

.article-body table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.45;
}

.article-body th {
    text-align: left;
    color: var(--navy);
    padding: 8px 12px 8px 0;
    border-bottom: 2px solid var(--primary-blue);
    vertical-align: bottom;
}

.article-body td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid #DDD;
    vertical-align: top;
}

.article-body td:first-child {
    font-weight: 600;
}

.article-body td em {
    font-style: normal;
    font-weight: 500;
    color: var(--ink-muted);
}

/* Callouts */
.callout,
.keypoint,
.checklist,
.principle {
    margin: 1.4em 0;
    border-radius: 8px;
}

.callout .eyebrow,
.keypoint .eyebrow,
.checklist .eyebrow,
.principle .eyebrow {
    margin-bottom: 8px;
}

.callout p:last-child,
.keypoint p:last-child {
    margin-bottom: 0;
}

.callout.tech {
    background: var(--light-bg);
    border-top: 4px solid var(--navy);
    padding: 16px 20px 18px;
    font-size: 15px;
    line-height: 1.55;
}

.callout.tech .eyebrow {
    color: var(--navy);
}

.callout.experience {
    padding: 4px 0 4px 20px;
    border-left: 4px solid var(--primary-blue);
    border-radius: 0;
}

.callout.experience .story {
    font-style: italic;
}

.callout.experience .outcome {
    font-size: 15px;
    color: var(--navy);
}

.keypoint {
    background: var(--blue-soft);
    padding: 18px 22px 20px;
}

.kp-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.keypoint.watch .eyebrow {
    color: var(--navy);
}

.keypoint .kp-title {
    margin-bottom: 6px;
    font-size: 19px;
    font-weight: 700;
    color: var(--navy);
}

.tag {
    padding: 1px 8px;
    border: 1px solid var(--blue-light);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--navy);
}

.checklist {
    border: 1px solid var(--blue-light);
    padding: 16px 20px 14px;
}

.checklist .eyebrow {
    color: var(--navy);
}

.checklist ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checklist li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 6px;
}

.checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.4em;
    width: 13px;
    height: 13px;
    box-sizing: border-box;
    border: 2px solid var(--primary-blue);
}

.principle {
    background: var(--navy);
    color: white;
    padding: 28px 32px 30px;
    border-radius: 10px;
}

.principle .eyebrow {
    color: var(--blue-light);
}

.principle .statement {
    margin: 0;
    font-size: 22px;
    line-height: 1.4;
    font-weight: 600;
    text-wrap: balance;
}

.more-insights {
    margin-top: 50px;
}

/* Articles (article.py's plain style): one open column of text, on a white
   card like the playbook's chapters, with photos and diagrams as images. */
.article-layout.no-contents {
    grid-template-columns: minmax(0, 1fr);
}

.article-prose {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 36px 44px 20px;
}

.no-contents .article-prose {
    max-width: 820px;
    margin: 0 auto;
}

.article-prose h2 {
    color: var(--navy);
    font-size: 26px;
    line-height: 1.25;
    margin: 1.7em 0 0.6em;
}

.article-prose > h2:first-child,
.article-prose > h3:first-child {
    margin-top: 0;
}

.figure-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.figure-image figcaption {
    text-align: center;
}

.figure-zoom {
    display: block;
    cursor: zoom-in;
}

/* The full-screen view of an article image (site.js) */
.lightbox {
    box-sizing: border-box;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 16px;
    border: none;
    background: transparent;
    cursor: zoom-out;
}

.lightbox[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lightbox::backdrop {
    background: rgba(10, 18, 28, 0.96);
}

.lightbox-image {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    object-fit: contain;
}

.lightbox-caption {
    flex: 0 0 auto;
    margin: 0;
    max-width: 60em;
    text-align: center;
    font-size: 15px;
    color: #DDE4EC;
}

.lightbox-close {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 1;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
    background: rgba(255, 255, 255, 0.25);
}

@media print {
    .lightbox {
        display: none !important;
    }
}

.article-prose blockquote {
    margin: 1.4em 0;
    padding: 4px 0 4px 20px;
    border-left: 4px solid var(--primary-blue);
    font-size: 18px;
    font-style: italic;
    color: var(--navy);
}

.article-prose blockquote p:last-child {
    margin-bottom: 0;
}

.article-prose hr {
    border: none;
    border-top: 1px solid #DDD;
    margin: 2em 0;
}

.article-prose h2 .num {
    color: var(--primary-blue);
}

/* "Part n of N" at the foot of an article in a series (generate.py) */
.series-nav {
    margin-top: 30px;
}

.series-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 16px;
    margin-top: 10px;
}

/* "nav a" above styles the site menu; these are plain links */
.series-nav .series-links a {
    text-transform: none;
    font-size: 16px;
    border-bottom: none;
    display: block;
    padding: 16px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    font-weight: 600;
    line-height: 1.35;
    color: var(--navy);
    transition: color 0.2s, box-shadow 0.2s;
}

.series-nav .series-links a:hover {
    color: var(--primary-blue);
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
}

.series-links .series-next {
    text-align: right;
    grid-column: -2;
}

.series-dir {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-blue);
}

.article-body .article-original {
    margin: 40px 4px 0;
    font-size: 15px;
    color: var(--ink-muted);
}

@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .article-toc {
        position: static;
        max-height: none;
        padding: 0 18px;
        background: white;
        border-top: none;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }

    .article-toc summary {
        pointer-events: auto;
        cursor: pointer;
        padding: 14px 0;
    }

    .article-toc summary .section-chevron {
        display: inline-flex;
    }

    .article-toc nav {
        padding-bottom: 14px;
    }

    .article-cover {
        padding: 30px 22px 28px;
    }

    .article-cover h1 {
        font-size: 30px;
    }

    .cover-standfirst {
        font-size: 17px;
    }

    .cover-mark {
        width: 220px;
        right: -50px;
        bottom: -50px;
    }

    .section-head {
        gap: 12px;
        padding: 18px 18px 12px;
    }

    .section-num {
        font-size: 24px;
    }

    .section-title h2 {
        font-size: 22px;
    }

    .section-body {
        padding: 0 18px 20px;
    }

    .article-body {
        font-size: 16px;
    }

    .article-prose {
        padding: 22px 18px 8px;
    }

    .article-prose h2 {
        font-size: 22px;
    }
}

@media print {
    .article-page .article-toc,
    .article-page .more-insights,
    .article-page .section-chevron,
    .menu-toggle,
    .scroll-progress,
    .cursor-glow {
        display: none !important;
    }

    .article-layout {
        display: block;
    }

    .article-cover,
    .principle {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .section-card,
    .article-prose {
        box-shadow: none;
        border: 1px solid #DDD;
    }

    .figure,
    .checklist,
    .keypoint,
    .callout {
        break-inside: avoid;
    }

    .article-body a.xref {
        color: inherit;
        text-decoration: none;
    }
}


/* Featured insights on the home page: the newest items that have a page of
   their own, as wide cards (image beside the text when there is room). */
.featured-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
    gap: 30px;
}

.featured-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    container-type: inline-size;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.featured-link {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    height: 100%;
    color: inherit;
    font-weight: 400;
}

.featured-link:hover {
    text-decoration: none;
}

.featured-image {
    position: relative;
    min-height: 220px;
    overflow: hidden;
}

.featured-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s ease;
}

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.featured-content {
    display: flex;
    flex-direction: column;
    padding: 25px;
}

.featured-content h3 {
    margin: 0 0 10px;
    padding: 0;
    border: none;
    font-size: 22px;
    line-height: 1.3;
    color: var(--primary-blue);
}

.featured-content p {
    flex-grow: 1;
    margin-bottom: 18px;
    color: #555;
}

@container (max-width: 560px) {
    .featured-link {
        grid-template-columns: 1fr;
    }

    .featured-image {
        min-height: 0;
        height: 200px;
    }
}
