@use '../mixins' as *;

h1, h2, h3, h4, h5, h6 {
    bookmark-label: content(before) ' ' content(text);
    margin-top: 2rem;

    @include numeration;

    a.anchor {
        margin-left: 0.25em;
        padding: 0 0.25em;
        opacity: 0;
        font-weight: normal;
        font-size: 0.8em;

        @if is-browser() {
            user-select: none;
        }
    }

    &:hover a.anchor {
        opacity: 1;
    }
}

h1 {
    font-family: 'Lato Semibold', sans-serif;
    font-size: 30pt;
    margin-top: 0;

    page: new-section;
    string-set: current-title content();

    &:not(:first-of-type) {
        break-before: page;
    }
}

h2 {
    font-family: 'Lato Semibold', sans-serif;
    font-size: 24pt;
}

h3 {
    font-family: 'Lato Light', sans-serif;
    font-size: 18pt;
}

h1 + *,
h2 + *,
h3 + * {
    margin-top: -.5em !important;
}