/* =========================================================
   Sardar Trust Eye Hospital — Discussion Forum
   Native forum styling. Uses ONLY the existing brand tokens
   declared in style.css (no new accent colours introduced).
   ========================================================= */

.forum-shell{padding:2rem 0 2.6rem;}
.forum-layout{
  display:grid;grid-template-columns:248px 1fr;gap:34px;align-items:start;
}

/* ---------- Sidebar ---------- */
.forum-side{position:sticky;top:96px;}
.forum-user{
  display:flex;align-items:center;gap:14px;margin-bottom:1.4rem;
}
.forum-user .fu-avatar{
  width:52px;height:52px;border-radius:50%;object-fit:cover;flex-shrink:0;
  border:1px solid var(--sand-2);background:#fff;
}
.forum-user .fu-name{font-family:'Montserrat',sans-serif;font-weight:600;color:var(--deep-2);font-size:1.125rem;line-height:1.1;}
.forum-user .fu-xp{font-size:0.875rem;color:var(--muted);margin-top:2px;}

.forum-nav{display:flex;flex-direction:column;gap:2px;}
.forum-nav a{
  display:flex;align-items:center;gap:11px;padding:.62em .8em;border-radius:var(--r-sm);
  font-weight:600;font-size:0.875rem;color:var(--ink);transition:background .18s,color .18s;
}
.forum-nav a svg{width:18px;height:18px;flex-shrink:0;stroke:var(--muted);fill:none;stroke-width:1.8;}
.forum-nav a:hover{background:var(--mist);color:var(--deep);}
.forum-nav a:hover svg{stroke:var(--primary);}
.forum-nav a.active{background:var(--mist);color:var(--deep-2);}
.forum-nav a.active svg{stroke:var(--primary);}
.forum-about{margin-top:1.2rem;padding-top:1.2rem;border-top:1px solid var(--line);}
.forum-about a{display:inline-flex;align-items:center;gap:8px;font-weight:600;color:var(--primary);font-size:0.875rem;}
.forum-about a:hover{text-decoration:underline;}
.forum-about a svg{width:16px;height:16px;stroke:var(--primary);fill:none;stroke-width:1.8;}

/* ---------- Main column ---------- */
.forum-main{min-width:0;}
.forum-head{
  display:flex;align-items:center;gap:16px;flex-wrap:wrap;
  justify-content:space-between;margin-bottom:1.6rem;
}
/* The page banner above carries the page's only h1, so the heading inside the
   column is an h2 and is sized as a section heading rather than a page title.
   Both selectors are kept because the h1 form shipped with the theme. */
.forum-head h1,.forum-head h2{margin:0;font-family:'Montserrat',sans-serif;font-weight:600;font-size:1.375rem;color:var(--deep-2);}
.forum-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}

.forum-filter{position:relative;}
.forum-filter select{
  appearance:none;padding:.55em 2.1em .55em .9em;border-radius:var(--r-sm);border:1px solid var(--line-strong);
  background:var(--mist);font-weight:600;font-size:0.875rem;color:var(--deep);cursor:pointer;width:auto;
}
.forum-filter::after{
  content:"";position:absolute;right:.85em;top:50%;width:8px;height:8px;pointer-events:none;
  border-right:2px solid var(--primary);border-bottom:2px solid var(--primary);
  transform:translateY(-70%) rotate(45deg);
}
.forum-search{position:relative;}
.forum-search input{
  padding:.6em 2.4em .6em .95em;border-radius:var(--r-sm);border:1px solid var(--line-strong);
  background:#fff;font-size:0.875rem;min-width:230px;width:auto;
}
.forum-search svg{
  position:absolute;right:.9em;top:50%;transform:translateY(-50%);
  width:17px;height:17px;stroke:var(--muted);fill:none;stroke-width:2;pointer-events:none;
}

