@font-face {
  font-family: 'AWConqueror-Std-Didot-Light';
  src: url('../../Fonts/conqueror/AWConqueror-Std-Didot-Light.eot');
  src: url('../../Fonts/conqueror/AWConqueror-Std-Didot-Light.eot?#iefix') format('embedded-opentype'),
       url('../../Fonts/conqueror/AWConqueror-Std-Didot-Light.woff2') format('woff2'),
       url('../../Fonts/conqueror/AWConqueror-Std-Didot-Light.woff') format('woff'),
       url('../../Fonts/conqueror/AWConqueror-Std-Didot-Light.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'AWConqueror-Std-Didot';
  src: url('../../Fonts/conqueror/AWConqueror-Std-Didot.eot');
  src: url('../../Fonts/conqueror/AWConqueror-Std-Didot.eot?#iefix') format('embedded-opentype'),
       url('../../Fonts/conqueror/AWConqueror-Std-Didot.woff2') format('woff2'),
       url('../../Fonts/conqueror/AWConqueror-Std-Didot.woff') format('woff'),
       url('../../Fonts/conqueror/AWConqueror-Std-Didot.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'Alkes';
  src: url('../../Fonts/alkes/Alkes-Regular.eot');
  src: url('../../Fonts/alkes/Alkes-Regular.eot?#iefix') format('embedded-opentype'),
       url('../../Fonts/alkes/Alkes-Regular.woff2') format('woff2'),
       url('../../Fonts/alkes/Alkes-Regular.woff') format('woff'),
       url('../../Fonts/alkes/Alkes-Regular.ttf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Alkes';
  src: url('../../Fonts/alkes/Alkes-Bold.eot');
  src: url('../../Fonts/alkes/Alkes-Bold.eot?#iefix') format('embedded-opentype'),
       url('../../Fonts/alkes/Alkes-Bold.woff2') format('woff2'),
       url('../../Fonts/alkes/Alkes-Bold.woff') format('woff'),
       url('../../Fonts/alkes/Alkes-Bold.ttf') format('opentype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Alkes';
  src: url('../../Fonts/alkes/Alkes-RegularItalic.eot');
  src: url('../../Fonts/alkes/Alkes-RegularItalic.eot?#iefix') format('embedded-opentype'),
       url('../../Fonts/alkes/Alkes-RegularItalic.woff2') format('woff2'),
       url('../../Fonts/alkes/Alkes-RegularItalic.woff') format('woff'),
       url('../../Fonts/alkes/Alkes-RegularItalic.ttf') format('opentype');
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: 'Alkes';
  src: url('../../Fonts/alkes/Alkes-BoldItalic.eot');
  src: url('../../Fonts/alkes/Alkes-BoldItalic.eot?#iefix') format('embedded-opentype'),
       url('../../Fonts/alkes/Alkes-BoldItalic.woff2') format('woff2'),
       url('../../Fonts/alkes/Alkes-BoldItalic.woff') format('woff'),
       url('../../Fonts/alkes/Alkes-BoldItalic.ttf') format('opentype');
  font-weight: bold;
  font-style: italic;
}

/* verhindert, dass nach externen Änderungen plötzlich gescrollt werden kann */

html.reader,
body.reader {
   height: 100%;
   overflow: hidden !important;
}
body.reader {
  margin: 0;
  background: #fff;
  color: #222;
  font-family: 'Alkes', sans-serif;
  transition: background 0.3s, color 0.3s;
  overflow: hidden;
}
body.reader.darkmode {
  background: #111;
  color: #ddd;
}

ul, ol {
  padding-left: 1.5em;        /* leichter Einzug */
  list-style-position: outside;
}

ul li, ol li {
  font-size: 1rem;            /* gleichbleibende Schriftgröße */
}

ul li::marker,
ol li::marker {
  font-size: 1.5em;           /* größere Punkte oder Zahlen */
}

/* Überschriften im Kapitel */
h1 {
  font-family: 'AWConqueror-Std-Didot-Light', sans-serif;
  font-size: 35px;
  line-height: 1.1em;
  margin-top: 0;
  margin-bottom: 20px;
}

/* Container */
#reader-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
:root {
  --vh: 100vh;
}
#reader-container {
  height: calc(var(--vh, 1vh) * 100);
}

/* Balken => Standard Lightmodus: hellgrau (#ccc) */
#top-bar, #bottom-bar {
  background: #ccc; 
  padding: 10px 20px;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
  justify-content: space-between;
  color: #333;
}

/* Darkmode-Balken => #333333 (Anthrazit) */
body.reader.darkmode #top-bar,
body.reader.darkmode #bottom-bar {
  background: #333333;
  color: #eee;
}

/* Back (links), Kapitel (mitte), Hamburger (rechts) */
#back-btn {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  margin-left: 0;
  order: 0;
}
#chapter-select {
  font-weight: bold;
  font-size: 18px;
  margin: 0 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  order: 1;
}
.hamburger {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  order: 2;
}

