/* posts.css — стили карточки поста (views/post.php)
 * Подключается после layout. Только классы поста, реакций, ленты. */

 .post-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: all var(--transition-base);
}

.post-card:hover {
    border-color: var(--color-border-dark);
    box-shadow: var(--shadow-md);
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

/* Обёртка аватара с точкой «онлайн» — фиксированный размер, как у аватара */
.post-author .user-avatar-wrap {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
}

.post-author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
    display: block;
}

.post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-info {
    flex: 1;
    min-width: 0;
}

.post-author-name {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-author-name:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.post-author-time {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    display: block;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.post-author-time:hover {
    color: var(--color-primary);
}

/* Меню поста (три точки) */
.post-actions-dropdown {
    position: relative;
}

.post-menu-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.post-menu-btn:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.post-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 180px;
    display: none;
    z-index: var(--z-dropdown);
    padding: 0.5rem 0;
}

.post-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* .menu-item — общий стиль в components.css */

.menu-divider {
    height: 1px;
    background-color: var(--color-border);
    margin: 0.5rem 0;
}

/* Шаринг */
.share-dropdown-wrap {
    position: relative;
}

.share-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.25rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    display: none;
    z-index: var(--z-dropdown);
    padding: 0.5rem 0;
}

.share-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* .share-dropdown-item — общий стиль в components.css (вместе с .dropdown-item, .menu-item) */

