/*
 * ITIL certification hub, fold 2: PATH (light surface + lilac wash). Spec: direction.md "FOLD 2", fold-path.json.
 * Loaded after tokens/base/skin and cert-hub/page.css. Scope: main.itil-v1[data-page="certification"] #path.
 *
 * Desktop budget at 1366x768 (content block <= 556px, >= 90px free):
 *   head 76 (H2 34px x 1.15 = 39 + 8 + lead 19px x 1.5 = 29) + 24 + cards 336 + 24 + actions 52 = 512px (134px free)
 *   worst case, every slot on: ITIL 4 card 310 + rule row 36 + one-line notice 32 = 378 -> 554px (92px free)
 *   Card = pad 20 + title 30 + 12 + steps + pad 20. Steps (gap 16): ITIL 4 = 48 + 100 + 48 = 228 (+ 32 = 260 incl. gaps),
 *   Version 5 = 100 + 74 + 48 = 222 (+ 32 = 254). The wide container gives a 543px text column, so each
 *   "course · duration · Next date" line stays on one line.
 * Motion: copies the .v1-rail pattern (html.v1-motion only, :not(.is-done)); nothing is hidden in the base CSS.
 */

main.itil-v1[data-page="certification"] .cert-path { overflow: hidden; }
main.itil-v1[data-page="certification"] .cert-path__glow {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(420px 260px at 18% 38%, rgba(76, 141, 255, .10), transparent 70%),
        radial-gradient(420px 260px at 82% 44%, rgba(240, 72, 155, .08), transparent 70%);
}
main.itil-v1[data-page="certification"] .cert-path__inner { position: relative; z-index: 1; gap: var(--s-6); }

/* ---------- Block 1: header (centred, about 76px) ---------- */
main.itil-v1[data-page="certification"] .cert-path__head { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); text-align: center; }
main.itil-v1[data-page="certification"] .cert-path__h2 {
    font-size: clamp(30px, 2.5vw, 34px);
    --v1-lh: 1.15; line-height: 1.15;
    margin: 0; max-width: 100%;
    text-wrap: balance;
}
main.itil-v1[data-page="certification"] .cert-path__lead { margin: 0; max-width: 760px; color: var(--mute); }

/* ---------- Block 2: the two cards ---------- */
main.itil-v1[data-page="certification"] .cert-path__cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); align-items: stretch; }
main.itil-v1[data-page="certification"] .cert-path__card {
    display: flex; flex-direction: column;
    min-width: 0;
    padding: 20px 24px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, .92);
    border-color: rgba(124, 92, 255, .18);
    box-shadow: 0 1px 2px rgba(14, 13, 51, .05), 0 22px 44px -30px rgba(76, 60, 200, .42);
    transition: border-color 320ms ease, box-shadow 320ms var(--ease-out);
}
/* Flat card: no lift (links never move under the pointer). Hover only tints the border and lights the spotlight. */
@media (hover: hover) {
    main.itil-v1[data-page="certification"] .cert-path__card:hover { border-color: rgba(124, 92, 255, .42); box-shadow: 0 1px 2px rgba(14, 13, 51, .05), 0 26px 50px -28px rgba(76, 60, 200, .55); }
    main.itil-v1[data-page="certification"] .cert-path__card:hover::after { opacity: 1; }
}
main.itil-v1[data-page="certification"] .cert-path__card:focus-within { border-color: rgba(124, 92, 255, .42); }

/* Decorative route line, top right of each card (behind the text; aria-hidden). */
main.itil-v1[data-page="certification"] .cert-path__art {
    position: absolute; z-index: 0; top: 14px; right: 14px;
    width: 180px; height: auto; opacity: .3; pointer-events: none;
}
main.itil-v1[data-page="certification"] .cert-path__card--v5 .cert-path__art { transform: scaleX(-1); }
main.itil-v1[data-page="certification"] .cert-path__art-line { stroke-dasharray: 1; stroke-dashoffset: 0; }
main.itil-v1[data-page="certification"] .cert-path__card > :not(.cert-path__art) { position: relative; z-index: 1; }

