/* file: templates/finclair-template/public/main.css */

/* ============================================================
   1. BOOTSTRAP THEME OVERRIDES
   ============================================================ */

:root,
[data-bs-theme=light] {
    color-scheme: light;
    body { font-family: 'Inter', sans-serif; background-color: #ffffff; }
    .bg-body { background-color: #ffffff !important; }
}

[data-bs-theme=dark] {
    color-scheme: dark;
    --bs-body-color: #dee2e6;
    --bs-body-color-rgb: 222, 226, 230;
    --bs-body-bg: #08090a;
    --bs-body-bg-rgb: 8, 9, 10;
    --bs-emphasis-color: #fff;
    --bs-secondary-color: rgba(222, 226, 230, .75);
    --bs-secondary-bg: #1c1d20;
    --bs-tertiary-color: rgba(222, 226, 230, .5);
    --bs-tertiary-bg: #141618;
    --bs-primary-text-emphasis: #6ea8fe;
    --bs-secondary-text-emphasis: #a7acb1;
    --bs-success-text-emphasis: #75b798;
    --bs-info-text-emphasis: #6edff6;
    --bs-warning-text-emphasis: #ffda6a;
    --bs-danger-text-emphasis: #ea868f;
    --bs-light-text-emphasis: #f8f9fa;
    --bs-dark-text-emphasis: #dee2e6;
    --bs-primary-bg-subtle: #031633;
    --bs-secondary-bg-subtle: #161719;
    --bs-success-bg-subtle: #051b11;
    --bs-info-bg-subtle: #032830;
    --bs-warning-bg-subtle: #332701;
    --bs-danger-bg-subtle: #2c0b0e;
    --bs-light-bg-subtle: #343a40;
    --bs-dark-bg-subtle: #1a1d20;
    --bs-primary-border-subtle: #084298;
    --bs-secondary-border-subtle: #41464b;
    --bs-success-border-subtle: #0f5132;
    --bs-info-border-subtle: #087990;
    --bs-warning-border-subtle: #997404;
    --bs-danger-border-subtle: #842029;
    --bs-light-border-subtle: #495057;
    --bs-dark-border-subtle: #343a40;
    --bs-heading-color: inherit;
    --bs-link-color: #6ea8fe;
    --bs-link-hover-color: #8bb9fe;
    --bs-link-color-rgb: 110, 168, 254;
    --bs-link-hover-color-rgb: 139, 185, 254;
    --bs-code-color: #e685b5;
    --bs-highlight-color: #dee2e6;
    --bs-highlight-bg: #664d03;
    --bs-border-color: rgba(255, 255, 255, 0.1);
    --bs-border-color-translucent: rgba(255, 255, 255, .15);
    --bs-form-valid-color: #75b798;
    --bs-form-valid-border-color: #75b798;
    --bs-form-invalid-color: #ea868f;
    --bs-form-invalid-border-color: #ea868f;
    body { font-family: 'Inter', sans-serif; background-color: #08090a; }
    .bg-body { background-color: #08090a !important; }
}

/* ============================================================
   2. DESIGN TOKENS
   ============================================================ */

:root {
    --primary: #3868da;
    --primary-hover: #3A68E6;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --topbar-height: 56px;
    --sidebar-width: 260px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   3. BASE TYPOGRAPHY
   ============================================================ */

body {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

article h1 {
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    margin-top: 20px;
    margin-bottom: 16px;
}

article h2 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-top: 48px;
    margin-bottom: 8px;
}

article h3 { margin-top: 10px; }
/* ============================================================
   4. NAVBAR AUSBLENDEN
   ============================================================ */

.navbar {
    visibility: hidden !important;
    height: 0 !important;
    overflow: visible !important;
    position: absolute !important;
}

/* Unser Topbar */
#finclair-topbar {
    display: flex;
    align-items: center;
    height: var(--topbar-height);
    width: 100%;
}

/* ============================================================
   5. HEADER
   ============================================================ */

header.bg-body {
    display: flex !important;
    align-items: center;
    height: var(--topbar-height);
    border-bottom: 1px solid var(--bs-border-color) !important;
    padding: 0;
    background-color: inherit;
}

.topbar-left {
    width: var(--sidebar-width);
    flex-shrink: 0;
    padding: 0 20px;
    border-right: 1px solid var(--bs-border-color);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
}

.topbar-center {
    flex: 1;
    padding: 0 24px;
    display: flex;
    align-items: center;
    min-width: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
    flex-shrink: 0;
}

/* Brand / Logo */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--bs-body-color);
    white-space: nowrap;
}

.brand img { height: 24px; width: auto; }

.brand-divider {
    width: 1px;
    height: 20px;
    background-color: var(--bs-border-color);
    flex-shrink: 0;
    margin: 0 2px;
}

.brand-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--bs-secondary-color);
    letter-spacing: 0.01em;
}

