/* The built pages that show one of the game's sections
   (app/src/site/SectionPage.astro): the tools' hero over the section's dark
   panel. The panel and its content keep the home page's styles (css/rpg.css,
   css/rpg-night.css), which key on the panel's id and .pane-frontiers. */

/* The hero's title is the section's own heading, lifted out of it */
.sf-section-page .builder-hero .section-title {
    scroll-margin-top: 32px;
}

/* The panel fills the page's width under the hero, as the home page's did */
.sf-section-page .pane-frontiers {
    position: relative;
}

/* A section that opens on a dark breakout (the Sciences, the Stars) starts
   it at the panel's top, as one that ends on one drops its bottom padding
   (css/rpg.css) */
.sf-section-page .rpg-panel:has(> .container > .breakout:first-child) {
    padding-top: 0;
}

/* ...including the top margin phones give the content (Bootstrap's mt-5) */
.sf-section-page .rpg-panel:has(> .container > .breakout:first-child) > .container {
    margin-top: 0 !important;
}


/* On the old home page a spacer followed each section, and the panels drop
   or lose their bottom padding (css/rpg.css). On a page of its own a section
   ends on the panel's usual 100px instead, unless it ends on a breakout,
   which meets the footer */
.sf-section-page :is(#rpg-setting, #rpg-adventure, #rpg-mechanics, #rpg-changelog).rpg-panel.section.unlimited:not(:has(> .container > .breakout:last-child)) {
    padding-bottom: 100px;
}

/* A link to a part of a page (/setting/#nations) lands with its heading
   clear of the pinned header */
.sf-section-page .rpg-panel :is(h3, h4)[id] {
    scroll-margin-top: 80px;
}

/* The sections' titles (The Setting's Timeline, Nations and so on, Another
   World's parts) in Bebas, like the page's hero and the site's other titles */
.sf-section-page .rpg-panel h3.sub-title {
    font-family: 'bebas_neueregular';
    font-size: 2.75rem;
    font-weight: normal;
    letter-spacing: 1px;
    line-height: 1;
    /* Bootstrap's .mb-3 (16px) left them crowded against their content */
    margin-bottom: 32px !important;
}

/* The rail of links within the page starts level with the content: 100px
   down (css/rpg.css), where the panel's padding ends or a breakout's spacer
   does, or at the top when the panel opens on a breakout with no spacer
   (.breakout-flush: The Setting's Introduction) */
.sf-section-page .rpg-panel:has(> .container > .breakout-flush:first-child) > .rpg-links-rail {
    top: 0;
}


/* The Rules pages: 72px between a part's rows, as on the Setting pages
   (.setting-rows), rather than a content stack's usual 48px or the two-column
   parts' 36px */
.sf-section-page #rpg-mechanics :is(.content-stack:not(.content-stack-xxs, .content-stack-xs, .content-stack-sm), .stat-types-grid) {
    row-gap: 72px;
}

.sf-section-page #rpg-mechanics .tab-panel-cols > :not(:last-child) {
    margin-bottom: 72px;
}
