/* ==========================================
   Markdown Tables & Code Blocks (Pure Text Style)
   ========================================== */
.markdown-table-text {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.35;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}

.markdown-code-block {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.35;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}

.markdown-code-block code {
  font-family: inherit;
  color: inherit;
}

.markdown-hr {
  border: none;
  height: 1em;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.markdown-hr::before {
  content: "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim-color);
  opacity: 0.45;
  white-space: nowrap;
  letter-spacing: 1px;
}

/* ==========================================
   MOTD ASCII Art Styling
   ========================================== */
.motd-ascii-art {
  white-space: pre;
  word-break: normal;
  overflow-x: visible;
  line-height: 1.1;
  display: block;
}

/* ==========================================
   Buddy Box ASCII Double-line Styling
   ========================================== */
.buddy-box {
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: 100%;
  margin: 15px 0 15px 7ch;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  white-space: nowrap;
  user-select: none;
}

.buddy-box-header,
.buddy-box-footer,
.buddy-box-divider {
  color: var(--dim-color);
  line-height: 1;
}

.buddy-box-title-row,
.buddy-box-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 2.1875em;
  /* 35px */
  /* Fits 31px high images comfortably */
  line-height: 1;
}

.buddy-box-title-row {
  height: 1.5em;
  /* 24px */
}

.buddy-border {
  color: var(--dim-color);
}

.buddy-title {
  flex-grow: 1;
  padding: 0 2ch;
  color: var(--accent-color);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.buddy-row-content {
  display: flex;
  gap: 0.75em;
  /* 12px */
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  padding: 0 2ch;
  height: 100%;
}

.buddy-link {
  display: inline-block;
  width: 5.5em;
  /* 88px */
  height: 1.9375em;
  /* 31px */
  line-height: 0;
  transition: transform 0.2s ease;
}

.buddy-link:hover {
  transform: translateY(-2px);
}

.buddy-img {
  width: 5.5em;
  /* 88px */
  height: 1.9375em;
  /* 31px */
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: 1px solid rgba(255, 255, 255, 0.2);
  outline-offset: -1px;
  border-radius: 2px;
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

.buddy-link:hover .buddy-img {
  outline-color: var(--link-color);
  box-shadow: 0 0 8px rgb(from var(--link-color) r g b / 0.5);
}

/* ==========================================
   Terminal Inline Image Rendering
   ========================================== */
.terminal-image {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  margin: 10px 0;
  border: 1px solid var(--dim-color);
  border-radius: 4px;
}
