/* ================================================================
   STYLE.CSS – Autoren-Webseite
   Farbpalette:
     Creme (Hintergrund):  #FAF3E0
     Dunkelbraun (Text):   #3E2723
     Gold (Akzent):        #C8A96E
     Gold hell:            #E8D5A3
     Gold dunkel (Hover):  #A8893E
   ================================================================ */

/* ----------------------------------------------------------------
   RESET & BASIS
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #FAF3E0;
  color: #3E2723;
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

/* ----------------------------------------------------------------
   TYPOGRAFIE
   ---------------------------------------------------------------- */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  color: #3E2723;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.5rem;
}

/* Goldener Unterstrich unter Kategorietiteln */
h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: #C8A96E;
  margin-top: 0.4rem;
  border-radius: 2px;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.6rem 0 0.8rem;
  line-height: 1.3;
}

a {
  color: #C8A96E;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------------
   HEADER
   ---------------------------------------------------------------- */
header {
  background: linear-gradient(135deg, #3E2723 0%, #5D3A1A 100%);
  color: #FAF3E0;
  padding: 2.5rem 2rem 2rem;
  border-bottom: 4px solid #C8A96E;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.header-text {
  flex: 1;
  min-width: 0;
}

header h1 {
  color: #E8D5A3;
}

.tagline {
  margin-top: 0.4rem;
  font-size: 1rem;
  font-weight: 300;
  color: #C8A96E;
  letter-spacing: 0.04em;
}

/* ----------------------------------------------------------------
   LÄNDERWÄHLER
   ---------------------------------------------------------------- */
.store-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.store-selector label {
  font-size: 1.2rem;
  cursor: default;
}

#country-select {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid #C8A96E;
  border-radius: 6px;
  color: #E8D5A3;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: background 0.2s;
}

#country-select:hover,
#country-select:focus {
  background: rgba(200, 169, 110, 0.25);
  outline: none;
}

#country-select option {
  background: #3E2723;
  color: #FAF3E0;
}

/* ----------------------------------------------------------------
   KATEGORIE-NAVIGATION
   ---------------------------------------------------------------- */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  padding: 1.5rem 1.5rem 0.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.category-nav a {
  display: inline-block;
  padding: 0.4rem 1.1rem;
  border: 2px solid #C8A96E;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #3E2723;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.category-nav a:hover {
  background: #C8A96E;
  color: #FAF3E0;
  text-decoration: none;
}

/* ----------------------------------------------------------------
   HAUPT-LAYOUT
   ---------------------------------------------------------------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ----------------------------------------------------------------
   KATEGORIE-SEKTION
   ---------------------------------------------------------------- */
.category {
  margin-top: 3rem;
  padding-top: 1rem;
}

/* ----------------------------------------------------------------
   BUCH-RASTER
   ---------------------------------------------------------------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.6rem;
}

/* ----------------------------------------------------------------
   BUCH-KACHEL
   ---------------------------------------------------------------- */
.book-card {
  background: #fff;
  border: 1px solid #E8D5A3;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(62, 39, 35, 0.15);
}

/* Hauptcover-Bild */
.book-card .main-cover {
  width: 100%;
  max-width: 160px;
  height: 210px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 2px 4px 10px rgba(62, 39, 35, 0.2);
}

/* Vorschaubild-Leiste */
.preview-images {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 0.5rem;
  min-height: 0;
}

.preview-images img {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #E8D5A3;
  cursor: zoom-in;
  transition: opacity 0.15s;
}

.preview-images img:hover {
  opacity: 0.8;
}

/* Kein Abstand wenn keine Vorschaubilder vorhanden */
.preview-images:empty {
  display: none;
}

/* ----------------------------------------------------------------
   BUCHBESCHREIBUNG
   ---------------------------------------------------------------- */
.book-desc {
  font-size: 0.78rem;
  color: #6D4C41;
  line-height: 1.4;
  margin: 0 0 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ----------------------------------------------------------------
   KAUFEN-BUTTON
   ---------------------------------------------------------------- */
.buy-btn {
  display: inline-block;
  margin-top: auto;
  padding: 0.55rem 1.1rem;
  background: #C8A96E;
  color: #FAF3E0;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  border-radius: 4px;
  transition: background 0.2s;
  text-decoration: none;
}

.buy-btn:hover {
  background: #A8893E;
  text-decoration: none;
  color: #FAF3E0;
}

/* ----------------------------------------------------------------
   KONTAKT
   ---------------------------------------------------------------- */
.contact {
  margin-top: 4rem;
  text-align: center;
  background: #fff;
  border: 1px solid #E8D5A3;
  border-radius: 8px;
  padding: 2.5rem 2rem;
}

.contact p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  color: #5D4037;
}

.contact-link {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #3E2723;
  border-bottom: 2px solid #C8A96E;
  padding-bottom: 2px;
  transition: color 0.2s;
}

.contact-link:hover {
  color: #A8893E;
  text-decoration: none;
}

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */
footer {
  background: #3E2723;
  color: #C8A96E;
  text-align: center;
  padding: 1.8rem 1.5rem;
  font-size: 0.88rem;
  line-height: 1.8;
}

footer a {
  color: #E8D5A3;
}

footer a:hover {
  color: #fff;
}

.affiliate-hint {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: #9E7D5A;
}

/* ----------------------------------------------------------------
   LADEINDIKATOR
   ---------------------------------------------------------------- */
#loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Lato', sans-serif;
  color: #9E7D5A;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}

/* ----------------------------------------------------------------
   RESPONSIVE ANPASSUNGEN
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }

  .book-card .main-cover {
    height: 175px;
  }

  header {
    padding: 2.5rem 1rem 2rem;
  }
}
