*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #B8D2DD;
    background: #121820;
}

a {
    color: #6EA9C3;
    text-decoration: none;
}

.breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}
.breadcrumb a {
    color: #ffa500;
    text-decoration: none;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    transition: background 0.2s ease, color 0.2s ease;
}
.breadcrumb a:hover {
    background: #ffa500;
    color: #121820;
}
.breadcrumb span {
    color: #B8D2DD;
}

a:hover {
    text-decoration: underline;
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background: #2B688E;
}

.site-banner {
    display: block;
    width: 100%;
    height: auto;
    max-height: 190px;
    object-fit: cover;
}

.site-body {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    background: #1a2535;
    border-right: 1px solid #2B688E;
    padding: 0.75rem;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.sidebar__section {
    background: #1a2535;
    border-radius: 5px;
    box-shadow: inset 0 0 3px #000;
    padding: 5px;
}

.sidebar__title {
    font-size: 0.95rem;
    font-weight: bold;
    color: #B8D2DD;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
}

.sidebar-search {
    display: flex;
    gap: 0;
    margin-top: 0.5rem;
    background: #1a2535;
    border-radius: 5px;
    padding: 0.5rem;
    box-shadow: inset 0 0 3px #000;
}

.sidebar-search__input-wrapper {
    flex: 1;
}

.sidebar-search__input {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    border: 1px solid #2B688E;
    border-radius: 3px 0 0 3px;
    background: #121820;
    color: #B8D2DD;
    outline: none;
}

.sidebar-search__input:focus {
    border-color: #ffa500;
    background: #1a2535;
}

.sidebar-search__input::placeholder {
    color: #888;
}

.sidebar-search__button {
    padding: 0.4rem 0.6rem;
    background: #2B688E;
    border: 1px solid #2B688E;
    border-radius: 0 3px 3px 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sidebar-search__button:hover {
    background: #ffa500;
    border-color: #ffa500;
    color: #121820;
}

.nav {
    list-style: none;
}

.nav--depth-2,
.nav--depth-3,
.nav--depth-4 {
    padding-left: 0.75rem;
    margin-top: 0;
}

.nav__item {
    margin-bottom: 0;
}

.nav__summary {
    display: block;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    user-select: none;
    color: #B8D2DD;
}

.nav__summary:hover {
    color: #ffa500;
}

.nav__summary--depth-1,
.nav__summary--depth-2,
.nav__summary--depth-3 {
    font-size: 0.85rem;
}

.nav__link {
    display: block;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    transition: background 0.15s;
    color: #B8D2DD;
}

.nav__link:hover {
    color: #ffa500;
    text-decoration: none;
}

.nav__summary:hover {
}

details:not([open]) summary.nav__summary::before {
    content: '+';
    float: right;
    font-size: 0.8rem;
}

details[open] summary.nav__summary::before {
    content: '-';
    float: right;
    font-size: 0.8rem;
}

details[data-depth="2"]:not([open]) summary.nav__summary::before {
    content: '+';
    float: right;
    font-size: 0.8rem;
}

details[data-depth="2"][open] summary.nav__summary::before {
    content: '-';
    float: right;
    font-size: 0.8rem;
}

details[data-depth="3"]:not([open]) summary.nav__summary::before {
    content: '+';
    float: right;
    font-size: 0.8rem;
}

details[data-depth="3"][open] summary.nav__summary::before {
    content: '-';
    float: right;
    font-size: 0.8rem;
}

details[data-depth="4"]:not([open]) summary.nav__summary::before {
    content: '+';
    float: right;
    font-size: 0.8rem;
}

details[data-depth="4"][open] summary.nav__summary::before {
    content: '-';
    float: right;
    font-size: 0.8rem;
}

details > .nav {
    margin-top: 0;
}

details[open] > .nav__summary {
    color: #fff;
}

.nav__summary:hover {
    color: #ffa500;
}

.nav--depth-1 > li > details > .nav__summary,
.nav--depth-1 > li > .nav__link {
    background: #2B688E;
    background: linear-gradient(to bottom, #2B688E 0%, #263F5D 100%);
    border-radius: 0;
    margin: 0;
}

.nav--depth-1 > li > details > .nav__summary:hover,
.nav--depth-1 > li > .nav__link:hover {
    background: #ffa500;
    color: #121820;
}

.nav--depth-2 > li > details > .nav__summary,
.nav--depth-2 > li > .nav__link {
    background: #3a6070;
    background: linear-gradient(to bottom, #3a6070 0%, #2B688E 100%);
    margin: 0;
}

.nav--depth-2 > li > details > .nav__summary:hover,
.nav--depth-2 > li > .nav__link:hover {
    background: #ffa500;
    color: #121820;
}

.nav--depth-3 > li > details > .nav__summary,
.nav--depth-3 > li > .nav__link {
    background: #5a8a9e;
    margin: 0;
}

.nav--depth-3 > li > details > .nav__summary:hover,
.nav--depth-3 > li > .nav__link:hover {
    background: #ffa500;
    color: #121820;
}

.nav--depth-4 > li > details > .nav__summary,
.nav--depth-4 > li > .nav__link {
    background: #3a5060;
    margin: 0;
}

.nav--depth-4 > li > details > .nav__summary:hover,
.nav--depth-4 > li > .nav__link:hover {
    background: #ffa500;
    color: #121820;
}

details[open] > .nav__summary {
    color: #fff;
}

.nav__summary:hover {
    color: #ffa500;
}

.nav__item--active > .nav__link,
.nav__item--active > details > .nav__summary {
    font-weight: bold;
    color: #fff !important;
}

.nav__item--active > .nav__link {
    background: #1a4560 !important;
}

.nav__item--active > details > .nav__summary {
    background: #1a4560 !important;
}

.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    min-width: 0;
}

.page-content {
    background: #1a2535;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.page-content h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #6EA9C3;
    border-bottom: 2px solid #2B688E;
    padding-bottom: 0.5rem;
}

.page-content h2 {
    font-size: 1.35rem;
    margin: 1.5rem 0 0.75rem;
    color: #B8D2DD;
}

.page-content h3 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
    color: #6EA9C3;
}

.page-content h4,
.page-content h5,
.page-content h6 {
    color: #B8D2DD;
    margin: 1rem 0 0.5rem;
}

.page-content p {
    margin-bottom: 1rem;
    color: #B8D2DD;
}

.page-content img {
    max-width: 500px;
    height: auto;
    border-radius: 4px;
    margin: 0.5rem 0;
    border: 1px solid #2B688E;
    cursor: pointer;
}

.page-content > p > img:only-child,
.page-content > p > a:only-child > img:only-child,
.page-content > p.article-image-float > img:first-child {
    float: left;
    margin-top: 0;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
    max-width: 500px;
}

.page-content > p > img:only-child + *,
.page-content > p.article-image-float > img:first-child + * {
    clear: none;
}

.image-with-caption {
    float: left;
    margin: 0 1rem 0.5rem 0;
    max-width: 500px;
    text-align: center;
    padding: 0 0.5rem 0.5rem 0.5rem;
    background: #1a2535;
    border-radius: 4px;
}
.image-with-caption img {
    display: block;
    float: none !important;
    vertical-align: top;
    margin: 0 auto 0.5rem auto !important;
    max-width: 480px;
    height: auto;
}
.image-with-caption .image-caption {
    width: 100%;
    text-align: center;
}

.page-content > p:has(+ p > img:only-child)::after {
    content: "";
    display: table;
    clear: both;
}

.page-content ul,
.page-content ol {
    margin: 1rem 0 1rem 1.5rem;
    color: #B8D2DD;
}

.page-content li {
    margin-bottom: 0.4rem;
    color: #B8D2DD;
}

.article-meta {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.page-content blockquote {
    border-left: 4px solid #6EA9C3;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #888;
    font-style: italic;
    background: #121820;
    padding: 0.75rem;
    border-radius: 0 4px 4px 0;
}

.page-content pre {
    background: #121820;
    border: 1px solid #2B688E;
    border-radius: 4px;
    padding: 0.75rem;
    overflow-x: auto;
    margin: 1rem 0;
    white-space: pre-wrap;
    font-size: 0.875rem;
    color: #B8D2DD;
}

.page-content code {
    background: #121820;
    color: #6EA9C3;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.875rem;
    border: 1px solid #2B688E;
}

.page-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: inherit;
}

.page-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.page-content th,
.page-content td {
    border: 1px solid #2B688E;
    padding: 0.5rem 0.75rem;
    text-align: left;
    color: #B8D2DD;
}

.page-content th {
    background: #2B688E;
    color: #fff;
}

.page-content tr:nth-child(even) {
    background: #121820;
}

.page-content .pub-article-nav-banner td {
    border: none !important;
    padding: 0 !important;
}
.page-content .pub-article-nav-banner img {
    border: none !important;
    display: block;
}

.page-content hr {
    border: none;
    border-top: 1px solid #2B688E;
    margin: 1.5rem 0;
}

.page-content strong {
    color: #fff;
}

.page-content em {
    color: #888;
}

.page-listing h1 {
    font-size: 1.75rem;
    color: #6EA9C3;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #2B688E;
    padding-bottom: 0.5rem;
}

.page-list {
    list-style: none;
    margin: 1rem 0;
}

.page-list__item {
    margin-bottom: 1.25rem;
    background: #1a2535;
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    border: 1px solid #2B688E;
}

.page-list__item a {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}

.page-list__item a:hover {
    text-decoration: none;
}

.page-list__item a:hover h2 {
    color: #6EA9C3;
}

.page-list__thumbnail {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid #2B688E;
}

.page-list__item h2 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: #B8D2DD;
    transition: color 0.15s;
}

.page-list__item p {
    color: #888;
    font-size: 0.875rem;
    margin: 0;
}

.section-intro {
    margin-bottom: 1rem;
    color: #B8D2DD;
    line-height: 1.7;
}

.section-quote {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid #ffa500;
    background: #1a2535;
    border-radius: 0 4px 4px 0;
}

.section-quote p {
    color: #B8D2DD;
    font-style: italic;
    margin: 0 0 0.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.section-quote cite {
    display: block;
    color: #6EA9C3;
    font-style: normal;
    font-size: 0.875rem;
}

.page-list__thumbnail--external {
    opacity: 0.7;
}

.page-list__content {
    min-width: 0;
}

.site-footer {
    background: #2B688E;
    background: linear-gradient(to bottom, #2B688E 0%, #263F5D 100%);
    color: #B8D2DD;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    border-top: 2px solid #6EA9C3;
}

.site-footer p {
    color: #B8D2DD;
}

.home-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    text-align: center;
    background: #121820;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #2B688E;
}

.home-welcome__text {
    flex: 0 0 30%;
    color: #B8D2DD;
}

.home-welcome__text p {
    color: #B8D2DD;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.home-welcome__image {
    flex: 0 0 auto;
}

.home-welcome__image img {
    max-width: 225px;
    height: auto;
    border: 1px solid #444;
}

.home-welcome__caption {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
}

.home-popular-links {
    margin: 1.5rem 0;
    padding: 0.5rem 1rem;
    background: #1a2535;
    border: 1px solid #2B688E;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #B8D2DD;
}

.home-popular-links strong {
    color: #6EA9C3;
}

.home-popular-links a {
    color: #ffa500;
    margin-right: 1rem;
}

.home-copyright {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 1rem;
    padding-top: 0.5rem;
}

#search-input {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid #2B688E;
    border-radius: 3px;
    margin-top: 0.5rem;
    background: #121820;
    color: #B8D2DD;
}

.search-results__item {
    background: #1a2535;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    border: 1px solid #2B688E;
}

.search-results__title {
    color: #6EA9C3;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.search-results__title a {
    color: #6EA9C3;
}

.search-results__excerpt {
    color: #888;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .site-body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: unset;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #2B688E;
    }

    .main-content {
        padding: 1rem;
    }

    .page-list__item a {
        flex-direction: column;
    }

    .page-list__thumbnail {
        width: 100%;
        height: auto;
    }

    .home-welcome {
        flex-direction: column;
    }
}

