/*
 * Companion page /itil-4-or-itil-5 ("ITIL 4 or ITIL 5? Which ITIL Foundation to take"): rules shared by ALL
 * four sections. Loaded after tokens.css, base.css and skin.css, before itil-4-or-5/fold-<key>.css.
 * Spec: docs/ux-discovery/itil-5-foundation/direction.md ("COMPANION PAGE") + fold-companion.json.
 * Scope: every selector starts main.itil-v1[data-page="itil-4-or-5"]. Shared pieces use the prefix .v1-q45__;
 * section rules (.v1-q45-<key>…) belong in fold-<key>.css. Tokens only; nothing under 16px.
 */

/* One type scale for the page (through the tokens). */
main.itil-v1[data-page="itil-4-or-5"] {
    --fs-h1: clamp(40px, 3.6vw, 48px);
    --fs-h2: clamp(30px, 2.6vw, 36px);
    --fs-h3: 19px;
    --fs-lead: 18px;
    --fs-body: 17px;
    --fs-small: 16px;
}
main.itil-v1[data-page="itil-4-or-5"] .v1-h1 { font-weight: 800; --v1-lh: 1.08; }
main.itil-v1[data-page="itil-4-or-5"] .v1-h2 { --v1-lh: 1.12; --v1-fw: 800; }
main.itil-v1[data-page="itil-4-or-5"] .v1-h3 { font-weight: 700; }
main.itil-v1[data-page="itil-4-or-5"] :is(.v1-lead, p) { line-height: 1.6; }

/* One-screen sections sized to their content: no 100vh, no scroll snap (556px budget at 1366x768). */
main.itil-v1[data-page="itil-4-or-5"] .v1-fold { min-height: 0; }

/* Hash targets (#answer, #compare, #changes, #faq, #faq-…) land below the fixed header. */
main.itil-v1[data-page="itil-4-or-5"] .v1-fold[id],
main.itil-v1[data-page="itil-4-or-5"] details[id] {
    scroll-margin-top: var(--hdr-h, 122px);
}

/* Dates and figures. */
main.itil-v1[data-page="itil-4-or-5"] time,
main.itil-v1[data-page="itil-4-or-5"] .v1-q45__num {
    font-variant-numeric: tabular-nums;
}

/* A name that must not break inside ("ITIL® 4 Foundation"). */
main.itil-v1[data-page="itil-4-or-5"] .v1-q45__nowrap { white-space: nowrap; }

/* Visually hidden, still read out (the table caption): clip, never display:none. */
main.itil-v1[data-page="itil-4-or-5"] .v1-q45__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Action row: the ONE pink button, then a quiet line or link that wraps under it when space is short. */
main.itil-v1[data-page="itil-4-or-5"] .v1-q45__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
}
main.itil-v1[data-page="itil-4-or-5"] .v1-q45__fresh {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink-2);
}
main.itil-v1[data-page="itil-4-or-5"] .v1-dark .v1-q45__fresh { color: var(--on-dark-2); }

@media (max-width: 767.98px) {
    main.itil-v1[data-page="itil-4-or-5"] {
        --fs-h1: 34px;
        --fs-h2: 28px;
        --fs-lead: 17px;
    }
    /* Sections flow; the bottom padding keeps a last line clear of the sticky bar. */
    main.itil-v1[data-page="itil-4-or-5"] .v1-fold {
        padding-top: 56px;
        padding-bottom: 72px;
    }
    main.itil-v1[data-page="itil-4-or-5"] .v1-fold[id],
    main.itil-v1[data-page="itil-4-or-5"] details[id] {
        scroll-margin-top: var(--hdr-h, 72px);
    }
    main.itil-v1[data-page="itil-4-or-5"] .v1-q45__actions { flex-direction: column; align-items: stretch; gap: 12px; }
    main.itil-v1[data-page="itil-4-or-5"] .v1-q45__actions .v1-btn { width: 100%; }
}
