
/* Global site styles (header, variables, background, layout basics) */
@font-face {
    font-family: 'Open Sans';
    src: url('/assets/fonts/OpenSans-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    font-stretch: 75% 125%;
}

@font-face {
    font-family: 'Open Sans';
    src: url('/assets/fonts/OpenSans-Italic-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
    font-stretch: 75% 125%;
}

:root {
    --bg-0: #090b0f;
    --bg-1: #0f1318;
    --page-bg: #0f1318;
    --panel: rgba(255, 255, 255, 0.03);
    --muted: #9aa2ac;
    --accent: rgb(76, 199, 104);
    --weak-border: rgba(255, 255, 255, 0.06); /* does not get affected by 'highlight borders' */
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass: rgba(255, 255, 255, 0.02);
    --radius: 12px;
    --basic-text: #e6eef3;
    --basic-text-contrast: #0f1318;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Segoe UI Mono", monospace;
    --ui: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

/* Layout basics */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--ui);
    color: var(--basic-text);
    background:#0f1318;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: flex;
    align-items: flex-start;
    width: 100%;
    
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    border-bottom: 2px solid var(--glass-border);
    backdrop-filter: blur(30px);
    background: var(--glass);
    transition: transform .12s ease, box-shadow .12s ease;
    will-change: transform;
}

#headerBrand {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    gap: 10px;
}

#headerLogo {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .18s;
}

#headerLogo:hover { transform: translateY(-2px) scale(1.03); }

#headerLogoText {
    padding-left: 10px;
    margin: 0;
    font-weight: 700;
    letter-spacing: 1.3px;
}

/* Use the accent color variable for the main header text */
#headerLogoText {
    color: var(--accent);
    transition: color .12s linear;
}

.header-controls { margin-left: auto; display:flex; align-items:center; gap:12px; }

/* Header navigation inserted between the logo and the header controls.
   Uses flex to occupy the middle space and centers the links there. */
.header-nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.header-link {
    color: var(--accent);
    font-weight: bold;
    
    text-decoration: none;
    padding: 6px 8px;
    margin: 0 20px;
    border-radius: 8px;
    display: inline-block;
    transition: transform .12s ease, color .12s ease;
}

/* Replace underline-on-hover with a slight upward translate for header links */
.header-link:hover,
.header-link:focus {
    text-decoration: none;
    transform: translateY(-3px);
}

#themeToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--glass);
    border: 2px solid var(--weak-border);
    color: var(--accent);
    cursor: pointer;
    transition: transform .12s ease, background-color .12s ease;
}


.wrapper { min-height: 100vh; display:flex; flex-direction:column; width:100%; padding-top: var(--header-height, 0px); transition: padding-top .14s ease; }

/* When header is hidden (scrolled down), translate it up out of view */
.header--hidden { transform: translateY(-100%); pointer-events: none; }

/* Move main content up visually when header is hidden while keeping
    the document flow (padding-top) unchanged. Using transform avoids
    layout reflow and prevents scroll-position jumps. */
.main { display:flex; gap:20px; width:100%; align-items:flex-start; transition: transform .12s ease; }

.wrapper.wrapper--header-hidden .main { transform: translateY(calc(-1 * var(--header-height))); }



.slot-div {
    padding: 20px 28px;
    border-radius: calc(var(--radius) - 2px);
    border: 2px solid var(--glass-border);
    margin-top: 17px;
    background: var(--glass);
}

/* Make the main content area flexible so sidebars sit left/right */
.slot-div { flex: 1; min-width: 0; }

p { font-size:16px; color: var(--basic-text); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Ensure controls rendered on `--accent` backgrounds use the contrasting text color.
    Provide an explicit alternate variant (.hero-cta--alt) when the button should use
    the regular `--basic-text` color instead. */
.hero-cta,
.overview-button,
.course-box,
.course-box .box-desc,
.dropdown-item.button,
a.hero-cta { color: var(--basic-text-contrast) !important; }

/* Variant: force the button to use the normal page text color (use when needed) */
.hero-cta--alt,
.hero-cta.alt { color: var(--basic-text) !important; }

.content h1, .content h2 { transition: color .12s linear; }
.content h1 { color: var(--accent); margin-top: 0; }
.content h2 { border-bottom: 1px solid rgba(255,255,255,0.03); padding-bottom: 6px; }

/* Also apply accent color to headings inside slot-divs (used by some templates) */
.slot-div h1, .slot-div h2 { color: var(--accent); transition: color .12s linear; }

footer {
    position: relative;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
}



/* Headings anchors and accessibility */
h2,h3,h4,h5,h6 { position: relative; }
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
a.header-anchor { opacity:0; position:absolute; left: -20px; }
h2:hover .header-anchor, h3:hover .header-anchor { opacity:.6; }

@media (max-width: 800px) {
    .main { flex-direction: column; }
    .slot-div { padding: 16px; }
}

/* Light-theme overrides when body.light-theme is toggled */
body.light-theme { background: #e8e8e8; color: #0b1b23; }
body.light-theme .header { border-bottom-color: var(--glass-border); }
body.light-theme .slot-div { color: #0b1b23; border-color: var(--glass-border); }
body.light-theme p { color: #0b1b23; }
body.light-theme a { color: var(--accent); }
body.light-theme blockquote { background: rgba(0, 0, 0, 0.15); }
body.light-theme .sidebar { border-color: var(--glass-border); color: #163238; }
body.light-theme {
    --glass-border: rgba(2,6,23,0.06);
    --weak-border: rgba(2,6,23,0.06);
    --glass: #efefef;
    --page-bg: #e8e8e8;
}
body.light-theme {
    --basic-text: #0b1b23;
    --basic-text-contrast: #e6eef3;
}

/* Global scrollbar styling (applies site-wide) */
html {
    scrollbar-width: auto; /* Firefox */
    scrollbar-color: var(--accent) transparent; /* Firefox */
}

/* WebKit/Blink */
html::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 8px; }

/* Dropdown / theme menu styles */
.theme-dropdown { position: relative; }
.theme-menu-button {
    font-size: 25px;
    background: transparent;
    border: none;
    color: var(--basic-text);
    cursor: pointer;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    margin-top: 6px;
    padding: 8px;
    background: var(--page-bg);
    border-radius: 6px;
    display: none;
    min-width: 250px;
    z-index: 30;
    border: 2px solid var(--glass-border);
    color: var(--basic-text);
    text-align: center;
}
.dropdown-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center; /* keep content centered */
    width: 100%;
    font-size: 16px;
    padding: 8px 10px;
    margin-top: 5px;
    border-radius: 10px;
    background: var(--glass);
    border: 2px solid var(--weak-border);
    color: var(--accent);
    cursor: pointer;
    transition: background-color .12s ease, transform .08s ease;
}

/* absolutely position the checkbox at the left */
.dropdown-item input[type="checkbox"] {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

/* center text block inside item */
.dropdown-text {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 4px 6px;
    border-radius: 6px;
}


/* Global circular checkbox: hidden native appearance, circular background when checked. */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 2px solid var(--accent);
    transition: background-color .1s ease, border-color .06s ease, transform .06s ease;
}

input[type="checkbox"]:checked {
    background: var(--accent);
    transition: background-color .25s ease;
}

/* Code block and inline code styling (Prism provides colors/themes) */
pre[class*="language-"], code[class*="language-"] {
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.5;
}
pre[class*="language-"] {
    padding: 12px 14px;
    border-radius: 8px;
    overflow: auto;
    margin: 12px 0;
}
/* Inline code fallback style */
code:not([class]) { background: rgba(255,255,255,0.03); padding: 2px 6px; border-radius: 6px; }