/* ---------- Thread list ---------- */
.thread-table{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;}
.thread-colhead{
  display:grid;grid-template-columns:1fr 62px 92px 150px;gap:12px;align-items:center;
  padding:14px 22px;border-bottom:1px solid var(--line);
  font-size:0.75rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);
}
.thread-colhead span:not(:first-child){text-align:center;}
.thread-colhead .th-activity{text-align:right;}
.thread-row{
  display:grid;grid-template-columns:1fr 62px 92px 150px;gap:12px;align-items:center;
  padding:20px 22px;border-bottom:1px solid var(--line);transition:background .18s;
}
.thread-row:last-child{border-bottom:none;}
.thread-row:hover{background:var(--mist);}
.thread-title{display:flex;align-items:center;gap:12px;min-width:0;}
.thread-title .bell{width:18px;height:18px;flex-shrink:0;stroke:var(--muted);fill:none;stroke-width:1.8;}
.thread-title a{font-family:'Montserrat',sans-serif;font-weight:600;font-size:1.125rem;color:var(--deep-2);line-height:1.2;}
.thread-title a:hover{color:var(--primary);text-decoration:underline;}
.thread-meta-avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;margin:0 auto;border:1.5px solid var(--sand-2);background:#fff;}
.thread-num{text-align:center;font-weight:600;color:var(--ink);}
.thread-num.zero{color:var(--muted);}
.thread-activity{text-align:right;color:var(--muted);font-size:0.875rem;}
.thread-empty{padding:32px 22px;text-align:left;color:var(--muted);}

/* ---------- Post detail ---------- */
.post-wrap{max-width:100%;}
.post-crumb{margin-bottom:1rem;}
.post-crumb a{color:var(--primary);font-weight:600;}
.post-crumb a:hover{text-decoration:underline;}

.post-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;}
.post-title{font-size:var(--fs-h1);color:var(--deep-2);margin:0 0 .2em;}
.post-hdr-icons{display:flex;gap:6px;flex-shrink:0;padding-top:8px;}
.post-hdr-icons .pico{background:none;border:none;cursor:pointer;padding:6px;border-radius:var(--r-xs);line-height:0;transition:background .15s;}
.post-hdr-icons .pico:hover{background:var(--mist);}
.post-hdr-icons .pico svg{width:22px;height:22px;stroke:var(--muted);fill:none;stroke-width:1.8;}
.post-hdr-icons .pico.on svg{stroke:var(--primary);fill:var(--primary);}

.post-views{font-size:0.875rem;color:var(--muted);font-weight:500;margin-bottom:1.6rem;}
.post-flag{display:inline-block;font-size:0.75rem;font-weight:700;color:var(--deep);background:var(--mist);border:1px solid var(--line);border-radius:var(--r-xs);padding:.4em .8em;margin-bottom:1rem;}

.qcard{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:24px;}
.post-author{display:flex;align-items:center;gap:12px;margin-bottom:14px;}
.post-author img{width:44px;height:44px;border-radius:50%;object-fit:cover;border:1.5px solid var(--sand-2);background:#fff;}
.post-author .pa-line{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;}
.post-author .pa-name{font-weight:700;color:var(--deep-2);font-size:1rem;}
.post-author .pa-time{font-size:0.875rem;color:var(--muted);}
.post-question{font-size:1.125rem;color:var(--ink);margin:0 0 14px;padding-left:56px;}
.post-tags{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px 56px;}
.post-tags .tag{background:var(--mist);color:var(--deep);border:1px solid var(--line);border-radius:var(--r-xs);padding:.28em .8em;font-size:0.75rem;font-weight:600;}

.qcard-foot{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding-left:56px;margin-top:10px;}
.vote-inline{display:flex;align-items:center;gap:8px;}
.vote-inline button{background:none;border:none;cursor:pointer;padding:2px;line-height:0;border-radius:var(--r-xs);transition:background .15s;}
.vote-inline button:hover{background:var(--mist);}
.vote-inline button svg{width:20px;height:20px;stroke:var(--muted);fill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;}
.vote-inline button.on svg{stroke:var(--primary);}
.vote-inline .vote-count{font-weight:700;color:var(--ink);font-size:1rem;min-width:16px;text-align:center;}

.qactions{display:flex;align-items:center;gap:16px;}
.qactions button{display:inline-flex;align-items:center;gap:6px;background:none;border:none;cursor:pointer;color:var(--muted);font-weight:600;font-size:0.875rem;font-family:'Inter',sans-serif;transition:color .15s;}
.qactions button:hover{color:var(--primary);}
.qactions button svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}

