/* Clarke Foundry software help, shared by every help-*.php page: layout and Clarke Foundry styling on top of Bootstrap 5.3 */

:root {
    --fr-brand:         #FF9600;
    --fr-brand-dark:    #E68700;
    --fr-on-brand:      #1A1A1A;
    --fr-navbar-height: 56px;
    --fr-sidebar-bg:    #FFFFFF;
    --fr-sidebar-hover: #FFF4E5;
    --fr-sidebar-text:  #333333;
    --fr-mark:          #FFE0A8;
    --bs-link-color:            #B35F00;
    --bs-link-color-rgb:        179, 95, 0;
    --bs-link-hover-color:      #8A4900;
    --bs-link-hover-color-rgb:  138, 73, 0;
}

[data-bs-theme="dark"] {
    --fr-sidebar-bg:    #1E1F22;
    --fr-sidebar-hover: #3A2C16;
    --fr-sidebar-text:  #DEE2E6;
    --fr-mark:          #6B4300;
    --bs-link-color:            #FFB54D;
    --bs-link-color-rgb:        255, 181, 77;
    --bs-link-hover-color:      #FFC978;
    --bs-link-hover-color-rgb:  255, 201, 120;
}

html {
    scroll-padding-top: calc(var(--fr-navbar-height) + 16px);
}

body {
    overflow-x:       hidden;
    background-color: var(--bs-tertiary-bg);
}

/* Top bar */
.navbar {
    min-height:   var(--fr-navbar-height);
    border-bottom: 3px solid var(--fr-brand);
}

.navbar-brand img {
    width:  28px;
    height: 28px;
}

.navbar .help-search {
    position: relative;
}

/* Sidebar: fixed beside the content on wide screens, a drop-down panel on narrow ones */
.sidebar {
    background-color: var(--fr-sidebar-bg);
    box-shadow:       inset -1px 0 0 var(--bs-border-color);
    overflow-y:       auto;
}

@media (min-width: 768px) {
    .sidebar {
        position: fixed;
        top:      calc(var(--fr-navbar-height) + 3px);
        bottom:   0;
        left:     0;
        z-index:  100;
        padding:  16px 0 24px;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        position:   fixed;
        top:        calc(var(--fr-navbar-height) + 3px);
        left:       0;
        right:      0;
        max-height: calc(100vh - var(--fr-navbar-height) - 3px);
        z-index:    1020;
        padding:    8px 0 16px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, .2);
    }
}

.sidebar .nav-link {
    color:         var(--fr-sidebar-text);
    padding:       .45rem 1.25rem;
    display:       flex;
    align-items:   center;
    gap:           10px;
    border-left:   3px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus-visible {
    background-color: var(--fr-sidebar-hover);
    color:            var(--fr-sidebar-text);
}

.sidebar .nav-link.active {
    background-color: var(--fr-sidebar-hover);
    border-left-color: var(--fr-brand);
    font-weight:      600;
}

.sidebar .nav-group > .nav-link {
    font-weight: 600;
}

.sidebar .nav-group > .nav-link .bi-chevron-down {
    transition: transform .2s ease;
}

.sidebar .nav-group > .nav-link[aria-expanded="false"] .bi-chevron-down {
    transform: rotate(-90deg);
}

.sidebar .nested-nav .nav-link {
    padding:   .3rem 1.25rem .3rem 2.75rem;
    font-size: .925rem;
    margin-right: 1px;
}

/* Content */
.main-content {
    margin-top: calc(var(--fr-navbar-height) + 3px);
    padding:    24px 32px 48px;
    max-width:  1100px;
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 16px 16px 40px;
    }
}

.main-content section {
    background-color: var(--bs-body-bg);
    border:           1px solid var(--bs-border-color);
    border-radius:    10px;
    padding:          24px 28px;
    margin-bottom:    24px;
}

@media (max-width: 575.98px) {
    .main-content section {
        padding: 18px 16px;
    }
}

.main-content h2 {
    font-size:     1.6rem;
    font-weight:   700;
    margin-bottom: .75rem;
}

.main-content h3 {
    font-size:  1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
}

.section-kicker {
    color:          var(--fr-brand-dark);
    font-size:      .8rem;
    font-weight:    700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom:  .25rem;
}

[data-bs-theme="dark"] .section-kicker {
    color: var(--fr-brand);
}

