/* ═══════════════════════════════════════════════
   Feed — Layout (custom: no Campfire equivalent)
   ═══════════════════════════════════════════════ */
body.feed-page #main-content {
  justify-content: start;
}

.feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  max-inline-size: 100%;
  padding: calc(var(--navbar-height) + var(--block-space)) var(--inline-space) var(--block-space-double);
}

@media (min-width: 100ch) {
  .feed {
    max-inline-size: 680px;
    margin-inline: auto;
    padding-block-start: var(--block-space);
  }
}

/* ─── Feed sections ─── */
.feed__pinned { margin-block-end: var(--block-space-double); }

.feed__pinned .post-card {
  --border-color: oklch(var(--lch-blue) / 0.2);
  box-shadow: 0 0 0 1px oklch(var(--lch-blue) / 0.08);
}

.feed__loading { display: flex; justify-content: center; padding: var(--block-space-double) 0; }

/* ═══════════════════════════════════════════════
   Post Card (minimal custom — mostly utility classes in HTML)
   ═══════════════════════════════════════════════ */
.post-card--feed { cursor: pointer; }
.post-card--feed:hover { --border-color: var(--color-border-darker); }

/* Options button — hidden until hover (matches message__options-btn pattern) */
.post-card__options-btn {
  @media (hover: hover) and (pointer: fine) {
    opacity: 0;
    transition: opacity 150ms ease-in-out;
    transition-delay: 150ms;
  }
  @media (hover: none) and (pointer: coarse) {
    opacity: 0.5;
  }
}

:is(.post-card, .comment, .comment--reply):hover .post-card__options-btn,
:is(.post-card, .comment, .comment--reply):has([open]) .post-card__options-btn {
  opacity: 1;
}

/* Actions dropdown menu (replaces inline positioning) */
.post-card__actions-menu {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: 100%;
  z-index: 10;
  min-inline-size: 10rem;
}

/* Post title */
.post-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Pinned badge (feed card footer) */
.post-card__pinned-badge {
  background: oklch(var(--lch-blue) / 0.1);
  color: oklch(var(--lch-blue));
  border-radius: 1em;
  padding: 0.15em 0.6em;
}

/* Pinned comment label (show page) */
.post-card__pinned-label {
  color: oklch(var(--lch-blue));
  font-weight: 600;
}

/* Show page variant */
.feed--show { padding-block-end: 0; }

/* Section heading */
.feed__section-heading { margin-block-end: var(--block-space-half); }

/* Body truncation in feed */
.post-card__preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Media thumbnail */
.post-card__media-thumb {
  position: relative;
  border-radius: 0.5em;
  overflow: clip;
  margin-block-start: var(--block-space-half);
}

.post-card__media-thumb img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.post-card__media-thumb--video img { aspect-ratio: 16 / 9; }

.post-card__play-icon {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  font-size: 1.75rem;
  filter: drop-shadow(0 1px 4px oklch(var(--lch-always-black) / 0.3));
}

/* Full body — blog typography */
.post-card__body .trix-content { line-height: 1.75; }
.post-card__body .trix-content > :first-child { margin-block-start: 0; }
.post-card__body .trix-content > :last-child { margin-block-end: 0; }
.post-card__body .trix-content img { max-width: 100%; border-radius: 0.5em; margin-block: var(--block-space-half); }

/* Video embed */
.post-card__video-embed {
  aspect-ratio: 16 / 9;
  border-radius: 0.5em;
  overflow: clip;
  margin-block: var(--block-space-half);
}

.post-card__video-embed iframe,
.post-card__video-embed video { width: 100%; height: 100%; border: 0; }

/* Media gallery — below text body */
.post-card__media-gallery {
  margin-block-start: var(--block-space-half);
  display: flex;
  flex-direction: column;
  gap: var(--block-space-half);
}

.post-card__media-gallery img { max-width: 100%; border-radius: 0.5em; display: block; }

/* Commenter faces */
.post-card__faces { display: flex; }

.post-card__face {
  --avatar-size: 1.8ch;
  margin-inline-end: -0.25rem;
  border: 2px solid var(--color-bg);
  border-radius: 50%;
}

.post-card__face:last-child { margin-inline-end: 0; }

/* Like widget */
.like-widget { display: inline-flex; align-items: center; }
.like-widget form.button_to { display: inline; }
.like-widget--active { color: oklch(var(--lch-blue)); }

