/* ==========================================================================
   GermanBits Portal – statisches Stylesheet
   Nachbildung des DotNetNuke-Skins „Metro7“ ohne DNN-Abhängigkeiten.
   ========================================================================== */

:root {
  --blue: #1BA0E1;
  --red: #D0312D;
  --text: #999999;
  --tile: #EEEEEE;
  --line: #CCCCCC;
  --font: Calibri, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-head: "Myriad Pro", Calibri, Arial, Helvetica, sans-serif;
}

/* ---- Basis --------------------------------------------------------------- */

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: #E5E5E5 url("../img/bg_schaltplan.png");
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
}

a { color: var(--blue); text-decoration: none; font-size: 14px; }
a:hover { color: #999CCC; text-decoration: underline; }

img { border: 0; }

p { margin: 0; padding: 0; }

h1 { font-weight: normal; font-size: 20px; color: var(--red); font-family: var(--font-head); margin: 0; }
h2 { font-weight: normal; font-size: 37px; color: var(--blue); font-family: var(--font); margin: 0 0 5px 0; }
h3 { font-weight: normal; font-size: 12px; color: var(--red); font-family: var(--font-head); margin: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Seitenrahmen -------------------------------------------------------- */

.site {
  width: 960px;
  min-height: 600px;
  margin: 0 auto;
  background: #FFFFFF;
  padding-bottom: 30px;
}

/* ---- Kopf: Logo + Menü ---------------------------------------------------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 6px 0 10px;
}

.logo { display: block; line-height: 0; }
.logo img { width: 556px; height: 136px; }

.main-nav { margin-top: 2px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.main-nav li { margin: 0; }
.main-nav a {
  display: block;
  padding: 60px 10px 0 10px;
  line-height: 23px;
  font-family: var(--font);
  font-size: 18px;
  color: var(--text);
  background: var(--tile);
  white-space: nowrap;
  text-decoration: none;
}
.main-nav a:hover,
.main-nav a.active,
.main-nav a[aria-current="page"] {
  color: #FFFFFF;
  background: var(--blue);
  text-decoration: none;
}

/* ---- Banner-Zeile: Slider + Suche + Begrüßung ----------------------------- */

.banner-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 38px 15px 0 25px;
}

.sidebar { width: 280px; flex: 0 0 280px; }

.search-cell,
.welcome-cell {
  background-color: var(--blue);
  background-repeat: no-repeat;
  background-position: right top;
  color: #FFFFFF;
  padding: 10px 15px 15px 15px;
}
.search-cell {
  height: 108px;
  margin-bottom: 10px;
  background-image: url("../img/SearchIconBG.png");
}
.welcome-cell {
  height: 131px;
  background-image: url("../img/LoginIconBG.png");
}

.search-cell h2 { color: #FFFFFF; }

.search-form {
  display: flex;
  align-items: center;
  width: 248px;
  height: 27px;
  background: url("../img/SearchBG.png") left top no-repeat;
  padding: 5px 0 0 8px;
}
.search-form input[type="search"] {
  width: 183px;
  height: 15px;
  margin: 0 13px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  line-height: 12px;
  color: var(--blue);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search-form input::-webkit-search-decoration,
.search-form input::-webkit-search-cancel-button { display: none; }
.search-form button {
  width: 30px;
  height: 17px;
  padding: 0;
  margin: 0 0 0 6px;
  border: 0;
  background: url("../img/btn_go.gif") no-repeat;
  cursor: pointer;
  font-size: 0;
  color: transparent;
}

.welcome-cell .welcome {
  display: block;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  font-size: 16px;
  line-height: 25px;
  color: #FFFFFF;
}
.welcome-cell .current-date {
  display: block;
  padding-top: 5px;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  font-size: 14px;
  color: #FFFFFF;
}

/* ---- Slider --------------------------------------------------------------- */

.slider {
  position: relative;
  width: 630px;
  height: 250px;
  flex: 0 0 630px;
  overflow: hidden;
  user-select: none;
}
.slider ul { list-style: none; margin: 0; padding: 0; }
.slider .slides,
.slider .slides li {
  position: absolute; inset: 0;
}
.slider .slides li { visibility: hidden; }
.slider .slides li.is-active { visibility: visible; z-index: 1; }
.slider .slides img { display: block; width: 630px; height: 250px; }

/* Kachelebene für den Flip-Effekt (wird von slider.js erzeugt) */
.slider .flip-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  background: #FFFFFF;
}
.slider .flip-layer div {
  position: absolute;
  background-repeat: no-repeat;
  will-change: transform;
}

.slider .caption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 5;
  margin: 9px;
  padding: 15px;
  max-width: 560px;
  background: #FFFFFF;
  color: #333333;
  font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
  font-size: 14px;
  border-radius: 5px;
  opacity: 0.8;
  transform: translateX(0);
  transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}
.slider .caption.is-hidden { transform: translateX(-120%); opacity: 0; }

.slider .bullets {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 7;
  display: flex;
  padding: 10px;
  margin: 0;
  font-size: 0;
}
.slider .bullets li { position: relative; margin-left: 3px; }
.slider .bullets button {
  display: block;
  width: 15px;
  height: 15px;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: url("../img/slider/bullet.png") left top;
  color: transparent;
  font-size: 0;
}
.slider .bullets button:hover { background-position: 0 50%; }
.slider .bullets li.is-active button { background-position: 0 100%; }

.slider .bullets .thumb {
  display: none;
  position: absolute;
  top: 20px;
  left: -113px;
  width: 234px;
  padding: 0;
  border: 4px solid #FFFFFF;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  background: #FFFFFF;
  pointer-events: none;
}
.slider .bullets .thumb::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 109px;
  width: 15px;
  height: 6px;
  background: url("../img/slider/triangle.png");
}
.slider .bullets .thumb img { display: block; width: 226px; height: 90px; }
.slider .bullets li:hover .thumb { display: block; }

