/* Background */

/*
#patternTopBarContents { background:linear-gradient(to left, #a8a8a8, #d5d5d5 25%, #e4e4e4 50%, #f5f5f5 75%, transparent ); background-size:1600px; background-position:top right; background-repeat:no-repeat;}
#patternPageShadow {background-image:url(background.jpg); background-repeat:no-repeat; background-position:top right;}
#patternPage {background-image:url(background.jpg); background-repeat:no-repeat; background-position:top right;}
*/
#patternScreen, #patternPage, #patternPageShadow, #patternWrapper  { background:transparent; background-color:transparent;}
#patternSideBar, #patternTopBarContents, #patternTopBarContentsWrapper, #patternTopBar {background:transparent; background-color:transparent;}
#patternTopBarContents { background-color: white; background-image:url(background.jpg); background-repeat:no-repeat; background-position:top right;}
#patternPageShadow { background-color: white; background-image:url(background.jpg); background-repeat:no-repeat; background-position:top right;}

/* Fonts */
@font-face {
    font-family: CG Omega;
    src: url(CG_Omega.ttf);
}
@font-face {
    font-family: CG Omega;
    src: url(CG_Omega_Bold.ttf);
    font-weight: bold;
}
/*#patternPageShadow { font-family: CG Omega, Arial, sans-serif;}*/

/* TopBar modification */
#patternTopBar { border-style: none none none none;}

/* BottomBar modification */
#patternBottomBar { background-color: transparent;}

