/* ==========================================================================
   r/labdachshunds (/adc/) — Pixel-Faithful Reddit / r/labrats Styling
   Authored & Moderated by u/DJ_PJ_MOD
   ========================================================================== */

:root {
  --canvas: #dae0e6;
  --card: #ffffff;
  --card-hover: #f8f9fa;
  --border: #cccccc;
  --border-light: #edeff1;
  --text-main: #1c1c1c;
  --text-body: #222222;
  --text-muted: #787c7e;
  --reddit-orange: #ff4500;
  --reddit-blue: #0079d3;
  --reddit-blue-hover: #1484d6;
  --downvote-blue: #7193ff;
  --mod-green: #46d160;
  --op-blue: #0079d3;
  --banner-bg: #1e4b7a;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--canvas);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: var(--reddit-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   TOP GLOBAL REDDIT NAVBAR
   ========================================================================== */
.reddit-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 48px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.snoo-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.4px;
  text-decoration: none !important;
}

.snoo-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--reddit-orange);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
}

.sub-pill-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: #f6f7f8;
}

.topbar-search {
  flex: 1;
  max-width: 580px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: #f6f7f8;
  padding: 0 16px 0 38px;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
}

.topbar-search input:focus {
  background: #ffffff;
  border-color: var(--reddit-blue);
}

.topbar-search .search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-chip-btn {
  border: 1px solid var(--reddit-blue);
  color: var(--reddit-blue);
  background: #ffffff;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
}

.top-chip-btn:hover {
  background: #f2f8fd;
}

.top-chip-btn.solid {
  background: var(--reddit-blue);
  color: #ffffff;
}

.top-chip-btn.solid:hover {
  background: var(--reddit-blue-hover);
}

/* ==========================================================================
   SUBREDDIT BANNER & HEADER
   ========================================================================== */
.sub-banner {
  height: 112px;
  background:
    linear-gradient(120deg, rgba(16, 52, 92, 0.92), rgba(14, 96, 118, 0.86)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 10px, transparent 10px, transparent 20px);
  position: relative;
  overflow: hidden;
}

.sub-banner-pattern {
  max-width: 1020px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  color: rgba(255, 255, 255, 0.22);
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  user-select: none;
}

.sub-header-strip {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
}

.sub-header-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px 14px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.sub-avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  margin-top: -22px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.sub-title-block {
  padding-top: 8px;
  flex: 1;
}

.sub-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sub-title-row h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-main);
}

