:root{
  --bg:#f6f7f9;
  --card:#ffffff;
  --muted:#72767d;
  --accent:#2b6fb2;
  --accent-2:#263238;
  --up-color:#0f6b2f;    /* upvote green */
  --down-color:#9f2b1f;  /* downvote red-ish */
  --shadow: 0 6px 18px rgba(11,18,25,0.06);
  --radius:12px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg,#f6f7f9 0%, #eef2f5 100%);
  color:#111827;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
  font-size:15px;
}

/* header */
.site-header{
  background:linear-gradient(90deg, rgba(255,255,255,0.85), rgba(255,255,255,0.6));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(16,24,32,0.04);
  position:sticky;
  top:0;
  z-index:40;
}
.header-inner{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  align-items:center;
  gap:16px;
  padding:12px 18px;
}
.brand{
  display:flex;
  gap:12px;
  text-decoration:none;
  color:var(--accent-2);
  align-items:center;
}
.brand-text .title{font-weight:700; font-size:16px}
.brand-text .subtitle{font-size:12px; color:var(--muted)}

.search-area{flex:1; display:flex; justify-content:center}
.search-area input{
  width:100%;
  max-width:560px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(16,24,32,0.08);
  background: #fff;
  box-shadow:none;
  font-size:14px;
}

.header-actions{display:flex; gap:8px}
.btn{padding:8px 12px; border-radius:8px; text-decoration:none; font-size:14px}
.btn.ghost{border:1px solid rgba(16,24,32,0.06); color:var(--accent-2); background:transparent}
.btn.solid{background:var(--accent); color:white; border: none}

/* layout */
.container{
  max-width:1100px;
  margin:22px auto;
  display:grid;
  grid-template-columns: 300px 1fr;
  gap:18px;
  padding:0 18px;
}
.sidebar{position:relative}
.card{
  background:var(--card);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:var(--shadow);
  border: 1px solid rgba(11,18,25,0.04);
  margin-bottom:14px;
}

/* feed */
.feed .feed-controls{display:flex; justify-content:space-between; align-items:center}
.posts-list{display:flex; flex-direction:column; gap:12px}

/* post card layout */
.post{
  display:grid;
  grid-template-columns: 64px 1fr;
  gap:12px;
  align-items:flex-start;
  padding:12px;
  border-radius:10px;
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,251,0.98));
  box-shadow: 0 4px 14px rgba(11,18,25,0.04);
  border:1px solid rgba(11,18,25,0.03);
}
.vote-col{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  width:64px;
  font-weight:600;
  color:var(--muted);
  padding-top:4px;
}
.vote-btn{
  width:44px;height:40px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;
  background:transparent;border:1px solid rgba(11,18,25,0.04);cursor:pointer;
  transition: transform 210ms cubic-bezier(.2,.9,.2,1), box-shadow 210ms, background-color 210ms, color 210ms;
  color:var(--muted);
  outline: none;
}
.vote-btn svg{ width:18px; height:18px; display:block; fill: currentColor; transition: transform 210ms;}
.vote-btn:active{ transform: scale(0.97); }

