/* Post cards — the work is the brightest thing on screen; the chrome recedes.
   Modes: .pk-post-card--feed (full-bleed native ratio), --grid (cropped thumbnail),
   --text (typographic, about half a media card's height). Counts render only
   when the server sent them. No inline styles: every dynamic value is a class
   or a CSSOM custom property. */

.pk-post-feed, .pk-post-grid { display: grid; gap: 18px; padding: 0; margin: 0; list-style: none; }
.pk-post-feed > li, .pk-post-grid > li { min-width: 0; }
.pk-post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.pk-post-card { position: relative; display: grid; gap: 0; min-width: 0; overflow: hidden; background: var(--pk-surface); border: 1px solid var(--pk-border); border-radius: var(--pk-radius-card); color: var(--pk-ink); overflow-wrap: anywhere; }
.pk-post-card a { color: inherit; text-decoration: none; }
.pk-post-card a:hover { color: #fff; }
.pk-post-card--feed { max-width: 100%; }

/* Source line ("Screening Room pick", "Feedback for colourists") and the reshare pointer. */
.pk-post-reason, .pk-post-reshared { display: flex; align-items: center; gap: 6px; margin: 0; padding: 10px 16px 0; color: var(--pk-muted); font-size: 12px; letter-spacing: .01em; }
.pk-post-reshared a { color: #d9dcdc; font-weight: 600; }
.pk-post-reshared .pk-icon { width: 14px; height: 14px; }

/* Author row. */
.pk-post-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; }
.pk-post-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pk-post-author-avatar { flex: none; display: block; border-radius: 50%; }
.pk-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #2a1e1b; color: #f2c9bf; font: 700 14px/1 var(--fs-font); }
.pk-post-author-text { display: grid; gap: 2px; min-width: 0; }
.pk-post-author-name { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.pk-post-author a, .pk-post-author-name a, .pk-post-reshared a, .pk-hearted-by a { color: inherit; text-decoration: none; }
.pk-post-author-name a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
h1.pk-post-author-name { font-size: 15px; }
.pk-post-author-meta { display: flex; flex-wrap: wrap; gap: 0 6px; margin: 0; color: var(--pk-muted); font-size: 12px; line-height: 1.3; }
.pk-post-author-meta > * + *::before { content: '·'; margin-right: 6px; color: #6f7576; }
.pk-post-server { flex: none; max-width: 40%; overflow: hidden; color: var(--pk-muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }

/* Marks: intent chip, Screening Room, Momentum state. */
.pk-post-marks { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.pk-post-card--grid .pk-post-marks { padding: 0 0 8px; }
.pk-intent, .pk-status, .pk-screening-mark { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 2px 9px; border: 1px solid #3b4041; border-radius: 999px; color: #d6d9d9; font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.2; white-space: nowrap; }
.pk-intent--feedback { color: #ffb4a6; border-color: #7a3a2e; background: rgba(240, 68, 46, .12); }
.pk-intent--question { color: #cfe0ff; border-color: #34507a; background: rgba(91, 140, 255, .12); }
.pk-intent--looking_for { color: #d3f2df; border-color: #2f5f45; background: rgba(47, 203, 122, .12); }
.pk-screening-mark { color: #ffd08a; border-color: #6a4b1e; background: rgba(242, 169, 59, .1); }
.pk-screening-mark .pk-icon { width: 14px; height: 14px; }
.pk-status { color: #c9d1d2; }
.pk-status--fixed, .pk-status--shipped, .pk-status--solved { color: #9cf2c4; border-color: #2f6a4a; }
.pk-status--planned, .pk-status--in_development, .pk-status--fixed_pending { color: #ffd08a; border-color: #6a4b1e; }
.pk-status--needs_info { color: #b9ccff; border-color: #34507a; }

/* Media: full-bleed inside the card, never cropped in the feed. Tall frames are
   letterboxed, not cut. The browser keeps the ratio from width/height attributes. */
.pk-media { position: relative; display: block; min-width: 0; margin: 0; background: #050607; color: #fff; }
.pk-media-image, .pk-video { display: block; width: 100%; height: auto; }
.pk-media--feed.pk-media--tall .pk-media-image, .pk-media--feed.pk-media--tall .pk-video, .pk-media--page.pk-media--tall .pk-media-image, .pk-media--page.pk-media--tall .pk-video { max-height: 78vh; object-fit: contain; }
.pk-media-missing { display: block; width: 100%; aspect-ratio: 16 / 9; background: linear-gradient(160deg, #1a1e1f, #0f1213); }
.pk-media--grid .pk-media-image, .pk-media--grid .pk-media-missing { aspect-ratio: 1; height: auto; object-fit: cover; }
.pk-media--grid.pk-media--tall .pk-media-image { aspect-ratio: 4 / 5; }
.pk-media--grid { overflow: hidden; }
a.pk-media--grid .pk-media-image { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
a.pk-media--grid:hover .pk-media-image { transform: scale(1.03); }

.pk-media-stack, .pk-media-duration, .pk-media-pair-mark { position: absolute; display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, .68); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .02em; pointer-events: none; backdrop-filter: blur(6px); }
.pk-media-stack { top: 10px; right: 10px; }
.pk-media-stack .pk-icon { width: 13px; height: 13px; }
.pk-media-duration { right: 10px; bottom: 10px; font-variant-numeric: tabular-nums; }
.pk-media-pair-mark { left: 10px; bottom: 10px; }
.pk-media-pair-mark .pk-icon { width: 13px; height: 13px; }

/* Video: a native element the player script upgrades. Stills carry a play glyph. */
.pk-media-video { position: relative; display: block; background: #000; }
.pk-media-video--still .pk-media-image { display: block; }
.pk-media-play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(6px); }
.pk-media-play .pk-icon { width: 24px; height: 24px; margin-left: 3px; }
.pk-media--grid .pk-media-play { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
.pk-media--grid .pk-media-play .pk-icon { width: 18px; height: 18px; }

/* Before/after as one tile: two halves. */
.pk-media-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: #000; }
.pk-media-pair .pk-media-image { height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.pk-media--wide .pk-media-pair .pk-media-image { aspect-ratio: 1; }

/* The compare slider on the post page: the after frame is revealed from the left. */
.pk-compare--pair { position: relative; display: grid; padding: 0; overflow: hidden; background: #000; border-radius: 0; }
.pk-compare--pair .pk-media-image { grid-area: 1 / 1; width: 100%; height: auto; }
.pk-compare-after { clip-path: inset(0 0 0 var(--pk-split, 50%)); }
.pk-compare--pair::after { content: ''; position: absolute; top: 0; bottom: 0; left: var(--pk-split, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); pointer-events: none; }
.pk-compare-mark { position: absolute; top: 12px; padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; pointer-events: none; }
.pk-compare-mark--before { left: 12px; }
.pk-compare-mark--after { right: 12px; }
.pk-compare-range { position: absolute; left: 0; right: 0; bottom: 0; grid-area: auto; width: 100%; height: 44px; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: ew-resize; }
.pk-compare-range::-webkit-slider-runnable-track { height: 44px; background: transparent; }
.pk-compare-range::-moz-range-track { height: 44px; background: transparent; }
.pk-compare-range::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: 5px; border: 2px solid #fff; border-radius: 50%; background: rgba(0, 0, 0, .6); box-shadow: 0 2px 10px rgba(0, 0, 0, .5); cursor: ew-resize; }
.pk-compare-range::-moz-range-thumb { width: 34px; height: 34px; border: 2px solid #fff; border-radius: 50%; background: rgba(0, 0, 0, .6); cursor: ew-resize; }
.pk-compare-range:focus-visible { outline: 2px solid var(--pk-accent); outline-offset: -4px; }

/* Carousel: swipe (scroll-snap), arrows, dots. */
.pk-carousel { position: relative; background: #050607; }
.pk-carousel-track { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pk-carousel-track::-webkit-scrollbar { display: none; }
.pk-carousel-track:focus-visible { outline: 2px solid var(--pk-accent); outline-offset: -2px; }
.pk-carousel-item { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.pk-carousel-arrow { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; margin-top: -20px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; opacity: .85; backdrop-filter: blur(6px); }
.pk-carousel-arrow:hover, .pk-carousel-arrow:focus-visible { opacity: 1; outline: none; border-color: #fff; }
.pk-carousel-arrow--prev { left: 12px; }
.pk-carousel-arrow--next { right: 12px; }
.pk-carousel-arrow .pk-icon { width: 20px; height: 20px; }
.pk-carousel-arrow[disabled] { opacity: .25; cursor: default; }
.pk-carousel-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.pk-carousel-dot { width: 22px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer; pointer-events: auto; }
.pk-carousel-dot::before { content: ''; display: block; width: 7px; height: 7px; margin: auto; border-radius: 50%; background: rgba(255, 255, 255, .45); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); }
.pk-carousel-dot.is-on::before { background: #fff; transform: scale(1.25); }
.pk-carousel-dot:focus-visible { outline: 2px solid var(--pk-accent); outline-offset: -4px; border-radius: 50%; }

/* Caption and body. */
.pk-post-card-body { display: grid; gap: 6px; padding: 12px 16px 4px; }
.pk-post-caption, .pk-post-title-line { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-line; }
.pk-post-card--feed .pk-post-caption { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.pk-post-caption--line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; line-height: 1.4; }
.pk-post-title-line { font-weight: 700; }
.pk-post-title-line + .pk-post-caption { color: #d4d7d7; }

/* Text posts: a typographic card at about half a media card's height. */
.pk-post-card--text.pk-post-card--feed .pk-post-card-text { padding: 2px 18px 6px; }
.pk-post-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; margin: 0; font-size: 18px; line-height: 1.45; letter-spacing: -.01em; white-space: pre-line; }
.pk-post-card--text .pk-post-card-text .pk-post-caption { color: #d4d7d7; font-size: 14px; }
.pk-media--text { display: grid; align-content: end; aspect-ratio: 1; padding: 16px; background: linear-gradient(155deg, #1b1f20, #101314); }
.pk-media--text.pk-media--grid { color: #f3f1ee; }
.pk-media-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; font-size: 15px; line-height: 1.4; }

/* Engagement row: heart · comments · reshare · share. */
.pk-engage { display: flex; align-items: center; gap: 4px; padding: 6px 10px 8px; color: var(--pk-muted); }
.pk-post-card--grid .pk-engage { padding: 2px 0 0; margin: 0 -8px; }
.pk-engage > button, .pk-engage > a, .pk-engage > span { display: inline-flex; align-items: center; gap: 6px; min-width: 40px; min-height: 40px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: 600 13px/1 var(--fs-font); text-decoration: none; cursor: pointer; font-variant-numeric: tabular-nums; }
.pk-engage > span { cursor: default; }
.pk-engage .pk-icon { width: 20px; height: 20px; flex: none; }
.pk-engage > button:hover, .pk-engage > a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.pk-engage > button:focus-visible, .pk-engage > a:focus-visible { outline: 2px solid var(--pk-accent); outline-offset: -2px; }
.pk-engage-heart[aria-pressed="true"] { color: var(--pk-heart); }
.pk-engage-heart[aria-pressed="true"] .pk-icon-heart path { fill: currentColor; }
.pk-engage-heart.is-popping .pk-icon-heart { animation: pk-heart-pop .42s var(--pk-ease-settle, cubic-bezier(.2, .8, .2, 1)); }
.pk-engage-reshare[aria-pressed="true"] { color: #5fe0a0; }
.pk-engage-count:empty { display: none; }
.pk-engage-share { margin-left: auto; }
.pk-engage-status { flex-basis: 100%; margin: 0; padding: 0 8px; font-size: 12px; color: #f2a595; }
.pk-engage-status:empty { display: none; }
.pk-engage-status a { color: #ff8a7a; text-decoration: underline; }
.pk-engage button.pk-loading { opacity: .6; }
@keyframes pk-heart-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* R3 social proof: a light human line, never a scoreboard. */
.pk-hearted-by { display: block; margin: 0; padding: 0 16px 14px; color: var(--pk-muted); font-size: 12.5px; line-height: 1.45; }
.pk-hearted-by .pk-icon { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; color: var(--pk-heart); }
.pk-hearted-by .pk-icon path { fill: currentColor; }
.pk-hearted-by a { color: #e2e5e5; font-weight: 600; }

/* Credits. */
.pk-post-credits { display: grid; gap: 8px; }
.pk-post-credits h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pk-muted); }
.pk-post-credits ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pk-credit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 14px; }
.pk-credit a { color: #f3f1ee; font-weight: 600; text-decoration: none; }
.pk-credit-role { color: var(--pk-muted); }
.pk-credit-role::before { content: '—'; margin-right: 8px; color: #6f7576; }
.pk-credit-pending { padding: 1px 8px; border: 1px dashed #4a5051; border-radius: 999px; color: var(--pk-muted); font-size: 11px; }
.pk-credit-respond { display: inline-flex; gap: 6px; margin-left: auto; }
.pk-credit-respond .fs-button { min-height: 32px; padding: 4px 12px; font-size: 12px; }

/* R4: For You | Following. */
.pk-feed-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--pk-border); border-radius: 999px; background: #0f1213; }
.pk-feed-toggle a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 14px; border-radius: 999px; color: var(--pk-muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.pk-feed-toggle a:hover { color: #fff; }
.pk-feed-toggle a[aria-current="page"] { color: #fff; background: #26292a; }

@media (max-width: 1050px) { .pk-post-grid { gap: 10px; } }
@media (max-width: 759px) {
  .pk-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pk-post-feed { gap: 12px; }
  .pk-post-card--feed { border-radius: 10px; }
  .pk-post-card-head { padding: 12px 14px 10px; }
  .pk-post-card-body { padding: 10px 14px 2px; }
  .pk-post-marks, .pk-hearted-by { padding-left: 14px; padding-right: 14px; }
  .pk-carousel-arrow { display: none; }
  .pk-post-text { font-size: 17px; }
  .pk-media--feed.pk-media--tall .pk-media-image, .pk-media--feed.pk-media--tall .pk-video { max-height: 70vh; }
}
@media (max-width: 480px) { .pk-post-card--grid .pk-engage > button, .pk-post-card--grid .pk-engage > a { min-width: 34px; padding: 6px; } }
@media (hover: none) { a.pk-media--grid:hover .pk-media-image { transform: none; } }