/* Card head: pill + "certification path" (30px, then 12px) */
main.itil-v1[data-page="certification"] .cert-path__title {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    min-height: 30px; margin: 0 0 12px;
    font-size: 17px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
}
main.itil-v1[data-page="certification"] .cert-path__title .v1-pill { font-size: 16px; }

/* The vertical path: 16px between steps; faint track + a gradient line that draws on entry. */
main.itil-v1[data-page="certification"] .cert-path__steps { gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
main.itil-v1[data-page="certification"] .cert-path__steps::before { background: var(--line); opacity: 1; }
main.itil-v1[data-page="certification"] .cert-path__steps::after {
    content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 2px; border-radius: 2px;
    background: linear-gradient(180deg, var(--blue), var(--violet), var(--pink));
    transform-origin: 50% 0;
}
main.itil-v1[data-page="certification"] .cert-path__step { margin: 0; min-width: 0; }
main.itil-v1[data-page="certification"] .cert-path__step > :nth-child(n) { margin: 0; }
main.itil-v1[data-page="certification"] .cert-path__steps > :nth-child(2) { --i: 1; }
main.itil-v1[data-page="certification"] .cert-path__steps > :nth-child(3) { --i: 2; }
main.itil-v1[data-page="certification"] .cert-path__steps > :nth-child(n+4) { --i: 3; }
main.itil-v1[data-page="certification"] .cert-path__step .v1-path__num {
    z-index: 1;
    transition: transform 320ms var(--ease-spring), box-shadow 320ms var(--ease-out), color var(--t-fast) ease, background 0s;
}
/* Hover/focus on a step: its number fills with the gradient and glows (the number is not a link, so nothing moves). */
main.itil-v1[data-page="certification"] .cert-path__step:is(:hover, :focus-within) .v1-path__num {
    background: var(--grad) border-box; color: #fff;
    transform: scale(1.08);
    box-shadow: 0 0 0 5px rgba(124, 92, 255, .14), 0 8px 18px -6px rgba(124, 92, 255, .7);
}

/* Step label (16px bold) with the optional note on the same row */
main.itil-v1[data-page="certification"] .cert-path__label { font-size: 16px; line-height: 22px; font-weight: 700; color: var(--ink); }
main.itil-v1[data-page="certification"] .cert-path__note { font-weight: 400; color: var(--mute); }
main.itil-v1[data-page="certification"] .cert-path__note::before { content: "\00B7"; display: inline-block; margin: 0 8px 0 4px; color: var(--violet); font-weight: 700; }

/* Course line (17px / 26px) and Bridge line (16px / 26px) */
main.itil-v1[data-page="certification"] .cert-path__line { font-size: 17px; line-height: 26px; color: var(--ink); }
main.itil-v1[data-page="certification"] .cert-path__bridge { font-size: 16px; line-height: 26px; color: var(--mute); }
main.itil-v1[data-page="certification"] .cert-path__bridge .v1-link { font-size: 16px; }
main.itil-v1[data-page="certification"] .cert-path__meta { color: var(--mute); font-variant-numeric: tabular-nums; }
main.itil-v1[data-page="certification"] .cert-path__meta > span::before { content: "\00B7"; display: inline-block; margin: 0 8px; color: var(--violet); font-weight: 700; }
main.itil-v1[data-page="certification"] .cert-path__meta time { color: var(--ink); font-weight: 600; }

/* Level rows (one per row: name link + muted count) and module links (inline, CSS middots) */
main.itil-v1[data-page="certification"] :is(.cert-path__levels, .cert-path__mods) { margin: 0; padding: 0; list-style: none; font-size: 17px; line-height: 26px; }
main.itil-v1[data-page="certification"] .cert-path__levels > li { margin: 0; }
main.itil-v1[data-page="certification"] .cert-path__count { color: var(--mute); font-size: 16px; font-variant-numeric: tabular-nums; }
main.itil-v1[data-page="certification"] .cert-path__mods { display: flex; flex-wrap: wrap; }
main.itil-v1[data-page="certification"] .cert-path__mods > li { margin: 0; white-space: nowrap; }
main.itil-v1[data-page="certification"] .cert-path__mods > li + li::before { content: "\00B7"; display: inline-block; margin: 0 10px; color: var(--violet); font-weight: 700; }

/* Slots (print nothing while off): scheme facts row (28px summary, 36px with margin) and the one-line notice */
main.itil-v1[data-page="certification"] .cert-path__rule { margin-top: var(--s-2); border-top: 1px solid var(--line); }
main.itil-v1[data-page="certification"] .cert-path__rule > summary {
    display: flex; align-items: center; gap: 8px;
    min-height: 28px; padding-top: 6px;
    font-size: 16px; line-height: 22px; font-weight: 700; color: var(--link);
    cursor: pointer; list-style: none;
}
main.itil-v1[data-page="certification"] .cert-path__rule > summary::-webkit-details-marker { display: none; }
main.itil-v1[data-page="certification"] .cert-path__rule > summary::before {
    content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 0 2px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); transition: transform 320ms var(--ease-out);
}
main.itil-v1[data-page="certification"] .cert-path__rule[open] > summary::before { transform: rotate(45deg); }
main.itil-v1[data-page="certification"] .cert-path__rule > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
main.itil-v1[data-page="certification"] .cert-path__rule-body { padding: 8px 0 4px 20px; font-size: 16px; line-height: 24px; color: var(--ink); }
main.itil-v1[data-page="certification"] .cert-path__rule-body > p { margin: 0 0 6px; }
main.itil-v1[data-page="certification"] .cert-path__rule-body > p:last-child { margin-bottom: 0; }
main.itil-v1[data-page="certification"] .cert-path__src { color: var(--mute); }
main.itil-v1[data-page="certification"] .cert-path__notice { margin: var(--s-2) 0 0; font-size: 16px; line-height: 24px; color: var(--mute); }