/* Icon Buttons */
.icon-btn {
    background: transparent;
    border: none;
    color: var(--bs-secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}

.icon-btn:hover {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

/* Logo hell/dunkel */
[data-bs-theme="dark"] .logo-light-mode { display: none; }
[data-bs-theme="light"] .logo-dark-mode { display: none; }
[data-bs-theme="dark"] .logo-dark-mode { display: block; }
[data-bs-theme="light"] .logo-light-mode { display: block; }

/* ============================================================
   6. BREADCRUMB
   ============================================================ */

#breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--bs-secondary-color);
    margin: 0;
    padding: 0;
}

#breadcrumb ol {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

#breadcrumb a { color: var(--bs-secondary-color); text-decoration: none; }
#breadcrumb a:hover { color: var(--bs-body-color); }

#breadcrumb .breadcrumb-item.active {
    color: var(--bs-body-color);
    font-weight: 500;
}

#breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--bs-secondary-color);
}

.actionbar { display: none; }

/* ============================================================
   7. SIDEBAR
   ============================================================ */

/* Sidebar Breite */
.toc-offcanvas .offcanvas-md,
.offcanvas-md.offcanvas-start,
div#tocOffcanvas,
#tocOffcanvas {
    --bs-offcanvas-width: var(--sidebar-width) !important;
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    border-right: 1px solid var(--bs-border-color) !important;
}

.offcanvas-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 0 !important;
}

nav#toc {
    width: 100% !important;
}

/* Filter ausblenden */
form.filter {
    display: none !important;
}

/* Sidebar Section Labels */
.toc-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
    padding: 20px 16px 8px 16px;
}

.toc-section-list {
    list-style: none;
    padding: 0;
    margin: 0 0 4px 0;
}

.toc-section-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--bs-body-color);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin: 0 8px;
}

.toc-section-link:hover {
    background: var(--bs-secondary-bg);
}

/* expand-stub ausblenden */
nav#toc .expand-stub {
    display: none !important;
}

/* Nav-Link Layout: Icon | Text | Pfeil */
nav#toc > div > ul > li > a {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    width: 100% !important;
    white-space: normal !important;
    text-decoration: none !important;
    position: relative;
}

nav#toc > div > ul > li > a img {
    flex-shrink: 0 !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 6px;
}

/* Pfeil-Pseudo-Element — immer rechts */
nav#toc > div > ul > li.expander > a::after {
    content: "›";
    margin-left: auto;
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
    color: var(--bs-secondary-color);
    transition: transform 0.2s;
}

/* Pfeil dreht sich beim Aufklappen */
nav#toc > div > ul > li.expander.expanded > a::after,
nav#toc > div > ul > li.expander.active > a::after {
    transform: rotate(90deg);
}

/* Bootstrap Chevron Icons ausblenden */
nav#toc .bi-chevron-right,
nav#toc .bi-chevron-down {
    display: none !important;
}

/* Hover-Zustand */
nav#toc > div > ul > li > a:hover {
    background-color: var(--bs-secondary-bg) !important;
    border-radius: var(--radius-sm) !important;
}

nav#toc a:focus {
    outline: none !important;
    box-shadow: none !important;
}


/* Nav-Links grau, weiß beim Hover */
nav#toc > div > ul > li > a {
    color: var(--bs-secondary-color) !important;
}

nav#toc > div > ul > li > a:hover,
nav#toc > div > ul > li.active > a,
nav#toc > div > ul > li.expanded > a {
    color: var(--bs-body-color) !important;
}

/* Untereinträge auch grau */
nav#toc > div > ul > li > ul a {
    color: var(--bs-secondary-color) !important;
    font-size: 13px;
}

nav#toc > div > ul > li > ul a:hover,
nav#toc > div > ul > li > ul a.active {
    color: var(--bs-body-color) !important;
}


/* Untereinträge Layout */
nav#toc > div > ul > li > ul {
    padding-left: 0 !important;
    margin: 0 !important;
}

nav#toc > div > ul > li > ul > li > a {
    display: flex !important;
    align-items: center !important;
    padding: 6px 16px 6px 50px !important;
    font-size: 13px !important;
    color: var(--bs-secondary-color) !important;
    text-decoration: none !important;
    border-radius: var(--radius-sm) !important;
    transition: background var(--transition), color var(--transition);
}

nav#toc > div > ul > li > ul > li > a:hover {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
    text-decoration: none !important;
}

nav#toc > div > ul > li > ul > li > a.active,
nav#toc > div > ul > li > ul > li.active > a {
    color: var(--bs-body-color) !important;
    font-weight: 500 !important;
}
/* Sidebar volle Höhe mit Trennlinie */


