html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
/* Universal sticky footer: short pages fill the viewport; long pages scroll normally. */
html { min-height: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > .site-header, body > header { flex-shrink: 0; }
body > main#main {
  flex: 1 0 auto;
  width: 100%;
}
body > .site-footer,
body > .tm-artcomtech-band { flex-shrink: 0; }

/* Global multilingual text wrapping. The document already sets lang=de/en.
   Browsers with German hyphenation dictionaries add natural hyphens at line breaks. */
html {
  overflow-wrap: break-word;
}

:where(body, main, section, article, aside, header, footer, nav,
       h1, h2, h3, h4, h5, h6, p, li, dt, dd, blockquote,
       label, button, .btn, .card, .card-body, .alert, .badge,
       .nav-link, .dropdown-item, .accordion-body, .modal-body) {
  overflow-wrap: anywhere;
}

:where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, blockquote,
       label, button, .btn, .card-title, .card-text, .nav-link,
       .dropdown-item, .accordion-body, .alert) {
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Allow text columns to shrink beside images instead of overlapping them. */
:where(.row > *, .d-flex > *, .flex-row > *, .card, .card-body,
       .col, [class^="col-"], [class*=" col-"]) {
  min-width: 0;
}

/* Preserve the intended formatting of code and user-entered text. */
:where(pre, code, kbd, samp, input, textarea, select, option) {
  -webkit-hyphens: none;
  hyphens: none;
}


/* Timafor: colorful scrollbars site-wide, including nested scroll containers.
   Firefox uses scrollbar-color; Chromium/WebKit use ::-webkit-scrollbar. */
:root {
  --tm-scroll-track: #e9eaf6;
  --tm-scroll-thumb-start: #7c3aed;
  --tm-scroll-thumb-middle: #ec4899;
  --tm-scroll-thumb-end: #06b6d4;
}

/* Firefox: inherited by scrollable descendants; scrollbar-width is not forced. */
html, body, body * {
  scrollbar-color: var(--tm-scroll-thumb-start) var(--tm-scroll-track);
}

/* Chrome, Edge, Safari: all scrollable elements, not only the page. */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: var(--tm-scroll-track);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,
    var(--tm-scroll-thumb-start) 0%,
    var(--tm-scroll-thumb-middle) 52%,
    var(--tm-scroll-thumb-end) 100%);
  border: 2px solid var(--tm-scroll-track);
  border-radius: 999px;
  min-height: 28px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6d28d9, #db2777 52%, #0891b2);
}
::-webkit-scrollbar-corner { background: var(--tm-scroll-track); }

/* Match the existing dark-mode attribute conventions. */
:root[data-bs-theme="dark"],
html[data-theme="dark"],
body[data-theme="dark"] {
  --tm-scroll-track: #171a2c;
  --tm-scroll-thumb-start: #a78bfa;
  --tm-scroll-thumb-middle: #f472b6;
  --tm-scroll-thumb-end: #22d3ee;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme="light"]):not([data-theme="light"]) {
    --tm-scroll-track: #171a2c;
    --tm-scroll-thumb-start: #a78bfa;
    --tm-scroll-thumb-middle: #f472b6;
    --tm-scroll-thumb-end: #22d3ee;
  }
}

@media (forced-colors: active) {
  html, body, body * { scrollbar-color: auto; }
  ::-webkit-scrollbar-thumb { background: ButtonText; border-color: Canvas; }
  ::-webkit-scrollbar-track { background: Canvas; }
}
