:root {
  /* TopHold variables */
  --th-primary: #4db5ff;
  --th-primary-rgb: 77, 181, 255;

  --th-primary-light: #7ac8ff;
  --th-primary-light-rgb: 122, 200, 255;

  --th-primary-dark: #3cafff;
  --th-primary-dark-rgb: 60, 175, 255;

  --th-space-1: .25rem;
  --th-space-2: .5rem;
  --th-space-3: 1rem;
  --th-space-4: 1.5rem;
  --th-space-5: 3rem;

  --th-font-size-s: .875rem;
  --th-font-size-xs: .75rem;

  --th-font-weight-semibold: 600;

  --th-container-max-width: 1140px;
  --th-container-margin-top: var(--th-space-4);
  --th-container-margin-bottom: var(--th-space-4);

  --th-navbar-bottom-height: 4rem;
  --th-icon-size: 1em;
  --th-icon-color: inherit;

  --th-head-font-family: Quicksand, Inter, Manrope, Barlow, system-ui, -apple-system, sans-serif;

  --th-transition-fast: .1s ease;

  /* Bootstrap overrides */
  --bs-body-font-family: system-ui, -apple-system, sans-serif;
  --bs-heading-color: var(--bs-gray-800);
  --bs-primary: var(--th-primary);
  --bs-primary-rgb: var(--th-primary-rgb);
  --bs-secondary: var(--bs-gray-600);
  --bs-secondary-rgb: 108, 117, 125;
  --bs-info: var(--th-primary);
  --bs-info-rgb: var(--th-primary-rgb);

  --bs-gray: #6c757d;
  --bs-gray-dark: #343a40;
  --bs-gray-100: #f8f9fa;
  --bs-gray-200: #e9ecef;
  --bs-gray-300: #dee2e6;
  --bs-gray-400: #ced4da;
  --bs-gray-500: #adb5bd;
  --bs-gray-600: #6c757d;
  --bs-gray-700: #495057;
  --bs-gray-800: #343a40;
  --bs-gray-900: #212529;

  --bs-code-color: var(--bs-gray-800);
  --bs-link-color: var(--th-primary);
  --bs-link-color-rgb: var(--th-primary-rgb);
  --bs-link-hover-color: var(--th-primary-dark);
  --bs-link-hover-color-rgb: var(--th-primary-dark-rgb);
}

/* App-wide styles */
html {
  background-color: rgba(var(--bs-dark-rgb), 1);
}

::-moz-focus-inner {
  padding: 0;
  border-style: none;
}

:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

/* Bootstrap overrides */
a, .btn-link {
  text-decoration: none;
}

.btn-primary {
  --bs-btn-font-weight: var(--th-font-weight-semibold);
  --bs-btn-bg: rgba(var(--th-primary-rgb), 1);
  --bs-btn-border-color: var(--bs-btn-bg);
  --bs-btn-hover-bg: rgba(var(--th-primary-dark-rgb), 1);
  --bs-btn-hover-border-color: var(--bs-btn-hover-bg);
  --bs-btn-active-bg: rgba(var(--th-primary-dark-rgb), 1);
  --bs-btn-active-border-color: var(--bs-btn-active-bg);
  --bs-btn-disabled-bg: rgba(var(--th-primary-rgb), .5);
  --bs-btn-disabled-border-color: var(--bs-btn-disabled-bg);
}

.btn-outline-primary {
  --bs-btn-color: rgba(var(--th-primary-rgb), 1);
  --bs-btn-border-color: var(--bs-btn-color);
  --bs-btn-hover-bg: rgba(var(--th-primary-dark-rgb), 1);
  --bs-btn-hover-border-color: var(--bs-btn-hover-bg);
  --bs-btn-focus-shadow-rgb: 13, 110, 253;
  --bs-btn-active-bg: rgba(var(--th-primary-rgb), 1);
  --bs-btn-active-border-color: var(--bs-btn-active-bg);
  --bs-btn-disabled-color: rgba(var(--th-primary-rgb), .5);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--bs-btn-disabled-color);
}

.btn-group.btn-group-switch {
  width: 100%;
}

.btn-group.btn-group-switch > .btn {
  flex: 1 0 50%;
}

.pagination {
  --bs-pagination-active-bg: var(--bs-body-bg);
  --bs-pagination-active-border-color: var(--bs-border-color);
  --bs-pagination-active-color: var(--th-primary);
}

.form-check-input:checked {
  background-color: var(--th-primary);
  border-color: var(--th-primary);
}

.container {
  max-width: var(--th-container-max-width);
  margin-top: var(--th-container-margin-top);
  margin-bottom: var(--th-container-margin-bottom);
}

.container.container-mid {
  --th-container-max-width: 44rem;
}

.container.container-thin {
  --th-container-max-width: 32rem;
}

.container.container-bottom {
  --th-container-margin-top: var(--th-space-4);

  display: grid;
  gap: var(--th-space-3);
}

