@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/montserrat/montserrat-latin-600-normal.woff2') format('woff2'),
       url('../fonts/montserrat/montserrat-latin-600-normal.woff') format('woff');
}

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/open-sans/open-sans-latin-300-normal.woff2') format('woff2'),
       url('../fonts/open-sans/open-sans-latin-300-normal.woff') format('woff');
}

/* Logo or headings */
.logo, h1, h2, h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

/* Subtext, body content */
body, p, span, .subtitle {
  font-family: 'Open Sans', sans-serif;
  font-weight: 300;
}

body{
  min-height:100vh;
}
.navbar-brand {
    display: flex;
    align-items: center;
    min-width: 200px;
}

.navbar-brand img {
    display: block;
    height: 30px;
    width: auto;
    aspect-ratio: 229 / 35;
}

.navbar {
    background-color: #11283b;
    padding-top: 0.25rem;
    padding-bottom:0.22em;
    width: auto;
    border:none;
    border-bottom: 2px solid grey;
}

.navbar .btn{
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.theme-toggle .theme-toggle-trigger {
    min-width: 2.5rem;
    justify-content: flex-start;
}

.theme-toggle .theme-toggle-trigger [data-theme-icon] {
    flex-shrink: 0;
}

.theme-toggle .theme-toggle-label {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    transition:
        max-width 200ms ease,
        opacity 150ms ease,
        margin-left 200ms ease;
}

.theme-toggle .theme-toggle-trigger[aria-expanded="true"] .theme-toggle-label {
    max-width: 10ch;
    opacity: 1;
    margin-left: 0.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ffffff !important;
}

.navbar-nav .active {
    color: #ffffff !important;
    font-weight: 600;
}

main {
    flex: 1;
}

.profile-avatar-placeholder {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 2px dashed rgba(17, 40, 59, 0.25);
    background-color: rgba(17, 40, 59, 0.05);
}

.blog-entry .markdown-body h1 {
    font-size: 1.75rem;
}

.blog-entry .markdown-body h2 {
    font-size: 1.5rem;
}

.blog-entry .markdown-body ul,
.blog-entry .markdown-body ol {
    padding-left: 1.25rem;
}

.blog-entry .markdown-body p:last-child {
    margin-bottom: 0;
}

/* Make disabled outline buttons stand out with a subtle stripe */
.btn:is([class^="btn-outline-"], [class*=" btn-outline-"]):disabled,
.btn:is([class^="btn-outline-"], [class*=" btn-outline-"]).disabled {
    opacity: 1;
    background-color: transparent;
    background-color: color-mix(in srgb, currentColor 8%, transparent);
    background-image: repeating-linear-gradient(135deg, currentColor 0 0.6rem, transparent 0.6rem 1.2rem);
    background-image: repeating-linear-gradient(135deg, color-mix(in srgb, currentColor 22%, transparent) 0 0.6rem, transparent 0.6rem 1.2rem);
    background-size: 100%;
    background-origin: border-box;
}

/* Navbar bell: unread count pinned to the icon's corner */
.notification-badge {
    position: absolute;
    top: 0.15rem;
    right: 0.1rem;
    font-size: 0.6rem;
    padding: 0.2em 0.4em;
}

.notification-unread {
    border-left: 3px solid var(--bs-primary) !important;
}

/* Notification bodies are plain text with newlines from the worker */
.notification-body {
    white-space: pre-line;
}

/* =========================================================================
   Theme tokens
   bootstrap.css is Bootswatch Lumen, a light-only design whose dark mode is
   stock Bootstrap. The overrides below give both themes the same hierarchy
   (page < card < raised control), neutral controls that read at similar
   contrast in both, tinted rather than solid alerts, and a close button that
   follows the theme. Put colour decisions here, not in templates.
   ========================================================================= */
:root,
:root[data-bs-theme="light"] {
    --wt-page-bg: #f2f0ef;
    --wt-surface-bg: #ffffff;
    --wt-neutral-color: #3d3d3d;
    --wt-neutral-border: #b8b4b1;
    --wt-neutral-border-rgb: 184, 180, 177;
    --wt-neutral-bg: #e2dfdd;
    --wt-neutral-bg-hover: #d6d2cf;
    --wt-navbar-border: rgba(0, 0, 0, 0.35);
    --wt-card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    /* Separators and chart grid: Lumen's #dee2e6 is 1.3:1 on white; this warm grey matches
       the dark theme's ~1.5:1 so rows and grid lines carry the same weight in both. */
    --bs-border-color: #d3d0cd;
}

/* Lumen's #158cba link is 3.8:1 on white; this shade clears 4.5:1 and keeps the hue.
   Scoped to the light attribute only: a bare :root rule would outrank Bootstrap's dark values. */
:root[data-bs-theme="light"] {
    --bs-link-color: #0f7aa3;
    --bs-link-color-rgb: 15, 122, 163;
    --bs-link-hover-color: #0c6283;
    --bs-link-hover-color-rgb: 12, 98, 131;
}

:root[data-bs-theme="dark"] {
    --wt-page-bg: #1b1b1b;
    --wt-surface-bg: #262626;
    --wt-neutral-color: #cfd3d7;
    --wt-neutral-border: #6a6a6a;
    --wt-neutral-border-rgb: 106, 106, 106;
    --wt-neutral-bg: #3a3a3a;
    --wt-neutral-bg-hover: #474747;
    --wt-navbar-border: rgba(255, 255, 255, 0.18);
    --wt-card-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.45);
    --bs-body-bg: #1b1b1b;
    --bs-body-bg-rgb: 27, 27, 27;
    --bs-secondary-bg: #363636;
    --bs-secondary-bg-rgb: 54, 54, 54;
    --bs-tertiary-bg: #262626;
    --bs-tertiary-bg-rgb: 38, 38, 38;
    --bs-border-color: #444444;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.12);
}