.hero {
    display:     flex;
    gap:         24px;
    align-items: center;
}

.hero img {
    width:     96px;
    height:    96px;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .hero {
        flex-direction: column;
        align-items:    flex-start;
    }
}

/* Screenshots */
.screenshot {
    margin: 1.25rem 0;
}

.screenshot img {
    max-width:     100%;
    height:        auto;
    border-radius: 8px;
    border:        1px solid var(--bs-border-color);
    box-shadow:    0 6px 18px rgba(0, 0, 0, .12);
}

.screenshot figcaption {
    color:      var(--bs-secondary-color);
    font-size:  .875rem;
    margin-top: .5rem;
}

.screenshot.narrow img {
    max-width: min(560px, 100%);
}

/* Inline elements */
.pro-badge {
    display:          inline-block;
    background-color: var(--fr-brand);
    color:            var(--fr-on-brand);
    font-size:        .68rem;
    font-weight:      700;
    letter-spacing:   .03em;
    border-radius:    4px;
    padding:          .1rem .4rem;
    vertical-align:   middle;
}

.free-badge {
    display:          inline-block;
    background-color: var(--bs-success-bg-subtle);
    color:            var(--bs-success-text-emphasis);
    font-size:        .68rem;
    font-weight:      700;
    border-radius:    4px;
    padding:          .1rem .4rem;
    vertical-align:   middle;
}

.ui {
    font-weight: 600;
}

kbd {
    background-color: var(--bs-secondary-bg);
    color:            var(--bs-body-color);
    border:           1px solid var(--bs-border-color);
    box-shadow:       inset 0 -1px 0 var(--bs-border-color);
    font-size:        .85em;
}

code {
    color: #b3006b;
}

[data-bs-theme="dark"] code {
    color: #ff8ac9;
}

.table td,
.table th {
    vertical-align: top;
}

.table .tray-icon {
    width:  24px;
    height: 24px;
}

.steps > li {
    margin-bottom: .5rem;
}

.alert .bi {
    margin-right: .4rem;
}

/* Search */
.search-results {
    position:      absolute;
    top:           calc(100% + 6px);
    left:          0;
    right:         0;
    z-index:       1050;
    max-height:    70vh;
    overflow-y:    auto;
    background:    var(--bs-body-bg);
    color:         var(--bs-body-color);
    border:        1px solid var(--bs-border-color);
    border-radius: 8px;
    box-shadow:    0 10px 24px rgba(0, 0, 0, .2);
}

.search-results a {
    display:         block;
    padding:         .6rem .9rem;
    color:           inherit;
    text-decoration: none;
    border-bottom:   1px solid var(--bs-border-color-translucent);
}

.search-results a:last-child {
    border-bottom: 0;
}

.search-results a:hover,
.search-results a.active {
    background-color: var(--fr-sidebar-hover);
}

.search-results .result-title {
    font-weight: 600;
}

.search-results .result-snippet {
    font-size: .85rem;
    color:     var(--bs-secondary-color);
}

.search-results .no-results {
    padding: .75rem .9rem;
    color:   var(--bs-secondary-color);
}

mark.search-hit {
    background-color: var(--fr-mark);
    color:            inherit;
    padding:          0 .1em;
    border-radius:    2px;
}

.btn-brand {
    --bs-btn-bg:                var(--fr-brand);
    --bs-btn-border-color:      var(--fr-brand-dark);
    --bs-btn-color:             var(--fr-on-brand);
    --bs-btn-hover-bg:          #ffa41f;
    --bs-btn-hover-border-color: var(--fr-brand-dark);
    --bs-btn-hover-color:       var(--fr-on-brand);
    --bs-btn-active-bg:         var(--fr-brand-dark);
    --bs-btn-active-color:      var(--fr-on-brand);
}

/* Footer */
.help-footer {
    color:     var(--bs-secondary-color);
    font-size: .875rem;
}

.help-footer img {
    width:  auto;
    height: 34px;
}

/* Keyboard focus is always visible */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline:        3px solid var(--fr-brand);
    outline-offset: 2px;
}

@media print {
    .navbar, .sidebar, .help-footer .btn {
        display: none !important;
    }

    .main-content {
        margin: 0;
        max-width: none;
    }

    .main-content section {
        break-inside: avoid-page;
        border: 0;
    }
}
