/* ============================================================
   ProKontakte — Instagram-Style Post Card
   ============================================================ */

/* ── Basis-Reset für die neue Card ── */
.pk-ig-post {
  background: var(--card-color, #fff);
  border-radius: 0;
  border-top: 1px solid rgba(128,128,128,.1);
  border-bottom: 1px solid rgba(128,128,128,.1);
  margin-bottom: 8px;
  overflow: hidden;
}
.pk-ig-post + .pk-ig-post { margin-top: 0; }

/* ── Header ── */
.pk-ig-post__header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  gap: 10px;
}
.pk-ig-post__avatar-link { flex-shrink: 0; }
.pk-ig-post__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(128,128,128,.2);
}
.pk-ig-post__avatar--online {
  border-color: #4caf50 !important;
}
.pk-ig-post__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pk-ig-post__header-info {
  flex: 1;
  min-width: 0;
}
.pk-ig-post__username {
  font-weight: 700;
  font-size: .875rem;
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pk-ig-post__username:hover { text-decoration: none; color: inherit; }
.pk-ig-post__badge { display: inline-flex; align-items: center; }
.pk-ig-post__more { flex-shrink: 0; }
.pk-ig-more-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  color: inherit;
  opacity: .75;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pk-ig-more-btn:hover { opacity: 1; background: rgba(128,128,128,.1); }

/* ── Repost / Pin Banner ── */
.pk-ig-repost-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  font-size: .72rem;
  opacity: .6;
  font-weight: 600;
}
.pk-ig-repost-banner a { color: inherit; text-decoration: none; }
.pk-ig-repost-banner a:hover { text-decoration: underline; }

/* ── Media (full-width, kein Rand) ── */
.pk-ig-post__media {
  width: 100%;
  overflow: hidden;
  margin: 0;
  background: #000;
}
.pk-ig-post__media .publication-image,
.pk-ig-post__media .publication-images-collage,
.pk-ig-post__media .publication-video,
.pk-ig-post__media .publication-og,
.pk-ig-post__media .publication-image img {
  width: 100%;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
}
.pk-ig-post__media .publication-image img {
  display: block;
  max-height: 600px;
  object-fit: contain;
  background: #000;
}
.pk-ig-post__media--audio,
.pk-ig-post__media--doc,
.pk-ig-post__media--poll,
.pk-ig-post__media--og,
.pk-ig-post__media--paid {
  background: transparent;
  padding: 0 14px;
}
.pk-ig-post__media--paid { padding: 0; }

