/* Suffah — full-screen image viewer (Phase 35) */
.media-grid img { cursor: zoom-in; }
body.iv-lock { overflow: hidden; }

.iv { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: #000; color: #fff; }
.iv__top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); transition: opacity .2s; }
.iv__btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(30, 30, 34, .75); color: #fff; cursor: pointer; }
.iv__btn:hover { background: rgba(60, 60, 66, .85); }
.iv__menu { position: relative; }
.iv__menulist { position: absolute; top: 46px; right: 0; min-width: 170px; padding: 6px 0; border-radius: 12px; background: #1b1b1f; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
.iv__menulist a { display: block; padding: 11px 16px; color: #fff; text-decoration: none; }
.iv__menulist a:hover { background: rgba(255, 255, 255, .08); }

.iv__track { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.iv__track::-webkit-scrollbar { display: none; }
.iv__slide { flex: 0 0 100%; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; scroll-snap-stop: always; }
.iv__slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }

.iv__arrow { position: absolute; top: 50%; z-index: 3; display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: rgba(30, 30, 34, .75); color: #fff; cursor: pointer; }
.iv__arrow--prev { left: 16px; } .iv__arrow--next { right: 16px; }
@media (hover: hover) and (pointer: fine) { .iv__arrow { display: inline-flex; } }

.iv__bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 40px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0)); transition: opacity .2s; }
.iv--bare .iv__top, .iv--bare .iv__bottom, .iv--bare .iv__arrow { opacity: 0; pointer-events: none; }
.iv__dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.iv__dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.iv__dots span.is-on { background: #fff; }

.iv__author { display: flex; align-items: center; gap: 12px; }
.iv__author .avatar { width: 40px; height: 40px; flex: none; }
.iv__author .post-card__header, .iv__author .xpost__who { display: flex; flex-direction: column; gap: 0; min-width: 0; color: #fff; line-height: 1.25; }
.iv__author .post-card__name, .iv__author .xpost__name { color: #fff; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.iv__author .post-card__handle, .iv__author .xpost__handle { color: rgba(255, 255, 255, .65); }
.iv__text { margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.iv__text, .iv__text * { color: #fff; }

/* Action pills, reusing the card's own buttons */
.iv__actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin: 12px 0 0 !important; padding: 0 !important; max-width: none !important; border: 0 !important; }
.iv__actions > *, .iv__actions .post-card__actions-end > * { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(40, 40, 46, .85); color: #fff; font: inherit; text-decoration: none; cursor: pointer; }
.iv__actions .post-card__actions-end { display: contents; }
.iv__actions .post-action__icon, .iv__actions .xpost__act { background: none; color: inherit; width: auto; height: auto; margin: 0; }
.iv__actions .xpost__act { width: auto; height: auto; min-height: 40px; padding: 0 14px; background: rgba(40, 40, 46, .85); }
.iv__actions .post-action--like[aria-pressed="true"], .iv__actions .is-like { color: #f91880; }
.iv__actions .post-action--repost[aria-pressed="true"] { color: #00ba7c; }
.iv__actions .post-action--views { display: none; }
.iv__actions .xpost__form, .iv__actions .xpost__repost { display: contents; }
.iv__actions .post-menu__list { background: #1b1b1f; color: #fff; }

/* tidy-ups: name + badge on one line, handle below; pills stay on one row */
.iv__author .post-card__header { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 4px; row-gap: 0; }
.iv__author .post-card__handle { flex-basis: 100%; }
.iv__author .post-card__name { max-width: 100%; }
.iv__actions { flex-wrap: nowrap !important; justify-content: space-between !important; gap: 6px !important; }
.iv__actions > *, .iv__actions .post-card__actions-end > * { padding: 0 11px !important; min-width: 0; flex: 0 1 auto; }
.iv__actions .post-card__actions-end { display: contents; }
