/* ===== Terminal theme: black background, white text, green accent ===== */

@font-face {
    font-family: 'CodeNewRomanNF';
    src: url('../fonts/CodeNewRomanNerdFontMono-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

html:root,
html[data-bs-theme=dark] {
    --term-bg: #000;
    --term-fg: #fff;
    --term-muted: #c8c8c8;
    --term-border: #2a2a2a;
    --term-accent: #39d353;

    --bs-body-bg: var(--term-bg);
    --bs-body-color: var(--term-fg);
    --bs-body-font-family: 'CodeNewRomanNF', 'Cascadia Mono', Consolas, monospace;
    --bs-border-color: var(--term-border);
    --bs-link-color: var(--term-accent);
    --bs-link-hover-color: #fff;
    --bs-secondary-color: var(--term-muted);
    --bs-secondary-color-rgb: 200, 200, 200;
    --bs-emphasis-color: #fff;
    --bs-heading-color: #fff;
    --bs-body-color-rgb: 255, 255, 255;
    --bs-body-bg-rgb: 0, 0, 0;
    --bs-tertiary-color: var(--term-muted);
    --bs-card-bg: #0a0a0a;
    --bs-card-border-color: var(--term-border);
}

html, body {
    background-color: #000 !important;
    color: #fff !important;
    font-family: 'CodeNewRomanNF', 'Cascadia Mono', Consolas, monospace !important;
}

h1, h2, h3, h4, h5, h6, .lead, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: inherit;
    color: #fff;
}

.text-muted, .text-secondary, .text-body-secondary {
    color: var(--term-muted) !important;
}

/* Dark, thin scrollbars */
html {
    scrollbar-width: none;
    overflow-x: hidden;
}

html::-webkit-scrollbar {
    display: none;
}

.col-nav {
    scrollbar-width: none;
}

.col-nav::-webkit-scrollbar {
    display: none;
}

#blazor-error-ui {
    background: #111 !important;
    color: #fff !important;
    border-top: 1px solid var(--term-accent);
}

#blazor-error-ui a {
    color: var(--term-accent);
}

h2::before {
    content: "## ";
    color: var(--term-accent);
}

a {
    color: var(--term-accent);
}

.card {
    border-radius: 0;
    border: 1px solid var(--term-border);
    background-color: #0a0a0a;
}

.badge, .btn, .form-control, .form-select {
    border-radius: 0;
}

::selection {
    background: var(--term-accent);
    color: #000;
}

/* Nerd Font glyph (icons encoded in the font) */
.glyph {
    font-family: 'CodeNewRomanNF', monospace;
    font-style: normal;
    line-height: 1;
}

/* ===== Three column shell ===== */

.shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 240px;
    grid-template-areas: "photo content nav";
    align-items: start;
    min-height: 100vh;
}

.col-photo {
    grid-area: photo;
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    overflow: visible;
    pointer-events: none;
    z-index: 0;
}

/* The photo is wider than its column and fades out into the content column */
.col-photo img {
    position: absolute;
    top: 0;
    left: -150px;
    width: 640px;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0;
    filter: grayscale(1);
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 45%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 45%, transparent 100%);
}

.col-content {
    grid-area: content;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow: visible;
    padding: 2rem 2.5rem 0 2.5rem;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

.col-content footer {
    margin-top: auto;
    padding: 1.5rem 0;
    text-align: center;
    color: var(--term-muted);
    border-top: 1px solid var(--term-border);
    font-size: 0.85rem;
}

.col-content footer a,
.impressum-back {
    color: var(--term-muted);
    text-decoration: none;
}

.col-content footer a:hover,
.impressum-back:hover {
    color: var(--term-accent);
}

.footer-sep {
    margin: 0 0.5rem;
}

.impressum-text {
    white-space: pre-line;
}

.col-nav {
    grid-area: nav;
    position: fixed;
    top: 0;
    right: 0;
    width: 240px;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    text-align: right;
    border-left: 1px solid var(--term-border);
    background: #000;
    z-index: 2;
}

/* ===== Navigation ===== */

.term-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-height: 100%;
}

.term-nav .brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: bold;
}

/* Small portrait, only shown when the big photo column is hidden */
.nav-avatar {
    display: none;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 15%;
    filter: grayscale(1);
    border: 1px solid var(--term-accent);
}

.term-nav .brand .prompt,
.term-nav .nav-link-item::before {
    color: var(--term-accent);
}

.term-nav .brand .prompt::after {
    content: "_";
    animation: blink 1s steps(1) infinite;
}

.term-nav ul {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
}

.term-nav li {
    margin: 0.4rem 0;
}

.term-nav a.nav-link-item,
.term-nav .nav-link {
    color: #fff;
    text-decoration: none;
    padding: 0;
    font-size: 1rem;
}

.term-nav a.nav-link-item::before {
    content: "~/";
}

.term-nav a.nav-link-item:hover,
.term-nav .nav-link:hover {
    color: var(--term-accent);
}

.term-nav .nav-footer {
    margin-top: auto;
    width: 100%;
}

.term-toggle {
    display: none;
    background: none;
    border: 1px solid var(--term-border);
    color: #fff;
    font-family: inherit;
    padding: 0.25rem 0.75rem;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ===== Platforms ===== */

.platforms {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.platforms a {
    color: #fff;
    text-decoration: none;
}

.platforms a:hover .platform-name {
    text-decoration: underline;
}

.platforms .glyph {
    margin-left: 0.5rem;
    font-size: 1.2rem;
}

/* ===== Responsive ===== */

@media (max-width: 1199.98px) {
    .shell {
        grid-template-columns: minmax(0, 1fr) 220px;
        grid-template-areas: "content nav";
    }

    .col-photo {
        display: none;
    }

    .col-nav {
        width: 220px;
    }

    .nav-avatar {
        display: block;
        width: 96px;
        height: 96px;
        margin: 0 0 1rem auto;
    }
}

@media (max-width: 767.98px) {
    .shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "nav" "content";
        padding-top: 4.5rem;
    }

    .col-nav {
        top: 0;
        left: 0;
        right: 0;
        width: auto;
        height: auto;
        max-height: 100vh;
        overflow-y: auto;
        z-index: 1000;
        border-left: none;
        border-bottom: 1px solid var(--term-border);
        padding: 0.75rem 1rem;
    }

    .nav-avatar {
        display: inline-block;
        width: 40px;
        height: 40px;
        margin: 0 0.6rem 0 0;
        vertical-align: middle;
    }

    .term-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .term-toggle {
        display: inline-block;
    }

    .term-nav #navbarText {
        width: 100%;
    }

    .col-content {
        padding: 1.5rem 1rem 0 1rem;
    }
}

@media (min-width: 768px) {
    .term-nav #navbarText {
        display: block !important;
        width: 100%;
    }
}
