

* { transition: background-color 0.25s ease, color 0.25s ease; }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ========================================================================== */
/* GLOBAL IMAGE BASELINE                                                      */
/* ========================================================================== */

img {
  border-radius: var(--ms-radius);
}


input, button, textarea, select { font: inherit; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

hr {
  border: none;
  height: 1px;
  display: block;
  width: 100%;
  background: linear-gradient(
    to right,
    transparent,
    oklch(0.7 0 0 / 0.35),
    transparent
  );
  margin: var(--ms-space-10) 0;
}

/***********************************************
 * IMAGE HOVER SYSTEM (nur in <main>)
 * Default + Varianten über .content-image
 ***********************************************/

/* ---------------------------------------------
   BASIS: Nur verlinkte Bilder innerhalb von <main>
   (greift immer, egal welche Variante)
---------------------------------------------- */
main .content-image a:has(> img) {
  display: inline-block;
  position: relative;
  overflow: hidden;
  border-radius: var(--ms-radius);
}

main .content-image a:has(> img) > img {
  display: block;
}

/* ---------------------------------------------
   DEFAULT: Zoom (wenn KEINE Variante gesetzt ist)
   .content-image:not([class*="image-hover--"])
---------------------------------------------- */
main .content-image:not([class*="image-hover--"]) a:has(> img) > img {
  transition: transform .35s ease;
}

main .content-image:not([class*="image-hover--"]) a:has(> img):hover > img {
  transform: scale(1.05);
}

/* Dezenter Overlay-Hint (Default) */
main .content-image:not([class*="image-hover--"]) a:has(> img)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .35s ease;
  pointer-events: none;
}

main .content-image:not([class*="image-hover--"]) a:has(> img):hover::after {
  background: rgba(0,0,0,0.08);
}

/* ---------------------------------------------
   VARIANTE: Zoom (explizit)
---------------------------------------------- */
main .content-image.image-hover--zoom a:has(> img) > img {
  transition: transform .35s ease;
}

main .content-image.image-hover--zoom a:has(> img):hover > img {
  transform: scale(1.05);
}

/* ---------------------------------------------
   VARIANTE: Lift-Up
---------------------------------------------- */
main .content-image.image-hover--lift a:has(> img) {
  transition: transform .25s ease, box-shadow .25s ease;
}

main .content-image.image-hover--lift a:has(> img):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* ---------------------------------------------
   VARIANTE: Glow (barrierefrei, ohne Motion)
---------------------------------------------- */
main .content-image.image-hover--glow a:has(> img) {
  outline: none;
}

main .content-image.image-hover--glow a:has(> img):hover {
  outline: 3px solid var(--ms-accent);
  outline-offset: 3px;
}

/* ---------------------------------------------
   VARIANTE: Keine Animation (höchste Priorität)
---------------------------------------------- */
main .content-image.image-hover--none a:has(> img) > img {
  transition: none !important;
  transform: none !important;
}

main .content-image.image-hover--none a:has(> img)::after {
  background: none !important;
}

/* ---------------------------------------------
   Motion-Reduction (global für alle Varianten)
---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  main .content-image a:has(> img) > img {
    transition: none !important;
  }
}


html { scroll-behavior: smooth; }


/* --- Body & Grundtypografie --- */

body {
  font-family: var(--ms-font-sans);
  font-size: var(--ms-font-size-base);
  line-height: var(--ms-line-normal);
  color: var(--ms-text);
  background-color: var(--ms-bg-site);
  -webkit-font-smoothing: antialiased;
}

/* Headline-Basis */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ms-font-sans);
  color: var(--ms-dark);
  font-weight: var(--ms-fw-bold);
  line-height: var(--ms-line-tight);
  margin-top: var(--ms-section-gap);
  margin-bottom: var(--ms-space-5);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin-top: 0;
  letter-spacing: -0.02em;
  color: var(--ms-primary);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  border-bottom: 2px solid var(--ms-bg-light-2);
  padding-bottom: var(--ms-space-2);
}

h3 {
  font-size: var(--ms-font-size-xl);
  color: var(--ms-dark);
}

h4 { font-size: var(--ms-font-size-lg); }

h5 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h6 {
  font-size: var(--ms-font-size-base);
  color: var(--ms-text);
}

h2 + h3, h3 + h4, h4 + h5 { margin-top: var(--ms-space-3); }

p {
  margin-bottom: var(--ms-space-5);
  max-width: 100ch;
}

ul, ol { padding-left: var(--ms-space-6); }

a[target="_blank"]::after {
  content: "";
  display: inline-block;
  margin-left: var(--ms-space-2);
  width: 16px;
  height: 16px;
  background-color: currentColor;

  mask: url('/files/ms-theme/icons/external-link.svg') center/16px no-repeat;
  -webkit-mask: url('/files/ms-theme/icons/external-link.svg') center/16px no-repeat;
}

strong.active,
strong.trail {
  font-weight: normal;
}


/* ========================================================= */
/* GLOBALE FOKUS-KLASSE                                      */
/* ========================================================= */

:focus-visible {
  outline: 2px dashed var(--ms-primary);
  outline-offset: 3px;
  border-radius: var(--ms-radius-sm);
}

/* -------------------------------------------------- */
/* Theme - Toggle                                     */
/* -------------------------------------------------- */

.ms-theme-toggle {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--ms-radius-sm);
  background-color: var(--ms-bg-light-2);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Icon */
.ms-theme-toggle::after {
  content: "";
  width: 22px;
  height: 22px;
  background-color: var(--ms-dark);

  mask: url('/files/ms-theme/icons/moon.svg') center/22px no-repeat;
  -webkit-mask: url('/files/ms-theme/icons/moon.svg') center/22px no-repeat;

  transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Hover */
.ms-theme-toggle:hover {
  background-color: var(--ms-bg-light-1);
  box-shadow: 0 0 0 2px var(--ms-bg-light-3);
}

.ms-theme-toggle:hover::after {
  transform: scale(1.1);
}