.share-post-recipient {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: inherit;
    color: var(--color-text-primary);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.share-post-recipient:hover:not(:disabled) {
    background-color: var(--color-bg-secondary);
}

.share-post-recipient:disabled {
    opacity: 0.6;
    cursor: wait;
}

.share-post-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.share-post-modal .modal-text {
    margin: 0 0 1rem;
    color: var(--color-text-secondary);
}

.share-post-recipients {
    max-height: 240px;
    overflow-y: auto;
}

/* Репост: заголовок и блок оригинала */
.post-repost-header {
    padding: 0.25rem 1rem 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}
.post-repost-header .post-repost-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.post-repost-header [data-lucide] {
    width: 0.9rem;
    height: 0.9rem;
}
.post-original-block {
    margin: 0.5rem 1rem 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border, rgba(0,0,0,0.08));
}
.post-original-author {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    margin-bottom: 0.35rem;
}
.post-original-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    object-fit: cover;
}
.post-original-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}
.post-original-avatar-placeholder [data-lucide] {
    width: 14px;
    height: 14px;
}
.post-original-snippet {
    margin: 0.35rem 0 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.4;
}
.post-original-block .post-original-content {
    margin-top: 0.5rem;
}
/* Медиа в посте и репосте: 1 — как обычно, 2+ — первое как обычно, остальные снизу миниатюрами */
.post-card .post-images-wrap[data-media-count] {
    display: grid;
    gap: 6px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.post-original-block .post-images-wrap[data-media-count] {
    margin-bottom: 0.5rem;
}
/* 1 файл — как обычно, на всю ширину */
.post-card .post-images-wrap[data-media-count="1"] {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
}
.post-card .post-images-wrap[data-media-count="1"] > .post-image,
.post-card .post-images-wrap[data-media-count="1"] > .post-video {
    grid-column: 1 / -1;
}
.post-card .post-images-wrap[data-media-count="1"] > .post-audio {
    grid-column: 1 / -1;
}
/* 2 и более — одна сетка: первое большое сверху, остальные снизу квадратными миниатюрами */
.post-card .post-images-wrap[data-media-count="2"],
.post-card .post-images-wrap[data-media-count="3"],
.post-card .post-images-wrap[data-media-count="4"],
.post-card .post-images-wrap[data-media-count="5"],
.post-card .post-images-wrap[data-media-count="6"],
.post-card .post-images-wrap[data-media-count="7"],
.post-card .post-images-wrap[data-media-count="8"],
.post-card .post-images-wrap[data-media-count="9"],
.post-card .post-images-wrap[data-media-count="10"] {
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: auto auto;
}
.post-card .post-images-wrap[data-media-count="2"] > *:nth-child(1),
.post-card .post-images-wrap[data-media-count="3"] > *:nth-child(1),
.post-card .post-images-wrap[data-media-count="4"] > *:nth-child(1),
.post-card .post-images-wrap[data-media-count="5"] > *:nth-child(1),
.post-card .post-images-wrap[data-media-count="6"] > *:nth-child(1),
.post-card .post-images-wrap[data-media-count="7"] > *:nth-child(1),
.post-card .post-images-wrap[data-media-count="8"] > *:nth-child(1),
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(1),
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 0;
}
.post-card .post-images-wrap[data-media-count="2"] > *:nth-child(2) { grid-column: 1; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="3"] > *:nth-child(2) { grid-column: 1; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="3"] > *:nth-child(3) { grid-column: 2; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="4"] > *:nth-child(2) { grid-column: 1; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="4"] > *:nth-child(3) { grid-column: 2; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="4"] > *:nth-child(4) { grid-column: 3; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="5"] > *:nth-child(2) { grid-column: 1; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="5"] > *:nth-child(3) { grid-column: 2; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="5"] > *:nth-child(4) { grid-column: 3; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="5"] > *:nth-child(5) { grid-column: 4; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="6"] > *:nth-child(2) { grid-column: 1; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="6"] > *:nth-child(3) { grid-column: 2; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="6"] > *:nth-child(4) { grid-column: 3; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="6"] > *:nth-child(5) { grid-column: 4; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="6"] > *:nth-child(6) { grid-column: 5; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="7"] > *:nth-child(2) { grid-column: 1; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="7"] > *:nth-child(3) { grid-column: 2; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="7"] > *:nth-child(4) { grid-column: 3; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="7"] > *:nth-child(5) { grid-column: 4; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="7"] > *:nth-child(6) { grid-column: 5; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="7"] > *:nth-child(7) { grid-column: 6; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="8"] > *:nth-child(2) { grid-column: 1; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="8"] > *:nth-child(3) { grid-column: 2; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="8"] > *:nth-child(4) { grid-column: 3; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="8"] > *:nth-child(5) { grid-column: 4; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="8"] > *:nth-child(6) { grid-column: 5; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="8"] > *:nth-child(7) { grid-column: 6; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="8"] > *:nth-child(8) { grid-column: 7; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(2) { grid-column: 1; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(3) { grid-column: 2; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(4) { grid-column: 3; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(5) { grid-column: 4; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(6) { grid-column: 5; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(7) { grid-column: 6; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(8) { grid-column: 7; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(9) { grid-column: 8; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(2) { grid-column: 1; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(3) { grid-column: 2; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(4) { grid-column: 3; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(5) { grid-column: 4; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(6) { grid-column: 5; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(7) { grid-column: 6; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(8) { grid-column: 7; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(9) { grid-column: 8; grid-row: 2; }
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(10) { grid-column: 9; grid-row: 2; }

/* Ячейки медиа-сетки — не растягивать, естественный размер, не выравнивать по ширине */
.post-card .post-images-wrap[data-media-count] .post-image,
.post-card .post-images-wrap[data-media-count] .post-video {
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    min-height: 0;
    justify-self: start;
}
/* Второй ряд — только нижние: квадратные миниатюры */
.post-card .post-images-wrap[data-media-count="2"] > *:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="3"] > *:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="4"] > *:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="5"] > *:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="6"] > *:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="7"] > *:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="8"] > *:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="9"] > *:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="10"] > *:nth-child(n+2) {
    aspect-ratio: 1;
}
.post-card .post-images-wrap[data-media-count]:not([data-media-count="1"]) > *:nth-child(n+2) img,
.post-card .post-images-wrap[data-media-count]:not([data-media-count="1"]) > *:nth-child(n+2) video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.post-card .post-images-wrap[data-media-count] .post-video {
    aspect-ratio: auto;
    max-width: 100%;
    position: relative;
}
.post-card .post-images-wrap[data-media-count="1"] .post-video {
    max-width: 100%;
}
.post-card .post-images-wrap[data-media-count="2"] > .post-video:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="3"] > .post-video:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="4"] > .post-video:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="5"] > .post-video:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="6"] > .post-video:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="7"] > .post-video:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="8"] > .post-video:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="9"] > .post-video:nth-child(n+2),
.post-card .post-images-wrap[data-media-count="10"] > .post-video:nth-child(n+2) {
}
.post-card .post-images-wrap[data-media-count] .post-image img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}
.post-card .post-images-wrap[data-media-count] .post-video video {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
    vertical-align: middle;
}
.post-card .post-images-wrap[data-media-count] .post-audio {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    min-height: 48px;
}
/* Блок «+N» при более чем 10 медиа (пост и репост) */
.post-images-more,
.post-original-block .post-images-wrap .post-original-more,
.post-original-more {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    padding: 0.5rem;
    background: var(--color-bg-tertiary);
}

