/* ══════════════════════════════════════════════════════════
   FachTap · Portfolio-Popup
   Datei wird nur geladen wenn die Karte ein "portfolio" Feld hat.
   ══════════════════════════════════════════════════════════ */

.pf-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 2, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.pf-backdrop.is-open { opacity: 1; pointer-events: auto; }
.pf-backdrop[hidden] { display: none; }

.pf-popup {
  width: 100%;
  max-width: 400px;
  max-height: 92vh;
  background: #0d0c08;
  border: 1px solid rgba(212, 160, 23, 0.16);
  border-radius: 20px;
  box-shadow:
    0 30px 70px -10px rgba(0,0,0,0.85),
    inset 0 0 0 1px rgba(255,255,255,0.02);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: scale(0.94) translateY(8px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), opacity 0.3s ease;
  position: relative;
}
.pf-backdrop.is-open .pf-popup { transform: scale(1) translateY(0); opacity: 1; }

/* Close-Button top-right */
.pf-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 4;
  appearance: none;
  background: rgba(10, 8, 4, 0.55);
  border: 1px solid rgba(245, 230, 184, 0.25);
  color: #f5e6b8;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pf-close:hover { border-color: #D4A017; background: rgba(212,160,23,0.15); transform: scale(1.06); }
.pf-close svg { width: 12px; height: 12px; }

/* Category chip top-left */
.pf-category {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 4;
  padding: 5px 11px;
  background: rgba(10, 8, 4, 0.55);
  border: 1px solid rgba(245, 230, 184, 0.2);
  color: #f5e6b8;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.28s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Bild-Bereich — FIXED 4:5 Aspect, Cross-Fade zwischen 2 Layern */
.pf-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #0f0d08;
  overflow: hidden;
  touch-action: pan-y;
}
.pf-image-layer {
  position: absolute;
  inset: 0;
  background-color: #0f0d08;
  opacity: 0;
  transform: scale(1);
  transition: opacity 0.35s ease, filter 0.35s ease;
  will-change: opacity, transform;
  background-size: cover;
  background-position: center;
}
.pf-image-layer.active {
  opacity: 1;
  animation: pf-ken-burns 14s ease-in-out infinite alternate;
}
.pf-image-layer.swiping { filter: blur(6px); }
@keyframes pf-ken-burns {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.04) translate(-1%, -1%); }
}
@media (prefers-reduced-motion: reduce) {
  .pf-image-layer.active { animation: none; }
}