/* Bottom-Bar */
#bottom-bar {
  justify-content: space-between;
}
#prev-btn, #next-btn {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}
#prev-btn {
  order: 0;
  margin-right: auto;
}
#page-indicator {
  order: 1;
  font-size: 16px;
  color: #666;
  text-align: center;
  margin: 0 20px;
}
body.reader.darkmode #page-indicator {
  color: #bbb;
}
#next-btn {
  order: 2;
  margin-left: auto;
}

/* Lesebereich */
#pages {
  flex: 1;
  overflow: auto;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  padding-top: 60px;
  box-sizing: border-box;
  line-height: 1.6;
  font-size: 18px;
}

/* Grundlegende Absatz-Styles */
p {
  margin: 0;
  text-align: justify;
  hyphens: auto;
}
p.indent {
  text-indent: 1.5em;
}
.chapter > p:first-of-type {
  text-indent: 0;
}
p.no-indent {
  text-indent: 0 !important;
}
.nachricht,
.email,
.person,
.neutral,
.system
{
  position: relative;
  margin: 1em 0;
  background-color: #f0f0f0;
  border-radius: 10px;
  padding: 10px 14px 10px 48px;
  max-width: 90%;
  background-image: none; /* ersetzt durch ::before */
  min-height: 48px;
  line-height: 1.4em;
  overflow: hidden;
	color: #000000;
	
}

.nachricht {
}
.neutral {
			background-color: #e8e5f6;
	  padding: 10px 14px 10px 14px;


}
.system {
		background-color: #fff0d6;

}

.email {
		background-color: #d8eafd;

}

.person {
		background-color: #d4e7d3;

}

.nachricht::before,
.email::before,
.person::before,
.neutral::before,
.system::before

{
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  background-size: 24px;
  background-repeat: no-repeat;
  position: absolute;
  top: 14px;
  left: 14px;
}

.nachricht::before {
  background-image: url('../../Bilder/message.png');
}

.email::before {
  background-image: url('../../Bilder/email.png');
}

.person::before {
  background-image: url('../../Bilder/person.png');
}
.system::before {
  background-image: url('../../Bilder/system.png');
}


/* Overlays => halbtransparenter Vorhang */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  overflow-x: hidden; /* horizontales Scrolling vermeiden */
}
.lightbox-overlay.hidden {
  display: none;
}

/* Lightbox => feste Standard-Hintergrundfarbe */
.lightbox-content {
  background-color: #fff; /* Standard Light */
  color: #222;
  border-radius: 8px;
  padding: 20px;
  width: 95%;
  max-width: 600px;
  max-height: 95%;
  box-sizing: border-box;
  position: relative;
  margin: 0 auto; 
}

/* Darkmode => Fallback */
body.reader.darkmode .lightbox-content {
  background-color: #333333;
  color: #ddd;
}

.scrollable {
  overflow-y: auto;
}
.lightbox-close {
  position: absolute;
  top: 15px;
  right: 15px;
  border: none;
  background: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}
body.reader.darkmode .lightbox-close {
  color: #aaa;
}

/* Menü-Einträge */
.menu-item {
  padding: 15px 0;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
  font-size: 18px;
}
.menu-item:last-child {
  border-bottom: none;
}
.menu-item:hover {
  background: #eee;
}
body.reader.darkmode .menu-item {
  border-bottom: 1px solid #555;
}
body.reader.darkmode .menu-item:hover {
  background: #444;
}

/* TOC-Einträge */
.toc-entry {
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  font-size: 16px;
}
.toc-entry:last-child {
  border-bottom: none;
}
.toc-entry:hover {
  background: #f0f0f0;
}
body.reader.darkmode .toc-entry {
  border-bottom: 1px solid #555;
}
body.reader.darkmode .toc-entry:hover {
  background: #444;
}

/* Bookmark-Einträge */
#bookmark-entries {
  margin: 15px 0;
}
.bookmark-row {
  padding: 10px 0;
  border-bottom: 1px solid #ccc;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}
.bookmark-row:hover {
  background: #f8f8f8;
}
.bookmark-row button {
  border: none;
  background: none;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 10px;
  font-size: 14px;
  color: #999;
}

/* Startscreen */
.startscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}
.startscreen h1 {
  font-size: 36px;
  margin-bottom: 20;
}
.startscreen h2 {
  font-size: 20px;
  color: #888;
  margin-top: 5px;
}
.startscreen .byline {
  font-size: 14px;
  color: #aaa;
  margin-top: 20px;
}
.startscreen .intro {
  font-size: 16px;
  margin-top: 20px;
  color: #444;
  max-width: 600px;
}
.startscreen .quote {
  font-style: italic;
  color: #666;
  margin-top: 40px;
}
.startscreen .start-hint {
  font-size: 14px;
  margin-top: 20px;
  color: #aaa;
}