.script-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.script-table th,
.script-table td {
  border: 1px solid #3a5060;
  padding: 0.5rem 0.75rem;
  vertical-align: top;
  text-align: left;
}
.script-table .col-code {
  width: 45%;
  white-space: nowrap;
}
.script-table .col-desc {
  width: 20%;
}
.script-table .col-comment {
  width: 35%;
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    background: #e67e22;
    padding: 16px;
    border-radius: 8px;
}
.scroll-to-top.visible {
    display: block;
    opacity: 1;
}
.scroll-to-top:hover {
    background: #3498db;
}
.scroll-to-top img {
    width: 40px;
    height: auto;
    filter: brightness(0) invert(1);
    display: block;
}

.prev-next-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #2B688E;
}
.prev-next-nav a {
    color: #ffa500;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: #1a2535;
    border: 1px solid #ffa500;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}
.prev-next-nav a:hover {
    background: #ffa500;
    color: #121820;
}
.prev-link {
    margin-right: auto;
}
.next-link {
    margin-left: auto;
}

/* PagefindUI search result overrides */
.pagefind-ui__result-title {
    color: #B8D2DD !important;
}

.pagefind-ui__result-title a {
    color: #B8D2DD !important;
}

.pagefind-ui__result-title a:visited {
    color: #ffa500 !important;
}

.pagefind-ui__result-excerpt {
    color: #B8D2DD;
}

.pagefind-ui__message {
    color: #B8D2DD;
}

.pagefind-ui__drawer {
    background: #1a2535;
    border: 1px solid #2B688E;
}

.pagefind-ui__result {
    border-bottom: 1px solid #2B688E;
}
