/* ====================================================================================================
   ACCESSIBILITY FOUNDATION & CORE VARIABLES (WCAG 2.0 AA COMPLIANT / WCAG 3.0 APCA TARGETED)
   ==================================================================================================== */
:root {
    --bg: #ffffff;
    --ink: #101828;            /* Rich Slate Gray - APCA optimal readability profile */
    --muted: #475467;          /* Accessible secondary description standard output */
    --line: #eaecf0;           /* Soft UI borders */
    --teal: #0e7490;           /* High contrast accent primary teal */
    --teal-dark: #0f766e;
    --teal-light: #f0fdfa;     /* Safe tone containers */
    --white: #ffffff;
    --shadow-sm: 0 4px 12px rgba(16, 24, 40, 0.02);
    --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.04);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Accessible focus ring indicators for keyboard navigation controls */
*:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 3px;
}

/* Hidden accessible link mechanism for assistive software skipping navigation anchors */
.skip-link {
    position: absolute;
    top: -100px;
    inset-inline-start: 20px;
    background: var(--teal);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 1000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 20px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ====================================================================================================
   HEADER & LOCALIZATION CONTROLS
   ==================================================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(20px, 5vw, 80px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-mark {
    color: var(--teal);
    display: grid;
    place-items: center;
}

.header-navigation-wrapper {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--ink);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Add or update these rules in static/css/site.css */
.header-action.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    /* Forces consistent text size */
    line-height: 1.25rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    #nav-menu-wrapper.hidden {
        display: flex !important;
        /* Forces desktop view to ignore mobile hidden state during paint */
    }
}

/* Language Selection Trigger Widget Layout styles */
.lang-selector-container {
    position: relative;
    display: inline-block;
}

.lang-picker-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: 16px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-picker-button:hover,
.lang-selector-container:hover .lang-picker-button {
    border-color: var(--ink);
    color: var(--ink);
}

/* CSS-driven micro translation selector panel popup display tree logic */
.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    inset-inline-end: 0;
    margin: 8px 0 0;
    padding: 6px;
    list-style: none;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-selector-container:hover .lang-dropdown-menu,
.lang-selector-container:focus-within .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    color: var(--muted);
}

/* 32 languages: keep the list scrollable and in two columns on wide screens */
.lang-dropdown-menu {
    max-height: min(70vh, 480px);
    overflow-y: auto;
    min-width: 200px;
    z-index: 70;
}

@media (min-width: 768px) {
    .lang-dropdown-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 360px;
    }
}

.lang-dropdown-menu a.is-current {
    background: var(--teal-light);
    color: var(--teal);
    font-weight: 700;
}

.lang-dropdown-menu a:hover {
    background: var(--teal-light);
    color: var(--teal);
}