/* Klassen für Schriftoptionen */
body.reader.serif {
  font-family: 'Alkes', serif;
}
body.reader.sans {
  font-family: 'Open Sans', sans-serif;
}
body.reader.ls-small #pages {
  line-height: 1.4;
}
body.reader.ls-medium #pages {
  line-height: 1.55;
}
body.reader.ls-large #pages {
  line-height: 1.8;
}
body.reader.font-small #pages {
  font-size: 15px;
}
body.reader.font-medium #pages {
  font-size: 17px;
}
body.reader.font-large #pages {
  font-size: 19px;
}

/* Vorschau-Box */
.preview {
  width: 90%;
  max-width: 100%;
  height: 300px;
  box-sizing: border-box;
  overflow-y: auto;
  margin: 0 auto;
}

/* Vorschau-Klassen */
.preview.serif {
  font-family: 'Alkes', serif;
}
.preview.sans {
  font-family: 'Open Sans', sans-serif;
}
.preview.ls-small {
  line-height: 1.4;
}
.preview.ls-medium {
  line-height: 1.55;
}
.preview.ls-large {
  line-height: 1.8;
}
.preview.font-small {
  font-size: 15px;
}
.preview.font-medium {
  font-size: 17px;
}
.preview.font-large {
  font-size: 19px;
}

/* Stealth-Scroll */
#stealth-scroll {
  position: absolute;
  top: 0;
  left: 0;
  height: 200vh;
  width: 1px;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

/* -- NEU: Premium-Panel hübsch stylen -- */
#premium-panel .lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#premium-panel p {
  margin-bottom: 1rem;
}

#premium-panel input[type="password"] {
  border: 1px solid #999;
  border-radius: 4px;
  padding: 8px;
  font-size: 16px;
}

#premium-panel button {
  background: #4b2e2e;
  color: #fff;
  border-radius: 4px;
  font-size: 16px;
  padding: 8px 16px;
  cursor: pointer;
  border: none;
}
#premium-panel button:hover {
  background: #2a1a1a;
}

/* NEU: Titelseite Overlay */
#titelseite-overlay {
  position: fixed;
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  background: #fff;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#titelseite-content {
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  overflow: auto;
  padding: 20px;
}

#titelseite-overlay.show {
  display: flex;
  animation: fadeIn 0s forwards;
}
#titelseite-overlay.hide {
  animation: shrinkOut 0.8s forwards;
}

@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}
@keyframes shrinkOut {
  0%   { transform: scale(1) translateY(0);   opacity:1; }
  100% { transform: scale(0.5) translateY(-100%); opacity:0; }
}

/* Desktop Ladebalken */
/* Deutlich sichtbarer Ladebalken */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;                    /* höher = auffälliger  */
  background: rgba(0,0,0,0.1);     /* leichter Kontrast   */
  z-index: 1000001;
  overflow: hidden;                /* Streifen begrenzen  */
}
#loading-overlay.hidden {
  display: none;
}

/* animierte Warn­farben + Diagonal­streifen */
#loading-overlay .loader-bar {
  width: 60%;
  height: 100%;
  background: repeating-linear-gradient(
                135deg,
                #ffcb00 0 14px,
                #ffc000 14px 28px
              );
  background-size: 28px 100%;
  animation: stripesSlide 0.8s linear infinite,
             pulseWidth   2.2s ease-in-out infinite;
  transform-origin: left;
}

@keyframes stripesSlide {
  from { background-position: 0 0; }
  to   { background-position: 28px 0; }
}
@keyframes pulseWidth {
  0%   { transform: scaleX(0.35); }
  50%  { transform: scaleX(0.95); }
  100% { transform: scaleX(0.35); }
}



/* Desktop: Titelseite ohne Scrollleisten darstellen */
@media (min-width: 769px){
  #titelseite-overlay        { overflow: hidden; }          /* Overlay selbst nicht scrollen */
  #titelseite-content        {
    max-height: none;        /* echte Höhe benutzen        */
    overflow: visible;       /* keine Scrollbalken         */
    box-sizing: border-box;  /* Padding wird eingerechnet  */
  }

  /* Bild oder SVG der Titelseite skaliert sich in die Fläche */
  #titelseite-content img,
  #titelseite-content svg{
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
}

