/* Reply item (nested comment thread) */

.reply-message img.pages-emoji-inline {
  width: 25px;
  height: 25px;
  vertical-align: middle;
  display: inline-block;
  margin: 0 2px;
  border: 0;
}

.reply-thread-list--desktop {
  display: none;
}

.reply-thread-list--mobile {
  display: block;
}

@media (min-width: 48rem) {
  .reply-thread-list--desktop {
    display: block;
  }

  .reply-thread-list--mobile {
    display: none;
  }
}

.reply-item-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.1rem;
  position: relative;
}

/* Left rail: avatar + connector + collapse */
.reply-avatar-rail {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  align-self: stretch;
  flex-shrink: 0;
  width: 32px;
}

.reply-item .reply-item .reply-avatar-rail,
.reply-item .reply-item .reply-thread-rail {
  width: 32px;
}

.reply-avatar-link {
  display: block;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.reply-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: var(--color-surface-container, #efeded);
  overflow: hidden;
  border: 1px solid var(--color-outline-variant, #79747e);
}

.reply-item .reply-item .reply-avatar {
  width: 2rem;
  height: 2rem;
}

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

.reply-rail-connector {
  position: absolute;
  width: 2px;
  height: 100%;
  background-color: var(--color-outline-variant);
}

.reply-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 1px solid color-mix(in oklab, var(--color-outline-variant, #79747e) 60%, transparent);
  background-color: var(--color-surface-container-lowest, #fff);
  color: var(--color-secondary, #79747e);
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
  cursor: pointer;
}

.reply-collapse-btn:hover {
  border-color: var(--color-cricket-green, #079d50);
  color: var(--color-cricket-green, #079d50);
}

.reply-collapse-btn .material-symbols-outlined {
  font-size: 14px;
  line-height: 1;
}

/* Content */
.reply-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.reply-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: bold;
  margin-top: 0.5rem;
}

.reply-username {
  font-family: var(--font-headline-md, Montserrat, sans-serif);
  font-size: 15px;
  color: var(--color-on-surface, #1c1b1f);
  margin-left: 10px;
}

.reply-item .reply-item .reply-username {
  font-size: 13px;
  margin-left: 5px;
}

.reply-date {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--color-secondary, #79747e);
}

.reply-item .reply-item .reply-date {
  font-size: 11px;
}

.reply-message {
  margin-top: 0.5rem;
  font-family: var(--font-body-sm, Inter, sans-serif);
  font-size: 15px;
  line-height: 1.625;
  word-break: break-all;
  color: var(--color-on-surface-variant, #49454f);
  margin-left: 10px;
}

.reply-item .reply-item .reply-message {
  margin-top: 0.25rem;
  font-size: 14px;
  margin-left: 0;
}

.reply-message {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
.reply-message img:not(.reply-content-img),
.reply-message video,
.reply-message iframe,
.reply-message embed {
  display: inline-block;
  max-width: 100%;
  height: auto !important;
}

/* Discussion content images: uniform thumbnails */
.reply-message .reply-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0.5rem 0;
  max-width: 80%;
}

.reply-image-thumb {
  flex: 1 1 calc(50% - 4px);
  max-width: calc(50% - 4px);
  aspect-ratio: 4 / 3;
  border-radius: 0.5rem;
  overflow: hidden;
  display: block;
  cursor: zoom-in;
  border: 0;
  padding: 0;
  background: var(--color-surface-container, #f3f3f3);
  text-decoration: none;
  line-height: 0;
}

.reply-image-gallery:has(.reply-image-thumb:only-child) .reply-image-thumb {
  flex: 0 1 auto;
  width: min(100%, 224px);
  max-width: 100%;
}

.reply-image-thumb img.reply-content-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: none !important;
  height: 100% !important;
}

/* Image lightbox */
.reply-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.reply-image-lightbox.hidden {
  display: none;
}

.reply-image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
}

.reply-image-lightbox__inner {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
}

.reply-image-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 0.5rem;
  object-fit: contain;
}

.reply-image-lightbox__close {
  position: absolute;
  top: -2.75rem;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}

.reply-image-lightbox__close .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
}

body.reply-image-lightbox-open {
  overflow: hidden;
}

/* Actions */
.reply-actions {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  min-width: 0;
  margin-top: 1rem;
  margin-left: 5px;
}

.reply-item .reply-item .reply-actions {
  gap: 1rem;
  margin-top: 0.75rem;
}

.reply-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: none;
  padding: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-secondary, #79747e);
  cursor: pointer;
  transition: color 0.15s ease;
  text-decoration: none;
}

.reply-item .reply-item .reply-action-btn {
  font-size: 11px;
}

.reply-action-btn:hover {
  color: var(--color-cricket-green, #079d50);
}

.reply-action-btn.haya-post-like-loved,
.reply-action-btn.haya-post-like-loved:hover {
  color: var(--color-cricket-green, #079d50);
}

.reply-action-btn:disabled {
  cursor: default;
  opacity: 1;
}

.reply-action-btn .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
}

.reply-item .reply-item .reply-action-btn .material-symbols-outlined {
  font-size: 14px;
}

/* Inline reply form slot */
.reply-form-slot {
  grid-column: 2;
  grid-row: 3;
  min-width: 0;
  padding: 0.5rem 0;
}

.reply-children-list .reply-item:not(:has(.reply-children-list)) .reply-form-slot {
  margin-left: -33px;
}

/* Child thread rail */
.reply-thread-rail {
  grid-column: 1;
  grid-row: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  flex-shrink: 0;
  width: 2.5rem;
}

.reply-thread-line {
  width: 2px;
  flex: 1;
  min-height: 12px;
  margin-top: 1px;
  background-color: color-mix(in oklab, var(--color-outline-variant, #79747e) 50%, transparent);
}

.reply-children {
  grid-column: 2;
  grid-row: 4;
  min-width: 0;
  margin-top: 0.25rem;
  position: relative;
}

.reply-children-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.5rem;
}

.reply-children-list .reply-item {
  position: relative;
}

.reply-children-list .reply-item::before {
  content: '';
  display: block;
  position: absolute;
  height: 15px;
  width: 15px;
  top: 0;
  left: -18px;
  border-left: 2px solid var(--color-outline-variant);
  border-bottom: 2px solid var(--color-outline-variant);
  border-radius: 0 0 0 20px;
  z-index: 10;
}

.reply-children-list .reply-item:last-child::after {
  content: '';
  display: block;
  position: absolute;
  height: 100%;
  width: 20px;
  top: 0;
  left: -26px;
  background: white;
}

.reply-inline-form-wrap .message-editor {
  min-height: 80px;
}

.reply-inline-form-wrap .message-editor.is-empty:before {
  content: attr(data-placeholder);
  color: color-mix(in oklab, var(--color-secondary, #79747e) 70%, transparent);
  pointer-events: none;
}

.reply-inline-form-wrap .emoface {
  position: relative;
}

.reply-inline-form-wrap .emoface .qqFace {
  position: absolute;
  z-index: 20;
  left: 0;
  top: 0.25rem;
}

/* Deeper replies link (shown at max nesting depth) */
.reply-deeper-link-wrap {
  padding-top: 0.5rem;
}

.reply-deeper-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: none;
  padding: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-cricket-green, #079d50);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.reply-deeper-link:hover {
  opacity: 0.85;
}

.reply-deeper-link__icon {
  font-size: 18px;
  line-height: 1;
}

.reply-item .reply-item .reply-deeper-link {
  font-size: 11px;
}

.reply-item .reply-item .reply-deeper-link__icon {
  font-size: 14px;
}

.reply-message-link {
  color: inherit;
  text-decoration: none;
}

.reply-view-thread {
  text-decoration: none;
}