/* active states with nicer color + subtle lift */
.vote-btn.upvoted{
  background: linear-gradient(180deg,#f0fff4,#e8fff0);
  border-color: rgba(15,107,47,0.12);
  color: var(--up-color);
  box-shadow: 0 8px 18px rgba(15,107,47,0.06);
  transform: translateY(-3px) scale(1.02);
}
.vote-btn.upvoted svg{ transform: translateY(-1px) scale(1.04); }

.vote-btn.downvoted{
  background: linear-gradient(180deg,#fff7f6,#ffefec);
  border-color: rgba(159,43,31,0.12);
  color: var(--down-color);
  box-shadow: 0 8px 18px rgba(159,43,31,0.04);
  transform: translateY(3px) scale(1.02);
}
.vote-btn.downvoted svg{ transform: translateY(1px) scale(1.04); }

.post-body{padding-right:6px}
.post-head{display:flex;gap:8px;align-items:center;margin-bottom:6px}
.post-title{font-weight:700;font-size:16px;margin:0}
.post-meta{color:var(--muted);font-size:13px}
.post-excerpt{color:#263238; opacity:0.9; margin-top:8px; margin-bottom:12px}
.post-footer{display:flex;gap:14px;align-items:center;color:var(--muted);font-size:13px}

/* tags */
.tag-inline{
  display:inline-block;background:rgba(43,111,178,0.08);color:var(--accent);padding:4px 8px;border-radius:999px;font-size:12px;margin-right:8px
}

/* empty */
.empty-note{text-align:center;padding:36px}

/* responsive */
@media (max-width:980px){
  .container{grid-template-columns:1fr; padding:0 12px}
  .sidebar{order:2}
  .feed{order:1}
  .vote-col{display:none}
  .post{grid-template-columns: 1fr}
  .header-inner{padding:10px}
}

/* small niceties */
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

/* focus styles (accessibility) */
.vote-btn:focus{
  box-shadow: 0 0 0 4px rgba(43,111,178,0.08);
  border-color: rgba(43,111,178,0.14);
}
/* ---------------------------
   Modal / post expandido
   --------------------------- */
.modal{ display:none; position:fixed; inset:0; z-index:120; font-family:inherit; }
.modal[aria-hidden="false"]{ display:block; }

.modal-backdrop{
  position:absolute; inset:0; background:rgba(6,12,20,0.45); backdrop-filter: blur(4px);
  opacity:0; transition:opacity 260ms ease;
}
.modal[aria-hidden="false"] .modal-backdrop{ opacity:1; }

.modal-panel{
  position:fixed;
  top:6vh; bottom:6vh; left:50%; transform:translateX(-50%) translateY(20px);
  width:min(980px, calc(100% - 48px));
  max-height:88vh;
  overflow:auto;
  border-radius:14px;
  background:linear-gradient(180deg,#fff,#fbfdfe);
  box-shadow: 0 30px 90px rgba(6,12,20,0.28);
  border:1px solid rgba(11,18,25,0.06);
  opacity:0; transition:opacity 320ms ease, transform 260ms cubic-bezier(.2,.9,.2,1);
}
.modal[aria-hidden="false"] .modal-panel{ opacity:1; transform:translateX(-50%) translateY(0); }

.modal-header{ display:flex; justify-content:flex-end; padding:10px 14px 0 14px; }
.modal-close{
  border:0; background:transparent; font-size:20px; cursor:pointer; color:var(--muted);
  padding:6px 8px; border-radius:8px;
}
.modal-close:hover{ background: rgba(11,18,25,0.03); color:var(--accent-2) }

.modal-content{
  padding:18px 22px 28px 22px; color:var(--accent-2);
}

/* modal content structure */
.modal-title{ font-size:20px; font-weight:700; margin:6px 0 6px 0; color:var(--accent-2); }
.modal-meta{ color:var(--muted); font-size:13px; margin-bottom:12px; }
.modal-body{ color:#222; line-height:1.6; margin-bottom:18px; }
.modal-body p{ margin:0 0 12px 0; }

.modal-attachments{ margin:10px 0 18px 0; display:flex; flex-direction:column; gap:8px; }
.attachment{ padding:10px 12px; border-radius:10px; background: #f7fbff; border:1px solid rgba(43,111,178,0.06); display:flex; gap:12px; align-items:center; text-decoration:none; color:var(--accent-2); }
.attachment small{ color:var(--muted); font-size:13px; }

/* comments */
.comments-title{ margin-top:8px; font-weight:700; font-size:15px; }
.comments-list{ margin-top:10px; display:flex; flex-direction:column; gap:10px; }
.comment{ background:#fff; border-radius:10px; padding:10px 12px; border:1px solid rgba(11,18,25,0.04); }
.comment-meta{ color:var(--muted); font-size:12px; margin-bottom:6px; }
.comment-body{ color:#111; font-size:14px; }

/* form */
.comment-form{ margin-top:14px; display:flex; flex-direction:column; gap:8px; }
.comment-form textarea{ min-height:86px; max-height:220px; padding:10px; border-radius:8px; border:1px solid rgba(11,18,25,0.06); font-family:inherit; resize:vertical }
.comment-form .btn-row{ display:flex; gap:8px; justify-content:flex-end; }
.comment-form button{ padding:8px 12px; border-radius:8px; border:0; background:var(--accent); color:white; cursor:pointer }
.comment-form button.secondary{ background:transparent; border:1px solid rgba(11,18,25,0.06); color:var(--accent-2) }

/* attachments row for small screens */
@media (max-width:680px){
  .modal-panel{ width:calc(100% - 24px); left:50% }
  .attachment{ font-size:14px }
}
