/* Linux roadmap (page-linux-roadmap.hbs). Linked from that template only.
   The title, excerpt, feature image and page body are rendered by the theme
   exactly as on any page; these rules only style the roadmap below them.
   Dark mode follows the theme's .dark class on <html>. */

.wrap {
    --bg: #fff;                                 /* page background (theme bg-white), cuts the line behind the step circles */
    --card: rgb(255 255 255 / .88);
    --card-bd: rgb(102 93 230 / .18);
    --ink: #17213a;
    --tx: #344054;
    --muted: #667085;
    --line: #6259eb;
    --purple: #a72bd4;
    --teal: #11b7a4;
    --teal-dark: #0d9c8d;
    --member: rgb(255 255 255 / .95);
    --member-tx: #445164;
    --member-line: #aeb9c8;
    --coming: #f7e9fc;
    --coming-tx: #74278a;
    --sep: #edf0f4;
    --shadow: 0 12px 35px rgb(50 56 90 / .08);
    --panel: #fafafa;
    --panel-bd: #ececec;

    max-width: 1040px;
    margin: 0 auto;
    padding: 0 0 6rem;
    line-height: 1.45;
    color: var(--ink);
}

.dark .wrap {
    --bg: rgb(var(--color-gray-900));           /* theme dark:bg-gray-900 */
    --card: rgb(23 30 43 / .92);
    --card-bd: #2d3850;
    --ink: #eef2f7;
    --tx: #c5ccd6;
    --muted: #9ca9b8;
    --member: #182130;
    --member-tx: #cbd4de;
    --member-line: #556274;
    --coming: #2a1a33;
    --coming-tx: #e2b4f2;
    --sep: #2b3546;
    --shadow: 0 12px 35px rgb(0 0 0 / .35);
    --panel: #171e2b;
    --panel-bd: #2d3850;
}

/* ---------- Overview: stats + legend ---------- */

.rm-overview {
    margin: 0 auto 48px;
}

/* subtitle left, stats right; stacked on small screens */
.rm-overview-top {
    display: grid;
    gap: 28px;
    align-items: center;
}

.rm-subtitle {
    margin: 0;
    line-height: 1.6;
    letter-spacing: -.01em;
    color: var(--ink);
}

@media (min-width: 900px) {
    .rm-overview-top {
        grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
        gap: 56px;
    }
}

.rm-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    margin: 0;
    padding: 22px 8px;
    text-align: center;
    background: var(--panel);
    border: 1px solid var(--panel-bd);
    border-radius: 18px;
}

.rm-stats > div {
    padding: 0 16px;
    border-left: 1px solid var(--panel-bd);
}

.rm-stats > div:first-child { border-left: none; }

.rm-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 auto 10px;
    color: var(--line);
    background: var(--card);
    border: 1px solid var(--panel-bd);
    border-radius: 9px;
}

.rm-stat-num {
    margin: 0;
    font-size: 1.875rem;
    line-height: 1.1;
    font-weight: 700;
    color: var(--ink);
}

.rm-stat-label {
    margin: 4px 0 0;
    font-size: .8125rem;
    color: var(--muted);
}

.rm-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.rm-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 14px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--member-tx);
    background: var(--card);
    border: 1px solid var(--panel-bd);
    border-radius: 999px;
}

.rm-legend .rm-updated {
    margin-left: auto;
    font-weight: 500;
    color: var(--muted);
    background: transparent;
    border-color: transparent;
}

.rm-swatch {
    flex: none;
    width: 26px;
    height: 14px;
    border-radius: 5px;
}

.rm-swatch.rm-free   { background: var(--teal); }
.rm-swatch.rm-member { background: var(--member); border: 1.5px dashed var(--member-line); }
.rm-swatch.rm-soon   { background: var(--coming); border: 1.5px dashed var(--purple); }

/* ---------- Road: centre line, cards alternate sides ---------- */