.slider .arrow {
  position: absolute;
  top: 50%;
  z-index: 6;
  width: 45px;
  height: 45px;
  margin-top: -22px;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: url("../img/slider/arrows.png") no-repeat;
  color: transparent;
  font-size: 0;
  opacity: 0;
  transition: opacity .2s;
}
.slider .arrow.prev { left: 11px; background-position: 0 0; }
.slider .arrow.next { right: 11px; background-position: 100% 0; }
.slider:hover .arrow,
.slider .arrow:focus-visible { opacity: 1; }

/* ---- Inhalt --------------------------------------------------------------- */

.content-row {
  display: flex;
  align-items: flex-start;
  margin: 59px 15px 0 20px;
}

.left-pane {
  width: 160px;
  flex: 0 0 160px;
  padding: 5px;
}
/* Im Original sitzt der Titel in einer nowrap-Tabellenzelle: ein langer Titel
   weitet die Spalte über die 520 px hinaus, der Fließtext folgt dieser Breite. */
.content-pane {
  min-width: 520px;
  max-width: 750px;
  flex: 0 1 auto;
  padding: 5px 10px;
}
.content-pane .module-title { white-space: nowrap; }
/* Der Fließtext soll die Spaltenbreite nicht beeinflussen (nur der Titel). */
.content-pane .module-body { width: 0; min-width: 100%; }
.content-pane.wide {
  width: 880px;
  flex: 0 0 880px;
}

.module-title {
  display: block;
  min-height: 37px;
  font-family: var(--font);
  font-size: 30px;
  font-weight: normal;
  line-height: normal;
  color: var(--blue);
  margin: 0;
}
.module-body { padding: 8px 0 8px 0; }
.module-bottom { height: 10px; }

.portrait img { display: block; width: 143px; height: 152px; }
.portrait h3 { margin-top: 18px; line-height: 18px; }

