/* ==========================================================================
   skowa – Theme "skowa_01" (modernisiert)
   Ersetzt skowa01_styles.css (Bootstrap 3 / Isotope / Modernizr-Zeit).
   Gleiches Aussehen, aber: CSS Grid statt Float+Isotope, Custom Properties,
   nur WOFF2, SVG-Icons, keine jQuery-Abhängigkeit.
   ========================================================================== */

/* ---- Schrift (Barlow, lokal) ---------------------------------------------- */
@font-face { font-family: Barlow; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/Barlow-Regular.woff2") format("woff2"); }
@font-face { font-family: Barlow; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/Barlow-Italic.woff2") format("woff2"); }
@font-face { font-family: Barlow; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/Barlow-Medium.woff2") format("woff2"); }
@font-face { font-family: Barlow; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/Barlow-SemiBold.woff2") format("woff2"); }

/* ---- Design-Token ---------------------------------------------------------- */
:root {
  --c-text: #242423;
  --c-muted: #666;
  --c-red: #c30;
  --c-blue: #007cbe;
  --c-grey: #eee;
  --c-white: #fff;

  --font: Barlow, Arial, Helvetica, sans-serif;
  --tile: 300px;          /* Kantenlänge einer Kachel */
  --gap: 20px;            /* Abstand zwischen Kacheln */
  --radius: 6px;
  --nav-width: 240px;     /* Platz links für Logo + Navigation */
  --page-width: 90%;      /* wird je Breakpoint überschrieben */
  --ease: cubic-bezier(.25, .46, .45, .94);

  color-scheme: light;
}

/* ---- Reset ----------------------------------------------------------------- */
*, ::before, ::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  overflow-y: scroll;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  font: 400 18px/1.42857 var(--font);
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; border: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 20000;
  padding: 8px 14px;
  background: var(--c-white); color: var(--c-text);
  border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }

/* ---- Typografie ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.3;
  color: var(--c-muted);
}
h1 { font-size: 36px; margin-top: 20px; margin-bottom: 10px; }
h2 { font-size: 40px; line-height: 1.25; letter-spacing: -1px; margin-top: 0; margin-bottom: 10px; }
h3 { font-size: 26px; margin-top: 10px; margin-bottom: 10px; }
h4, h5, h6 { font-size: 18px; }

/* Optische Stufe unabhängig von der HTML-Ebene: das Template ordnet Überschriften
   lückenlos (h1 → h2 → h3), die ursprünglich gewählte Größe bleibt über .is-hN erhalten. */
.is-h1 { font-size: 36px; line-height: 1.3; letter-spacing: 0; margin-top: 20px; margin-bottom: 10px; }
.is-h2 { font-size: 40px; line-height: 1.25; letter-spacing: -1px; margin-top: 0; margin-bottom: 10px; }
.is-h3 { font-size: 26px; line-height: 1.3; letter-spacing: 0; margin-top: 10px; margin-bottom: 10px; }
.is-h4, .is-h5, .is-h6 { font-size: 18px; line-height: 1.3; letter-spacing: 0; margin-top: 10px; margin-bottom: 10px; }

p { margin: 0 0 10px; line-height: 1.5; }
strong, b { font-weight: 600; color: var(--c-muted); }
em, i { font-style: italic; }
small, .small { font-size: 85%; }

a { color: var(--c-muted); text-decoration: none; transition: color .2s, background-color .2s, opacity .2s; }
a:hover, a:focus { text-decoration: underline; }

/* ---- Seitenaufbau ---------------------------------------------------------- */
.site-content {
  position: relative;
  z-index: 103;
  width: var(--page-width);
  margin: 0 auto;
  padding: 40px 0 70px var(--nav-width);
  background: var(--c-white);
  transition: transform .33s cubic-bezier(.33, 0, .2, 1);
}

.logo-wrapper {
  position: fixed;
  left: 0;
  z-index: 101;
  padding: 40px 35px 35px;
}
.logo-wrapper img { width: auto; height: auto; }

/* Menü-Schalter (nur bei schmalen Fenstern sichtbar) */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  width: 50px; height: 50px;
  margin: 1px 20px 0 10px;
  border: 1px solid var(--c-red);
  border-radius: 50%;
  background: var(--c-red);
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle__bar {
  display: block;
  width: 19px; height: 2px;
  border-radius: 1px;
  background: var(--c-white);
  transition: transform .2s, opacity .2s;
}
.nav-open .menu-toggle__bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-open .menu-toggle__bar:nth-child(2) { opacity: 0; }
.nav-open .menu-toggle__bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.site-header-bar { display: block; }

/* ---- Navigation ------------------------------------------------------------ */
.site-nav {
  position: fixed;
  top: 180px; left: 0;
  z-index: 104;
  width: 200px;
  height: 90%;
  padding-left: 20px;
}
.site-nav__inner { width: 165px; margin-left: 35px; }

.site-nav a {
  display: block;
  min-height: 24px;               /* Touch-Ziel mind. 24 px (WCAG 2.2) */
  padding: 3px 0;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c-muted);          /* 5,7:1 auf Weiß (vorher durch opacity .7 nur 3,0:1) */
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a.rex-current,
.site-nav a.rex-active { color: var(--c-red); }

.site-nav ul ul li { padding: 0 15px; }
.site-nav ul ul a { padding: 3px 0; font-size: 13px; }

/* Unterpunkte nur im aktiven Pfad zeigen (Desktop) */
@media (min-width: 1201px) {
  .site-nav li:not(.rex-active):not(.rex-current) > ul { display: none; }
}

/* ---- Kachel-Raster (ersetzt Isotope/Packery) -------------------------------
   CSS Grid mit 10px-Zeilen ("Masonry-Technik"): jede Kachel belegt so viele
   Zeilen, wie sie hoch ist. Feste Größen (s, m) sind vorbelegt, Kacheln mit
   freier Höhe misst skowa.js nach und setzt --rows. Mit dem dichten Auto-Flow
   füllen spätere Kacheln Lücken wie bisher bei Packery.                      */
.tiles {
  --unit: 10px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--tile));
  grid-auto-flow: dense;
  grid-auto-rows: var(--unit);
  column-gap: var(--gap);
  row-gap: 0;
  margin-bottom: -10px; /* letzte Kachel-Reihe hat schon 20px Abstand */
  padding: 10px 10px 0;
  animation: scale-in-bl .5s var(--ease) both;
}

.tiles > * {
  grid-row: span var(--rows, 32);
  align-self: start;
  margin-bottom: var(--gap);
}
.tiles > :not(.tile) { grid-column: 1 / -1; }

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--c-grey);
  color: var(--c-text);
}

