:root {
  --video-viewport-h: 100dvh;
}

.video-feed {
  position: relative;
  height: var(--video-viewport-h);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  background: #000;
  overscroll-behavior-y: contain;
  font-family: var(--font-sans);
  line-height: var(--line-height-body);
}

.video-feed::-webkit-scrollbar {
  display: none;
}

.video-slide {
  position: relative;
  height: var(--video-viewport-h);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}

.video-slide__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.video-slide__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(28px) brightness(0.45) saturate(1.1);
  transform: scale(1.08);
  pointer-events: none;
}

.video-slide__frame {
  position: relative;
  z-index: 1;
  aspect-ratio: 9 / 16;
  height: var(--video-viewport-h);
  width: auto;
  max-width: 100%;
  max-height: var(--video-viewport-h);
  overflow: hidden;
  background: #000;
}

.video-slide__media {
  position: absolute;
  inset: 0;
}

.video-slide__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #000;
}

.video-slide__gradient {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  pointer-events: none;
}

.video-slide__meta {
  position: absolute;
  z-index: 3;
  left: 0.85rem;
  right: 5.25rem;
  bottom: calc(var(--tabbar-occupied) + 0.85rem);
  min-width: 0;
  pointer-events: auto;
}

.video-slide__author {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

.video-slide__caption {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-slide__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
}

.video-slide__tag {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.85);
}

.video-slide__article-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  text-decoration: none;
}

.video-slide__article-link:hover {
  text-decoration: underline;
}

.video-slide__actions {
  position: absolute;
  z-index: 3;
  right: 0.85rem;
  bottom: calc(var(--tabbar-occupied) + 4.25rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  pointer-events: auto;
}

.video-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

.video-action__chip {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  box-sizing: border-box;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(44px) saturate(2.1) brightness(1.14);
  -webkit-backdrop-filter: blur(44px) saturate(2.1) brightness(1.14);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.32),
    0 4px 12px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -16px 24px rgba(255, 255, 255, 0.04);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.2, 0.64, 1),
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.video-action__chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.1) 26%,
    rgba(255, 255, 255, 0.02) 50%,
    transparent 74%
  );
}

.video-action__chip::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    120% 80% at 50% 0%,
    rgba(255, 255, 255, 0.14) 0%,
    transparent 55%
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.video-action__chip .video-action__icon {
  position: relative;
  z-index: 1;
}

.video-action:hover .video-action__chip {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 6px 18px rgba(0, 0, 0, 0.22);
}

.video-action:active .video-action__chip {
  transform: scale(0.92);
}

.video-action__icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  flex-shrink: 0;
  shape-rendering: geometricPrecision;
}

.video-action.is-liked {
  color: #ff375f;
}

.video-action.is-liked .video-action__chip {
  background: rgba(255, 55, 95, 0.22);
  border-color: rgba(255, 120, 150, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 6px 20px rgba(255, 55, 95, 0.25);
}

.video-action.is-liked .video-action__icon {
  fill: #ff375f;
  stroke: none;
}

.video-action.is-unmuted .video-action__chip {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

@media (prefers-reduced-transparency: reduce) {
  .video-action__chip {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(18, 18, 20, 0.82);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  }

  .video-action__chip::before,
  .video-action__chip::after {
    display: none;
  }

  .video-action.is-liked .video-action__chip {
    background: rgba(255, 55, 95, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-action__chip {
    transition: none;
  }
}

.video-feed__empty,
.video-feed__error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
}

.video-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-occupied) + 1rem);
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.video-toast.is-visible {
  opacity: 1;
}

@media (min-width: 768px) {
  :root {
    --video-viewport-h: 100dvh;
  }

  .video-slide__meta {
    left: max(0.85rem, calc((100% - calc(var(--video-viewport-h) * 9 / 16)) / 2 + 0.85rem));
    right: max(5.25rem, calc((100% - calc(var(--video-viewport-h) * 9 / 16)) / 2 + 5.25rem));
    bottom: 0.85rem;
  }

  .video-slide__actions {
    right: max(0.85rem, calc((100% - calc(var(--video-viewport-h) * 9 / 16)) / 2 + 0.85rem));
    bottom: 4.25rem;
  }

  .video-toast {
    bottom: 1.5rem;
  }
}

.bibliothek-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
}

@media (min-width: 640px) {
  .bibliothek-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 1.5rem;
  }
}

.bibliothek-card {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--shell-bg-muted, #f3f5f0);
}

.bibliothek-card__thumb {
  aspect-ratio: 9 / 16;
  background: #111;
  position: relative;
}

.bibliothek-card__thumb video,
.bibliothek-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bibliothek-card--article .bibliothek-card__thumb {
  aspect-ratio: 16 / 9;
  background: var(--shell-bg-muted, #f3f5f0);
}

.bibliothek-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.5rem;
  opacity: 0.5;
}

.bibliothek-card__caption {
  padding: 0.5rem 0.65rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.3;
}

.bibliothek-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--shell-muted);
}

.page-artikel-header {
  padding: 1rem 1.5rem 0;
}

.page-artikel-header h1 {
  margin: 0;
  font-size: 1.5rem;
}