/* ---------- Block 3: action row (52px, centred) ---------- */
main.itil-v1[data-page="certification"] #path .cert-path__actions { justify-content: center; gap: var(--s-3) var(--s-6); }
main.itil-v1[data-page="certification"] .cert-path__guide { font-size: 17px; min-height: 32px; }

/* ---------- Motion (only under html.v1-motion; .is-done ends it) ---------- */
html.v1-motion main.itil-v1[data-page="certification"] .cert-path__steps.is-in:not(.is-done)::after { animation: v1-draw-y 900ms var(--ease-out) 120ms backwards; }
html.v1-motion main.itil-v1[data-page="certification"] .cert-path__steps.is-in:not(.is-done) .v1-path__num { animation: v1-pop 520ms var(--ease-spring) backwards; animation-delay: calc(160ms + var(--i, 0) * 150ms); }
html.v1-motion main.itil-v1[data-page="certification"] .cert-path__steps.is-in:not(.is-done) .cert-path__step > :not(.v1-path__num) { animation: v1-up var(--t-reveal) var(--ease-out) backwards; animation-delay: calc(220ms + var(--i, 0) * 150ms); }
html.v1-motion main.itil-v1[data-page="certification"] .cert-path__cards.is-in:not(.is-done) .cert-path__art-line { animation: v1-dash 1400ms var(--ease-out) 300ms backwards; }
html.v1-motion main.itil-v1[data-page="certification"] .cert-path__cards.is-in:not(.is-done) .cert-path__art-dot { animation: v1-pop 520ms var(--ease-spring) 300ms backwards; transform-box: fill-box; transform-origin: center; }
html.v1-motion main.itil-v1[data-page="certification"] .cert-path__cards.is-in:not(.is-done) .cert-path__art-dot--2 { animation-delay: 900ms; }
html.v1-motion main.itil-v1[data-page="certification"] .cert-path__cards.is-in:not(.is-done) .cert-path__art-dot--3 { animation-delay: 1500ms; }
@media (prefers-reduced-motion: reduce) {
    main.itil-v1[data-page="certification"] .cert-path__step .v1-path__num,
    main.itil-v1[data-page="certification"] .cert-path__rule > summary::before { transition: none; }
    main.itil-v1[data-page="certification"] .cert-path__step:is(:hover, :focus-within) .v1-path__num { transform: none; }
}

