/* Highlight the phpBB comments link on node pages */
.phpbb-bridge-comments-container a.phpbb-bridge-comments-link {
  color: #c00;
  font-weight: 700;
}

/* --- phpBB topic preview (first posts) --- */
.phpbb-bridge-preview {
  margin-top: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 12px;
}

.phpbb-bridge-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.phpbb-bridge-preview__all {
  font-size: 0.9em;
  text-decoration: none;
}

.phpbb-bridge-preview__list {
  display: grid;
  gap: 10px;
  /* Prevent the grid from stretching rows and creating large blank areas
     if a parent container gives it extra height. */
  align-content: start;
}

.phpbb-bridge-preview__item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  background: #fff;
}

/* Make it easier to scan: alternating backgrounds */
.phpbb-bridge-preview__item:nth-child(even) {
  background: #fafafa;
}

.phpbb-bridge-preview__avatar,
.phpbb-bridge-preview__avatar img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

/* Left column: avatar + username underneath */
.phpbb-bridge-preview__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.phpbb-bridge-preview__who {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.phpbb-bridge-preview__user {
  font-weight: 600;
  font-size: 0.85em;
  line-height: 1.15;
  text-align: center;
  max-width: 92px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.phpbb-bridge-preview__time {
  font-size: 0.8em;
  opacity: 0.65;
  white-space: nowrap;
}

.phpbb-bridge-preview__msg,
.phpbb-bridge-preview__message {
  line-height: 1.35;
}

.phpbb-bridge-preview__message img.smilies {
  vertical-align: middle;
  width: 20px;
  height: 20px;
  display: inline-block;
}

.phpbb-bridge-preview__message {
  margin-top: 0;
}

.phpbb-bridge-preview__footer {
  text-align: center;
  /* Make footer span full width and keep it compact. */
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 6px;
}

.phpbb-bridge-preview__more {
  display: inline-block;
  /* Compact "Далее" button */
  padding: 5px 10px;
  font-size: 0.85em;
  line-height: 1.1;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  text-decoration: none;
}

.phpbb-bridge-preview__more:hover {
  text-decoration: underline;
}

/* --- Make phpBB quotes look nice inside Drupal theme --- */
.phpbb-bridge-preview__message blockquote,
.phpbb-bridge-preview__message .quote {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 4px solid #d9d9d9;
  background: #f5f5f5;
  border-radius: 10px;
}

/* Some Drupal themes add huge decorative quotes via ::before/::after. Disable them here. */
.phpbb-bridge-preview__message blockquote::before,
.phpbb-bridge-preview__message blockquote::after,
.phpbb-bridge-preview__message .quote::before,
.phpbb-bridge-preview__message .quote::after {
  content: none !important;
}

.phpbb-bridge-preview__message blockquote {
  quotes: none;
}

.phpbb-bridge-preview__message blockquote cite,
.phpbb-bridge-preview__message .quote cite,
.phpbb-bridge-preview__message .quote .quoteheader {
  display: block;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
  margin-bottom: 6px;
}

.phpbb-bridge-preview__message blockquote cite a,
.phpbb-bridge-preview__message .quote cite a {
  color: inherit;
  text-decoration: none;
}

/* Nested quotes */
.phpbb-bridge-preview__message blockquote blockquote,
.phpbb-bridge-preview__message .quote .quote {
  background: #ffffff;
  border-left-color: #e6e6e6;
}

/* Keep quoted content readable */
.phpbb-bridge-preview__message blockquote > div,
.phpbb-bridge-preview__message .quote > div {
  margin: 0;
}

/* Images inside messages (incl. smilies) should not break layout */
.phpbb-bridge-preview__message img {
  max-width: 100%;
  height: auto;
}
