/* BuchFairHandlung – Startseite: Atmosphäre, Wimpel-Hero, Weltenwahl-Farben */

/* Atmosphäre: warmes Licht hinter dem Hero + feine Papierstruktur */
.welt-dachmarke {
  background-color: var(--papier);
  background-image:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="240"><filter id="p"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2" stitchTiles="stitch"/><feColorMatrix type="matrix" values="0 0 0 0 0.129 0 0 0 0 0.114 0 0 0 0 0.086 0 0 0 0.045 0"/></filter><rect width="240" height="240" filter="url(%23p)"/></svg>'),
    radial-gradient(ellipse 90% 55% at 50% 0%, #FDF9F0 0%, rgba(253, 249, 240, 0) 70%);
}

.hero {
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 0 1.5rem var(--abstand-block);
}

@keyframes einhaengen {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
}

@keyframes linie-ziehen {
  to {
    transform: scaleX(1);
  }
}

@keyframes pendeln {
  from {
    transform: rotate(0.8deg);
  }
  to {
    transform: rotate(-0.8deg);
  }
}

/* Der Logo-Wimpel hängt wie ein Ladenschild aus dem oberen Seitenschnitt
   und pendelt kaum merklich, als striche Luft durch den Laden */
.wimpel {
  margin: 0;
  line-height: 0;
}

html.anim .wimpel {
  animation: einhaengen 700ms var(--kurve-aus) backwards;
}

.wimpel img {
  width: clamp(200px, 30vw, 300px);
  height: auto;
  filter: drop-shadow(0 12px 20px rgba(33, 29, 22, 0.20));
  transform-origin: 50% 0;
  animation: pendeln 7s ease-in-out 1.2s infinite alternate;
}

.claim {
  font-family: var(--schrift-lese);
  font-style: italic;
  font-size: clamp(1.15rem, 1rem + 0.9vw, 1.55rem);
  color: var(--tinte);
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
}

html.anim .claim {
  animation: aufblenden 600ms var(--kurve-aus) 180ms backwards;
}

.claim::before {
  content: "";
  display: block;
  width: 72px;
  height: 1px;
  background: var(--messing);
  margin: 0 auto 1.1rem;
}

html.anim .claim::before {
  transform: scaleX(0);
  animation: linie-ziehen 700ms var(--kurve-aus) 500ms forwards;
}

.untertitel {
  font-family: var(--schrift-sach);
  font-size: var(--groesse-klein);
  letter-spacing: 0.04em;
  color: var(--neben);
  margin-top: 0.7rem;
}

html.anim .untertitel {
  animation: aufblenden 600ms var(--kurve-aus) 280ms backwards;
}

.hero-frage {
  font-family: var(--schrift-lese);
  font-style: italic;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  color: var(--neben);
  margin-top: clamp(1.8rem, 4vw, 2.8rem);
}

html.anim .hero-frage {
  animation: aufblenden 600ms var(--kurve-aus) 380ms backwards;
}

/* Die zwei Welten als Bildportale: Text oben, Szene darunter.
   Beim Überfahren verwandelt sich die Szene (Brandschutz fängt Feuer,
   die Fantasie-Bibliothek wird zur Knetwelt). */
/* Auf der Startseite immer genau zwei ausgewogene Portalspalten */
.weltenwahl {
  grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr));
}

/* Subgrid: Textzeile und Bildzeile beider Portale teilen sich die Höhen –
   die Bilder liegen dadurch exakt parallel, egal wie der Text umbricht */
.portal-bild {
  position: relative;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
  gap: 0.95rem;
  text-decoration: none;
}

html.anim .portal-bild {
  animation: aufblenden 650ms var(--kurve-aus) backwards;
}

html.anim .portal-bild--fachbuch {
  animation-delay: 480ms;
}

html.anim .portal-bild--belletristik {
  animation-delay: 580ms;
}

.pb-text {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pb-kicker {
  font-family: var(--schrift-lese);
  font-style: italic;
  font-size: var(--groesse-klein);
}

.portal-bild--fachbuch .pb-kicker {
  color: #23606E;
}

.portal-bild--belletristik .pb-kicker {
  color: #8A5A1F;
}

.pb-titel {
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.8rem);
  line-height: 1.15;
}

.portal-bild--fachbuch .pb-titel {
  font-family: var(--schrift-sach);
  font-weight: 600;
  color: #182530;
}

.portal-bild--belletristik .pb-titel {
  font-family: var(--schrift-marke);
  font-weight: 540;
  color: #33261A;
}

.pb-themen {
  font-size: var(--groesse-klein);
  line-height: 1.6;
}

.portal-bild--fachbuch .pb-themen {
  font-family: var(--schrift-sach);
  color: #4A5A64;
}

.portal-bild--belletristik .pb-themen {
  font-family: var(--schrift-lese);
  color: #6B5636;
}

.pb-cta {
  font-size: var(--groesse-klein);
  font-weight: 500;
  margin-top: auto;
  padding-top: 0.15rem;
}

.portal-bild--fachbuch .pb-cta {
  font-family: var(--schrift-sach);
  color: #23606E;
}

.portal-bild--belletristik .pb-cta {
  font-family: var(--schrift-lese);
  color: var(--einbandrot);
}

.pb-cta .pfeil {
  display: inline-block;
  transition: transform var(--dauer-normal) var(--kurve-aus);
}

.portal-bild:hover .pfeil,
.portal-bild:focus-visible .pfeil {
  transform: translateX(5px);
}

.pb-buehne {
  position: relative;
  display: block;
  aspect-ratio: 1672 / 941;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 32px -20px rgba(33, 29, 22, 0.4);
  transition: transform var(--dauer-normal) var(--kurve-aus), box-shadow var(--dauer-normal) var(--kurve-aus);
}

.pb-buehne img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb-wechsel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 650ms ease;
}

.portal-bild:hover .pb-wechsel,
.portal-bild:focus-visible .pb-wechsel {
  opacity: 1;
}

.portal-bild:hover .pb-buehne,
.portal-bild:focus-visible .pb-buehne {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px -20px rgba(33, 29, 22, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .portal-bild:hover .pb-buehne,
  .portal-bild:focus-visible .pb-buehne {
    transform: none;
  }
}

/* Autorenhinweis */
.autor {
  max-width: var(--breite-text);
  margin-inline: auto;
  padding: 0 1.5rem var(--abstand-sektion);
  text-align: center;
}

.autor h2 {
  font-family: var(--schrift-marke);
  font-weight: 560;
  font-size: var(--groesse-h2);
  margin-bottom: 0.9rem;
}

.autor p {
  color: var(--neben);
}

/* Sanftes Einblenden beim Scrollen, nur wo der Browser es nativ kann */
@supports (animation-timeline: view()) {
  .autor {
    animation: aufblenden both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}
