@media print {

    #chapter-header h2 {
        text-align: left !important;
    }

    #chapter-content {
        padding-bottom: var(--body-padding) !important;
    }

}

.anchor {
  scroll-margin-top: 160px;
}

#chapter-header {
    display: flex;
    gap: 24px;
    justify-content: space-between;
    align-items: baseline;
}

.chapter-nav {
    display: flex;
    align-items: center;
    text-decoration: none;   
    overflow: hidden;
}

.chapter-nav span {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}


#chapter-content {
    /* padding bottom to allow over scrolling a little bit */
    padding-bottom: 60dvh;
}

#chapter-content h1,
#chapter-content h2,
#chapter-content h3,
#chapter-content h4,
#chapter-content h5,
#chapter-content h6 {
    font-size: calc(0.88 * var(--pico-font-size));
}

/* Reset h1 margin for first title of the page, either at root or within a slide */
#chapter-content>h1:first-child,
#chapter-content [x-tag=x-slide]:first-child>h1:first-child {
    margin-top: 0 !important;
}

@media (max-width: 555px) {

    .chapter-nav {
        overflow: initial;
    }

    .chapter-nav span {
        display: none;
    }

    .chapter-nav i {
        font-size: 1.75rem;
    }

}
