﻿:root, html[data-bs-theme='light'] {
    /* Fonts */
    --default-font: 'Calibri';
    --code-font: 'Lucida Console', 'Courier New';

	/* Color definitions */
	--wild-sand: #f4f4f4;
	--silver: #dadada;
	--waterloo: rgba(140, 140, 162, 0.25);

	/* Usages */
	--background: var(--wild-sand);
	--tag-background: var(--waterloo);

	--background-gradient-start: var(--wild-sand);
	--background-gradient-end: var(--silver);

    /* Override some Bootstrap defaults */
    --bs-body-font-weight: 400;
    --bs-nav-link-font-weight: 400;
    --bs-link-color: #0057b8;
    /* Bootstrap default --bs-code-color (#d63384) achieves only ~3.9:1 on --wild-sand (#f4f4f4).
       This darker pink achieves ~5.4:1 on #f4f4f4, passing WCAG AA (>= 4.5:1). */
    --bs-code-color: #b52b6e;
}

html[data-bs-theme='dark'] {
	/* Color definitions */
	--jaguar: rgb(17, 16, 19);
	--shark: rgb(40, 40, 47);
	--trout: rgba(78, 78, 93, 0.5);

	/* Usages */
	--background: var(--jaguar);
	--tag-background: var(--trout);

	--background-gradient-start: var(--jaguar);
	--background-gradient-end: var(--shark);

    /* Override some Bootstrap defaults */
    --bs-body-font-weight: 400;
    --bs-nav-link-font-weight: 400;
}

html {
    height: 100%;
}

html:focus-within {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-image: linear-gradient(to bottom, var(--background-gradient-start) 20%, var(--background-gradient-end));
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: var(--default-font), sans-serif !important;
    min-height: 100vh;
    text-rendering: optimizeSpeed;
}

a {
    transition: 0.3s ease-in-out !important;
    font-weight: 500;
}

.disabled a {
    font-weight: 400;
}

h1 {
    word-wrap: break-word;
}

blockquote {
    padding-left: 0.5em;
}

blockquote::before {
    content: open-quote;
    vertical-align: -0.4em;
    line-height: 0.1em;
    font-size: 2.5em;
}

blockquote::after {
    content: close-quote;
    vertical-align: -0.4em;
    line-height: 0.1em;
    font-size: 2.5em;
}

blockquote p {
    display: inline;
}

section {
    padding-bottom: 10px;
}

code {
    font-family: var(--code-font), cursive;
}

.date:before {
    font-family: 'icons';
    font-weight: 900;
    content: "\e953";
}

.theme-toggle:before {
	font-family: 'icons';
	font-weight: 900;
	content: "\e9d5";
}

.copy-btn {
	border-color: whitesmoke !important;
}

.copy-btn:active {
	animation: copy-flash 0.5s ease-out;
}

@keyframes copy-flash {
	50% {
		border-color: whitesmoke !important;
		background: whitesmoke;
	}
}

/* Template defined css */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* Fixes white background/white icon for markdown editors */
.editor-toolbar {
	background: rgb(36, 90, 170) !important;
}

.editor-toolbar button.active, .editor-toolbar button:hover {
    background: rgb(36, 90, 170) !important;
}

.badge.bg-primary {
    background-color: #0a5cc9 !important;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}


.members-teaser {
    position: relative;
    overflow: hidden;
}

.members-teaser-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--bs-body-bg, #fff));
    pointer-events: none;
}

/* ============================================================
   Shared content-page layout container
   Used by blog posts (blog-container) and video watch pages
   (video-container). Centralised here so both stay in sync.
   ============================================================ */
.content-page-container {
    background: var(--background);
    width: clamp(60%, 2vw, 90%);
    box-shadow: 0 3px 7px -1px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

@media only screen and (max-width: 700px) {
    .content-page-container {
        width: 90%;
    }
}

@media only screen and (min-width: 700px) and (max-width: 1024px) {
    .content-page-container {
        width: 80%;
    }
}

/* Tag pill badge -- shared by blog post and video watch pages */
.goto-tag {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    background-color: #e8f0fe;
    color: #1a1a2e !important;
}

/* Tag icon glyph -- shared by blog post and video watch pages */
.blogpost-tag:before {
    font-family: 'icons';
    font-weight: 900;
    content: "\e936";
}

/* WCAG AA contrast overrides for github-dark-dimmed highlight.js theme (#22272e background).
   The original theme colors below fail at normal-text size (< 4.5:1):
     .hljs-comment/#768390 = 3.88:1  |  .hljs-section/#316dca = 2.98:1
   These overrides bring both classes to >= 4.5:1 while preserving the color character.
   Specificity: (0,2,0) via .hljs .hljs-comment beats github-dark-dimmed.min.css (0,1,0)
   which loads AFTER basic.css in App.razor and would otherwise win the cascade. */
.hljs .hljs-code,
.hljs .hljs-comment,
.hljs .hljs-formula {
    color: #8a9bab;
}
.hljs .hljs-section {
    color: #539bf5;
}
