/* ForumSam1337 Original UI Layer
   This stylesheet is an original visual system inspired only by common forum UX patterns. */
:root{--fs-border:#242932;--fs-muted:#8e96a3}
.fs-accent-line{height:1px;background:linear-gradient(90deg,#fff,rgba(255,255,255,.08),transparent)}

/* Create-thread form: stable category/unlock controls. */
.topic-field{display:flex;flex-direction:column;gap:7px}
.topic-field>label,.unlock-method-box>label{color:#d9dde3;font-size:12px;font-weight:850;letter-spacing:.01em}
.topic-select{display:block!important;min-height:48px!important;height:auto!important;line-height:1.35!important;appearance:auto!important;-webkit-appearance:auto!important;border:1px solid #334155!important;border-radius:12px!important;background:#0f172a!important;color:#e5e7eb!important;padding:0 14px!important;outline:none!important;box-shadow:none!important}
.topic-select:focus{border-color:#64748b!important;box-shadow:0 0 0 3px rgba(100,116,139,.12)!important}
.topic-select option{background:#0f172a;color:#e5e7eb;padding:8px}
.topic-field input,.topic-field textarea{outline:none}
.topic-field input:focus,.topic-field textarea:focus{border-color:#64748b!important;box-shadow:0 0 0 3px rgba(100,116,139,.12)}
.topic-field+ .topic-field{margin-top:2px}
.light .topic-select{background:#fff!important;color:#1f2937!important;border-color:#d1d5db!important}
.light .topic-select option{background:#fff;color:#1f2937}

/* Thread author/profile sidebar */
.thread-main-post{display:grid;grid-template-columns:205px minmax(0,1fr);gap:24px;margin-top:24px;padding-top:24px;border-top:1px solid #292e36}
.thread-main-body{min-width:0}
.post-profile-card{width:100%;padding:18px 14px;text-align:center;background:linear-gradient(180deg,#24202f,#1b1923);border:1px solid #302b3b;border-radius:12px;box-shadow:0 10px 28px rgba(0,0,0,.14)}
.post-profile-avatar{display:flex;width:118px;height:118px;margin:0 auto 12px;align-items:center;justify-content:center;border-radius:7px;overflow:hidden;background:#11141a;border:1px solid #393441}
.post-profile-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.post-profile-initial{font-size:42px;font-weight:900;color:#e9e4f1}
.post-profile-name{font-size:15px;font-weight:900;line-height:1.25;word-break:break-word}
.post-profile-name a{text-decoration:none}
.post-profile-role{display:inline-flex;align-items:center;gap:4px;margin-top:7px;padding:4px 7px;border-radius:5px;font-size:9px;font-weight:900;letter-spacing:.08em;background:#17151d;border:1px solid #3a3445;color:#ddd4ea}
.post-profile-rank{margin-top:12px;font-size:11px;font-weight:900;letter-spacing:.22em;color:#f2edf6}
.post-profile-divider{height:8px;margin:13px 0 10px;background:#17141c;border-radius:1px}
.post-profile-stats{display:grid;gap:4px;text-align:left;font-size:10px;color:#8e8798}
.post-profile-stats span{display:flex;justify-content:space-between;gap:8px}
.post-profile-stats b{color:#eee9f2;font-weight:800}
.post-profile-joined{margin-top:11px;padding-top:10px;border-top:1px solid #322d39;font-size:9px;color:#777080}
.post-layout{display:grid;grid-template-columns:190px minmax(0,1fr);gap:0;overflow:hidden;margin-bottom:14px}
.post-profile-wrap{padding:16px;border-right:1px solid #292e36;background:rgba(255,255,255,.012)}
.post-profile-wrap .post-profile-card{background:transparent;border:0;box-shadow:none;padding:4px 2px}
.comment-body{min-width:0;padding:18px 20px}
.comment-user-mobile{display:none;font-size:12px;font-weight:800;color:#dbe1e9}
.light .post-profile-card{background:linear-gradient(180deg,#f2eef7,#e9e6ee);border-color:#d9d5df}
.light .post-profile-wrap{border-color:#dfe2e7;background:rgba(0,0,0,.015)}
.light .post-profile-avatar{background:#fff;border-color:#d7d3dd}
.light .post-profile-divider{background:#ded9e4}
.light .post-profile-stats b{color:#25212c}
.light .post-profile-joined{border-color:#d8d4dd}
.light .comment-user-mobile{color:#292631}
@media(max-width:760px){
  .thread-main-post{grid-template-columns:1fr;gap:14px;margin-top:18px;padding-top:18px}
  .thread-main-post>.post-profile-card{display:grid;grid-template-columns:64px minmax(0,1fr);grid-template-areas:"avatar name" "avatar rank" "avatar stats";column-gap:12px;text-align:left;padding:12px}
  .thread-main-post .post-profile-avatar{grid-area:avatar;width:64px;height:64px;margin:0}
  .thread-main-post .post-profile-name{grid-area:name;align-self:end}
  .thread-main-post .post-profile-rank{grid-area:rank;margin-top:4px}
  .thread-main-post .post-profile-stats{grid-area:stats;display:flex;gap:10px;flex-wrap:wrap;margin-top:5px}
  .thread-main-post .post-profile-role,.thread-main-post .post-profile-divider,.thread-main-post .post-profile-joined{display:none}
  .post-layout{grid-template-columns:1fr;}
  .post-profile-wrap{border-right:0;border-bottom:1px solid #292e36;padding:10px 12px}
  .post-profile-wrap .post-profile-card{display:grid;grid-template-columns:52px minmax(0,1fr);grid-template-areas:"avatar name" "avatar rank" "avatar stats";column-gap:10px;text-align:left;padding:0}
  .post-profile-wrap .post-profile-avatar{grid-area:avatar;width:52px;height:52px;margin:0}
  .post-profile-wrap .post-profile-name{grid-area:name;align-self:end}
  .post-profile-wrap .post-profile-rank{grid-area:rank;margin-top:2px}
  .post-profile-wrap .post-profile-stats{grid-area:stats;display:flex;gap:8px;margin-top:3px}
  .post-profile-wrap .post-profile-role,.post-profile-wrap .post-profile-divider,.post-profile-wrap .post-profile-joined{display:none}
  .comment-body{padding:14px}
  .comment-user-mobile{display:block}
}

/* ===== V5 POST PROFILE SIDEBAR — KEEP PROFILE BESIDE CONTENT =====
   The post author panel stays on the left, including narrow/mobile screens,
   matching the classic forum layout shown in the reference. */
.thread-main-post{
  display:grid!important;
  grid-template-columns:205px minmax(0,1fr)!important;
  gap:0!important;
  align-items:stretch;
  margin-top:24px;
  padding-top:24px;
  border-top:1px solid #292e36;
}
.thread-main-post>.post-profile-card{
  box-sizing:border-box;
  min-width:0;
  height:100%;
  border-radius:12px 0 0 12px;
  border-right:1px solid #302b3b;
  box-shadow:none;
  padding:18px 14px;
}
.thread-main-post>.thread-main-body{
  min-width:0;
  padding:0 0 0 22px;
}
.post-layout{
  display:grid!important;
  grid-template-columns:190px minmax(0,1fr)!important;
  gap:0!important;
  align-items:stretch;
  overflow:hidden;
}
.post-profile-wrap{
  min-width:0;
  border-right:1px solid #292e36;
}
.comment-body{min-width:0;overflow-wrap:anywhere}

@media(max-width:760px){
  .thread-main-post{
    grid-template-columns:180px minmax(0,1fr)!important;
    gap:0!important;
    margin-top:18px;
    padding-top:18px;
  }
  .thread-main-post>.post-profile-card{
    display:block!important;
    padding:14px 10px!important;
    text-align:center!important;
    border-radius:10px 0 0 10px;
  }
  .thread-main-post>.post-profile-card .post-profile-avatar{
    width:92px!important;height:92px!important;margin:0 auto 9px!important;
  }
  .thread-main-post>.post-profile-card .post-profile-name{font-size:12px}
  .thread-main-post>.post-profile-card .post-profile-role{font-size:7px;padding:3px 5px}
  .thread-main-post>.post-profile-card .post-profile-rank{font-size:9px;margin-top:8px;letter-spacing:.12em}
  .thread-main-post>.post-profile-card .post-profile-divider{height:6px;margin:9px 0 8px}
  .thread-main-post>.post-profile-card .post-profile-stats{font-size:8px;gap:3px}
  .thread-main-post>.post-profile-card .post-profile-joined{font-size:7px;margin-top:8px;padding-top:7px}
  .thread-main-post>.thread-main-body{padding:0 0 0 12px}

  .post-layout{
    grid-template-columns:165px minmax(0,1fr)!important;
  }
  .post-profile-wrap{
    border-right:1px solid #292e36!important;
    border-bottom:0!important;
    padding:12px 8px!important;
  }
  .post-profile-wrap .post-profile-card{
    display:block!important;
    padding:2px!important;
    text-align:center!important;
  }
  .post-profile-wrap .post-profile-avatar{
    width:76px!important;height:76px!important;margin:0 auto 8px!important;
  }
  .post-profile-wrap .post-profile-name{font-size:11px}
  .post-profile-wrap .post-profile-role{font-size:7px;padding:3px 5px}
  .post-profile-wrap .post-profile-rank{font-size:8px;margin-top:7px;letter-spacing:.1em}
  .post-profile-wrap .post-profile-divider{height:5px;margin:8px 0 7px}
  .post-profile-wrap .post-profile-stats{display:grid!important;gap:3px!important;font-size:8px;text-align:left!important}
  .post-profile-wrap .post-profile-joined{font-size:7px;margin-top:7px;padding-top:6px}
  .post-profile-wrap .post-profile-role,
  .post-profile-wrap .post-profile-divider,
  .post-profile-wrap .post-profile-joined{display:block!important}
  .comment-body{padding:12px 11px!important}
  .comment-user-mobile{display:none!important}
}

@media(max-width:400px){
  .thread-main-post{grid-template-columns:145px minmax(0,1fr)!important}
  .thread-main-post>.post-profile-card .post-profile-avatar{width:68px!important;height:68px!important}
  .thread-main-post>.post-profile-card{padding:10px 7px!important}
  .post-layout{grid-template-columns:135px minmax(0,1fr)!important}
  .post-profile-wrap{padding:10px 6px!important}
  .post-profile-wrap .post-profile-avatar{width:62px!important;height:62px!important}
  .comment-body{padding:10px 9px!important}
}

/* PROFILE LINKS — final fix: use joined users.id, never post/thread id */
.profile-user-link,.thread-author-link,.post-profile-card a{position:relative;z-index:50;pointer-events:auto;cursor:pointer;text-decoration:none}
.profile-user-link:hover,.thread-author-link:hover,.post-profile-card a:hover{text-decoration:underline;text-underline-offset:3px}
.post-profile-card,.post-profile-card *{pointer-events:auto}
.post-profile-card:before,.post-profile-card:after{pointer-events:none!important}
