/* Formatting of text fragments, shared by the public site and the editor. */
.fragment-text blockquote {
    border-left: .25rem solid var(--bs-border-color);
    padding: .25rem 0 .25rem 1rem;
    margin: 0 0 1rem;
    color: var(--bs-secondary-color);
    font-style: italic;
}
.fragment-text pre {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: .5rem .75rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.fragment-text hr {
    margin: 1rem 0;
}
/* A text block that is only a heading (e.g. the year above a file list) belongs to the
   block below it: little space below, a bit more above. Only plain text blocks
   (fragments/text.html), not the halves of text-image blocks or the editor area. */
.fragment-text.mb-3:not(.col-md-6):has(> :is(h2, h3, h4):only-child) {
    margin-bottom: 0 !important;  /* instead of mb-3 */
}
.fragment-text.mb-3:not(.col-md-6):has(> :is(h2, h3, h4):only-child) > * {
    margin-bottom: .35rem;
}
* + .fragment-text.mb-3:not(.col-md-6):has(> :is(h2, h3, h4):only-child) {
    margin-top: .5rem;
}

/* People list block (fragments/people.html) */
.people-list .people-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}
.people-list .min-w-0 {
    min-width: 0;
}

/* Main menu (layout.html): white text on the blue bar (the default light text reaches
   only 2.5:1); the current page is underlined instead of brighter. */
.navbar.site-menu[data-bs-theme] {   /* more specific than Bootstrap's dark navbar */
    --bs-navbar-color: #fff;
    --bs-navbar-hover-color: #fff;
    --bs-navbar-active-color: #fff;
}
.site-menu .navbar-nav > .nav-item > .nav-link:hover,
.site-menu .navbar-nav > .nav-item > .nav-link:focus-visible,
.site-menu .nav-link.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: .35em;
}
/* Icon links on the right (calendar, news, member area, account): no underline (it ran under
   the icon and the dropdown arrow); a light background on hover/focus, and as the current
   page marker (member area) */
.site-menu .navbar-nav > .nav-item > .nav-link.menu-icon {
    text-decoration: none;
    border-radius: .375rem;
    padding-left: .5rem;
    padding-right: .5rem;
}
.site-menu .navbar-nav > .nav-item > .nav-link.menu-icon:hover,
.site-menu .navbar-nav > .nav-item > .nav-link.menu-icon:focus-visible,
.site-menu .navbar-nav > .nav-item > .nav-link.menu-icon.show,
.site-menu .navbar-nav > .nav-item > .nav-link.menu-icon.active {
    background-color: rgba(255, 255, 255, .18);
}
.site-menu .nav-link {
    white-space: nowrap;   /* a title and its lock icon stay on one line (layout.html) */
}
.site-menu .dropdown-menu .nav-link {
    color: var(--bs-dropdown-link-color);
}
.site-menu .dropdown-menu .nav-link.active {
    color: var(--bs-dropdown-link-active-color, #fff);
}

/* "Zum Inhalt springen": hidden until it gets keyboard focus */
.skip-link {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 1100;
    padding: .5rem 1rem;
    background: #fff;
    color: #000;
    border: 2px solid #0075bb;
    border-radius: .375rem;
}
main:focus {
    outline: none;
}

/* Links on the light sidebar background: the default blue reaches only 4.3:1 there */
.bg-light {
    --bs-link-color: #0a58ca;
    --bs-link-hover-color: #084298;
    --bs-link-color-rgb: 10, 88, 202;
    --bs-link-hover-color-rgb: 8, 66, 152;
}

/* Sidebar layout (base.html, news_detail.html, calendar_event_detail.html): from tablet
   width up the sidebar keeps at least 15rem, the content takes the rest. Narrower, the
   sidebar moves below the content (its d-md-none copy). */
@media (min-width: 768px) {
    .row.with-sidebar > .layout-sidebar {
        flex: 0 0 auto;
        width: max(25%, 15rem);
    }
    .row.with-sidebar > .layout-main {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }
}

/* File block: long names are shortened with "…" (full name in the tooltip);
   the size is right-aligned to the block, the digits line up (tabular figures) */
.file-list li {
    display: flex;
    align-items: baseline;
    gap: .75rem;
}
.file-list .file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.file-list .file-size {
    flex-shrink: 0;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* Page title on the header picture (base.html, news, calendar): on phones the picture is
   only ~110px high, so a long title would run past it and cover the content below; there
   the title sits below the picture instead. */
@media (max-width: 575.98px) {
    .cover-title {
        position: static !important;
        --bs-bg-opacity: 1;
        padding-top: .75rem !important;
        padding-bottom: .75rem !important;
    }
}

/* Long words and web addresses in the content may break instead of running out of
   their column (phones, the 15rem sidebar); headings get German hyphenation on phones
   ("Knaben-schiessen"), the language comes from <html lang="de-CH">. */
main {
    overflow-wrap: break-word;
}
main a {
    overflow-wrap: anywhere;
}
@media (max-width: 575.98px) {
    main h1, main h2, main h3, main .h1, main .h2, main .h3 {
        hyphens: auto;
    }
}