.answers-head{margin:2rem 0 1rem;font-size:1.25rem;color:var(--deep-2);}
.no-answers{background:var(--mist);border:1px solid var(--line);border-radius:var(--radius);padding:22px 26px;margin-top:1.8rem;}
.no-answers h4{margin:0 0 .3em;color:var(--deep-2);font-size:1.25rem;}
.no-answers p{margin:0;color:var(--deep);}

.post-reply-cta{margin-top:1.4rem;}
.post-reply-cta .btn{padding:.72em 1.25em;}

.answer{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px 22px;margin-bottom:14px;box-shadow:var(--shadow);}
.answer .a-meta{display:flex;align-items:center;gap:10px;margin-bottom:8px;}
.answer .a-meta img{width:34px;height:34px;border-radius:50%;object-fit:cover;background:var(--mist);border:1.5px solid var(--sand-2);}
.answer .a-meta .a-name{font-weight:700;color:var(--deep-2);font-size:0.875rem;}
.answer .a-meta .a-time{font-size:0.75rem;color:var(--muted);}
.answer p{margin:0;color:var(--ink);}

.reply-box{margin-top:1.6rem;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:24px;}
.reply-box[hidden]{display:none;}
.reply-box h4{margin:0 0 1rem;color:var(--deep-2);}

/* ---------- Ask form ---------- */
.ask-form{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:30px;max-width:100%;}
.ask-row{display:grid;grid-template-columns:150px 1fr;gap:20px;align-items:start;margin-bottom:22px;}
.ask-row > label{padding-top:.55em;font-size:1rem;color:var(--deep-2);}
.ask-hint{font-size:0.875rem;margin-top:.5em;}
.ask-hint a{color:var(--primary);font-weight:600;}
.ask-hint .tip{color:var(--muted);}
.ask-actions{display:flex;align-items:center;gap:16px;padding-left:170px;}
.ask-actions .discard{color:var(--primary);font-weight:600;background:none;border:none;cursor:pointer;font-size:1rem;}
.ask-actions .discard:hover{text-decoration:underline;}
.field-error{color:#b3341f;font-size:0.875rem;margin-top:.4em;display:none;}
.field-error.show{display:block;}

/* ---------- Profile ---------- */
.profile-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:30px;}
.profile-top{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-bottom:1.6rem;padding-bottom:1.6rem;border-bottom:1px solid var(--line);}
.profile-top img{width:88px;height:88px;border-radius:50%;object-fit:cover;border:3px solid var(--sand-2);background:#fff;}
.profile-top h2{margin:0;color:var(--deep-2);font-size:1.75rem;}
.profile-top .p-xp{color:var(--muted);font-weight:600;margin-top:4px;}
.profile-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:1.8rem;}
.pstat{background:var(--mist);border:1px solid var(--line);border-radius:var(--r-md);padding:16px;text-align:left;}
.pstat .num{font-family:'Montserrat',sans-serif;font-size:1.75rem;font-weight:600;color:var(--primary);line-height:1;}
.pstat .lbl{font-size:0.75rem;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em;margin-top:6px;}
.profile-card h3{color:var(--deep-2);margin:0 0 1rem;font-size:1.25rem;}
.p-post{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:14px 0;border-bottom:1px solid var(--line);}
.p-post:last-child{border-bottom:none;}
.p-post a{font-family:'Montserrat',sans-serif;font-weight:600;color:var(--deep-2);font-size:1rem;}
.p-post a:hover{color:var(--primary);text-decoration:underline;}
.p-post .p-post-meta{font-size:0.875rem;color:var(--muted);white-space:nowrap;}

/* ---------- FAQ intro line ---------- */
.faq-crumbs{margin-bottom:1.4rem;font-size:0.875rem;color:var(--muted);}
.faq-crumbs a{color:var(--primary);font-weight:600;}
.faq-crumbs a:hover{text-decoration:underline;}

/* ---------- Toast ---------- */
.forum-toast{
  position:fixed;left:50%;bottom:30px;transform:translateX(-50%) translateY(20px);
  background:var(--deep-2);color:#fff;padding:.9em 1.4em;border-radius:999px;
  font-weight:600;font-size:0.875rem;box-shadow:0 8px 24px rgba(2,55,87,.28);
  opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;z-index:2000;
}
.forum-toast.show{opacity:1;transform:translateX(-50%) translateY(0);}