.post-original-block .post-audio {
    margin-bottom: 0.5rem;
}
.post-original-block .post-link-preview {
    margin-top: 0.5rem;
}
.post-original-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    text-decoration: none;
}
.post-original-link:hover {
    text-decoration: underline;
}

/* Контент поста */
.post-content, .post-comment {
    padding: 1rem;
}

.post-category {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.post-image,
.post-video {
    overflow: hidden;
    margin-bottom: 1rem;
    background-color: var(--color-bg-secondary);
}

/* Аудиоплеер в посте — тёмное компактное оформление */
.post-audio {
    margin-bottom: 0.75rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.35rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
}

.post-audio audio {
    display: block;
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 32px;
    border-radius: var(--radius-sm);
    background: transparent;
}

.post-audio audio::-webkit-media-controls-panel {
    background: rgba(255, 255, 255, 0.06);
}

.post-audio audio::-webkit-media-controls-enclosure {
    border-radius: var(--radius-sm);
}

.post-audio::before {
    content: '';
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13%3E%3Ccircle cx='6' cy='18' r='3'%3E%3Ccircle cx='18' cy='16' r='3'%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
}

.post-video video {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

/* Полноэкранный режим (двойной клик / двойной тап как на YouTube) */
.post-video:fullscreen,
.post-video:-webkit-full-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    margin: 0;
}
.post-video:fullscreen video,
.post-video:-webkit-full-screen video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.post-image,
.post-image img,
.post-image-view {
    cursor: pointer;
}

.post-image img,
.post-image-view {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.post-image img:hover,
.post-image-view:hover {
    transform: scale(1.02);
}

.post-images-wrap {
    margin-bottom: 1rem;
}

.post-text {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-primary);
    margin: 0 0 0.5rem;
    padding: 0;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    text-indent: 0;
}

.post-text .post-text-link {
    color: var(--color-primary);
    text-decoration: none;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.post-text .post-text-link:hover {
    text-decoration: underline;
}

/* Форматирование как в Telegram */
.post-text .post-text-bold { font-weight: 700; }
.post-text .post-text-italic { font-style: italic; }
.post-text .post-text-underline { text-decoration: underline; }
.post-text .post-text-strikethrough { text-decoration: line-through; }
.post-text .post-text-code {
    font-family: var(--font-family-mono);
    font-size: 0.9em;
    background: var(--color-bg-secondary);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
}
.post-text .post-text-spoiler {
    background: var(--color-text-secondary);
    color: var(--color-text-secondary);
    border-radius: 3px;
    padding: 0 3px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.post-text .post-text-spoiler:hover,
.post-text .post-text-spoiler.spoiler-revealed {
    background: transparent;
    color: inherit;
}

/* Сокращённый длинный текст + «Читать далее» */
.post-text--with-expand {
    margin: 0 0 1rem;
}
.post-text--with-expand .post-text-preview,
.post-text--with-expand .post-text-full {
    margin: 0;
}
.post-text--with-expand .post-text-full {
    display: none;
}
.post-text--with-expand.is-expanded .post-text-preview,
.post-text--with-expand.is-expanded .post-text-expand-btn {
    display: none !important;
}
.post-text--with-expand.is-expanded .post-text-full {
    display: block;
}
.post-text-expand-btn {
    display: inline-block;
    margin: 0.25rem 0 0;
    padding: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    text-align: right;
}
.post-text-expand-btn:hover {
    text-decoration: underline;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-tag {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.post-tag:hover {
    background-color: var(--color-border-light);
    color: var(--color-text-primary);
}

/* Панель действий — два ряда: основной + реакции */
.post-actions {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--color-border-light);
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.post-action-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
}

.post-action-main {
    display: flex;
    align-items: center;
    justify-content: stretch;
    gap: 0;
    flex: 1 1 100%;
    width: 100%;
}

.post-action-main .post-action-views,
.post-action-main .post-action-btn,
.post-action-main .post-bookmark-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}

.post-reactions-wrap.post-reactions-readonly .post-reaction-btn {
    cursor: default;
}

/* ─── Настройки реакций (время, анимации) ─────────────────────────────────────
 * Ниже перечислено, за что отвечает каждый параметр.
 *
 * Бар и кнопки:
 *   .post-reaction-btn transition 0.25s / 0.35s — плавность фона и масштаба при наведении/активном состоянии.
 *   .post-reaction-more transition 0.2s / 0.25s — плавность кнопки «+» (больше реакций).
 *
 * Пикер (всплывающая панель с эмодзи):
 *   .reaction-picker-popover animation reaction-picker-in 0.35s — длительность появления пикера при открытии.
 *   .reaction-picker-item transition 0.25s / 0.2s — плавность наведения и фона у пунктов пикера.
 *
 * Взрыв частиц (burst) при постановке реакции:
 *   .reaction-burst-particle animation reaction-burst-out 3s — полная анимация разлёта частиц (двойной клик/удержание).
 *   .reaction-burst-particle.reaction-compact animation reaction-compact-out 1.8s — короткая анимация при быстром тапе.
 *   --burst-x, --burst-y (в keyframes) — смещение частиц по осям; задаётся из JS для каждой частицы.
 *   В keyframes: scale(1.4)→1.25→0.4 (burst) и scale(1.2)→0.6 (compact) — масштаб в начале и в конце.
 * ─────────────────────────────────────────────────────────────────────────── */
.post-reactions-wrap {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.25rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--color-border-light);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.post-reactions-wrap img {
    -webkit-touch-callout: none;
    pointer-events: none;
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.post-action-btn:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.post-action-btn.active,
.post-action-btn.like-btn.active {
    color: var(--color-primary);
}

.post-action-btn.active i,
.post-action-btn.like-btn.active i {
    color: var(--color-primary);
}

.post-action-btn i {
    transition: color var(--transition-fast);
}

.post-action-btn.comment-link {
    text-decoration: none;
}

.post-action-btn.comment-link:hover {
    text-decoration: none;
}

.post-action-views {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}


.post-reactions-bar {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.post-reaction-btn {
    display: inline-flex;
    flex-direction: row;
    flex-shrink: 0;
    align-items: center;
    background: none;
    border: none;
    padding: 0.05rem 0.45rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.25s 
    cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s 
    cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.post-reaction-btn:hover {
    background: var(--color-bg-secondary);
    transform: scale(1.08);
}

.post-reaction-btn.active {
    background: var(--color-bg-tertiary);
    background: color-mix(in srgb, var(--color-primary) 12%, var(--color-bg-tertiary));
}

/* Фиксированный размер контейнера эмодзи — один и тот же до и после подстановки img (убирает «крупные в начале»). */
.post-reaction-btn .post-reaction-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.post-reaction-btn .post-reaction-emoji picture,
.reaction-picker-item picture {
    display: inline-flex;
    line-height: 0;
}

.post-reaction-btn .post-reaction-emoji .emoji-reaction-img,
.post-reaction-btn .post-reaction-emoji picture .emoji-reaction-img {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    display: block;
    vertical-align: middle;
    pointer-events: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.reaction-picker-item .emoji-picker-emoji,
.reaction-picker-item picture .emoji-picker-emoji,
.reaction-picker-item .emoji-reaction-img,
.reaction-picker-item picture .emoji-reaction-img {
    width: 1.4rem;
    height: 1.4rem;
    object-fit: contain;
    display: block;
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.post-reaction-btn:hover .post-reaction-emoji,
.post-reaction-btn.active .post-reaction-emoji {
    transform: scale(1.12);
}

/* Кнопка «больше реакций» */
.post-reaction-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    background: none;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.post-reaction-more:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    transform: scale(1.1);
}

/* При открытом пикере реакций блок действий (просмотры, комментарии, закладка) не кликается */
.post-actions.reaction-picker-open .post-action-main {
    pointer-events: none;
}

/* Расширенный пикер реакций (при удержании / клике на +) */
.reaction-picker-popover {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-0.5rem);
    z-index: 100;
    padding: 1px 3px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: -10x;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.reaction-picker-popover:not([hidden]) {
    display: block;
    /* 0.35s — длительность появления пикера реакций */
    animation: reaction-picker-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes reaction-picker-in {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0.5rem) scale(0.7);
    }
    70% {
        opacity: 1;
        transform: translateX(-50%) translateY(-0.6rem) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(-0.5rem) scale(1);
    }
}
.reaction-picker-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.125rem;
    max-width: 100%;
}
.reaction-picker-grid::-webkit-scrollbar {
    height: 4px;
}
.reaction-picker-item {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    font-size: 1.4rem;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.2s ease,
                filter 0.2s ease;
    filter: drop-shadow(0 0 0 transparent);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.reaction-picker-item:hover {
    background: var(--color-bg-secondary);
    transform: scale(1.2);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.reaction-picker-item.active {
    background: var(--color-bg-tertiary);
    background: color-mix(in srgb, var(--color-primary) 12%, var(--color-bg-tertiary));
}

/* Частицы взрыва при клике на реакцию (стиль Telegram) */
.reaction-burst-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}
.reaction-burst-particle {
    position: absolute;
    font-size: 1.15rem;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: reaction-burst-out 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.6))
            drop-shadow(0 2px 6px rgba(0,0,0,0.15));
    will-change: transform, opacity;
}

.reaction-burst-particle .emoji-reaction-img,
.reaction-burst-particle img {
    width: 1.4rem;
    height: 1.4rem;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.reaction-burst-particle.reaction-compact {
    font-size: 1rem;
    animation: reaction-compact-out 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.reaction-burst-particle.reaction-compact .emoji-reaction-img,
.reaction-burst-particle.reaction-compact img {
    width: 1.15rem;
    height: 1.15rem;
}
/* --burst-x, --burst-y задаются в JS для каждой частицы (смещение в px) */
@keyframes reaction-burst-out {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translate(0, 0) scale(1.4);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) translate(
            calc(var(--burst-x, 0) * 0.15),
            calc(var(--burst-y, 0) * 0.15)
        ) scale(1.25);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(var(--burst-x, 0), var(--burst-y, 0)) scale(0.4);
    }
}
@keyframes reaction-compact-out {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translate(0, 0) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(var(--burst-x, 0), var(--burst-y, 0)) scale(0.6);
    }
}

.post-reaction-count {
    font-size: 0.65rem;
    color: var(--color-text-secondary);
}

.post-bookmark-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.post-bookmark-btn:hover {
    color: var(--color-primary);
}

.post-bookmark-btn.active {
    color: var(--color-primary);
}

/* Lucide bookmark: заполненная иконка при активной закладке */
.post-bookmark-btn.active svg {
    fill: currentColor;
    stroke: currentColor;
}

.post-action-btn:disabled,
.post-bookmark-btn:disabled,
.post-reaction-btn:disabled {
    cursor: wait;
    opacity: 0.8;
}

/* Иконки в посте — единый размер */
.post-actions [data-lucide] svg,
.post-actions .lucide {
    font-size: 0.95rem;
}

.post-action-btn i,
.post-bookmark-btn i {
    font-size: 0.95rem;
}

/* Реакции на ПК: чуть крупнее; один источник размеров — только здесь (без дублирования в responsive.css). */
@media (min-width: 769px) {
    .post-reaction-btn {
        font-size: 1.35rem;
        padding: 0.08rem 0.5rem;
    }
    .post-reaction-btn .post-reaction-emoji {
        width: 1.35rem;
        height: 1.35rem;
        font-size: 1.35rem;
    }
    .post-reaction-btn .post-reaction-emoji .emoji-reaction-img,
    .post-reaction-btn .post-reaction-emoji picture .emoji-reaction-img {
        width: 1.35rem;
        height: 1.35rem;
    }
    .reaction-picker-item .emoji-picker-emoji,
    .reaction-picker-item picture .emoji-picker-emoji {
        width: 1.35rem;
        height: 1.35rem;
    }
    .post-reaction-more {
        width: 1.35rem;
        height: 1.35rem;
        min-width: 1.35rem;
        font-size: 1rem;
    }
    .reaction-picker-item {
        width: 2.25rem;
        min-width: 2.25rem;
        height: 2.25rem;
        font-size: 1.35rem;
    }
    .post-reaction-count {
        font-size: 0.75rem;
    }
    .reaction-burst-particle {
        font-size: 1.35rem;
    }
    .reaction-burst-particle img {
        width: 1.65rem;
        height: 1.65rem;
    }
    .reaction-burst-particle.reaction-compact {
        font-size: 1.2rem;
    }
    .reaction-burst-particle.reaction-compact img {
        width: 1.35rem;
        height: 1.35rem;
    }
}

