/* Datei: buch.css */

/* Grundlayout nur für Buchstil */
body.buchansicht {
  font-family: 'EB Garamond', serif;
  margin: 0;
  padding: 0;
  background: url('/static/images/Kaser1.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #333;
}

/* Buch-Layout */
.buch-container {
  display: flex;
  justify-content: center;
  padding: 4rem 1rem;
}

.buch-seite {
  background: url('/static/images/pergament.png') no-repeat center center;
  background-size: cover;
  padding: 2rem;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  min-height: 100vh;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  margin: 2rem auto;
}

.buch-titel {
  font-family: 'IM Fell English SC', serif;
  font-size: 2.8rem;
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  color: #2d2d2d;
}

/* Filter und Button */
.buch-filter { margin-bottom: 2rem; }

.buch-filter input,
.buch-filter a:not(.neuer-eintrag-button):not(.such-button),
.buch-filter button:not(.such-button) {
  margin: 0.2rem;
  padding: 0.5rem 1rem;
  border: 1px solid #999;
  border-radius: 4px;
  font-size: 1rem;
  text-decoration: none;
  background-color: #fff;
  color: #000;
  cursor: pointer;
}
.buch-filter button:hover,
.buch-filter a:hover { background-color: #b08c5a; }

/* Einträge */
.buch-eintrag {
  border-top: 1px dashed #bbb;
  padding: 0.8rem 0;
  margin-bottom: 0.5rem;
}

.eintrag-meta {
  font-style: italic;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  color: #555;
}

.eintrag-text {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  color: #2a1f14;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
}

/* Initialbuchstabe */
.eintrag-text::first-letter {
  font-size: 2.2rem;
  font-family: 'IM Fell English SC', serif;
  color: #3b2f1f;
  float: left;
  line-height: 1;
  padding-right: 0.2rem;
  margin-top: 0.2rem;
}

/* Bildliste */
.eintrag-bilder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

/* Link-Wrapper neutral halten */
body.buchansicht .eintrag-bilder a {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  display: inline-block;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Bildvorschau – Rahmen direkt am IMG */
body.buchansicht .eintrag-bilder img.buch-bild {
  width: auto !important;
  height: auto !important;
  max-width: 200px;
  max-height: 200px;
  border: 4px double #5c4324;
  border-radius: 6px;
  padding: 4px;
  background-color: #d6c4a0;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.25);
  display: block;
  transition: transform 0.2s ease;
}

/* --- Hover-Zoom nur bei Geräten mit Maus --- */
@media (hover: hover) and (pointer: fine) {
  body.buchansicht .eintrag-bilder img.buch-bild:hover {
    transform: scale(2);
  }
}

/* --- Kein Zoom & keine Transition auf Touch --- */
@media (hover: none), (pointer: coarse) {
  body.buchansicht .eintrag-bilder img.buch-bild {
    transform: none !important;
    transition: none !important;
  }
  body.buchansicht .eintrag-bilder a:active img.buch-bild,
  body.buchansicht .eintrag-bilder a:focus img.buch-bild {
    transform: none !important;
  }
}

/* Mobile Overrides */
@media (max-width: 768px) {
  body.buchansicht .eintrag-bilder img.buch-bild {
    max-width: 70vw !important;
    max-height: 70vh !important;
  }
}

@media (max-width: 480px) {
  body.buchansicht .eintrag-bilder img.buch-bild {
    max-width: 85vw !important;
    max-height: 85vh !important;
  }
}

/* Sonstiges */
.keine-eintraege {
  text-align: center;
  color: #555;
  margin-top: 2rem;
}

.meta-zeile {
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 0.4rem;
  color: #333;
}

.button-leiste {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 1.5rem;
}

.buch-filter label {
  margin: 0 0.3rem;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  color: #3e2f1c;
}

.filter-felder {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.filter-felder label {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  color: #3e2f1c;
}

#filter-form { display: none; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

.neuer-eintrag-button,
.such-button {
  background-color: #8c6b41;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease;
  display: inline-block;
}
.neuer-eintrag-button:hover,
.such-button:hover { background-color: #7a5a38; }

.pagination { text-align: center; margin-top: 1rem; }
.pagination a,
.pagination span.current {
  margin: 0 0.25rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid #8c6b41;
  border-radius: 4px;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  text-decoration: none;
  color: #3e2f1c;
  background-color: #f5eee0;
}
.pagination span.current { font-weight: bold; background-color: #d7c3a3; }

.page-footer {
  text-align: center;
  background-color: rgba(96, 72, 48, 0.9);
  padding: 1rem 0;
  color: #fef9f5;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  margin-top: 2rem;
  border-top: 1px solid #c4b49a;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}
.page-footer a {
  color: #f5e5c8;
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.2s ease;
}
.page-footer a:hover { color: #ffffff; text-decoration: underline; }

/* Bildhöhe fix (Rahmen proportional) */
body.buchansicht .eintrag-bilder img.buch-bild {
  height: 200px !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain;
}

/* Tablet */
@media (max-width: 768px) {
  body.buchansicht .eintrag-bilder img.buch-bild {
    height: 160px !important;
  }
}

/* Phone */
@media (max-width: 480px) {
  body.buchansicht .eintrag-bilder img.buch-bild {
    height: 140px !important;
  }
}
