/* Reference and information pages — migrated from Ghost page-level injections. */

body.page-about {
    --bf-reference-width: 1400px;
    --bf-reference-text-width: 1180px;
    --bf-reference-gutter: 80px;
}

body.page-glossary {
    --bf-reference-width: 1400px;
    --bf-reference-text-width: 1400px;
    --bf-reference-gutter: 80px;
}

body:is(.page-readings, .page-contact, .page-terms, .page-privacy) {
    --bf-reference-width: 1180px;
    --bf-reference-text-width: 1180px;
    --bf-reference-gutter: 70px;
}

body:is(.page-about, .page-glossary, .page-readings, .page-contact, .page-terms, .page-privacy) .gh-article {
    width: 100% !important;
    max-width: none !important;
}

body:is(.page-about, .page-glossary, .page-readings, .page-contact, .page-terms, .page-privacy) .gh-article-header,
body:is(.page-about, .page-glossary, .page-readings, .page-contact, .page-terms, .page-privacy) .gh-content {
    display: block !important;
    width: min(var(--bf-reference-width), calc(100vw - (var(--bf-reference-gutter) * 2))) !important;
    max-width: min(var(--bf-reference-width), calc(100vw - (var(--bf-reference-gutter) * 2))) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body:is(.page-about, .page-glossary, .page-readings, .page-contact, .page-terms, .page-privacy) .gh-article-header > *,
body:is(.page-about, .page-glossary, .page-readings, .page-contact, .page-terms, .page-privacy) .gh-content > * {
    grid-column: auto !important;
}

body:is(.page-about, .page-glossary, .page-readings, .page-contact, .page-terms, .page-privacy) .gh-article-title {
    width: 100% !important;
    max-width: var(--bf-reference-text-width) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    position: static !important;
    left: auto !important;
    text-align: left !important;
}

body.page-about .gh-article-title { margin-bottom: 2.2rem !important; }

body.page-about .gh-content > p,
body.page-about .gh-content > ul,
body.page-about .gh-content > ol {
    width: 100% !important;
    max-width: var(--bf-reference-text-width) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
}

body.page-about .gh-content > p { font-size: 18px; line-height: 1.72; }
body.page-about .gh-content > p + p { margin-top: 1.35em !important; }
body.page-about .gh-content > ul,
body.page-about .gh-content > ol { padding-left: 1.35rem !important; list-style-position: outside !important; }
body.page-about .gh-content li { line-height: 1.65; margin-bottom: 0.45rem; }
body.page-about .gh-content a { text-underline-offset: 2px; }

body.page-about :is(.kg-image-card, .kg-gallery-card, figure) {
    width: 100% !important;
    max-width: var(--bf-reference-text-width) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.page-about :is(.kg-image-card, .kg-gallery-card, figure) img {
    max-width: 850px !important;
    width: 100% !important;
    height: auto !important;
    margin: 8px 0 0 !important;
    display: block !important;
}

body.page-glossary .gh-content > * {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.page-glossary .bfc-glossary-search {
    width: 100%;
    max-width: none;
}

body:is(.page-readings, .page-contact, .page-terms, .page-privacy) .gh-content > :is(h2, h3, p, ul, ol) {
    width: 100% !important;
    max-width: var(--bf-reference-text-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: left !important;
}

body:is(.page-readings, .page-terms, .page-privacy) .gh-content > p {
    line-height: 1.65 !important;
    margin-top: 0 !important;
    margin-bottom: 22px !important;
}

body.page-contact .gh-content > p { line-height: 1.65; }
body.page-contact .gh-content > p:last-of-type { margin-bottom: 28px !important; }

body:is(.page-readings, .page-terms, .page-privacy) .gh-content > h2 {
    margin-top: 56px !important;
    margin-bottom: 12px !important;
}

body:is(.page-readings, .page-terms, .page-privacy) .gh-content > h3 {
    margin-top: 34px !important;
    margin-bottom: 6px !important;
}

body.page-terms .gh-content > :is(ul, ol) {
    padding-left: 1.35em !important;
    margin-top: -4px !important;
    margin-bottom: 24px !important;
    list-style-position: outside !important;
}

body.page-terms .gh-content > :is(ul, ol) > li {
    max-width: none !important;
    width: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0.15em !important;
    line-height: 1.6 !important;
    margin-bottom: 8px !important;
    text-align: left !important;
}

body.page-terms .gh-content > :is(ul, ol) > li:last-child { margin-bottom: 0 !important; }

body.page-privacy .gh-content :is(ul, ol) {
    list-style-position: outside !important;
    padding-left: 18px !important;
    margin-top: 0 !important;
    margin-bottom: 24px !important;
}

body.page-privacy .gh-content li { line-height: 1.6 !important; margin-bottom: 8px !important; }

body:is(.page-readings, .page-contact, .page-terms, .page-privacy) :is(.kg-html-card:has(.bf-tab-window), .bf-tab-window) {
    width: 100% !important;
    max-width: var(--bf-reference-text-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body:is(.page-readings, .page-contact, .page-terms, .page-privacy) .bf-post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body:is(.page-readings, .page-contact, .page-terms, .page-privacy) :is(.kg-image-card, .kg-gallery-card, figure) img {
    max-width: 850px !important;
    width: 100% !important;
    height: auto !important;
    margin: 8px auto 0 !important;
    display: block !important;
}

@media (max-width: 1000px) {
    body:is(.page-about, .page-glossary) { --bf-reference-gutter: 32px; }
}

@media (max-width: 900px) {
    body:is(.page-readings, .page-contact, .page-terms, .page-privacy) { --bf-reference-gutter: 20px; }
    body:is(.page-readings, .page-contact, .page-terms, .page-privacy) .bf-post-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 600px) {
    body:is(.page-about, .page-glossary) { --bf-reference-gutter: 20px; }
    body.page-about .gh-content > p { font-size: 17px; }
}