/* Größen: s = 1×1, m = 2×2, l = 3–4 Spalten, full = ganze Breite */
.tile--s { --rows: 32; min-height: 280px; height: var(--tile); }
.tile--m { --rows: 64; grid-column: span 2; height: calc(var(--tile) * 2 + var(--gap)); }
.tile--l { grid-column: span 4; height: auto; background: none; }
.tile--full { grid-column: 1 / -1; height: auto; padding: 20px; }

.tile--s .tile__body,
.tile--m .tile__body,
.tile--l .tile__body { padding: 20px; }

/* Farben */
.tile--grey  { background: var(--c-grey); }
.tile--white { background: var(--c-white); color: var(--c-muted); }
.tile--blue  { background: var(--c-blue); color: var(--c-white); }
.tile--orange{ background: var(--c-red);  color: var(--c-white); }

.tile--blue a, .tile--orange a { color: var(--c-white); }
.tile--blue a:hover, .tile--orange a:hover { color: var(--c-grey); }
.tile--blue :is(h1, h2, h3, h4, h5, h6, strong, b),
.tile--orange :is(h1, h2, h3, h4, h5, h6, strong, b) { color: var(--c-white); }

/* weisse Kacheln: Links als Buttons, Listen mit Pfeil */
.tile--white a { display: inline-block; color: var(--c-white); background: var(--c-blue); border-radius: 8px; }
.tile--white .tile__body a { margin-top: 10px; padding: 5px 10px; }
.tile--white a:hover { background: var(--c-red); color: var(--c-white); text-decoration: none; }
.tile--white .is-h3 { color: var(--c-red); }
.tile--white ul li {
  margin-bottom: 5px;
  padding: 0 0 5px 25px;
  border-bottom: 1px dotted #ccc;
  background: url("images/pfeil_grau.gif") no-repeat 0 5px;
}