body {
    background-color: var(--wt-page-bg);
}

/* Cards sit one step above the page in both themes */
.card {
    --bs-card-bg: var(--wt-surface-bg);
}

.shadow-sm {
    box-shadow: var(--wt-card-shadow) !important;
}

.navbar {
    border-bottom-color: var(--wt-navbar-border);
}

/* Neutral controls: Lumen's "secondary" is near-white (#f0f0f0), which vanishes on the light
   page and glows on the dark one. These use a mid-tone that reads at similar contrast in both. */
.btn-outline-secondary {
    --bs-btn-color: var(--wt-neutral-color);
    --bs-btn-border-color: var(--wt-neutral-border);
    --bs-btn-hover-color: var(--wt-neutral-color);
    --bs-btn-hover-bg: var(--wt-neutral-bg);
    --bs-btn-hover-border-color: var(--wt-neutral-border);
    --bs-btn-focus-shadow-rgb: var(--wt-neutral-border-rgb);
    --bs-btn-active-color: var(--wt-neutral-color);
    --bs-btn-active-bg: var(--wt-neutral-bg-hover);
    --bs-btn-active-border-color: var(--wt-neutral-border);
    --bs-btn-disabled-color: var(--wt-neutral-color);
    --bs-btn-disabled-border-color: var(--wt-neutral-border);
    color: var(--bs-btn-color);
}

.btn-secondary {
    --bs-btn-color: var(--wt-neutral-color);
    --bs-btn-bg: var(--wt-neutral-bg);
    --bs-btn-border-color: var(--wt-neutral-border);
    --bs-btn-hover-color: var(--wt-neutral-color);
    --bs-btn-hover-bg: var(--wt-neutral-bg-hover);
    --bs-btn-hover-border-color: var(--wt-neutral-border);
    --bs-btn-focus-shadow-rgb: var(--wt-neutral-border-rgb);
    --bs-btn-active-color: var(--wt-neutral-color);
    --bs-btn-active-bg: var(--wt-neutral-bg-hover);
    --bs-btn-active-border-color: var(--wt-neutral-border);
    --bs-btn-disabled-color: var(--wt-neutral-color);
    --bs-btn-disabled-bg: var(--wt-neutral-bg);
    --bs-btn-disabled-border-color: var(--wt-neutral-border);
}

/* Lumen pins these with literal colours at higher specificity */
.btn-secondary:hover,
.btn-secondary:active,
.btn-secondary:focus {
    background-color: var(--bs-btn-hover-bg);
}

.btn-secondary,
.btn-secondary:not(.disabled):hover,
.btn-secondary:not(.disabled):active,
.btn-secondary:focus {
    border-color: var(--bs-btn-border-color);
}

.text-bg-secondary {
    color: var(--wt-neutral-color) !important;
    background-color: var(--wt-neutral-bg) !important;
}

/* Alerts: Lumen paints them solid with white text (1.8–2.7:1). Use Bootstrap 5.3's tinted
   variants instead; they carry their own dark-mode values. The thick bottom edge is Lumen's. */
.alert {
    color: var(--bs-alert-color);
    border-width: 0 1px 4px 1px;
}

.alert-primary,
.alert-secondary,
.alert-success,
.alert-info,
.alert-warning,
.alert-danger,
.alert-light,
.alert-dark {
    background-color: var(--bs-alert-bg);
    border-color: var(--bs-alert-border-color);
}

.alert .alert-link {
    font-weight: 700;
    color: var(--bs-alert-link-color);
}

/* Lumen ships a white-only close icon (for its solid alerts). Draw it in the body colour and
   invert for dark, as stock Bootstrap does. */
.btn-close {
    --bs-btn-close-color: #000;
    --bs-btn-close-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414'/%3e%3c/svg%3e");
    --bs-btn-close-opacity: 0.55;
    opacity: var(--bs-btn-close-opacity);
}

[data-bs-theme="dark"] .btn-close {
    --bs-btn-close-filter: invert(1) grayscale(100%) brightness(200%);
}

/* Login / register: standalone pages that share the theme but not the navbar layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 30% 20%, #1d4160 0%, #11283b 60%, #0c1c2a 100%);
}

.auth-page .container {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 15px;
}

.auth-card {
    max-width: 900px;
    width: 100%;
    margin: 2rem auto;
    background-color: var(--wt-surface-bg);
    color: var(--bs-body-color);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35);
    border-radius: 1rem;
    overflow: hidden;
}

.auth-card .btn {
    padding: 0.75rem 1.5rem;
}

.auth-card label:has(+ input[required])::after {
    content: " *";
    color: var(--bs-danger);
}

.auth-image {
    background-image: url('../img/1024x1024.webp');
    background-color: #11283b;
    background-size: cover;
    background-position: center;
    min-height: 100%;
}

@media (max-width: 450px) {
    .auth-card {
        margin: 1rem auto;
    }
}