/* ── Text-Status (roter Hintergrund, wie /explore) ── */
.pk-ig-post__text-status {
  width: 100%;
  min-height: 200px;
  background: linear-gradient(135deg, #7C1D3C 0%, #c0392b 60%, #e84c3c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  box-sizing: border-box;
}
.pk-ig-post__text-status-inner {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  text-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.pk-ig-post__text-status-inner a { color: rgba(255,255,255,.85); text-decoration: underline; }

/* ── Aktions-Leiste ── */
.pk-ig-post__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 2px;
}
.pk-ig-post__actions-left {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ── Buttons ── */
.pk-ig-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 7px 8px;
  cursor: pointer;
  color: inherit;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 8px;
  transition: opacity .15s, background .15s;
  line-height: 1;
}
.pk-ig-btn:hover { opacity: .7; background: rgba(128,128,128,.07); }
.pk-ig-btn__icon { display: flex; align-items: center; }
.pk-ig-btn__icon svg { display: block; }
.pk-ig-btn__num { font-size: .78rem; min-width: 14px; }

/* Like — aktiv = rot (JS setzt .liked) */
.pk-ig-btn--liked,
.pk-ig-btn--like.liked { color: #e0334c !important; }

/* Single-SVG Herz: outline → filled */
.pk-heart-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pk-ig-btn--like.liked .pk-heart-path {
  fill: currentColor;
  stroke: none;
}

/* Repost — aktiv = grün (JS setzt .reposted) */
.pk-ig-btn--reposted,
.pk-ig-btn--repost.reposted { color: #27ae60 !important; }

/* Bookmark — aktiv = dunkelrot */
.pk-ig-btn--bookmarked { color: var(--main-color, #7C1D3C) !important; }

/* ── Multi-Bild Gallery (Slideshow) ── */
.pk-gallery {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  touch-action: pan-x pinch-zoom;
}
.pk-gallery__track {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: scroll !important;
  overflow-y: visible !important;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pk-gallery__track::-webkit-scrollbar { display: none; }
.pk-gallery__slide {
  flex: 0 0 100% !important;
  min-width: 100% !important;
  width: 100% !important;
  scroll-snap-align: start;
  display: block !important;
}
.pk-gallery__slide a { display: block; width: 100%; }
.pk-gallery__slide img {
  width: 100%;
  display: block;
  max-height: 600px;
  object-fit: contain;
  background: #000;
}
/* Pfeil-Buttons */
.pk-gallery__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background .15s;
  padding: 0;
}
.pk-gallery__btn:hover { background: rgba(0,0,0,.7); }
.pk-gallery__btn--prev { left: 10px; }
.pk-gallery__btn--next { right: 10px; }
/* Dots */
.pk-gallery__dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
}
.pk-gallery__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  transition: background .2s, transform .2s;
}
.pk-gallery__dot--active {
  background: #fff;
  transform: scale(1.3);
}

/* ── Caption ── */
.pk-ig-post__caption {
  padding: 4px 14px 2px;
  font-size: .84rem;
  line-height: 1.45;
  word-break: break-word;
}
.pk-ig-post__caption-user {
  font-weight: 700;
  margin-right: 6px;
  color: inherit;
  text-decoration: none;
}
.pk-ig-post__caption-user:hover { text-decoration: none; }
.pk-ig-post__caption-text { color: inherit; }

/* ── Zeit ── */
.pk-ig-post__time {
  padding: 2px 14px 10px;
  font-size: .72rem;
  opacity: .5;
  font-weight: 400;
}

/* ── Dark-Mode ── */
[data-skin="dark"] .pk-ig-post {
  background: var(--card-color, #1a1a1a);
  border-color: rgba(255,255,255,.06);
}
[data-skin="dark"] .pk-ig-post__media { background: #111; }

/* ── Comment Bottom Sheet ── */
.pk-comment-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.pk-comment-sheet-overlay.pk-cs-open {
  opacity: 1;
  pointer-events: all;
}
.pk-comment-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10001;
  background: var(--card-color, #fff);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  will-change: transform;
}
.pk-comment-sheet.pk-cs-open { transform: translateY(0); }
.pk-comment-sheet__handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0 4px;
  flex-shrink: 0;
}
.pk-comment-sheet__handle-bar {
  width: 40px; height: 4px;
  background: rgba(128,128,128,.3);
  border-radius: 4px;
}
.pk-comment-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px 10px;
  border-bottom: 1px solid rgba(128,128,128,.1);
  flex-shrink: 0;
}
.pk-comment-sheet__title {
  font-weight: 700;
  font-size: .95rem;
}
.pk-comment-sheet__close {
  background: none; border: none; cursor: pointer;
  opacity: .5; padding: 4px; border-radius: 50%;
  display: flex; align-items: center;
  transition: opacity .15s;
}
.pk-comment-sheet__close:hover { opacity: 1; }
.pk-comment-sheet__list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}
.pk-comment-sheet__loading {
  text-align: center;
  padding: 24px;
  opacity: .5;
  font-size: .85rem;
}
.pk-cs-comment {
  display: flex;
  gap: 10px;
  padding: 8px 16px;
  align-items: flex-start;
}
.pk-cs-comment__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid rgba(128,128,128,.15);
}
.pk-cs-comment__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-cs-comment__body { flex: 1; min-width: 0; }
.pk-cs-comment__top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}
.pk-cs-comment__user {
  font-weight: 700;
  font-size: .82rem;
  color: inherit;
  text-decoration: none;
}
.pk-cs-comment__user:hover { text-decoration: underline; }
.pk-cs-comment__text { font-size: .84rem; line-height: 1.45; word-break: break-word; }
.pk-cs-comment__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.pk-cs-comment__time { font-size: .7rem; opacity: .5; }
.pk-cs-comment__like-btn {
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; color: inherit;
  opacity: .55; padding: 2px 0;
  transition: opacity .15s, color .15s;
}
.pk-cs-comment__like-btn:hover { opacity: 1; }
.pk-cs-comment__like-btn.pk-cs-liked { opacity: 1; color: #e0334c; }
/* Kommentar-Herz SVG */
.pk-cs-heart { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pk-cs-comment__like-btn.pk-cs-liked .pk-cs-heart { fill: currentColor; stroke: none; }
.pk-cs-comment__more-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; padding: 0 4px; opacity: .45;
  line-height: 1;
}
.pk-comment-sheet__see-all {
  text-align: center;
  padding: 8px 16px 12px;
}
.pk-comment-sheet__see-all a {
  font-size: .8rem;
  opacity: .6;
  color: inherit;
  text-decoration: none;
}
.pk-comment-sheet__see-all a:hover { text-decoration: underline; opacity: 1; }
.pk-comment-sheet__input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid rgba(128,128,128,.1);
  flex-shrink: 0;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.pk-cs-input-avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  border: 1.5px solid rgba(128,128,128,.15);
}
.pk-cs-input-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-comment-sheet__input {
  flex: 1;
  border: 1.5px solid rgba(128,128,128,.2);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: .84rem;
  background: transparent;
  color: inherit;
  outline: none;
  resize: none;
  min-height: 36px;
  max-height: 80px;
  line-height: 1.4;
  font-family: inherit;
}
.pk-comment-sheet__input:focus { border-color: var(--main-color, #7C1D3C); }
.pk-comment-sheet__send {
  background: none; border: none; cursor: pointer;
  color: var(--main-color, #7C1D3C);
  padding: 6px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: .4;
  transition: opacity .15s;
}
.pk-comment-sheet__send.pk-cs-ready { opacity: 1; }
.pk-comment-sheet__send:hover { opacity: .8; }

[data-skin="dark"] .pk-comment-sheet {
  background: var(--card-color, #1e1e1e);
}
[data-skin="dark"] .pk-comment-sheet__input {
  border-color: rgba(255,255,255,.12);
  color: #fff;
}

/* ── Double-Tap Herz-Animation ── */
.pk-ig-post { position: relative; }
.pk-dbt-heart {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  will-change: transform, opacity;
}
@keyframes pk-dbt-burst {
  0%   { transform: translate(-50%,-50%) scale(0);   opacity: 0; }
  15%  { opacity: 1; }
  40%  { transform: translate(-50%,-50%) scale(1.25); opacity: 1; }
  65%  { transform: translate(-50%,-50%) scale(1.05); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(0.9);  opacity: 0; }
}
.pk-dbt-animate {
  animation: pk-dbt-burst 0.7s cubic-bezier(.17,.89,.32,1.28) forwards;
}
