/* srbog-custom.css
 * Project-specific overrides for srbog.tepedu.dk —
 * navbar transparency, side page menu, and content offsets.
 * All typography / component styling comes from chapters-shared.css.
 */

body {
    margin-top: 56px; /* fixed navbar offset */
    font-style: normal; /* override italic leftover in styles.css */
}

/* -------- Navbar -------- */
.transparent-navbar {
    background-color: rgba(248, 249, 250, 0.8);
}

.navbar-nav .nav-item {
    margin-left: 40px;
}

.navbar-nav {
    flex-wrap: nowrap;
}

.navbar-nav .nav-link .bi {
    font-size: 1.6em;
    vertical-align: middle;
}

/* -------- Side page menu (TOC): slide-in/out animation -------- */
#page-menu {
    position: fixed;
    top: 56px;
    left: 0;
    width: 200px;
    height: calc(100% - 56px);
    background-color: rgba(248, 249, 250, 0.95);
    border-right: 1px solid rgba(26, 58, 92, 0.12);
    overflow-y: auto;
    padding: 1rem;
    /* Slide transition instead of display:none */
    transform: translateX(0);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1029;
}

#page-menu ul li a {
    text-decoration: none;
    color: inherit;
    display: block;
    text-align: left;
    padding: 3px 0;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

#page-menu ul li a:hover {
    color: var(--accent-marine, #1a3a5c);
    font-weight: 600;
}

#page-menu .menu-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
}

/* -------- Animated circular sidebar toggle (like skills #sidebar-toggle-button) -------- */
#menu-icon {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 1032;
    background: #868e96;
    color: white;
    border: 2px solid #868e96;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 22px;
    line-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#menu-icon:hover,
#menu-icon:focus,
#menu-icon:active {
    background: #d3d3d3;
    border-color: #d3d3d3;
    transform: translateY(-50%) scale(1.1);
    outline: none;
}

/* Move button to right edge of menu when open */
#menu-icon.open {
    left: 220px;
}

@media (min-width: 992px) {
    #menu-icon.open {
        left: 300px;
    }
}

/* Icon crossfade animations */
#menu-icon .icon-open,
#menu-icon .icon-close {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menu-icon .icon-close {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

#menu-icon.open .icon-open {
    transform: scale(0);
    opacity: 0;
}

#menu-icon.open .icon-close {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* When menu is hidden: slide menu out */
body.menu-hidden #page-menu {
    transform: translateX(-110%);
    pointer-events: none;
}

/* Content offset transitions */
.content {
    margin-left: 200px;
    padding-top: 40px;
    padding-left: 1.5rem;
    transition: margin-left 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

body.menu-hidden .content {
    margin-left: 0 !important;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
    scroll-margin-top: 70px;
}

.content-container {
    padding-left: 30px;
    padding-right: 50px;
}

/* -------- Box left padding: more breathing room from the navy border -------- */
.example-box {
    padding-left: 36px !important;
}

.info-box {
    padding-left: 36px !important;
}

/* -------- List indentation inside info-box and example-box -------- */
/* Top-level lists: push markers clear of the left edge so they appear more indented than <p> text */
.info-box > ul,
.info-box > ol,
.example-box > ul,
.example-box > ol {
    padding-left: 2.5rem !important;
    margin-left: 0.75rem !important;
    margin-bottom: 0.5rem;
}

/* Nested lists: keep them indented relative to parent items */
.info-box ul ul,
.info-box ul ol,
.info-box ol ul,
.info-box ol ol,
.example-box ul ul,
.example-box ul ol,
.example-box ol ul,
.example-box ol ol,
.content ol ol,
.content ol ul,
.content ul ol,
.content ul ul {
    padding-left: 1.75rem !important;
    margin-left: 0 !important;
    margin-top: 0.4rem;
}

@media (min-width: 992px) {
    #page-menu {
        width: 280px;
    }
    .content {
        margin-left: 280px;
    }
    body.menu-hidden .content {
        margin-left: 0 !important;
    }
}

@media (min-width: 1200px) {
    .content-container {
        padding-right: 150px;
    }
}

@media (min-width: 1400px) {
    .content-container {
        padding-right: 200px;
    }
}