/* Likes popup */
.likes-popup {
  position: absolute;
  inset-block-end: 100%;
  inset-inline-start: 0;
  margin-block-end: var(--block-space-half);
  min-inline-size: 14rem;
  max-block-size: 16rem;
  overflow-y: auto;
  z-index: 10;
}

.likes-popup__heading {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* @mention highlight */
.trix-content .mention { color: var(--color-link); font-weight: 500; }

/* ═══════════════════════════════════════════════
   Post Composer
   ═══════════════════════════════════════════════ */
.post-form__title-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 1.4rem;
  font-weight: 300;
  color: inherit;
  background: transparent;
  padding: var(--block-space) var(--inline-space) var(--block-space-half);
}

.post-form__title-input::placeholder { color: var(--color-border-darker); }

.post-form__editor { padding-inline: var(--inline-space); min-block-size: 6rem; }

/* Show Trix toolbar in post composer */
.post-composer trix-toolbar {
  display: block !important;
  border-block-end: 1px solid var(--color-border);
  padding-block-end: var(--block-space-half);
  margin-block-end: var(--block-space-half);
}

.post-composer trix-toolbar .trix-button-group { border: none !important; margin-inline-end: 0.25rem !important; }
.post-composer trix-toolbar .trix-button { border: none !important; border-radius: 0.25em; }

.post-form__editor trix-editor {
  border: none !important;
  padding: 0 !important;
  min-block-size: 5rem;
  line-height: 1.7;
}

.post-form__editor trix-editor:focus { outline: none; box-shadow: none; }
.post-form__editor trix-editor img { max-width: 100%; max-height: 300px; object-fit: contain; border-radius: 0.4em; }

/* Media area in composer */
.post-form__media-area { padding-inline: var(--inline-space); }
.post-form__file-input { display: none; }

.post-form__media-files { display: flex; flex-wrap: wrap; gap: var(--block-space-half); }

.post-form__media-file-thumb {
  width: 80px; height: 80px; object-fit: cover; border-radius: 0.5em;
  border: 1px solid var(--color-border);
}

.post-form__media-file-name {
  display: inline-flex; align-items: center;
  padding: 0.4em 0.6em;
  font-size: 0.8rem;
}

/* Video URL input in composer */
.post-form__media-item-input {
  flex-grow: 1;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font-size: 0.85rem;
  padding: 0.25em 0;
}

.post-form__media-item-input::placeholder { color: var(--color-border-darker); }

/* GIF picker grid */
.gif-picker__results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.25em;
  max-height: 220px;
  overflow-y: auto;
}

.gif-picker__results img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 0.4em;
  cursor: pointer;
}

.gif-picker__results img:hover { opacity: 0.75; }

/* Hide Trix captions */
.post-form__editor figcaption { display: none !important; }

/* ═══════════════════════════════════════════════
   Comments
   ═══════════════════════════════════════════════ */

/* Comment bubble */
.comment__bubble {
  background: var(--color-message-bg);
  border-radius: 0.25em 0.75em 0.75em 0.75em;
}

.comment__text .trix-content { font-size: inherit; line-height: inherit; }
.comment__text .trix-content > :first-child { margin-block-start: 0; }
.comment__text .trix-content > :last-child { margin-block-end: 0; }
.comment__text .trix-content p { margin-block: 0.2em; }
.comment__text .trix-content img { max-width: 100%; max-height: 200px; border-radius: 0.4em; }

/* Reply indent */
.comment--reply { margin-inline-start: 3ch; }
.comment--reply .comment__avatar { --avatar-size: 2ch; }

/* Hide Trix toolbar in comment composers */
#new_comment_form trix-toolbar,
[data-comment-reply-target="form"] trix-toolbar { display: none !important; }

/* Hide figcaptions in comment composers */
#new_comment_form figcaption,
[data-comment-reply-target="form"] figcaption { display: none !important; }

/* Images inside comment Trix editors */
#new_comment_form trix-editor img,
[data-comment-reply-target="form"] trix-editor img {
  max-width: 100%;
  max-height: 150px;
  border-radius: 0.4em;
}

/* GIF picker inside comments — shorter than post composer */
#new_comment_form .gif-picker__results,
[data-comment-reply-target="form"] .gif-picker__results { max-height: 160px; }

/* Sticky comment composer at bottom */
.comment-composer-sticky {
  position: sticky;
  bottom: 0;
  background: var(--color-bg);
  z-index: 2;
}

/* ═══════════════════════════════════════════════
   Mobile
   ═══════════════════════════════════════════════ */
@media (max-width: 50ch) {
  .comment--reply { margin-inline-start: 2ch; }
}