/* ---------- Two columns from 992px (cards stay side by side) ---------- */
@media (min-width: 992px) {
    main.itil-v1[data-page="certification"] .cert-path__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    main.itil-v1[data-page="certification"] .cert-path__cards--one { grid-template-columns: minmax(0, 639px); justify-content: center; }
}
/* 768 to 991px: cards stack; the fold may be taller than one screen. Keep a readable measure. */
@media (min-width: 768px) and (max-width: 991.98px) {
    main.itil-v1[data-page="certification"] .cert-path__cards { max-width: 720px; width: 100%; margin-inline: auto; }
}

/* ---------- Phones (below 768px): the fold flows; single column, left aligned ---------- */
@media (max-width: 767.98px) {
    main.itil-v1[data-page="certification"] .cert-path__head { align-items: flex-start; text-align: left; }
    main.itil-v1[data-page="certification"] .cert-path__h2 { font-size: 28px; }
    main.itil-v1[data-page="certification"] .cert-path__lead { font-size: 17px; }
    main.itil-v1[data-page="certification"] .cert-path__cards { gap: var(--s-4); }
    main.itil-v1[data-page="certification"] .cert-path__card { padding: 20px; }
    main.itil-v1[data-page="certification"] .cert-path__art { width: 120px; top: 10px; right: 10px; opacity: .3; }
    main.itil-v1[data-page="certification"] .cert-path__note { display: block; }
    main.itil-v1[data-page="certification"] .cert-path__note::before { content: none; }
    /* Course lines: the meta (duration, next date) drops to its own line under the link */
    main.itil-v1[data-page="certification"] .cert-path__line > .v1-link { display: inline-flex; align-items: center; min-height: 44px; }
    main.itil-v1[data-page="certification"] .cert-path__line > .cert-path__meta { display: block; }
    main.itil-v1[data-page="certification"] .cert-path__line > .cert-path__meta > span:first-child::before { content: none; }
    main.itil-v1[data-page="certification"] .cert-path__bridge .v1-link { display: inline-flex; align-items: center; min-height: 44px; }
    main.itil-v1[data-page="certification"] .cert-path__bridge .cert-path__meta { display: block; }
    main.itil-v1[data-page="certification"] .cert-path__bridge .cert-path__meta > span:first-child::before { content: none; }
    /* Level rows: one per row, 44px tall; module links wrap 2 or 3 per row, 44px tall, no separators */
    main.itil-v1[data-page="certification"] .cert-path__levels > li { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; min-height: 44px; }
    main.itil-v1[data-page="certification"] .cert-path__mods { gap: 4px 16px; }
    main.itil-v1[data-page="certification"] .cert-path__mods > li { display: flex; align-items: center; min-height: 44px; }
    main.itil-v1[data-page="certification"] .cert-path__mods > li + li::before { content: none; }
    main.itil-v1[data-page="certification"] .cert-path__rule > summary { min-height: 44px; }
    /* Actions: full-width button (54px, 18px text), the quiet link centred under it with a 44px tap height */
    main.itil-v1[data-page="certification"] #path .cert-path__actions { flex-direction: column; align-items: stretch; gap: var(--s-2); }
    main.itil-v1[data-page="certification"] #path .cert-path__actions .v1-btn { display: flex; width: 100%; align-self: stretch; justify-content: center; min-height: 54px; font-size: 18px; }
    main.itil-v1[data-page="certification"] .cert-path__guide { align-self: center; justify-content: center; min-height: 44px; }
}
