/* forum_custom.css */
.blog-post-card,
.card-comment,
.card-comment-form {
    --bs-card-color: var(--bs-body-color);
    --bs-card-bg: var(--bs-light-bg-subtle); /* Use a subtle light background */
}

.post-content-html {
    overflow-wrap: break-word;
    word-wrap: break-word; /* Legacy fallback */
    word-break: break-word;
}
.avatar-sm { width:32px;height:32px;object-fit:cover;border-radius:50%;border:2px solid #dde5ea;background:#f4fbff;margin-right:12px;}
.comment-avatar { width:26px;height:26px;object-fit:cover;border-radius:50%;border:2px solid #e9e9e9;background:#f6fbff;margin-right:8px;}
.upvote-btn { background:none; border:none; padding:0.25em 0; color:#a2cfba; font-size:2em; display:block; width:100%; transition:.12s; }
.downvote-btn { background:none; border:none; padding:0.25em 0; color:#ea858f; font-size:2em; display:block; width:100%; transition:.12s; }
.upvote-btn.vote-active, .upvote-btn:hover { color:#198754; }
.downvote-btn.vote-active, .downvote-btn:hover { color:#dc3545; }
.vote-count-box {
  background: #f8fcff; border-radius:11px; border:1.2px solid #e7ecf0; min-width:54px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; padding:9px 0 8px 0; margin-right:26px;
  box-shadow:0 2.5px 12px #c8e2fe18;
}
.vote-score { font-size:1.18em; font-weight: 700; line-height:1.2; color:#235174; margin:1px 0 1px 0;}

.blog-post-card { border-radius:15px; background:#fff; box-shadow:0 4px 24px #d5e8fc14; border: 1.2px solid #e5eefa; border-color: inherit !important;}

.display-6 { font-family: 'Playfair Display', serif; font-weight:900; color:#14589a; }

.forum-card:hover,
.card:hover,
.blog-post-card:hover {
    background: #ffffff !important;
    box-shadow: #ffffff !important;
    border-color: inherit !important;
    transform: none !important;
    filter: none !important;
    color: inherit !important;
}

.blog-post-meta { color:black; font-size:1em;}
.post-content-html { font-size:1.06em; line-height:1.85; color:black; word-break:break-word; }
.post-content-html p { margin-bottom: 1.1em; }
.post-content-html h2, .post-content-html h3, .post-content-html h4 {
  font-family:inherit;font-weight:700;color:#288ac8;margin-top:1.3em;margin-bottom:.74em;line-height:1.24; }
 .post-content-html ul, .post-content-html ol { margin-bottom:1.15em; }
.post-content-html blockquote { color:#397; font-size:1.12em; background:#e7fbee; border-left:5px solid #48cca0; margin:1.2em 0;padding:0.7em 1em;}
.post-content-html pre { background:#f3f3f6; border-radius:7px; padding:.7em 1.2em; font-size:1em;}

.card-comment { border-radius:12px; margin-bottom:19px; background:#fafdff; border:1.2px solid #e7ecf0;}
.card-comment .card-body { padding:.93rem 1.23rem .5rem 1.1rem; }
.card-comment .badge { font-size:.85em; padding:.19em .62em;}

.sidebar-tree-panel { position: sticky; top: 78px; max-height: 86vh; overflow-y:auto;
  background: #f7fbff; border-radius:1.18em; border: 1px solid #dbe6ee; box-shadow:0 2px 14px #c6e5fe11;
  padding:1.62rem 1.28rem 1.45rem 1.13rem; }
  
.sidebar-tree-year { font-weight:600; color:#337399; margin-bottom:5px; margin-top:8px;}
.sidebar-tree-month { font-weight:500; color:#2bbf9b; margin-left:13px; margin-bottom:2px; margin-top:2px;}
.sidebar-tree-posts ul { margin:0 0 7px 25px; padding:0; list-style:none; }
.sidebar-tree-post-link { display:block;padding:3px 0 3px 8px; color:#185187; border-left:2.5px solid #ddeffe; border-radius:2px;
  font-size:1em; text-decoration:none; transition:background .12s;}
.sidebar-tree-post-link.active, .sidebar-tree-post-link:hover { background:#eaf7ff; color:#217bc0; border-left:2.5px solid #36b6fb; }
@media (max-width: 991px) { .sidebar-tree-panel { max-height: none; width:100%; position:static; margin:2rem 0 0 0; }}
@media (max-width: 767px) {
  .avatar-sm,.comment-avatar{width:20px;height:20px;}
  .vote-count-box{min-width:40px;padding:5px 0;}
}
/* Avatar in forum card/user header: always 32px, always perfect circle */
.forum-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: cover;
  object-position: center;
  border-radius: 50% !important;
  border: 2px solid #e9e9e9;
  background: #f6fbff;
  margin-right: 10px;
  box-shadow: 0 1px 4px rgba(10,40,90,0.09);
  display: inline-block;
  vertical-align: middle;
}



/* Bonus: avatar a bit smaller on mobile */
@media (max-width: 575px) {
  .forum-avatar {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    margin-right: 7px;
  }
}

.comment-meta { font-size:.96em; color:#000; }
.card-comment { border-radius:12px; margin-bottom: 22px; }
.card-comment .card-body { padding:.8rem 1.2rem; }
.card-comment .badge { font-size:.85em; padding:.18em .62em;}
.sidebar-thumb { width: 48px; height: 48px; object-fit:cover; border-radius:7px; border:1.2px solid #dde5ee; background:#fcfeff; }
.blog-post-meta { color: #868e96; font-size:.99em; }
[data-bs-theme="dark"] .card {
  --bs-card-bg: #dee2e608;
  background-color: var(--bs-card-bg) !important;
}
.forum-card-image-wrapper {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  overflow: hidden;
  background: #ddefff;
  border-top-left-radius: 0.7rem;
  border-top-right-radius: 0.7rem;
  flex-direction: row;          /* Make children flow side-by-side */
  align-items: center;          /* Center SVG/text vertically */
  justify-content: center;      /* Center both horizontally */
  gap: 0.75em;                  /* Spacing between logo and text */
  min-height: 112px;
  max-height: 180px;
}
.tag-highlight {
  color: #209CEE;
  font-weight: bold;
}

.forum-card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0.7rem 0.7rem 0 0;
  background: #ddefff;
}

.profile-avatar-bg {
  background-repeat: no-repeat;
  background-size: cover; /* Ensures 'cover', not tile */
  background-position: center;
}

.forum-card-body-truncate {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;   /* or whatever number of lines you want */
  overflow: hidden;
  text-overflow: ellipsis;
}


.card-text, .entry-summary {
  overflow: visible !important;
  max-height: none !important;
  min-height: 0 !important;
}
.forum-card .card-body {
  overflow: visible !important;
}

/* Headings */
.comments-title,
h4.comments-title { color: #14589a; font-weight: 700; }
[data-bs-theme="dark"] .comments-title,
[data-bs-theme="dark"] h4.comments-title { color: #000000; }
.sidebar-tree-panel h5 { color: #178bad; }


/* Comment cards */
.card-comment { background: #fafdff; color: #222; border-radius:12px; border:1.2px solid #e7ecf0;}
[data-bs-theme="dark"] .card-comment {
  background: #1f2630 !important;
  color: #f2fffe !important;
  border-color: #24415e !important;
}
.card-comment .fw-semibold,
.card-comment .comment-author { color: #209cee !important; }
[data-bs-theme="dark"] .card-comment .fw-semibold,
[data-bs-theme="dark"] .card-comment .comment-author { color: #85e7ff !important; }

/* Text editor fixes */
.trumbowyg-box { min-height: 180px !important; }
.trumbowyg-editor, .trumbowyg-textarea {
  min-height: 150px !important;
  background: #fff;
  
}
[data-bs-theme="dark"] .trumbowyg-box,
[data-bs-theme="dark"] .trumbowyg-editor,
[data-bs-theme="dark"] .trumbowyg-textarea {
  background: #fff !important;
  border-color: #2b3745 !important;
}

[data-bs-theme="dark"] .trumbowyg-button-pane button,
[data-bs-theme="dark"] .trumbowyg-button-pane span {
  
}
.post-content-html p { margin-bottom: 1.1em; }


.comment-avatar {
  width: 28px !important;
  height: 28px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  border: 2px solid #e9e9e9 !important;
  background: #f6fbff !important;
  margin-right: 7px !important;
  display: inline-block !important;
}

@media (max-width: 767px) {
  .comment-avatar { width: 22px !important; height: 22px !important; }
}
.avatar-sm {
    width: 32px; height: 32px; object-fit: cover; border-radius: 50%; border:2px solid #e9e9e9; background:#f5fcff; margin-right: 8px;
}

[data-bs-theme="dark"] .trumbowyg-button-pane {
  border-bottom: 1px solid #253143 !important;
}

/* Restrict image to content width and prevent overflow */
.forum-post-content img {
    max-width: 100%;
    height: auto !important;
    display: inline-block;
    vertical-align: middle;
    /* Prevents image being outside of container and improves shrinkage */
}

/* Default: In Line with Text */
.img-inline { display: inline; }

/* Square: Text wraps square around image */
.img-square { float: left; margin: 8px 16px 8px 0; }

/* Tight: For transparent images with close wrapping (requires JS or editor config for advanced shape) */
.img-tight { float: left; margin: 8px 16px 8px 0; }

/* Through: Even tighter, for demonstration, behaves similar to tight unless advanced shape is defined */
.img-through { float: left; margin: 8px 16px 8px 0; }

/* Top and Bottom only: No text to sides */
.img-top-bottom { display: block; margin: 16px auto; clear: both; }

/* Behind Text: Needs absolute/fixed container, handled via editor overlay or z-index on image in content-editable area */
.img-behind { position: absolute; z-index: 0; opacity: 0.7; }

/* In Front of Text: higher z-index (editor mode) */
.img-front { position: absolute; z-index: 10; }

/* Alignment classes */
.img-left { float: left; margin-right: 16px; }
.img-right { float: right; margin-left: 16px; }
.img-center { display: block; margin: 0 auto 16px auto; }
.img-top { vertical-align: top; }
.img-middle { vertical-align: middle; }
.img-bottom { vertical-align: bottom; }

/* Editor-specific overlays for resize handles and wrap/alignment overlay UI */
.img-selected {
    outline: 2px solid #0078d7;
    position: relative;
}

.img-toolbar { background: #fff; border: 1px solid #bbd; padding:6px 8px; border-radius:8px; z-index:10000; }
.img-resize-handle {
    position: absolute;
    width: 10px; height: 10px;
    background: #0078d7;
    border-radius: 50%;
    border: 1.5px solid #fff;
    z-index: 20000;
    pointer-events: auto;
}

.forum-trumbowyg { min-height: 160px; }
.forum-card:hover,
.card:hover,
.blog-post-card:hover {
    background: inherit !important;
    box-shadow: inherit !important;
    border-color: inherit !important;
    transform: none !important;
    filter: none !important;
    color: inherit !important;
}
/* Force textarea to fill */
.forum-trumbowyg, #forum-quick-content, .trumbowyg-textarea {
  min-height: 160px !important;
  height: 130px !important;
  resize: vertical;
}

.flex-grow-1 {
    min-width: 0;
}
.post-content-html {
    overflow-wrap: break-word;
    word-wrap: break-word; 
}
.post-content-html pre {
    white-space: pre-wrap;    /* Allows the code block to wrap long lines */
    word-break: break-all;    /* Breaks even long, unbroken strings inside the code */
    background-color: #f0f0f0; /* A light background for code blocks */
    padding: 1rem;
    border-radius: 0.25rem;
    overflow-x: auto;         /* As a last resort, makes only the code block scrollable, not the whole page */
}
.post-content-html img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
}
.trumbowyg-box, .trumbowyg-button-pane {
    background: #ffffff !important;
    border-color: #dee2e6 !important;
}
.trumbowyg-editor, .trumbowyg-textarea {
    color: #212529 !important;
	min-height: 100% !important;
}
.trumbowyg-button-pane .trumbowyg-button-group button {
    color: #495057 !important;
}

.trumbowyg-modal,
.trumbowyg-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: #212529 !important;
}
.trumbowyg-modal-box label {
    color: #212529 !important;
}
.trumbowyg-modal-box input[type="text"],
.trumbowyg-modal-box input[type="url"],
.trumbowyg-modal-box input[type="email"] {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}
.trumbowyg-modal-box .trumbowyg-modal-button {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}

.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit {
    background-color: #0d6efd !important; /* Bootstrap's primary blue */
    color: #ffffff !important;
    border-color: #0d6efd !important;
}

/* 4. Style the items inside the dropdown menus */
.trumbowyg-dropdown a,
.trumbowyg-dropdown button {
    color: #212529 !important;
}

.trumbowyg-dropdown a:hover,
.trumbowyg-dropdown button:hover {
    background-color: #e9ecef !important; /* A light gray for hover */
}