/* Links im Fließtext nicht nur per Farbe kenntlich machen (WCAG 1.4.1) */
.tile__body a:not(.tile__link) { text-decoration: underline; text-underline-offset: .15em; }
.tile--white .tile__body a, .tile--white .tile__body a:hover { text-decoration: none; }

/* Kachel als Ganzes verlinkt */
.tile__link { display: block; height: 100%; color: inherit; text-decoration: none; }
.tile__link:hover { cursor: url("images/toaster.cur"), progress; text-decoration: none; }
.tile--white .tile__link,
.tile--white .tile__link:hover { padding: 0; color: inherit; background: none; border-radius: 0; display: block; }

/* Bild */
.tile__media { position: relative; display: block; margin: 0; }
.tile__media img { width: 100%; transition: opacity .2s; }
.tile__link:hover .tile__media img { opacity: .6; }

.tile__overlay {
  position: absolute;
  inset: 0;
  padding: 5%;
  background: #ccc;
  color: var(--c-text);           /* dunkler Text statt Weiß: 8:1 statt 1,6:1 */
  opacity: 0;
  pointer-events: none;
}
.tile__link:hover .tile__overlay,
.tile__link:focus-visible .tile__overlay,
.tile__media:hover .tile__overlay {
  opacity: .9;
  animation: slide-in-left .5s var(--ease) both;
}
.tile__overlay :is(h1, h2, h3, h4, h5, h6) {
  position: absolute;
  left: 50%; top: 40%;
  min-width: 280px;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--c-text);
}

/* Icons unten rechts */
.tile__icon {
  position: absolute;
  right: 0; bottom: 0;
  z-index: 10;
  width: 40px; height: 40px;
  background: no-repeat left top / 40px 40px;
  pointer-events: none;
}
.tile__icon--arrow { background-image: url("images/pfeil.svg"); }
.tile__icon--plus  { background-image: url("images/plus.svg"); }
.tile--blue .tile__icon--arrow,
.tile--orange .tile__icon--arrow { background-image: url("images/pfeil_weiss.svg"); }

/* Bild-Kachel, in der Text unter dem Bild steht */
.tile__body > :last-child { margin-bottom: 0; }

/* ---- Kunden-Kacheln (Bild + kleiner Name) ----------------------------------------- */
.tile__caption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 5;
  padding: 30px 50px 8px 14px;      /* oben Platz für den Verlauf, rechts für das Pfeil-Icon */
  /* Verlauf von unten (mittelgrau, leicht durchscheinend) nach oben (transparent) */
  background: linear-gradient(to top, rgb(184 184 188 / .96) 0%, rgb(184 184 188 / .92) 55%, rgb(184 184 188 / 0) 100%);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: .3px;
}
/* lange Wörter notfalls umbrechen (weiche Trennstellen setzt das Modul) */
.tile__caption, .tile__body h1, .tile__body .is-h1 { overflow-wrap: break-word; hyphens: manual; }
.tile__caption-type { margin-right: .35em; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: inherit; opacity: .85; }
.tiles > .tile--back { position: relative; grid-column: 1 / -1; height: 40px; margin-bottom: 0; }
.tile--back .back { top: 0; bottom: auto; }

/* ---- Zurück-Button ----------------------------------------------------------- */
.back {
  position: absolute;
  right: 10px; bottom: -45px;
  z-index: 30000;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--c-blue) url("images/pfeil_back.svg") center / 25px no-repeat;
  opacity: .8;
  transition: background-color .2s, opacity .2s;
}
.back:hover, .back:focus-visible { background-color: var(--c-red); opacity: 1; }

/* ---- Lightbox (<dialog>) ----------------------------------------------------- */
.lightbox {
  width: 100%; max-width: none;
  height: 100%; max-height: none;
  margin: 0; padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-white);
  overflow: hidden;
}
.lightbox::backdrop { background: rgb(0 0 0 / .9); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox__img { max-width: 90%; max-height: 90%; border-radius: 8px; }
.lightbox__btn {
  position: absolute;
  z-index: 1;
  border: 0; background: none;
  color: var(--c-white);
  line-height: 1;
  user-select: none;
}
.lightbox__close { top: 20px; right: 20px; font-size: 2rem; }
.lightbox__prev,
.lightbox__next { top: 50%; font-size: 3rem; transform: translateY(-50%); }
.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }
.lightbox__btn[hidden] { display: none; }