/* Button & Action Pill Component Classes */
.header-action,
.button {
    display: inline-flex;
    min-height: 40px;
    padding: 0 18px;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.header-action.secondary {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
}

.header-action.secondary:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.header-action.primary,
.button-primary {
    background: var(--teal);
    color: var(--white);
}

.header-action.primary:hover,
.button-primary:hover {
    background: var(--teal-dark);
}

/* ====================================================================================================
   STRUCTURAL WORKSPACES & MAIN HERO SPLIT SYSTEM
   ==================================================================================================== */
.section {
    padding-right: clamp(20px, 5vw, 80px);
    padding-left: clamp(20px, 5vw, 80px);
    max-width: 1440px;
    margin: 0 auto;
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(40px, 5vw, 80px);
    align-items: center;
    min-height: calc(85vh - 74px);
    padding-top: 60px;
    padding-bottom: 60px;
}

.hero-label {
    display: block;
    font-weight: 600;
    color: var(--muted);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.8rem, 4.5vw, 4.2rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.hero-copy p {
    color: var(--muted);
    font-size: clamp(1.1rem, 1.3vw, 1.25rem);
    line-height: 1.6;
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.button-secondary-outlined {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button-secondary-outlined:hover {
    background: #f9fafb;
    border-color: var(--ink);
}

/* Container pod handling the visual illustration assets */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.visual-concept-pod {
    width: 100%;
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
}

.lottie-viewport {
    width: 100%;
    max-width: 480px;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Forces the web component custom tag element to expand cleanly inside the layout viewport */
.lottie-viewport dotlottie-wc {
    width: 100% !important;
    height: 100% !important;
    max-height: 450px;
}

/* ====================================================================================================
   FEATURE GRID & METRIC ROW COMPONENT BLOCKS
   ==================================================================================================== */
.program-features {
    padding-top: 40px;
    padding-bottom: 60px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    border-top: 1px solid var(--line);
    padding-top: 60px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-icon {
    color: var(--teal);
    width: 40px;
    height: 40px;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.feature-card p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.5;
}

/* Flexible Dashboard Metrics Bar */
.metrics-banner {
    padding-top: 40px;
    padding-bottom: 40px;
}

.metrics-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 32px;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 32px 64px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--teal);
    line-height: 1;
}

.metric-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

/* ====================================================================================================
   MISSION CORE & MAIN PROGRAM GRID ENVIRONMENT
   ==================================================================================================== */
h2 {
    font-size: clamp(2rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.badge {
    display: inline-block;
    background: var(--teal-light);
    color: var(--teal);
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.mission {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    padding-top: 80px;
    padding-bottom: 80px;
    border-top: 1px solid var(--line);
}

.mission-content p {
    font-size: 1.15rem;
    color: var(--muted);
    line-height: 1.7;
}

/* Centered Programs Hub Styling Header Layout rules */
.programs-hub {
    padding-top: 80px;
    padding-bottom: 80px;
}

.section-heading-centered {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 56px;
}

.section-heading-centered p {
    font-size: 1.15rem;
    color: var(--muted);
    margin-top: 12px;
}

/* Responsive 2x2 Platform Track Block Matrix */
.programs-modern-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
}

.program-modern-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.program-modern-card:hover {
    transform: translateY(-4px);
    border-color: var(--teal);
    box-shadow: var(--shadow-md);
}

.card-glow-icon {
    width: 44px;
    height: 44px;
    background: var(--teal-light);
    color: var(--teal);
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.program-modern-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.program-modern-card p {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 0;
}

/* ====================================================================================================
   IMPACT MATRIX & FULL COMPONENT CTA WRAPPERS
   ==================================================================================================== */
.impact {
    padding-top: 60px;
    padding-bottom: 80px;
}

.impact-panel-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 32px;
    padding: 64px;
    align-items: center;
}

.impact-copy p {
    font-size: 1.1rem;
    color: var(--muted);
    margin-top: 16px;
}

.impact-interactive-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.list-item-ui {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--white);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.checkbox-icon {
    color: var(--teal);
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1;
}

.list-item-ui p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Bottom Structural Immersive CTA Callout */
.volunteer {
    padding-top: 40px;
    padding-bottom: 80px;
}

.cta-banner-card {
    background: linear-gradient(135deg, #0e7490 0%, #0f766e 100%);
    color: var(--white);
    border-radius: 32px;
    padding: 64px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.cta-banner-card h2 {
    margin-bottom: 16px;
}

.cta-banner-card p {
    max-width: 600px;
    margin: 0 auto 36px;
    color: #e0f2fe;
    font-size: 1.1rem;
}

.button-white {
    background: var(--white);
    color: var(--teal-dark);
    font-weight: 700;
    min-height: 48px;
    padding: 0 28px;
    border-radius: 24px;
}

.button-white:hover {
    background: #f8fafc;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px clamp(20px, 5vw, 80px);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ====================================================================================================
   RESPONSIVE DESIGN ADAPTATION MATRIX (MEDIA BREAKPOINTS)
   ==================================================================================================== */
@media (max-width: 1024px) {
    .hero, .mission, .programs-modern-grid, .impact-panel-modern {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .hero-visual {
        order: -1;
    }

    .metrics-container {
        padding: 32px;
        justify-content: grid;
    }
}

@media (max-width: 768px) {
    .header-navigation-wrapper {
        display: none; /* Simplifies complex multi-actions for clean mobile toggles */
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .metrics-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .impact-panel-modern, .cta-banner-card {
        padding: 40px 24px;
    }
    
    .site-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* Blog page layout */
.blog-layout {
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .blog-layout {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 2rem;
    }
}

.blog-page-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

.blog-post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

/* Desktop */
@media (min-width: 1280px) {
    .blog-page-layout {
        grid-template-columns: 220px minmax(0, 1050px) 220px;
        justify-content: center;
        gap: 2rem;
    }

    .blog-filter-sidebar {
        position: sticky;
        top: 7rem;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1279px) {
    .blog-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */
@media (max-width: 1279px) {
    .blog-filter-sidebar {
        position: static;
    }
}

@media (max-width: 767px) {
    .blog-post-grid {
        grid-template-columns: 1fr;
    }
}

.blog-shell {
    width: 100%;
    max-width: 1600px;
}

/* ====================================================================================================
   LONG-FORM TEXT PAGES (ACCESSIBILITY STATEMENT, POLICIES)
   ==================================================================================================== */

/* This build has no Tailwind typography plugin, so the `prose` classes never
   applied and long-form pages had hand-placed <br> tags instead. Vertical
   rhythm lives here now. Colours use the theme variables so dark mode follows. */
.longform {
    font-size: 1.0625rem;
    line-height: 1.75;
}

.longform > * + * {
    margin-top: 1.25rem;
}

.longform h2 {
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Breathing room above a new section, less below its heading. */
.longform > * + h2 {
    margin-top: 2.75rem;
}

.longform > h2 + * {
    margin-top: 0.75rem;
}

.longform h3 {
    color: var(--ink);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

.longform > * + h3 {
    margin-top: 1.75rem;
}

.longform > h3 + * {
    margin-top: 0.5rem;
}

.longform ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.longform li + li {
    margin-top: 0.5rem;
}

.longform strong {
    color: var(--ink);
    font-weight: 600;
}

.longform a {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.longform a:hover {
    color: var(--teal-dark);
}


/* ====================================================================================================
   RIGHT-TO-LEFT ADJUSTMENTS
   ==================================================================================================== */

/* The hero slider chevrons are direction-specific glyphs, so they point the
   wrong way in Arabic. The buttons already advance correctly; only the icon
   needs mirroring. */
/* Decorative arrows in links ("View all posts →"). They are literal glyphs,
   so mirror them alongside the text direction. */
.dir-arrow {
    display: inline-block;
}

[dir="rtl"] .dir-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] #prev-slide svg,
[dir="rtl"] #next-slide svg {
    transform: scaleX(-1);
}


/* ====================================================================================================
   LONG-FORM PAGE FURNITURE (HERO, CONTENTS RAIL, TIMELINE)
   ==================================================================================================== */

/* Built here rather than as Tailwind utilities: output.css is a committed
   build, so a class that is not already in it would do nothing at all. */

.page-hero {
    background: #0b3b46;
    color: #ffffff;
    padding: 72px 0;
}

.page-hero-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-hero .eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7fd4c1;
}

.page-hero h1 {
    margin: 14px 0 0;
    font-size: clamp(2.25rem, 5vw, 3.4rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #ffffff;
}

.page-hero .hero-lede {
    margin: 18px 0 0;
    max-width: 40em;
    font-size: 1.125rem;
    line-height: 1.65;
    color: #b9d9e2;
}

.page-hero .hero-meta {
    margin: 18px 0 0;
    font-size: 0.875rem;
    color: #9dc4cf;
}

/* Hero with a photograph beside the text. */
.hero-split {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    align-items: center;
    justify-content: space-between;
}

.hero-split > div {
    flex: 1 1 420px;
}

.hero-photo {
    flex: 0 0 340px;
    width: 340px;
    height: 340px;
    object-fit: cover;
    object-position: center 22%;
    border-radius: 18px;
    display: block;
}

@media (max-width: 720px) {
    .hero-photo {
        flex-basis: 100%;
        width: 100%;
        height: 260px;
    }
}

/* Two-column shell with a contents rail. */
.with-toc {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.toc {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 0 12px 14px;
}

.toc a {
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: none;
    padding: 9px 14px;
    border-inline-start: 2px solid var(--line);
}

.toc a:hover,
.toc a:focus-visible {
    color: var(--teal);
    background: var(--teal-light);
}

/* The "short version" band. */
.keypoints {
    background: #0b3b46;
    border-radius: 20px;
    padding: 36px 40px;
    color: #ffffff;
}

.keypoints h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.keypoints .keypoints-lede {
    margin: 6px 0 24px;
    max-width: 45em;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #b9d9e2;
}

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

.keypoint-grid li {
    background: rgb(255 255 255 / .07);
    border: 1px solid rgb(255 255 255 / .14);
    border-radius: 14px;
    padding: 22px;
}

.keypoint-grid strong {
    display: block;
    margin: 12px 0 8px;
    font-size: 1rem;
    color: #ffffff;
}

.keypoint-grid span {
    font-size: 0.82rem;
    line-height: 1.55;
    color: #9dc4cf;
}

/* A bordered panel used for contact and accommodation blocks. */
.panel {
    background: var(--teal-light);
    border: 1px solid #99e0d3;
    border-radius: 16px;
    padding: 28px 32px;
}

.panel h2 {
    margin: 0 0 6px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ink);
}

.panel p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
}

.panel .button-pill {
    display: inline-block;
    margin-top: 16px;
    background: var(--teal);
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 12px 26px;
    border-radius: 999px;
    text-decoration: none;
}

.panel .button-pill:hover {
    background: var(--teal-dark);
    color: #ffffff;
}

/* Checklist used for the accessibility feature list. */
.checklist {
    list-style: none;
    margin: 0;
    padding: 0 26px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 17px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    color: var(--ink);
}

.checklist li:last-child {
    border-bottom: 0;
}

.checklist svg {
    flex-shrink: 0;
    color: var(--teal);
}

/* The timeline. */
.timeline {
    display: flex;
    flex-direction: column;
}

.timeline-row {
    display: grid;
    grid-template-columns: 150px 32px minmax(0, 1fr);
    align-items: stretch;
}

.timeline-era {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teal);
    padding-top: 4px;
}

.timeline-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-rail::before {
    content: "";
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--teal);
}

.timeline-rail::after {
    content: "";
    width: 2px;
    flex-grow: 1;
    background: var(--line);
}

.timeline-row:last-child .timeline-rail::before {
    box-shadow: 0 0 0 5px var(--teal-light);
}

.timeline-row:last-child .timeline-rail::after {
    display: none;
}

.timeline-body {
    padding: 0 0 48px 28px;
}

.timeline-body h2 {
    margin: 0 0 14px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.timeline-body p {
    margin: 0 0 16px;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.timeline-body p:last-child {
    margin-bottom: 0;
}

.timeline-quote {
    margin: 26px 0 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--teal);
    border-radius: 0 14px 14px 0;
    padding: 24px 28px;
    font-size: 1.25rem;
    line-height: 1.6;
    font-weight: 600;
    color: var(--ink);
}

/* Captioned photo pair. */
.photo-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 26px 0 0;
}

.photo-pair figure {
    margin: 0;
    flex: 1 1 260px;
}

.photo-pair figure.portrait {
    flex: 0 1 290px;
}

.photo-pair img {
    width: 100%;
    height: 388px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.photo-pair figcaption {
    margin-top: 9px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--muted);
}

@media (max-width: 900px) {
    .with-toc {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .toc {
        position: static;
    }

    .timeline-row {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .timeline-era {
        grid-column: 2;
        margin-bottom: 8px;
        padding-top: 0;
    }

    .timeline-rail {
        grid-row: 1 / 3;
    }

    .timeline-body {
        padding-left: 18px;
    }

    .photo-pair img {
        height: 280px;
    }
}