.sub-handle {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.join-btn {
  background: var(--reddit-blue);
  color: #ffffff;
  border: 1px solid var(--reddit-blue);
  border-radius: 999px;
  padding: 6px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.join-btn:hover {
  background: var(--reddit-blue-hover);
}

.join-btn.joined {
  background: #ffffff;
  color: var(--reddit-blue);
}

/* ==========================================================================
   MAIN TWO-COLUMN REDDIT LAYOUT (FEED + SIDEBAR)
   ========================================================================== */
.reddit-container {
  max-width: 1020px;
  margin: 18px auto 48px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 312px;
  gap: 24px;
  align-items: start;
}

/* Sort Bar Card */
.sort-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.sort-btn:hover {
  background: #f0f2f4;
  color: var(--text-main);
}

.sort-btn.active {
  background: #f0f2f4;
  color: var(--reddit-blue);
}

.flair-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.flair-chip {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.flair-chip:hover {
  border-color: var(--reddit-blue);
}

.flair-chip.active {
  background: var(--reddit-blue);
  color: #ffffff;
  border-color: var(--reddit-blue);
}

/* ==========================================================================
   POST CARDS (FEED VIEW & FULL THREAD VIEW)
   ========================================================================== */
.post-card {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.12s ease;
}

.post-card.feed-item:hover {
  border-color: #898989;
}

.vote-col {
  width: 42px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  flex-shrink: 0;
  user-select: none;
}

.vote-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #878a8c;
  font-size: 16px;
  line-height: 1;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vote-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.vote-btn.up.active {
  color: var(--reddit-orange);
}

.vote-btn.down.active {
  color: var(--downvote-blue);
}

.vote-score {
  font-size: 12px;
  font-weight: 700;
  margin: 3px 0;
  color: var(--text-main);
}

.vote-score.upvoted { color: var(--reddit-orange); }
.vote-score.downvoted { color: var(--downvote-blue); }

.post-main {
  flex: 1;
  padding: 9px 14px 8px 10px;
  min-width: 0;
}

.post-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.pinned-tag {
  color: #2e9e44;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
}

.user-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
}

.badge-mod {
  background: #e6f7ea;
  color: #1d8a35;
  border: 1px solid #9be0ab;
}

.badge-op {
  background: #e6f3fc;
  color: var(--op-blue);
  border: 1px solid #9acdf4;
}

.user-flair {
  background: #edeff1;
  color: #444;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
}

/* Post Flairs */
.post-flair {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
  margin-right: 6px;
}

.flair-protocol { background: #dff4e7; color: #116634; }
.flair-facs     { background: #e1effe; color: #164e99; }
.flair-gpcr     { background: #f3e8ff; color: #6b21a8; }
.flair-ngs      { background: #e0f7fa; color: #006064; }
.flair-adc      { background: #ffedd5; color: #9a3412; }
.flair-rant     { background: #fee2e2; color: #991b1b; }
.flair-flame    { background: #ff4500; color: #ffffff; }
.flair-cmc      { background: #fef3c7; color: #92400e; }

/* Reddit Awards & Mod Action Stubs */
.awards-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.award-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  background: #fff8e6;
  border: 1px solid #f0d58c;
  color: #7c5800;
  padding: 0 5px;
  border-radius: 999px;
}

.mod-removed-box {
  background: #fdf2f2;
  border-left: 3px solid #dc2626;
  padding: 6px 10px;
  margin: 4px 0 6px 0;
  font-size: 12.5px;
  color: #7f1d1d;
  font-style: italic;
}

.controversial-dagger {
  color: #ff4500;
  font-weight: 800;
  margin-left: 2px;
  title: "Controversial";
}

.comment-node.downvoted-heavy > .comment-header .comment-author {
  color: #6b7280;
}

.comment-node.downvoted-heavy > .comment-body-wrap .comment-text {
  color: #4b5563;
}

.locked-branch-notice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin: 6px 0;
}

.post-title {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
}

.post-title a {
  color: var(--text-main);
  text-decoration: none;
}

.post-title a:hover {
  color: var(--reddit-blue);
}

.post-preview {
  color: #3a3d40;
  font-size: 13.5px;
  margin: 0 0 8px 0;
  line-height: 1.48;
}

.post-thumb-inline {
  max-height: 220px;
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  display: block;
  margin: 8px 0;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 3px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
}

.action-btn:hover {
  background: #edeff1;
  color: var(--text-main);
}

/* ==========================================================================
   FULL THREAD BODY CONTENT & SCIENTIFIC FIGURES
   ========================================================================== */
.thread-body {
  color: var(--text-body);
  font-size: 14.5px;
  line-height: 1.6;
}

.thread-body h3 {
  font-size: 16px;
  margin: 18px 0 6px 0;
  color: #111;
}

.thread-body p {
  margin: 0 0 12px 0;
}

.thread-body ul, .thread-body ol {
  margin: 0 0 12px 22px;
  padding: 0;
}

.thread-body li {
  margin-bottom: 6px;
}

.thread-body code {
  background: #f1f3f5;
  border: 1px solid #e1e4e8;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  color: #b91c1c;
}

.sci-callout {
  background: #f4f8fc;
  border-left: 4px solid var(--reddit-blue);
  padding: 10px 14px;
  margin: 12px 0;
  border-radius: 0 4px 4px 0;
  font-size: 13.5px;
}

.sci-figure {
  background: #fbfcfd;
  border: 1px solid #d5dbe1;
  border-radius: 6px;
  padding: 12px;
  margin: 14px 0;
  text-align: center;
}

.sci-figure svg, .sci-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.sci-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.sci-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.sci-table th, .sci-table td {
  border: 1px solid #d8dde2;
  padding: 7px 9px;
  text-align: left;
}

.sci-table th {
  background: #f0f4f8;
  font-weight: 700;
}

/* ==========================================================================
   COMMENTS SECTION (WORKING NESTED COLLAPSE & LIVE REPLY BOX)
   ========================================================================== */
.comments-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px 18px 22px 18px;
}

.comment-composer {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.comment-composer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-composer select {
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.comment-composer textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.comment-composer textarea:focus {
  outline: none;
  border-color: var(--reddit-blue);
}

.composer-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.comment-node {
  position: relative;
  margin-top: 14px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e9eef5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: 1px solid #d0d7de;
}

.comment-author {
  font-weight: 700;
  color: var(--text-main);
}

.collapse-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 3px;
}

.collapse-btn:hover {
  color: var(--reddit-blue);
}

.comment-body-wrap {
  display: flex;
  align-items: stretch;
}

.thread-line-col {
  width: 24px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  cursor: pointer;
}

.thread-line {
  width: 2px;
  background: #edeff1;
  transition: background 0.12s;
}

.thread-line-col:hover .thread-line {
  background: var(--reddit-blue);
}

.comment-content-col {
  flex: 1;
  min-width: 0;
  padding-left: 4px;
}

.comment-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-body);
  margin: 0 0 4px 0;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.comment-actions .vote-btn {
  width: 20px;
  height: 20px;
  font-size: 13px;
}

.comment-children {
  margin-left: 4px;
  margin-top: 6px;
}

.comment-children .comment-children .comment-children .thread-line-col {
  width: 18px;
}

/* Collapsed Comment State */
.comment-node.collapsed > .comment-body-wrap {
  display: none;
}

.collapsed-summary {
  display: none;
  font-size: 11px;
  color: var(--reddit-blue);
  font-style: italic;
  cursor: pointer;
}

.comment-node.collapsed > .comment-header .collapsed-summary {
  display: inline;
}

/* "Load more replies" expandable hidden thread */
.more-replies-btn {
  margin: 10px 0 4px 28px;
  border: none;
  background: transparent;
  color: var(--reddit-blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 3px 6px;
}

.more-replies-btn:hover {
  text-decoration: underline;
}

.hidden-replies {
  display: none;
}

.hidden-replies.expanded {
  display: block;
}

/* ==========================================================================
   RIGHT SIDEBAR (ABOUT COMMUNITY, RULES, MODERATORS)
   ========================================================================== */
.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 14px;
  overflow: hidden;
}

.sidebar-head {
  background: var(--banner-bg);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}

.sidebar-body {
  padding: 12px;
  font-size: 13px;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin: 10px 0;
}

.sidebar-stats strong {
  display: block;
  font-size: 16px;
  color: var(--text-main);
}

.sidebar-stats span {
  font-size: 12px;
  color: var(--text-muted);
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #46d160;
  margin-right: 4px;
}

.rule-item {
  border-bottom: 1px solid var(--border-light);
  padding: 8px 0;
}

.rule-item:last-child { border-bottom: none; }

.rule-toggle {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}

.rule-desc {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: #4a4d50;
  line-height: 1.45;
}

.rule-item.open .rule-desc {
  display: block;
}

.mod-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mod-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}

@media (max-width: 860px) {
  .reddit-container {
    grid-template-columns: 1fr;
  }
  .topbar-search {
    display: none;
  }
}