/* Colors (headings) */
h1, h2, h3, h4, h5, h6 {background-color:transparent;}
h1 {color:#600e0e;}
/*h1 {color:#003818;}*/
h2, h3, h4, h5, h6 {color:#bb8929;border-color:#e2e2e2;}


/* Colors (links and wikiwords) */
.foswikiNewLink font {color:inherit;}
.foswikiNewLink a:link sup,.foswikiNewLink a:visited sup {color:#777;border-color:#ddd;}
.foswikiNewLink a:hover sup {background-color:transparent;color:#b55500;border-color:#b55500;}
.foswikiNewLink {border-color:#ddd;}
:link:focus,:visited:focus,:link,:visited,:link:active,:visited:active,a:visited,.foswikiUnvisited a,.foswikiUnvisited a:visited {color:#d07145;background-color:transparent;}
:link:hover,:visited:hover,a:hover,.foswikiUnvisited a:hover {color:#b55500;background-color:transparent;background-image:none;}
:link:hover img,:visited:hover img {background-color:transparent;}
.patternActionButtons a:link, .patternActionButtons a:visited, .patternActionButtons a:hover { color: #b55500; }
.patternTopicActions .foswikiAccessKey { border-color: #d07145; color: #d07145; }
.patternTopicActions a:hover .foswikiAccessKey { color: #d07145; }
a:link .foswikiAccessKey, a:visited .foswikiAccessKey { color: #d07145; }
#patternSideBar a:hover, #patternSideBar a:focus, #patternSideBar a:active {color:#b55500;}

/* WebIncicator modification */
#patternSideBarContents .patternWebIndicator { background-color:transparent; border-style:none none solid none;border-width:1px; }
#patternSideBarContents .patternWebIndicator a{ background-color:transparent; border-style:none none solid none;border-width:1px; }


/* TimeTable modification */
.timeTablePluginTable td[id*="TTP_TD"] { border-style: solid; border-width: 1px; border-color: white; }

/* HomePath modification*/
.patternHomePath:hover a:link,.patternHomePath:hover a:visited{color:#d07145}

/* Topbar-Navigation */
#patternTopBarButtons,#patternTopBarButtons ul,#patternTopBarButtons li,#patternTopBarButtons ul li{
background-color:transparent;
color:black;
}
#patternTopBarButtons li,#patternTopBarButtons ul li{
display:block;
float:left;
margin:10px;
}
#patternTopBarButtons a{
color:black;
font-size:90%;
font-weight:bold;
text-decoration:none;
width:120px;
/* margin-top: 10px; */
/* margin-bottom: 10px; */
margin-left: 20px;
margin-right: 10px;
border: 1px solid grey;
border-radius:5px;
box-shadow:8px 8px 20px lightgrey;
}
#patternTopBarButtons a:hover{
background-image: linear-gradient(to bottom, #F8F8F8, #EBEBEB);
font-weight:bold;
color:#bb8929;
}

#patternTopBarButtons ul li a.active{background-color:#4c94db;color:#fff}
#patternTopBarButtons ul ul{border-style:none solid solid solid;border-width:1px;border-color:#ccc}
#patternTopBarButtons ul ul,#patternTopBarButtons ul ul li{background-color:#f6f6f5;color:#333}
#patternTopBarButtons ul ul li a{color:#333;font-weight:normal}

/* Sidebar-Buttons included in an nav Environment*/
#patternSideBarContents nav a:hover{
	text-decoration:none;
}

#patternSideBarContents nav h2{
font-weight:bold;
font-size:90%;
border: 1px solid grey;
width:120px;
color:black;
padding:15px;
border-radius:5px;
box-shadow:8px 8px 20px lightgrey;
}

#patternSideBarContents nav a:hover h2{
color:#bb8929;
border-color:grey;
box-shadow:none;
}

#patternSideBarContents nav h3{
font-weight:bold;
font-size:80%;
border: 1px solid grey;
width:120px;
color:black;
padding:5px;
border-radius:5px;
box-shadow:8px 8px 20px lightgrey;
margin-left:10px;
width:80px;
}

#patternSideBarContents nav a:hover h3{
color:#bb8929;
border-color:grey;
box-shadow:none;
}

/* Button definition*/
a{
text-decoration:none;
}
a .Button{
padding:8px;
width:180px;
text-align:center;
background-color:#bb8929;
color:white;
border-radius:5px;
font-weight:bold;
box-shadow: 10px 10px 20px grey;
}
a:hover .Button{
text-align:center;
background-color:transparent;
color:black;
border-radius:5px;
font-weight:bold;
box-shadow:none;
border:1px solid grey;
text-decoration:none;

}

.Button_current{
width:180px;
padding:8px;
text-align:center;
background-color:transparent;
color:black;
border-radius:5px;
font-weight:bold;
box-shadow:none;
border:1px solid grey;
text-decoration:none;
}

/* textfeld definitions*/
.textfield {
border:1px solid #bb8929;
box-shadow: 10px 10px 20px lightgrey;
border-radius:5px;
padding: 20px;
margin-left:auto;
margin-right:auto;
/* width:90%; */
}

div.greybox{
border:1px solid #bb8929;
box-shadow: 10px 10px 20px lightgrey;
border-radius:5px;
padding: 20px;
margin-left:auto;
margin-right:auto;
float:left;
/* width: 100%; */
background-color:lightgrey;
clear: both;
}
div.leftside{
   float: left;
   clear: left;
   width: 33%;
   background-color: transparent;
}
div.rightside{
   float: right;
   clear: right;
   width: 66%;
   background-color: transparent;
}

/* Review Info */
/* .patternRevInfo { display: none; } */

/* Comment modification */
/*
input[type='text']:hover, input[type='file']:hover, input[type='password']:hover, .foswikiInputField:hover, input[type='text']:focus, input[type='file']:focus, input[type='password']:focus, .foswikiInputField:focus, textarea.focused, .foswikiTextarea.focused, input[type='text'].focused, input[type='file'].focused, input[type='password'].focused, .foswikiInputField.focused, textarea[name=comment].focused { border-color: rgba(181,â€‹ 85,â€‹ 0,â€‹ 0.5); box-shadow: 0 0 2px 0 rgba(181,â€‹ 85,â€‹ 0,â€‹ 0.5); }
*/

/* a4 letter */
/* DIN A4 size: 210mm x 297mm */

/**
 * Baseline grid: 7pt
 * Distance from top to content: 12.7mm
 *
 * @author      Kim-Christian Meyer
 * @copyright   2016 Kim-Christian Meyer
 * @license     GPL-3.0+
 */
/**
* {
  margin: 0;
  padding: 0;
}
*/

html,
body {
  width: 100%;
  /* height: 100%; */
  min-height: 100%;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Fira Sans', 'Myriad Pro', sans-serif;
  font-size: 10pt;
  line-height: 14pt;
  background: #ffffff;
}

p {
  margin: 0 0 14pt 0;
}

.page-hd {

}

.clear-storage-btn {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  z-index: 10;
  padding: 8px 20px;
  font-size: 10pt;
  line-height: 14pt;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  text-decoration: none;
}

.clear-storage-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}

.clear-storage-btn:active {
  background: rgba(0, 0, 0, 0.7);
}

.clear-storage-btn.is-visible {
  display: block;
}

.editors {
  display: none; /* Not needed anymore because of contenteditable */
  float: left;
  width: 50%;
  background: #ddd;
  height: 100%;
  padding: 24mm;
  box-sizing: border-box;
}

.preview {
  position: relative;
  padding: 0mm;
  width: 210mm; /* DIN A4 */
  min-height: 297mm; /* Mindestens A4, wächst aber bei Bedarf */
  height: auto;      /* WICHTIG: Erlaubt das Mitwachsen */
  margin: 50px auto; /* Zentrierung im Browser */
  box-sizing: border-box;
<!--  border:1px solid green; -->
  display: block;
  clear: both;
}

/* DIN lang size: 220mm x 110mm*/
/* DIN A4 size: 210mm x 297mm */
.address-overlay {
  position: absolute;
  /* DIN lang: address window must be 15mm from bottom, and 20mm from left
     horizontal difference envelope vs. paper: 220mm - 210mm = 10mm;
     top:
     105mm (line 1) - 15mm (margin bottom) - 45mm (height) + 1.5mm (puffer) = 46.5mm
     left:
     20mm - 5mm (horizontal difference envelope vs. paper / 2) = 15mm */
  left: 15mm;
  top: 46.5mm;

  /* Standard DIN lang width and height */
  width: 90mm;
  height: 45mm;

  border-radius: 4mm;
  background: rgba(0, 0, 0, 0);
  z-index: 0;
}

.address-wrapper {
  position: absolute;
  left: 20mm;
  top: 126pt;
  width: 90mm;
  padding: 14pt 4mm;
  z-index: 10;
  box-sizing: border-box;
<!--  border:1px solid red; -->
}

.address-overline {
  font-size: 8pt;
}

.address {
  font-size: 10pt;
}

.sidebar {
  position: absolute;
  right: 24mm;
  top: 105pt;
  width: 60mm;
  height: 147pt;
  font-size: 10pt;
<!--  border:1px solid brown; -->
}

.sidebar-text {
  position: absolute !important;
  left: 25mm;
  top: 20pt;
  right: 75mm;
  height: 280pt;
  font-size: 10pt;
  text-align: left;
  z-index: 100;
<!--    border:1px solid red; -->
}

.logo {
  position: absolute;
  right: 5mm;
  top: 5mm;
  width: 60mm;
  height: 100pt;
<!--  border:1px solid blue; -->
}

.footer {
  position: absolute;
  right: 5mm;
  top: 257mm;
  left: 5mm;
  height: 35mm;
  font-size: 8pt;
<!--  border:1px solid grey; -->
}

.align-bottom {
  position: absolute;
  bottom: 0;
  width: 100%;
}

.sidebar-date {
  margin-top: 14pt;
}

.sidebar-email {
  margin-top: 14pt;
}

.sidebar-phone {
  margin-top: 14pt;
}

div.body {
  position: relative !important;
  /*
  left: 20mm;
  top: 308pt;
  right: 20mm;
  */
  padding-top: 308pt !important; /* Schiebt den Inhalt UNTER den absoluten Briefkopf */
  margin-left: 20mm !important;
  margin-right: 20mm !important;
  width: auto !important;
  height: auto !important;
  display: block !important;
  min-height: 10mm; /* Sicherheitshalber */
  clear: both;

<!--  border:1px solid grey; -->
}

.headless {
  padding-top: 0pt !important;
<!--  border:1px solid grey; -->
}

.table-container {
  position: relative; /* Nicht mehr absolute! */
  width: auto;
  margin-left: 20mm !important;
  margin-right: 20mm !important;
  width: auto !important;
  height: auto !important;
  min-height: 10mm; /* Sicherheitshalber */
  page-break-inside: auto;
}

/* Tabellen-Optimierung für den Druck */
table {
  width: 100%;
  border-collapse: collapse;
  page-break-inside: auto; /* Erlaubt Seitenumbrüche innerhalb der Tabelle */
}

.body-subject {
  font-weight: bold;
  margin-bottom: 14pt;
}

.attachments-hd {
  font-style: italic;
  font-size: 8pt;
  line-height: 12pt;
  margin: 0;
}

.attachments-bd {
  font-size: 8pt;
  line-height: 12pt;
}

.line {
  position: absolute;
  left: 5mm;
  height: 0.3mm;
  /* WonÂ´t get printed, using 1x1 pixel instead */
  /*background-color: rgba(0, 0, 0, 0.3);*/
}

.line-img-helper {
  width: 100%;
  height: 100%;
  display: block;
}

.line-1 {
  top: 105mm;
  width: 3mm;
}

.line-2 {
  top: 148.5mm;
  width: 5mm;
}

.line-3 {
  top: 210mm;
  width: 3mm;
}

.baseline-10pt {
  padding-top: 4.7pt;
  margin-bottom: -4.7pt;
  /* Sicherstellen, dass dies nicht das Layout verschiebt */
  display: block;
}

.baseline-8pt {
  padding-top: 5.1pt;
  margin-bottom: -5.1pt;
   /* Sicherstellen, dass dies nicht das Layout verschiebt */
  display: block;
}

.baseline-8pt-bottom {
  padding-bottom: 1.4pt;
    /* Sicherstellen, dass dies nicht das Layout verschiebt */
  display: block;
}

/* Only for debugging */
.baselines {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
}

.baseline {
  height: 14pt;
}

.baseline:nth-child(2n) {
  background: rgba(255,0,0,0.3);
}

@media screen {
  /* Create a wider border around the element without effecting other elements */
  *[contenteditable] {
    position: relative;
    display: inline-block;
    margin: -7pt;
    padding: 7pt;
    width: 100%;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0);
    -webkit-transition: box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out;
    transition: box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out;
  }

  *[contenteditable]:focus {
    z-index: 20;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    outline: none;
    background-color: rgba(255, 255, 255, 0.95);
  }

  .baseline-8pt:focus {
    padding-top: 12.1pt;
    margin-bottom: -12.1pt;
  }

  .body-subject:focus {
    margin-bottom: 7pt; /* = 14pt - 7pt */
  }

  body {
    background-color: rgba(0, 0, 0, 0.3);
  }

  .preview {
    display: block !important;
    position: relative;
    margin: 50px auto;
    background: white;
    width: 210mm;
    min-height: 297mm; /* height: 297mm; */
    box-shadow: 0 5px 50px rgba(0, 0, 0, 0.3);
    height: auto !important; /* Erlaubt dem Blatt, mit dem Inhalt zu wachsen */
    overflow: visible; /* Verhindert, dass Text unter andere Elemente schlüpft */
    /* margin-bottom: 50px; /* Abstand zum nächsten Blatt in der Ansicht */
    clear: both;
    page-break-after: always !important;
    page-break-before: always !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    /* box-shadow: none; */
  }
}

@media print {
/*
  * {
    outline: 1px solid rgba(255, 0, 0, 0.2) !important;
  }
*/

  @page {
    size: A4 portrait;   /* auto is the current printer page size */
    margin: 0;
    /* outline: 3px solid blue !important; /* Blau: Das A4 Blatt */
  }

  .preview {
    display: block !important;
    position: relative !important;
    width: 210mm !important;
    min-height: 297mm !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
/*    page-break-before: auto !important;
    page-break-after: auto !important; */
    clear: both !important;
  }

  .preview + .preview {
    page-break-before: always !important;
    break-before: page !important;
  }

  .preview:last-child {
    page-break-after: avoid !important;
    break-after: avoid !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .preview:last-of-type ~ * {
    display: none !important;
    min-height: 290mm !important; /* Etwas kürzer als A4 */
    height: 0 !important;
    margin: 0 !important;
  }
    div.body {
    display: block !important;
    position: relative !important;
    /* 308pt oder ca. 95mm Platz für den Briefkopf lassen */
    padding-top: 95mm !important;
    box-sizing: border-box !important;
    /* outline: 3px solid green !important; /* Grün: Der Inhaltsbereich */
  }

  .table-container {
    display: block !important;
    margin-top: 0 !important;
    padding: 0 !important;
    overflow: visible !important; /* Ganz wichtig für Chrome */
  }

  table {
    display: table !important;
    width: 100% !important;
    /* margin-top: -15mm !important; */
    border-collapse: collapse !important;
    border: none !important; /* Rote Linie entfernen, wenn Debug fertig */
    page-break-inside: auto !important; /* Erlaubt Umbruch auf Seite 2 */
    /* outline: 3px solid orange !important; Orange: Die Tabelle */
  }

  tr {
    page-break-inside: avoid !important; /* Einzelne Zeilen nicht zerreißen */
  }

  thead::before {
    content: "";
    display: block;
    height: 15mm; /* Dies ist der Abstand zum oberen Rand auf Folgeseiten */
  }


  .page-break {
    page-break-before: always !important;
    break-before: page !important;
    page-break-inside: avoid;
  }

  /* 1) Adressfenster & Logo präzise positionieren */
  .address-wrapper {
    position: absolute !important;
    /* Hier den Wert anpassen, bis es im Fenster sitzt (ca. 45mm - 52mm) */
    top: 45mm !important;
    left: 20mm !important;
    width: 85mm !important;
    z-index: 1000;
  }

  .logo {
    position: absolute !important;
    top: 10mm !important;    /* Kleinerer Wert = weiter nach oben */
    right: 10mm !important; /* Kleinerer Wert = weiter nach rechts */
    left: auto !important;  /* WICHTIG: Überschreibt eventuelle left-Werte */
    margin: 0 !important;
    z-index: 1000 !important;
  }

  .no-print {
    display: none !important;
  }

    /* Wir markieren alle potenziellen Übeltäter lila
  div, p, br, span, section, footer {
    outline: 1px solid purple !important;
    position: relative !important;
  }*/

  /* Wir schreiben den Tag-Namen und die Klasse direkt an das Element
  div::after, p::after, span::after, br::after {
    content: " Element: <" attr(class) "> Tag: " counter(dummy);
    content: "TAG: " uc-words(tag) " CLASS: " attr(class) !important;

    content: "HIER: " attr(class) " (" attr(id) ")" !important;

    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    background: purple !important;
    color: white !important;
    font-family: monospace !important;
    font-size: 10pt !important;
    z-index: 99999 !important;
    display: block !important;
    white-space: nowrap !important;
  } */

  .patternInfo,
  .patternInfoBar,
  .patternRevInfo,
  .foswikiAttachments,
  .foswikiContentFooter,
  .foswikiContentHeader,
  #patternBottomBar {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    overflow: hidden !important;
  }

/*
  * {
    background-color: rgba(200, 200, 200, 0.1) !important;
  }
*/
}