/* ---------- Responsive ---------- */
@media (max-width:960px){
  .forum-layout{grid-template-columns:1fr;gap:24px;}
  .forum-side{position:static;}
  .forum-nav{flex-direction:row;flex-wrap:wrap;}
  .forum-nav a{padding:.55em .75em;}
}
@media (max-width:640px){
  .thread-colhead{display:none;}
  .thread-row{grid-template-columns:1fr auto;gap:6px 12px;padding:16px;}
  .thread-title{grid-column:1/-1;}
  .thread-meta-avatar{display:none;}
  .thread-num{text-align:left;font-size:0.875rem;color:var(--muted);}
  .thread-num.zero::before{content:"Replies: ";}
  .thread-num.views::before{content:"Views: ";}
  .thread-activity{text-align:left;grid-column:1/-1;}
  .ask-row{grid-template-columns:1fr;gap:8px;}
  .ask-row > label{padding-top:0;}
  .ask-actions{padding-left:0;}
  .profile-stats{grid-template-columns:repeat(2,1fr);}
  .post-question,.post-tags,.qcard-foot{padding-left:0;}
  .post-tags{margin-left:0;}
  .qcard-foot{gap:12px;}
  .post-header{flex-wrap:nowrap;}
}

/* ---------- Server-rendered forum additions ---------- */
/* The listing grid is four columns wide (see .thread-row above). The old
   browser-side engine wrote five children into it, which pushed the Activity
   column onto a second line for every row; the author now sits inside the
   title cell instead. */
.thread-title .tt-text{display:flex;flex-direction:column;gap:3px;min-width:0;}
.thread-by{font-size:0.8125rem;color:var(--muted);}

.forum-note{
  padding:14px 18px;margin:0 0 1.4rem;border-radius:var(--r-sm);
  background:var(--mist);border:1px solid var(--line);color:var(--ink);
  font-size:0.9375rem;line-height:1.5;
}
.forum-note a{color:var(--primary);font-weight:600;}
.forum-note a:hover{text-decoration:underline;}
.forum-note.is-good{background:#eaf5ef;border-color:#bcdccb;color:#22593c;}
.forum-note.is-pending{background:#fdf4e3;border-color:#e8d6ae;color:#6b5320;}

.forum-pager{display:flex;align-items:center;gap:14px;justify-content:center;margin-top:1.8rem;flex-wrap:wrap;}
.forum-pager-count{color:var(--muted);font-size:0.875rem;}
.forum-pager .is-disabled{opacity:.45;pointer-events:none;}

.answer.is-pending{border-left:3px solid #e0b64f;background:#fffdf7;}
.pending-tag,.status-tag{
  display:inline-block;font-size:0.6875rem;font-weight:700;letter-spacing:.04em;
  text-transform:uppercase;padding:2px 8px;border-radius:999px;vertical-align:middle;
}
.pending-tag,.status-pending{background:#fdf0d5;color:#7a5b12;}
.status-published{background:#e4f2ea;color:#22593c;}
.status-rejected{background:#f6e4e4;color:#8a2b2b;}

.p-post-meta{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:6px;color:var(--muted);font-size:0.8125rem;}
.p-post-body{margin:8px 0 0;color:var(--ink);font-size:0.9375rem;}

/* The theme sized this grid for the four stat tiles the old profile page had,
   two of which counted invented XP and badges. Three real ones (questions,
   answers, views) left a hole in the row, so the track count now follows
   however many tiles there are. */
.profile-stats{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));}

/* The theme laid a profile row out as one line: title on the left, a single
   value pushed to the right. Each row now carries a title, a status chip with
   dates and counts, and for an answer an extract of it, so it reads down
   rather than across - three items in a space-between row just collide. */
.p-post{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:2px;}

/* Signed-out prompt above the two sign-in buttons. */
.post-reply-cta{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.post-reply-cta p{margin:0;width:100%;color:var(--deep);}

/* Visible to screen readers only - the search and filter controls are icon
   led, and each still needs a real label. */
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}
