/* ===== entries.css — 投稿・バブル・スタンプ・アクション ===== */

.log-board {
  display: grid;
  gap: 0;
}

.day-divider {
  display: block;
  padding: 4px 0;
  color: #666;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  opacity: 0;
  position: relative;
  z-index: 1;
}

.day-divider.is-visible {
  opacity: 1;
}

.day-divider::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: #000;
  margin-bottom: 4px;
}

.day-divider span {
  white-space: nowrap;
  display: block;
  text-align: center;
}

/* 直後にポストがある場合のみ: 高さ0にしてテキストをポストに重ねる */
.day-divider:has(+ .entry) {
  height: 0;
  padding: 0;
  overflow: visible;
}

.day-divider:has(+ .entry) span {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
}

.entry {
  display: block;
  scroll-margin-top: 84px;
  opacity: 0;
}

.entry.is-visible {
  opacity: 1;
}

.entry.is-highlighted .author {
  color: #ff0000;
}

.entry.is-highlighted .author-icon {
  color: #ff0000;
  opacity: 1;
}

.bubble {
  padding: 9px 0;
  position: relative;
}

.bubble::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: #000;
}

.entry:has(+ .day-divider) .bubble,
#entries .entry:last-child .bubble {
  padding-bottom: 4px;
}

.entry:has(+ .day-divider) .bubble::after,
#entries .entry:last-child .bubble::after {
  display: none;
}

.bubble.loading-state {
  position: relative;
}

.bubble.loading-state > *:not(.pixel-loader):not(.stamp):not(.entry-actions) {
  opacity: 0;
  pointer-events: none;
}

.bubble.loading-state > .stamp > :not(.author),
.bubble.loading-state > .entry-actions > .view-count {
  opacity: 0;
  pointer-events: none;
}

.stamp {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.35;
  margin-bottom: 6px;
  word-break: break-word;
}

.author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: var(--muted);
  flex-shrink: 0;
}

.author-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.entry-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
}

.entry-media {
  border: 2px solid #000;
  background: #ddd;
  width: 66.66%;
  cursor: zoom-in;
}

.entry-media img {
  display: block;
  width: 100%;
}

.entry-caption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.81rem;
}

.entry-actions {
  margin-top: 7px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.icon-btn.is-danger {
  background: #ff4444;
  color: #fff;
  border-color: #cc0000;
}

.icon-btn.is-danger:hover {
  background: #cc0000;
  border-color: #990000;
}

.view-count {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-size: 0.68rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.view-count-plus {
  display: none;
}

.view-last-read {
  margin-left: 6px;
  color: #9a9a9a;
  font-size: 0.64rem;
  white-space: nowrap;
}

.view-last-read[hidden] {
  display: none !important;
}

@keyframes countBlink {
  0%, 100% { opacity: 1; }
  25%      { opacity: 0; }
  50%      { opacity: 1; }
  75%      { opacity: 0; }
}

@keyframes plusFlash {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}

.view-count-number.is-bumping {
  animation: countBlink 0.54s steps(1) forwards;
}

.view-count-plus.is-bumping {
  display: inline;
  animation: plusFlash 0.8s steps(1) forwards;
}
