/* ==========================================================================
   BSR – Business Software Ressing
   Übergangs-Theme für Contao 5 (angelehnt an das Layout von 2011, responsiv)
   ========================================================================== */

:root {
  --bsr-blue: #3a8ad6;
  --bsr-blue-dark: #1f5f9e;
  --bsr-blue-light: #7baee0;
  --bsr-green: #5cee7d;
  --bsr-green-dark: #1f9e45;
  --bsr-heading: #2f78b8;
  --bsr-text: #4d4d4d;
  --bsr-muted: #767676;
  --bsr-bg: #000;
  --bsr-card: #fff;
  --bsr-radius: 14px;
  --bsr-max: 1100px;
  --bsr-font: Verdana, "DejaVu Sans", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font: 15px/1.6 var(--bsr-font);
  color: var(--bsr-text);
  background: var(--bsr-bg) url("bsr-bg.jpg") center top / 2000px auto no-repeat;
}

img { max-width: 100%; height: auto !important; border: 0; vertical-align: middle; }
img[style*="float: left"], img[style*="float:left"] { margin: 0 1em .5em 0; }
img[style*="float: right"], img[style*="float:right"] { margin: 0 0 .5em 1em; }

a { color: var(--bsr-blue-dark); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--bsr-green-dark); }
:focus-visible { outline: 3px solid var(--bsr-green); outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 { color: var(--bsr-heading); line-height: 1.3; margin: 1.4em 0 .5em; font-weight: bold; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4, h5, h6 { font-size: 1rem; }
p, ul, ol, table, figure { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid #d9d9d9; margin: 2em 0; }
table { border-collapse: collapse; max-width: 100%; }
td, th { padding: .25em .5em .25em 0; vertical-align: top; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Seitenrahmen ---------- */
#wrapper { max-width: var(--bsr-max); margin: 0 auto; padding: 18px 16px 32px; }

/* ---------- Kopfbereich (Blau-Grün-Verlauf wie bisher) ---------- */
#header {
  position: relative;
  border-radius: var(--bsr-radius) var(--bsr-radius) 0 0;
  background: linear-gradient(180deg, #2f7fcf 0%, #4fa3e6 22%, #5cee7d 42%, #5cee7d 62%, #49c86a 78%, #3a8ad6 100%);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}
#header .inside {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; min-height: 150px; padding: 18px 28px 26px;
}

.bsr-logo { display: inline-flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; text-shadow: 0 2px 3px rgba(0, 0, 0, .45); }
.bsr-logo:hover, .bsr-logo:focus-visible { color: #fff; }
.bsr-logo__text { display: flex; flex-direction: column; font-family: Arial, Helvetica, sans-serif; font-weight: bold; line-height: 1.1; }
.bsr-logo__small { font-size: 1rem; }
.bsr-logo__big { font-size: clamp(1.3rem, 3.4vw, 2rem); }
.bsr-logo img { width: 52px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }

/* Hauptnavigation */
.nav-main { align-self: flex-start; }
.nav-main ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.nav-main a, .nav-main strong {
  display: block; padding: 6px 12px; border-radius: 6px;
  color: #fff; font-weight: bold; text-decoration: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  background: rgba(16, 66, 120, .45);
}
.nav-main a:hover, .nav-main a:focus-visible { background: rgba(16, 66, 120, .8); color: #fff; }
.nav-main strong.active, .nav-main a.trail { background: #fff; color: var(--bsr-blue-dark); text-shadow: none; }

.nav-toggle {
  display: none; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid #fff; border-radius: 8px;
  background: rgba(0, 0, 0, .15); color: #fff; font: bold 1rem var(--bsr-font); cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 20px; height: 2px; background: #fff; position: relative; content: "";
}
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after { position: absolute; top: 6px; }

/* ---------- Inhaltskarte ---------- */
#container {
  position: relative; background: var(--bsr-card);
  border-radius: 0 0 var(--bsr-radius) var(--bsr-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
#container::before {
  content: ""; position: absolute; top: 18px; right: 22px; width: 82px; height: 74px;
  background: url("bsr-pixel.png") no-repeat; opacity: .9; pointer-events: none;
}
#main .inside { padding: 28px clamp(16px, 5vw, 64px) 40px; }
#main .inside > :first-child { margin-top: 0; }
/* Umflossene Bilder und Tabellen sicher einschließen, damit die weiße Karte mitwächst */
#container, #main, #main .inside { display: flow-root; }
#main .inside::after, [class^="content-"]::after, [class*=" content-"]::after, .rte::after { content: ""; display: table; clear: both; }
#main { overflow-wrap: break-word; }

/* Kontaktzeile oben */
.bsr-contactbar { margin: 0 110px 1.5em 0; color: var(--bsr-blue-light); font-weight: bold; }
.bsr-contactbar a { color: var(--bsr-text); }

/* Unternavigation (Ebene 2 + 3) */
.nav-sub { margin: 0 110px 2em 0; }
.nav-sub ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nav-sub ul ul { margin-top: 6px; flex-basis: 100%; }
.nav-sub li.submenu, .nav-sub li.trail { display: contents; }
.nav-sub a, .nav-sub strong {
  display: inline-block; padding: 5px 12px; border: 1px solid #cfe0f2; border-radius: 999px;
  background: #f3f8fd; color: var(--bsr-blue-dark); font-size: .9rem; text-decoration: none;
}
.nav-sub a:hover, .nav-sub a:focus-visible { background: #e3f9e9; border-color: var(--bsr-green); color: #145c2b; }
.nav-sub strong.active { background: var(--bsr-blue); border-color: var(--bsr-blue); color: #fff; }
.nav-sub .level_2 a, .nav-sub .level_2 strong { font-size: .85rem; }

/* Bilder & Medien */
figure { margin: 0 0 1em; }
.content-image figure, .ce_image figure { text-align: center; }
/* Contao 5 setzt media--left/right auf das ganze Element – nur das Bild darin umfließen lassen */
.media--left > figure, .float_left { float: left; margin: .3em 1.4em 1em 0; max-width: 45%; }
.media--right > figure, .float_right { float: right; margin: .3em 0 1em 1.4em; max-width: 45%; }
.content-text::after, .ce_text::after { content: ""; display: table; clear: both; }
.content-youtube figure, .content-video figure { margin-bottom: 1.5em; }
.content-youtube iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.swiper { max-width: 760px; margin: 0 auto 1.5em; border-radius: 8px; overflow: hidden; }
.swiper img { width: 100%; display: block; }

/* Buttons */
.bsr-button, .widget-submit button, button.submit {
  display: inline-block; padding: 10px 20px; border: 0; border-radius: 8px;
  background: var(--bsr-blue); color: #fff; font: bold 1rem var(--bsr-font); text-decoration: none; cursor: pointer;
}
.bsr-button:hover, .bsr-button:focus-visible, .widget-submit button:hover { background: var(--bsr-green-dark); color: #fff; }

/* News */
.mod_newslist .layout_latest, .mod_newslist .layout_short { padding: 0 0 1.2em; margin-bottom: 1.2em; border-bottom: 1px solid #e3e3e3; }
.mod_newslist .info, .mod_newsreader .info { color: var(--bsr-muted); font-size: .85rem; }
.mod_newsreader .back { margin-top: 2em; }

/* Formulare */
.widget { margin-bottom: 1em; }
.widget > label, .widget legend { display: block; font-weight: bold; margin-bottom: .25em; }
.widget-text input, .widget-textarea textarea, .widget-select select, input.text, textarea, select {
  width: 100%; max-width: 560px; padding: 9px 11px; border: 1px solid #b9c7d6; border-radius: 6px; font: inherit; color: inherit;
}
textarea { min-height: 160px; }
.widget-checkbox fieldset { border: 0; padding: 0; margin: 0; }
.mandatory .mandatory, span.mandatory { color: #c0392b; }
p.error, .widget .error { color: #c0392b; font-weight: bold; }

/* ---------- Fußbereich ---------- */
#footer { margin-top: 18px; color: #c9d9ea; font-size: .85rem; text-align: center; }
#footer .inside { padding: 14px 16px; }
#footer a { color: var(--bsr-blue-light); }
#footer a:hover { color: var(--bsr-green); }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  body { font-size: 15px; background-size: 1200px auto; }
  #wrapper { padding: 0 0 24px; }
  #header { border-radius: 0; }
  #header .inside { min-height: 0; padding: 16px; }
  #container { border-radius: 0; }
  #container::before { display: none; }
  .bsr-contactbar, .nav-sub { margin-right: 0; }
  .nav-toggle { display: inline-flex; }
  .js .nav-main { display: none; flex-basis: 100%; }
  .js .nav-main.is-open { display: block; padding: 8px; border-radius: 10px; background: rgba(16, 66, 120, .9); }
  .nav-main a { background: transparent; }
  .nav-main ul { flex-direction: column; }
  .nav-main a, .nav-main strong { padding: 10px 12px; }
  .media--left > figure, .media--right > figure, .float_left, .float_right { float: none; max-width: 100%; margin: 0 0 1em; }
  img[style*="float"] { float: none !important; display: block; margin: 0 auto 1em !important; }
  table { display: block; overflow-x: auto; }
  [style*="justify"] { text-align: left !important; }
  [style*="font-size"] { font-size: inherit !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  body { background: none; color: #000; }
  #header { background: none; box-shadow: none; }
  .bsr-logo { color: #000; text-shadow: none; }
  .nav-main, .nav-sub, .nav-toggle, #container::before { display: none !important; }
  #container { box-shadow: none; }
}