.rm-road {
    position: relative;
    max-width: 1040px;
    margin: 0 auto;
    padding: 8px 0 20px;
}

.rm-road::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #7260ef, #5d5bf0, #8f43eb);
    border-radius: 999px;
}

.rm-step {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr);
    align-items: center;
    min-height: 220px;
    margin: 0 0 30px;
}

.rm-left .rm-card  { grid-column: 1; }
.rm-right .rm-card { grid-column: 3; }

.rm-node {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #7362ef, #8546e9);
    border: 5px solid var(--bg);
    border-radius: 50%;
    box-shadow: 0 5px 14px rgb(93 91 240 / .22);
}

.rm-dot {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 10px;
    height: 10px;
    margin-top: -4px;
    background: var(--line);
    border-radius: 50%;
}

.rm-left .rm-dot  { left: calc(50% - 45px); }
.rm-right .rm-dot { right: calc(50% - 45px); }

.rm-card {
    position: relative;
    padding: 22px;
    background: var(--card);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--card-bd);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* connector from card to the centre line */
.rm-card::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 42px;
    height: 2px;
    background: var(--line);
}

.rm-left .rm-card::after  { right: -42px; }
.rm-right .rm-card::after { left: -42px; }

.rm-top {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.rm-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    font-size: 1.55rem;
    background: linear-gradient(135deg, #f3e8ff, #eeeaff);
    border-radius: 15px;
}

.dark .rm-icon { background: linear-gradient(135deg, #2a2140, #232647); }

.rm-eyebrow {
    margin: 0 0 3px;
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7355e8;
}

.dark .rm-eyebrow { color: #a594f5; }

.rm-title {
    margin: 0;
    font-size: 1.375rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
}

.rm-summary {
    margin: 5px 0 0;
    font-size: .9375rem;
    color: var(--muted);
}

/* ---------- Topics ---------- */

.rm-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.rm-topic {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    line-height: 1.3;
    font-weight: 600;
    border-radius: 10px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
}

a.rm-topic:hover { transform: translateY(-1px); }

.rm-topic.rm-free {
    color: #fff;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    box-shadow: 0 4px 10px rgb(17 183 164 / .14);
}

.rm-topic.rm-free:hover { box-shadow: 0 6px 16px rgb(17 183 164 / .28); }

.rm-topic.rm-member {
    color: var(--member-tx);
    background: var(--member);
    border: 1.5px dashed var(--member-line);
}

.rm-topic.rm-member:hover {
    color: #5039c8;
    border-color: #7a62eb;
}

.dark .rm-topic.rm-member:hover { color: #b9acff; }

.rm-topic.rm-soon {
    color: var(--coming-tx);
    background: var(--coming);
    border: 1.5px dashed var(--purple);
}

/* ---------- Supporting links ---------- */

.rm-support {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--sep);
}

.rm-support-title {
    margin: 0 0 4px;
    font-size: .875rem;
    font-weight: 800;
    color: #5f54d9;
}

.dark .rm-support-title { color: #a594f5; }

.rm-group { margin-top: 10px; }

.rm-group-label {
    display: block;
    margin-bottom: 6px;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--muted);
}

.rm-micros {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rm-micro {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    font-size: .8125rem;
    line-height: 1.3;
    color: var(--member-tx);
    background: var(--member);
    border: 1px dashed var(--member-line);
    border-radius: 7px;
    transition: border-color .15s ease, color .15s ease;
}

.rm-micro:hover {
    color: #5037c4;
    border-color: #7b61e8;
}

.dark .rm-micro:hover { color: #b9acff; }

a.rm-topic:focus-visible,
.rm-micro:focus-visible,
.rm-btn:focus-visible {
    outline: 2px solid var(--line);
    outline-offset: 2px;
}

/* ---------- Calls to action ---------- */

.rm-cta {
    position: relative;
    z-index: 4;
    width: min(720px, calc(100% - 120px));
    margin: 10px auto 44px;
    padding: 26px 28px;
    text-align: center;
    background: linear-gradient(135deg, #f9edfd, #fff);
    border: 1px solid rgb(167 43 212 / .28);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.dark .rm-cta {
    background: linear-gradient(135deg, #21182a, #171e2b);
    border-color: #4d2b58;
}

.rm-cta-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #72208b;
}

.dark .rm-cta-title { color: #e2b4f2; }

.rm-cta > p:not(.rm-btns) {
    max-width: 620px;
    margin: 8px auto 16px;
    color: var(--muted);
}

.rm-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.rm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    font-size: .9375rem;
    font-weight: 800;
    border-radius: 999px;
    transition: transform .15s ease, opacity .15s ease;
}

.rm-btn:hover { transform: translateY(-1px); }

.rm-primary {
    color: #fff;
    background: #6359e9;
}

.rm-secondary {
    color: #384152;
    background: #fff;
    border: 1px solid #c8cfda;
}

.dark .rm-secondary {
    color: #eef2f7;
    background: #171e2b;
    border-color: #475467;
}

.rm-finish {
    max-width: 720px;
    margin: 42px auto 0;
    padding: 30px 28px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #6c60ee, #a640e2);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgb(111 82 230 / .22);
}

.rm-finish h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.rm-finish > p:not(.rm-btns) {
    margin: 0 auto 16px;
    max-width: 560px;
    opacity: .9;
}

.rm-finish .rm-secondary,
.dark .rm-finish .rm-secondary {
    color: #fff;
    background: rgb(255 255 255 / .12);
    border-color: rgb(255 255 255 / .35);
}

/* ---------- Tablet / mobile: line on the left ---------- */

@media (max-width: 860px) {
    .wrap { padding: 0 0 5rem; }

    .rm-road::before { left: 24px; }

    .rm-step {
        grid-template-columns: 52px minmax(0, 1fr);
        min-height: 0;
        margin-bottom: 22px;
    }

    .rm-left .rm-card,
    .rm-right .rm-card { grid-column: 2; }

    .rm-node {
        top: 32px;
        left: 24px;
        width: 38px;
        height: 38px;
        transform: translate(-50%, 0);
        font-size: .8125rem;
        border-width: 4px;
    }

    .rm-dot { display: none; }

    .rm-left .rm-card::after,
    .rm-right .rm-card::after {
        top: 51px;
        left: -28px;
        right: auto;
        width: 28px;
    }

    .rm-cta {
        width: calc(100% - 52px);
        margin-left: 52px;
    }
}

@media (max-width: 560px) {
    .rm-road::before { left: 16px; }

    .rm-step { grid-template-columns: 36px minmax(0, 1fr); }

    .rm-node {
        left: 16px;
        width: 32px;
        height: 32px;
        font-size: .75rem;
    }

    .rm-card {
        padding: 18px 15px;
        border-radius: 16px;
    }

    .rm-top {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 10px;
    }

    .rm-icon {
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
        border-radius: 12px;
    }

    .rm-title { font-size: 1.125rem; }

    .rm-topic { padding: 7px 10px; }

    .rm-left .rm-card::after,
    .rm-right .rm-card::after {
        left: -20px;
        width: 20px;
    }

    .rm-cta {
        width: calc(100% - 36px);
        margin-left: 36px;
        padding: 20px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rm-topic,
    .rm-micro,
    .rm-btn { transition: none; }
    a.rm-topic:hover,
    .rm-btn:hover { transform: none; }
}

@media print {
    .rm-card,
    .rm-cta,
    .rm-finish { break-inside: avoid; }
}

@media (max-width: 560px) {
    .rm-legend .rm-updated { margin-left: 0; }
    .rm-subtitle { font-size: 1.125rem; }
    .rm-stats > div { padding: 0 8px; }
    .rm-stat-num { font-size: 1.625rem; }
}