/* Text-Overlay auf Bild */
.pf-text-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 60px 22px 20px;
  background:
    linear-gradient(180deg,
      transparent 0%,
      rgba(6, 5, 3, 0.18) 30%,
      rgba(6, 5, 3, 0.65) 65%,
      rgba(6, 5, 3, 0.92) 100%);
  color: #f5e6b8;
  transition: opacity 0.28s ease;
  z-index: 2;
}
.pf-title-line {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.2;
  color: #f9ecc3;
  margin: 0 0 8px;
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  letter-spacing: 0.1px;
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 10px;
}
.pf-title-line::before {
  content: '';
  width: 20px; height: 1px;
  background: linear-gradient(90deg, #D4A017, transparent);
  display: inline-block;
  flex-shrink: 0;
  transform: translateY(-5px);
}
.pf-title-text { font-style: italic; }
.pf-title-date {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-style: normal;
  font-size: 9.5px;
  color: rgba(245, 230, 184, 0.5);
  letter-spacing: 2.2px;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  align-self: baseline;
  padding-bottom: 2px;
}
.pf-desc {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11.5px;
  line-height: 1.55;
  color: rgba(245, 230, 184, 0.62);
  margin: 0 0 12px;
  max-width: 90%;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
  font-weight: 300;
}

/* CTA + Share row */
.pf-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  min-height: 22px;
}
.pf-cta {
  display: none;
  align-items: center; gap: 6px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f5e6b8;
  text-decoration: none;
  border-bottom: 1px solid rgba(212,160,23,0.4);
  padding-bottom: 3px;
  transition: color 0.15s, border-color 0.15s;
}
.pf-cta.is-visible { display: inline-flex; }
.pf-cta:hover { color: #D4A017; border-color: #D4A017; }
.pf-cta svg { width: 10px; height: 10px; transition: transform 0.2s ease; }
.pf-cta:hover svg { transform: translateX(3px); }

.pf-share {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(245, 230, 184, 0.2);
  color: rgba(245, 230, 184, 0.7);
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
  margin-left: auto;
  position: relative;
}
.pf-share:hover { border-color: #D4A017; color: #f5e6b8; transform: scale(1.05); }
.pf-share svg { width: 12px; height: 12px; }
.pf-share.is-copied::after {
  content: 'Link kopiert';
  position: absolute;
  right: calc(100% + 8px); top: 50%;
  transform: translateY(-50%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 9px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #f5e6b8;
  background: rgba(6, 5, 3, 0.9);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid rgba(212,160,23,0.2);
}

/* Navigation arrows */
.pf-nav {
  position: absolute;
  top: 44%;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(6, 5, 3, 0.45);
  border: 1px solid rgba(245, 230, 184, 0.15);
  color: rgba(245, 230, 184, 0.85);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0.7;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
  z-index: 3;
  appearance: none;
}
.pf-image-wrap:hover .pf-nav { opacity: 1; }
.pf-nav:hover { background: rgba(212, 160, 23, 0.28); transform: scale(1.08); border-color: rgba(245,230,184,0.5); }
.pf-nav.prev { left: 12px; }
.pf-nav.next { right: 12px; }
.pf-nav:disabled { opacity: 0.2; pointer-events: none; }
.pf-nav svg { width: 14px; height: 14px; }

/* Timeline */
.pf-timeline {
  padding: 20px 22px 22px;
  background: #0d0c08;
  border-top: 1px solid rgba(245, 230, 184, 0.05);
  flex-shrink: 0;
}
.pf-timeline-track {
  position: relative;
  height: 14px;
  display: flex; align-items: center;
  margin-bottom: 14px;
}
.pf-timeline-line {
  position: absolute;
  left: 5px; right: 5px; top: 50%;
  height: 1px;
  background: rgba(245, 230, 184, 0.14);
  transform: translateY(-0.5px);
}
.pf-timeline-progress {
  position: absolute;
  left: 5px; top: 50%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #8a6800 8%, #D4A017 50%, #f5e6b8 100%);
  transform: translateY(-0.75px);
  transition: width 0.5s cubic-bezier(.4,.0,.2,1);
  border-radius: 1px;
}
.pf-timeline-dots {
  position: relative;
  display: flex; justify-content: space-between;
  width: 100%;
  z-index: 2;
}
.pf-dot {
  appearance: none;
  background: #0d0c08;
  border: 1.5px solid rgba(245, 230, 184, 0.28);
  width: 10px; height: 10px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.pf-dot:hover { transform: scale(1.3); border-color: #D4A017; }
.pf-dot.is-active {
  background: #D4A017;
  border-color: #f5e6b8;
  transform: scale(1.6);
  box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.14), 0 0 12px rgba(212, 160, 23, 0.55);
  animation: pf-dot-pulse 2.4s ease-in-out infinite;
}
@keyframes pf-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.14), 0 0 12px rgba(212, 160, 23, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(212, 160, 23, 0.08), 0 0 16px rgba(212, 160, 23, 0.7); }
}
@media (prefers-reduced-motion: reduce) {
  .pf-dot.is-active { animation: none; }
}
.pf-dot.is-past { background: #8a6800; border-color: #D4A017; }

.pf-timeline-dates {
  display: flex; justify-content: space-between;
  padding: 0 2px;
}
.pf-date {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 10px;
  color: rgba(245, 230, 184, 0.35);
  letter-spacing: 0.8px;
  text-align: center;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease, opacity 0.25s ease;
  white-space: nowrap;
  width: 32px;
  margin-left: -11px;
  opacity: 1;
}
.pf-date.is-active { color: #f5e6b8; font-style: normal; }
.pf-date.is-hidden { opacity: 0; visibility: hidden; }

.pf-counter {
  text-align: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(245, 230, 184, 0.35);
  margin: 18px 0 0;
  font-variant-numeric: tabular-nums;
}
.pf-counter strong { color: #f5e6b8; font-weight: 500; font-style: normal; }

/* Swipe hint (nur beim ersten Öffnen, per LocalStorage) */
.pf-swipe-hint {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.35);
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pf-swipe-hint.is-show { opacity: 1; }
.pf-swipe-hint-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  color: #f5e6b8;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.pf-swipe-hint svg {
  width: 44px; height: 44px;
  color: #f5e6b8;
  animation: pf-swipe-anim 2s ease-in-out;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}
@keyframes pf-swipe-anim {
  0%   { transform: translateX(30px); opacity: 0; }
  15%  { transform: translateX(30px); opacity: 1; }
  50%  { transform: translateX(-30px); opacity: 1; }
  85%  { transform: translateX(-30px); opacity: 1; }
  100% { transform: translateX(-30px); opacity: 0; }
}

/* Vollbild (Doppel-Tap) */
.pf-fullscreen {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.98);
  z-index: 1600;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}
.pf-fullscreen.is-open { opacity: 1; pointer-events: auto; }
.pf-fullscreen[hidden] { display: none; }
.pf-fs-image {
  max-width: 100%; max-height: 100%;
  background-color: #0f0d08;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 12px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  width: 100%;
  aspect-ratio: 4 / 5;
}
.pf-fullscreen.is-open .pf-fs-image { transform: scale(1); }
.pf-fs-hint {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(245, 230, 184, 0.5);
  pointer-events: none;
}

/* Focus ring */
.pf-popup :focus-visible,
.pf-fullscreen :focus-visible {
  outline: 2px solid #D4A017;
  outline-offset: 2px;
  border-radius: 4px;
}
