/*
 * Blog-Lookbook: Galerien in Beitraegen als Polaroid-Wand.
 *
 * Standard: Polaroids in Spalten unter dem Text.
 * Galerie-Stil "Polaroids rechts": inc/lookbook.php setzt Text und Galerie in
 * zwei Spalten (.lb-text und .lb-wand-seite).
 * Hotspots, Vorher-Nachher und Video schreibt inc/lookbook.php in das Bild;
 * bedient werden sie von assets/js/blog-lookbook.js.
 */
.blog-body {
  --lb-papier: #fffaf1;
  --lb-tinte: #1f2328;
  --lb-gedaempft: #4a3f31;
  --lb-terra: #b8236e;
  --lb-hand: var(--font-hand, "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive);
}

/* ---------- Wand ---------- */
.blog-body .wp-block-gallery.has-nested-images:not(#lb) {
  display: block;
  columns: 3 240px;
  column-gap: clamp(1.4rem, 3vw, 2.4rem);
  gap: 0;
  margin: 2.2rem 0 1rem;
  padding: 1.6rem 0 0;
  border-top: 1px dashed #d6ccbe;
}
.blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:not(#lb) {
  display: block;
  position: relative;
  width: auto;
  max-width: none;
  margin: 0 0 clamp(1.6rem, 3vw, 2.4rem);
  padding: 0.65rem 0.65rem 0;
  break-inside: avoid;
  background: var(--lb-papier);
  box-shadow: 0 1px 0 #d6ccbe, 0 18px 34px -16px rgba(60, 38, 18, 0.55);
  transform: rotate(var(--tilt, -1.2deg));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}
.blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:nth-child(even):not(#lb) {
  --tilt: 1deg;
}
.blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:nth-child(3n):not(#lb) {
  --tilt: -0.4deg;
}
.blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:not(#lb)::before {
  content: none;
  display: none;
}
.blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:not(#lb) img {
  display: block;
  flex: none;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: cover;
}
.blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:not(#lb) figcaption {
  position: static;
  width: auto;
  max-height: none;
  margin: 0;
  padding: 0.7rem 0.3rem 0.9rem;
  overflow: visible;
  background: none;
  color: var(--lb-tinte);
  font-family: var(--lb-hand);
  font-size: 1.02rem;
  line-height: 1.4;
  text-align: center;
  text-shadow: none;
  -webkit-mask-image: none;
  mask-image: none;
}
.blog-body .wp-block-gallery figcaption a {
  color: var(--lb-terra);
}
.lb-imbild {
  display: block;
  margin-top: 0.25rem;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  color: var(--lb-gedaempft);
}
.blog-body .wp-block-gallery figcaption .lb-imbild a {
  color: var(--lb-terra);
}

/* ---------- Foto-Flaeche ---------- */
.blog-body .lb-foto {
  position: relative;
  display: block;
  overflow: hidden;
  background: #ece2d2;
}
.blog-body .lb-foto > img,
.blog-body .lb-foto > a > img {
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.blog-body .wp-block-gallery .lb-foto::after {
  /* Sandboee mit Glitzer, wie am Wegweiser */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: url("assets/wegweiser-sand-fein.svg") 0 0 / 160px 70px repeat;
  -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 47%, #000 53%, transparent 65%);
  mask-image: linear-gradient(100deg, transparent 35%, #000 47%, #000 53%, transparent 65%);
  -webkit-mask-size: 300% 100%;
  mask-size: 300% 100%;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  opacity: 0;
}

/* ---------- Hotspots ---------- */
.lb-punkt:not(#lb) {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 3;
  inline-size: 2.4rem;
  block-size: 2.4rem;
  min-width: 0;
  min-height: 0;
  margin: -1.2rem 0 0 -1.2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.lb-punkt::before,
.lb-punkt::after {
  content: "";
  position: absolute;
  inset: 0.65rem;
  border-radius: 50%;
}
.lb-punkt::before {
  background: radial-gradient(circle, #fff 0 32%, #b8236e 35% 100%);
  box-shadow: 0 0 0 2px rgba(255, 250, 241, 0.95), 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}
.lb-punkt::after {
  border: 2px solid #fffaf1;
  opacity: 0;
}
.lb-punkt:hover::before,
.lb-punkt[aria-expanded="true"]::before {
  transform: scale(1.25);
}
.lb-punkt:not(#lb):focus-visible {
  outline: 3px solid #fffaf1;
  outline-offset: -2px;
  box-shadow: 0 0 0 5px #b8236e;
}

.lb-karteikarte {
  position: absolute;
  left: 50%;
  z-index: 5;
  width: min(12.5rem, 84%);
  padding: 0.55rem 0.55rem 0.7rem;
  transform: translateX(-50%);
  background: #fffaf1;
  border-radius: 0.5rem;
  box-shadow: 0 16px 34px -12px rgba(0, 0, 0, 0.6);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.85rem;
  line-height: 1.35;
  text-align: center;
  color: #1f2328;
}
.lb-karteikarte[hidden] {
  display: none;
}
.lb-karteikarte--oben {
  top: 3%;
}
.lb-karteikarte--unten {
  bottom: 3%;
}
.blog-body .lb-karteikarte img:not(#lb) {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.3rem;
  background: #ece2d2;
}
.lb-karteikarte__name {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--lb-hand);
  font-size: 0.98rem;
}
.lb-karteikarte__preis {
  display: block;
  color: #4a3f31;
}
.lb-karteikarte a.lb-karteikarte__link:not(#lb) {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.35rem 0.9rem;
  background: var(--brush-block, #141210) center / 100% 100% no-repeat;
  color: #fffaf1;
  font-family: var(--lb-hand);
  text-decoration: none;
  box-shadow: none;
}
.lb-karteikarte a.lb-karteikarte__link:focus-visible {
  outline: 3px solid #b8236e;
  outline-offset: 2px;
}
.lb-karteikarte__zu:not(#lb) {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  z-index: 1;
  inline-size: 2rem;
  block-size: 2rem;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 18, 16, 0.78);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.lb-karteikarte__zu:focus-visible {
  outline: 3px solid #b8236e;
  outline-offset: 1px;
}

/* ---------- Vorher-Nachher ---------- */
.blog-body .lb-vergleich {
  --pos: 50%;
}
.blog-body .lb-vergleich > img.lb-vergleich__oben:not(#lb) {
  position: absolute;
  inset: 0;
  z-index: 1;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.lb-vergleich__linie {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 2;
  width: 3px;
  margin-left: -1.5px;
  background: #fffaf1;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.lb-vergleich__linie::after {
  content: "\2194";
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  inline-size: 2.6rem;
  block-size: 2.6rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fffaf1;
  color: #b8236e;
  font-size: 1.3rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.lb-vergleich input[type="range"]:not(#lb) {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: ew-resize;
}
.lb-vergleich:has(input:focus-visible) {
  outline: 3px solid #b8236e;
  outline-offset: 3px;
}
.lb-etikett {
  position: absolute;
  top: 0.6rem;
  z-index: 2;
  max-width: 45%;
  padding: 0.15rem 0.6rem;
  background: rgba(20, 18, 16, 0.78);
  color: #fffaf1;
  font-family: var(--lb-hand);
  font-size: 0.85rem;
  border-radius: 999px;
  pointer-events: none;
}
.lb-etikett--links {
  left: 0.6rem;
}
.lb-etikett--rechts {
  right: 0.6rem;
}

/* ---------- Video ---------- */
.blog-body .lb-video > video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lb-video-knopf:not(#lb) {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  z-index: 3;
  inline-size: 2.6rem;
  block-size: 2.6rem;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 18, 16, 0.78);
  color: #fffaf1;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.lb-video-knopf:focus-visible {
  outline: 3px solid #fffaf1;
  outline-offset: 2px;
}

/* ---------- Polaroids rechts ---------- */
.blog-body:has(> .lb-wand-seite) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 32%, 360px);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.blog-body > .lb-text > :first-child {
  margin-top: 0;
}
.blog-body > .lb-wand-seite .wp-block-gallery.has-nested-images:not(#lb) {
  columns: auto;
  margin: 0;
  padding: 0;
  border: 0;
}
@media (max-width: 860px) {
  .blog-body:has(> .lb-wand-seite) {
    grid-template-columns: 1fr;
  }
  .blog-body > .lb-wand-seite .wp-block-gallery.has-nested-images:not(#lb) {
    columns: 2 220px;
    padding-top: 1.6rem;
    border-top: 1px dashed #d6ccbe;
  }
}

/* ---------- Bewegung ---------- */
@media (hover: hover) and (pointer: fine) {
  .blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:not(#lb):hover,
  .blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:not(#lb):focus-within {
    transform: rotate(0deg) translateY(-8px);
    box-shadow: 0 1px 0 #d6ccbe, 0 26px 40px -16px rgba(60, 38, 18, 0.6);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .blog-body .wp-block-gallery figure.wp-block-image:hover .lb-foto::after {
    animation: lb-sand 1.5s ease-out forwards;
  }
  .lb-punkt::after {
    animation: lb-puls 2.2s ease-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:not(#lb),
  .blog-body .lb-foto > img {
    transition: none;
  }
}
@keyframes lb-sand {
  0% {
    opacity: 0;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}
@keyframes lb-puls {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .blog-body .wp-block-gallery.has-nested-images:not(#lb) {
    columns: 1;
  }
  .blog-body .wp-block-gallery.has-nested-images figure.wp-block-image:not(#lb) {
    max-width: 26rem;
    margin-inline: auto;
  }
}