.text {
  font-family: var(--font);
  font-size: 12px;
  line-height: 18px;
  color: var(--text);
}
.text p { margin: 0; }
.text p + p { margin-top: 0; }
.text .gap { height: 18px; }
.text a { font-size: 14px; }
.text strong { color: var(--text); }
.text .head,
.text .sub-head {
  font-family: var(--font);
  font-size: 13px;
  line-height: 18px;
  font-weight: bold;
  color: var(--blue);
  margin: 0;
}
.text table { border-collapse: collapse; }
.text td { padding: 1px 3px; font-family: var(--font); vertical-align: top; }
.text ul { margin: 0 0 0 20px; padding: 0 0 0 20px; }
.text ul li { margin: 0; }

/* Suche */
.search-results li { margin: 0 0 14px 0; }
.search-results .hit-title { font-size: 14px; }
.search-results mark { background: #FFF2A8; color: #333333; }

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
  width: 930px;
  margin: 9px 15px 0 20px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
}
.site-footer > a,
.site-footer > span {
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  padding: 0 10px;
  text-decoration: none;
}
.site-footer a:hover { color: var(--blue); text-decoration: none; }

/* ---- Responsive-Fallback (Original ist fest 960 px breit) ----------------- */
/* Unter 980 px: eine Kachelreihe mit Start | Impressum | Suche | Willkommen
   (alle gleich breit und gleich hoch), darunter der Slider, dann der Inhalt.
   Header und Banner-Zeile werden dafür per display:contents aufgelöst, so dass
   Logo, Menü, Slider und Seitenleiste direkt im Raster von .site liegen. */

@media (max-width: 979px) {
  .site {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 16px 12px 30px 12px;
  }
  .site-header, .banner-row { display: contents; }

  .logo { grid-column: 1 / -1; order: 0; }
  .logo img { width: 100%; max-width: 556px; height: auto; }

  /* Menü: zwei Kacheln, je eine Rasterspalte */
  .main-nav { grid-column: span 2; order: 1; margin: 0; display: flex; }
  .main-nav ul { width: 100%; gap: 8px; }
  .main-nav li { flex: 1 1 0; min-width: 0; display: flex; }
  .main-nav a {
    flex: 1 1 auto;
    display: flex;
    align-items: flex-end;
    padding: 8px 4px;
    line-height: 20px;
    font-size: clamp(11px, 4vw, 16px);
    overflow: hidden;
  }

  /* Seitenleiste: zwei Kacheln, je eine Rasterspalte, gleiche Höhe wie das Menü */
  .sidebar { grid-column: span 2; order: 1; width: 100%; flex: 0 0 auto; display: flex; gap: 8px; }
  .search-cell, .welcome-cell {
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    margin: 0;
    max-width: none;
    padding: 8px 4px 8px 4px;
    background-size: 48px auto;
    overflow: hidden;
  }
  .search-cell h2 { font-size: 22px; line-height: 26px; margin: 0 0 6px 0; }
  .search-form { width: 100%; height: 24px; padding: 3px 0 0 4px; background-size: 100% 100%; }
  .search-form input[type="search"] { flex: 1 1 auto; width: auto; min-width: 0; margin: 0 4px 0 0; }
  .search-form button { flex: 0 0 30px; margin: 0 4px 0 0; }
  .welcome-cell .welcome { font-size: clamp(11px, 3.3vw, 14px); line-height: 20px; }
  .welcome-cell .current-date { font-size: clamp(10px, 3vw, 12px); line-height: 16px; padding-top: 4px; }

  /* Slider unter der Kachelreihe */
  .slider {
    grid-column: 1 / -1;
    order: 2;
    width: 100%;
    max-width: 630px;
    flex: 0 0 auto;
    aspect-ratio: 630 / 250;
    height: auto;
    justify-self: start;
  }
  .slider .slides img { width: 100%; height: 100%; object-fit: cover; }

  .content-row { grid-column: 1 / -1; order: 3; flex-wrap: wrap; margin: 8px 0 0 0; }
  .content-pane, .content-pane.wide { width: 100%; min-width: 0; max-width: none; flex: 0 0 auto; padding: 5px 0; }
  .content-pane .module-title { white-space: normal; }
  .content-pane .module-body { width: auto; min-width: 0; }

  .site-footer { grid-column: 1 / -1; order: 4; width: auto; margin: 8px 0 0 0; }
}