main.container-xxl {
    display: flex !important;
    padding: 0 !important;
}

/* Sidebar bei kleinem Fenster */
@media (max-width: 768px) {
    .toc-offcanvas .offcanvas-md {
        z-index: 1045 !important;
    }

    nav#toc > div > ul > li > a {
        padding-right: 40px !important;
    }

    nav#toc > div > ul > li.expander > a::after {
        position: absolute;
        right: 12px;
    }
}


/* Search Modal Styling wie Katrin */
.search-list {
    background-color: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3) !important;
    max-width: 600px !important;
    margin: 12vh auto 0 !important;
}

#search-results .search-list {
    padding: 0 !important;
}

.search-results-container {
    background-color: var(--bs-body-bg) !important;
    border-radius: var(--radius-lg) !important;
}

/* Search Input Box */
.container-xxl.search-results {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 9999 !important;
    display: none;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 12vh !important;
    max-width: 100% !important;
}

.container-xxl.search-results.show {
    display: flex !important;
}

/* ============================================================
   8. ALERT BOXES
   ============================================================ */

div.NOTE, div.TIP, div.WARNING, div.CAUTION {
    display: block;
    padding: 16px;
    border-radius: var(--radius-md);
    margin: 24px 0;
}

div.NOTE h5, div.TIP h5, div.WARNING h5, div.CAUTION h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

div.NOTE p, div.TIP p, div.WARNING p, div.CAUTION p {
    margin: 0;
    font-size: 14px;
    padding-left: 28px;
}

div.NOTE {
    border: 1px solid rgba(56, 104, 218, 0.3);
    background-color: rgba(56, 104, 218, 0.05) !important;
}
div.NOTE h5 { color: #3868da !important; }

div.TIP {
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
}
div.TIP h5 { color: #10b981 !important; }

div.WARNING {
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    background-color: rgba(245, 158, 11, 0.05) !important;
}
div.WARNING h5 { color: #f59e0b !important; }

div.CAUTION {
    border: 1px solid rgba(225, 29, 72, 0.3) !important;
    background-color: rgba(225, 29, 72, 0.05) !important;
}
div.CAUTION h5 { color: #e11d48 !important; }

/* ============================================================
   9. FOOTER
   ============================================================ */

/* Footer sichtbar machen */
footer {
    display: none !important;
}


/* ============================================================
   10. PREV/NEXT NAVIGATION
   ============================================================ */

#nextArticle {
    display: flex !important;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--bs-border-color);
}

#nextArticle .prev,
#nextArticle .next {
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    padding: 20px 24px !important;
    background: transparent !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: var(--radius-md) !important;
    transition: border-color var(--transition), background var(--transition);
}

#nextArticle .prev:hover,
#nextArticle .next:hover {
    border-color: var(--bs-body-color) !important;
    background: var(--bs-secondary-bg) !important;
}

#nextArticle .prev > span,
#nextArticle .next > span {
    font-size: 12px;
    color: var(--bs-secondary-color);
    margin-bottom: 6px;
    display: block;
}

#nextArticle .prev a,
#nextArticle .next a {
    font-size: 15px;
    font-weight: 500;
    color: var(--bs-body-color) !important;
    text-decoration: none !important;
}

#nextArticle .next {
    text-align: right;
}

/* ============================================================
   11. AUF DIESER SEITE (Affix)
   ============================================================ */

.affix {
    border-left: 1px solid var(--bs-border-color) !important;
    padding-left: 24px !important;
}

nav#affix h5 {
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: var(--bs-secondary-color) !important;
    border-bottom: none !important;
    margin-bottom: 8px !important;
}

nav#affix ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

nav#affix ul li a {
    font-size: 13px !important;
    color: var(--bs-secondary-color) !important;
    text-decoration: none !important;
    display: block !important;
    padding: 4px 8px !important;
    border-radius: var(--radius-sm) !important;
    transition: background var(--transition), color var(--transition) !important;
    line-height: 1.5 !important;
}

nav#affix ul li a:hover {
    background: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
    text-decoration: none !important;
}

nav#affix ul li a.active {
    color: var(--bs-body-color) !important;
    font-weight: 500 !important;
}


/* Search Overlay */
#finclair-search-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

#finclair-search-modal {
    width: 100%;
    max-width: 600px;
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
}

#finclair-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bs-border-color);
}

#finclair-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--bs-body-color);
    font-size: 15px;
    font-family: var(--font-body);
}

#finclair-search-input::placeholder {
    color: var(--bs-secondary-color);
}

#finclair-search-header kbd {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--bs-secondary-color);
    cursor: pointer;
    flex-shrink: 0;
}

#finclair-search-results {
    padding: 32px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}