.container:last-child {
  --th-container-margin-bottom: var(--th-space-5);
}

.container:last-child > *:last-child,
.container:last-child fieldset > *:last-child {
  margin-bottom: 0 !important;
}

.avatar {
  --size: 1.5rem;
  --border-color: transparent;

  width: var(--size);
  height: var(--size);
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border-color);
}

.avatar.icon {
  --th-icon-size: var(--size);
  --th-icon-color: var(--bs-gray-500);
  --border-color: var(--th-icon-color);

  padding: var(--th-space-1);
}

.card {
  --bs-secondary: var(--bs-gray-500);
  --bs-secondary-rgb: 173, 181, 189;

  --bs-card-cap-padding-y: .75rem;
  --bs-card-title-color: var(--bs-gray-300);
  --bs-card-subtitle-color: var(--bs-secondary);
  --bs-card-color: rgba(var(--bs-light-rgb), 1);
  --bs-card-bg: rgba(var(--bs-dark-rgb), 1);
  --bs-card-border-width: 0;
  --bs-card-border-radius: var(--bs-border-radius-lg);

  color: var(--bs-card-color);
}

.card a {
  font-weight: var(--th-font-weight-semibold);
}

.card .list-group {
  --bs-list-group-color: var(--bs-card-color);
  --bs-list-group-bg: var(--bs-card-bg);
  --bs-list-group-border-color: var(--bs-gray-800);
}

.card.boulder {
  --bs-card-title-spacer-y: 0;
  --th-img-height: 12rem;

   height: 100%;
   position: relative;
   overflow: hidden;
 }

.card.boulder .boulder-visual {
  --th-dot-size: 2rem;
  --th-dot-bg: transparent;

  position: relative;
}

.card.boulder.archived .boulder-visual {
  opacity: .5;
  transition: opacity var(--th-transition-fast);
}

.card.boulder.archived::before {
  content: 'archiviert';
  position: absolute;
  z-index: 2;
  top: 1.5em;
  right: -6em;
  width: 18em;
  text-align: center;
  transform: rotate(45deg);
  background: var(--bs-info);
  color: #fff;
  box-shadow: 0 5px 10px rgba(0,0,0,0.15);
  font-size: var(--th-font-size-s);
  font-weight: var(--th-font-weight-semibold);
  line-height: 2.5;
  letter-spacing: 1px;
}

.card.boulder.archived:hover .boulder-visual,
.card.boulder.archived:focus .boulder-visual {
  opacity: 1;
}

.card.boulder:hover .start-hold,
.card.boulder:focus .start-hold {
  --color: #FFF;
}

.card.boulder.with-difficulty .boulder-visual::after {
  content: "";
  display: block;
  position: absolute;
  z-index: 1;
  bottom: calc((var(--th-dot-size) / 3) * -1);
  right: calc(var(--th-dot-size) / 2);
  width: var(--th-dot-size);
  height: var(--th-dot-size);
  background-color: var(--th-dot-bg);
  border: 1px solid var(--bs-card-color);
  border-radius: 50%;
}

/* Start Holds */
.start-hold {
  --size: 2.5rem;
  --color: var(--bs-primary);
  --opacity: .9;

  position: absolute;
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: transparent;
  border: 2px dashed var(--color);
  opacity: var(--opacity);
  transform: translate(-50%, -50%);
  transition: opacity var(--th-transition-fast), border-color var(--th-transition-fast);
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: var(--th-head-font-family);
  font-weight: var(--th-font-weight-semibold);
}

h1 {
  color: var(--th-primary);
  margin-bottom: var(--th-space-3);
}

h2, .h2 {
  color: var(--bs-secondary);
  margin-bottom: var(--th-space-3);
}

h3, h4, h5, h6,
.h3, .h4, .h5, .h6 {
  color: var(--bs-secondary);
}

/* Admin */
header.d-flex {
  margin-bottom: var(--th-space-3);
}

header.d-flex h1 {
  margin-bottom: 0;
}

/* Validation for static identity pages */
.form-control.invalid {
  border-color: var(--bs-form-invalid-border-color);
  padding-right: calc(1.5em + .75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(.375em + .1875rem) center;
  background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

.form-control.invalid ~ .invalid-feedback {
  display: block;
}

li.validation-message {
  list-style-type: none;
}

/* Quicksand font */
@font-face {
  font-display: swap;
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 300;
  src: url('/fonts/quicksand-v37-latin-300.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/quicksand-v37-latin-regular.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 500;
  src: url('/fonts/quicksand-v37-latin-500.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 600;
  src: url('/fonts/quicksand-v37-latin-600.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 700;
  src: url('/fonts/quicksand-v37-latin-700.woff2') format('woff2');
}

/* Blazor error UI */
#blazor-error-ui {
  color-scheme: light only;
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  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;
}