/* ---- Cookie-Hinweis ---------------------------------------------------------- */
.cookie-notice {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
  padding: 8px 16px;
  background: #000;
  color: #fff;
  font: 400 14px/1.4 Arial, Helvetica, sans-serif;
  text-align: center;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice a { color: #bbb; text-decoration: underline; }
.cookie-notice a:hover { color: #fff; }
.cookie-notice__ok { padding: 2px 12px; border: 1px solid #fff; border-radius: 3px; background: none; color: #fff; }
.cookie-notice__ok:hover { background: #fff; color: #000; }

/* ---- Tabellen (Module mit Datenlisten) ---------------------------------------- */
.data-table { border-collapse: collapse; width: 100%; font-size: 16px; }
.data-table th, .data-table td { padding: 5px; border: 1px solid #ccc; text-align: left; }
.data-table caption { text-align: left; }

/* ---- Animationen ------------------------------------------------------------- */
@keyframes scale-in-bl {
  from { transform: scale(0); transform-origin: 0 100%; opacity: 1; }
  to   { transform: scale(1); transform-origin: 0 100%; opacity: 1; }
}
@keyframes slide-in-left {
  from { transform: translateX(-1000px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Responsive – gleiche Umbrüche wie bisher
   ========================================================================== */
@media (max-width: 1520px) {
  :root { --page-width: 1200px; }
  .tile--l { grid-column: span 3; }
}

@media (max-width: 1200px) {
  :root { --page-width: 1000px; --nav-width: 30px; }

  .menu-toggle { display: flex; }
  .site-header-bar { display: flow-root; }

  .logo-wrapper { position: relative; z-index: 101; float: left; margin-bottom: 25px; padding: 0; }
  .site-header-bar .menu-toggle { float: left; }

  /* Navigation liegt hinter dem Inhalt und wird beim Öffnen freigelegt */
  .site-nav { position: absolute; top: 0; z-index: 101; padding-top: 55px; }
  body::before {
    content: "";
    position: fixed; inset: 0;
    z-index: 102;
    background: var(--c-white);
    transition: transform .33s cubic-bezier(.33, 0, .2, 1);
  }
  .nav-open .site-content,
  .nav-open::before { transform: translate3d(200px, 0, 0); }
  .nav-open .site-nav__inner { margin-left: 10px; padding: 10px; margin-top: -10px; }
}

@media (max-width: 992px) {
  :root { --page-width: 680px; }
  .tile--l { grid-column: span 2; }
}

@media (max-width: 767px) {
  :root { --page-width: 680px; --nav-width: 0px; }

  h2, .is-h2 { font-size: 26px; font-weight: 400; margin-top: 10px; line-height: 1.3; letter-spacing: 0; }

  .tile--m, .tile--l { grid-column: span 1; height: auto; }
  .tile--m.tile--has-media { height: 280px; }
  .tile--m.tile--grey { padding: 17px 35px; }
  .tile--white.tile--m.tile--text { height: auto; }

  /* Lightbox-Plus auf Touch-Geräten ausblenden, Antippen funktioniert trotzdem */
  .tile__icon--plus { display: none; }
}

@media (max-width: 657px) {
  :root { --page-width: 320px; }
}

@media (max-width: 340px) {
  :root { --page-width: 100%; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  .tile--white.tile--m.tile--text { height: auto; min-height: 280px; }
}

/* ---- Drucken ---------------------------------------------------------------- */
@media print {
  .site-nav, .menu-toggle, .cookie-notice, .back, .logo-wrapper, .tile__icon { display: none !important; }
  .site-content { width: 100%; padding: 0; }
  .tiles { display: block; animation: none; }
  .tile { height: auto !important; break-inside: avoid; margin-bottom: 10px; background: none !important; color: #000 !important; }
  body { font: 12pt/1.4 Arial, Helvetica, sans-serif; color: #000; }
  a[href]::after { content: " (" attr(href) ")"; }
  a[href^="#"]::after, a[href^="javascript:"]::after { content: ""; }
  h2, h3 { break-after: avoid; }
  img { max-width: 100% !important; }
}
