/* ─────────────────────────────────────────────────────────────────────────────
 * Feature-Tabs — moderner GIF-Showcase mit Tab-Navigation & Auto-Advance
 * ───────────────────────────────────────────────────────────────────────────── */

.tf-section--ftabs {
  background: linear-gradient(180deg, var(--tf-bg-elev) 0%, var(--tf-bg) 55%, var(--tf-bg-elev) 100%);
  overflow: hidden;
}

/* ── Outer grid: nav + stage ── */
.tf-ftabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 1060px;
  margin: 0 auto;
}

@media (min-width: 860px) {
  .tf-ftabs {
    grid-template-columns: 258px 1fr;
    gap: 2rem;
    align-items: start;
  }
}

/* ── Navigation: horizontal scroll on mobile, vertical on desktop ── */
.tf-ftabs__nav {
  display: flex;
  flex-direction: row;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.125rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.tf-ftabs__nav::-webkit-scrollbar {
  display: none;
}

@media (min-width: 860px) {
  .tf-ftabs__nav {
    flex-direction: column;
    overflow-x: visible;
    padding: 0;
    gap: 0.3rem;
  }
}

/* ── Tab button ── */
.tf-ftabs__btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  text-align: left;
  color: var(--tf-text);
  transition:
    background 0.2s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
  overflow: hidden;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: max-content;
}

@media (min-width: 860px) {
  .tf-ftabs__btn {
    white-space: normal;
    min-width: unset;
    width: 100%;
    align-items: flex-start;
    padding: 0.85rem 1rem;
  }
}

.tf-ftabs__btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(15, 23, 42, 0.1);
}

.tf-ftabs__btn.is-active {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow:
    0 2px 8px rgba(15, 23, 42, 0.06),
    0 8px 28px rgba(37, 99, 235, 0.09);
}

/* ── Icon chip ── */
.tf-ftabs__icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--tf-accent);
  transition: background 0.2s ease;
}

.tf-ftabs__icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tf-ftabs__btn.is-active .tf-ftabs__icon {
  background: rgba(37, 99, 235, 0.14);
}

@media (max-width: 859px) {
  .tf-ftabs__icon {
    display: none;
  }
}

/* ── Text block ── */
.tf-ftabs__text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.tf-ftabs__name {
  font-size: 0.91rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--tf-text);
  line-height: 1.3;
}

.tf-ftabs__desc {
  font-size: 0.77rem;
  line-height: 1.45;
  color: var(--tf-muted);
  white-space: normal;
  /* reveal on active (desktop only) */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition:
    max-height 0.35s var(--tf-ease-soft),
    opacity 0.3s ease,
    margin-top 0.3s ease;
}

@media (min-width: 860px) {
  .tf-ftabs__btn.is-active .tf-ftabs__desc {
    max-height: 5rem;
    opacity: 1;
    margin-top: 0.25rem;
  }
}

@media (max-width: 859px) {
  .tf-ftabs__desc {
    display: none;
  }
}

/* ── Progress bar ── */
.tf-ftabs__prog {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(37, 99, 235, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tf-ftabs__btn.is-active .tf-ftabs__prog {
  opacity: 1;
}

.tf-ftabs__prog-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 1px;
  will-change: width;
}

/* ── Stage ── */
.tf-ftabs__stage {
  position: relative;
  border-radius: var(--tf-radius-lg);
  overflow: hidden;
  background: #0d1117;
  border: 1px solid rgba(59, 130, 246, 0.18);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    0 4px 16px rgba(15, 23, 42, 0.1),
    0 24px 64px rgba(15, 23, 42, 0.24);
  aspect-ratio: 16 / 9;
}

/* Top highlight line */
.tf-ftabs__stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 160, 250, 0.55), transparent);
  z-index: 3;
  pointer-events: none;
}

/* ── Panels ── */
.tf-ftabs__panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.42s ease;
  pointer-events: none;
}

.tf-ftabs__panel.is-active {
  opacity: 1;
  pointer-events: auto;
}

.tf-ftabs__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Hero mouse-follow glow layer ── */
.tf-hero--cinema {
  --tf-cursor-x: 62%;
  --tf-cursor-y: 42%;
}

.tf-hero--cinema .tf-cinema-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 520px 420px at var(--tf-cursor-x) var(--tf-cursor-y),
    rgba(59, 130, 246, 0.07),
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
  transition: background 0.06s linear;
}

/* ── Einblicke: Nav von links, Stage von rechts (wie Promo-Slides) ── */
html.tf-reveal-js #einblicke .tf-ftabs__nav.tf-reveal:not(.is-visible),
html.tf-reveal-js #einblicke .tf-ftabs__stage.tf-reveal:not(.is-visible) {
  opacity: 0;
  transition:
    opacity 0.95s var(--tf-ease-spring),
    transform 0.95s var(--tf-ease-spring);
}

html.tf-reveal-js #einblicke .tf-ftabs__nav.tf-reveal.tf-reveal--slide-wide.tf-reveal--left:not(.is-visible) {
  transform: translate3d(-72px, 10px, 0);
}

html.tf-reveal-js #einblicke .tf-ftabs__stage.tf-reveal.tf-reveal--slide-wide.tf-reveal--right:not(.is-visible) {
  transform: translate3d(72px, 10px, 0);
}

#einblicke .tf-ftabs__nav.tf-reveal.is-visible,
#einblicke .tf-ftabs__stage.tf-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

#einblicke .tf-ftabs__stage.tf-reveal.tf-reveal--delay-1.is-visible {
  transition-delay: 0.14s;
}

@media (max-width: 859px) {
  html.tf-reveal-js #einblicke .tf-ftabs__nav.tf-reveal.tf-reveal--slide-wide.tf-reveal--left:not(.is-visible) {
    transform: translate3d(-28px, 18px, 0);
  }

  html.tf-reveal-js #einblicke .tf-ftabs__stage.tf-reveal.tf-reveal--slide-wide.tf-reveal--right:not(.is-visible) {
    transform: translate3d(28px, 18px, 0);
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .tf-ftabs__panel {
    transition: none;
  }

  .tf-ftabs__desc {
    transition: none;
  }

  .tf-hero--cinema .tf-cinema-layer::after {
    display: none;
  }
}