@media (min-width: 1600px) {
    .content-container {
        padding-right: 250px;
    }
}

/* -------- Indent utility classes used by script.js TOC -------- */
.pl-0 { padding-left: 0 !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-5 { padding-left: 1.5rem !important; }
.pl-7 { padding-left: 2rem !important; }

/* -------- Info-box: navy background for text/content sections -------- */
/* theme-light.css resets background-color to white — override here (loads last) */
.info-box,
:root:not([data-theme="dark"]) .info-box,
[data-theme="light"] .info-box {
    background: #1a3a5c !important;
    background-color: #1a3a5c !important;
    color: #ffffff !important;
}

.info-box h2,
.info-box h3,
.info-box h4,
.info-box h5,
.info-box p,
.info-box li,
.info-box b,
.info-box strong {
    color: #ffffff !important;
}

/* -------- Info-box containing a table: white background -------- */
/* Sections like 5.6, 7.6, 8.3, 9.2 should not have navy bg when they hold a table */
.info-box:has(table),
.info-box:has(.table-responsive),
:root:not([data-theme="dark"]) .info-box:has(table),
[data-theme="light"] .info-box:has(table) {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1a3a5c !important;
    border: 1px solid rgba(26, 58, 92, 0.15) !important;
    border-left: 5px solid #1a3a5c !important;
}

.info-box:has(table) h2,
.info-box:has(table) h3,
.info-box:has(table) h4,
.info-box:has(table) h5,
.info-box:has(table) p,
.info-box:has(table) li,
.info-box:has(table) b,
.info-box:has(table) strong {
    color: #1a3a5c !important;
}

/* Table cells inside formerly-navy info-box: dark text */
.info-box:has(table) .table tbody td,
.info-box:has(table) .table tbody th {
    color: #212529 !important;
}

/* Keep thead white text on navy */
.info-box:has(table) .table thead th,
.info-box:has(table) .table thead td {
    color: #ffffff !important;
    background-color: #1a3a5c !important;
}

/* -------- Table hover -------- */
.table tbody tr:hover td,
.table tbody tr:hover th {
    background-color: rgba(26, 58, 92, 0.08) !important;
    cursor: default;
}

/* Remove stray bottom margin inside table wrappers */
.table-responsive .table {
    margin-bottom: 0;
}

/* -------- Standalone tables: consistent visual treatment matching info-box sections -------- */
/* All article-level table-responsive blocks get the same framing as info-box-with-table */
article .table-responsive {
    background: #ffffff;
    border: 1px solid rgba(26, 58, 92, 0.15);
    border-left: 5px solid #1a3a5c;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

/* Inside info-box / example-box / stat-card — parent already provides the border, don't double it */
.info-box .table-responsive,
.example-box .table-responsive,
.stat-card .table-responsive {
    background: transparent;
    border: none;
    border-left: none;
    margin-bottom: 0;
}

/* Standalone table tbody text: always dark (not affected by parent info-box color) */
article .table-responsive .table tbody td,
article .table-responsive .table tbody th {
    color: #212529;
}

/* -------- Dark-mode adjustments for srbog-specific surfaces -------- */
[data-theme="dark"] #menu-icon {
    background: #4a5568;
    border-color: #4a5568;
}

[data-theme="dark"] #menu-icon:hover,
[data-theme="dark"] #menu-icon:focus {
    background: #718096;
    border-color: #718096;
}

[data-theme="dark"] .transparent-navbar,
[data-theme="dark"] #page-menu {
    background-color: rgba(20, 30, 45, 0.85);
    border-right-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .info-box,
[data-theme="dark"] :root:not([data-theme="light"]) .info-box {
    background: #0f2237 !important;
    background-color: #0f2237 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .info-box:has(table) {
    background: #1a1a2e !important;
    background-color: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-left-color: #4a7fa8 !important;
}

[data-theme="dark"] .info-box:has(table) h2,
[data-theme="dark"] .info-box:has(table) h3,
[data-theme="dark"] .info-box:has(table) h4,
[data-theme="dark"] .info-box:has(table) p,
[data-theme="dark"] .info-box:has(table) li {
    color: #e0e0e0 !important;
}
