/* ============================================================
   POST.CSS — CampusConnect Posts Feature
   Responsive rebuild. Extends style.css design tokens.
   post.html imports style.css first, then this file.
   ============================================================ */

/* ── Global box-sizing reset (prevents ALL overflow issues) ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ── Loading screen safety ── */
#loading-screen.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

/* ============================================================
   PAGE SHELL
   ============================================================ */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

.posts-page {
  min-height: calc(100vh - var(--nav-height));
  padding-top: calc(var(--nav-height) + 28px);
  padding-bottom: 64px;
  overflow-x: hidden;
}

/* ============================================================
   3-COLUMN LAYOUT
   Breakpoints:
     ≥ 1100px  → left + center + right
     768–1099px → center + right
     < 768px   → center only (full width)
   ============================================================ */
.posts-layout {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 24px);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  grid-template-areas: "left center right";
  gap: clamp(14px, 2vw, 22px);
  align-items: start;
}

.posts-left-sidebar  { grid-area: left;   }
.posts-center        { grid-area: center; }
.posts-right-sidebar { grid-area: right;  }

/* Sticky sidebars */
.posts-left-sidebar,
.posts-right-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 14px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - var(--nav-height) - 28px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.posts-left-sidebar::-webkit-scrollbar,
.posts-right-sidebar::-webkit-scrollbar { display: none; }

/* ── 1280px — slightly tighter columns ── */
@media (max-width: 1280px) {
  .posts-layout {
    grid-template-columns: 220px minmax(0, 1fr) 220px;
  }
}

/* ── 1100px — drop left sidebar ── */
@media (max-width: 1100px) {
  .posts-layout {
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-areas: "center right";
  }
  .posts-left-sidebar { display: none; }
}

/* ── 768px — single column, hide right sidebar ── */
@media (max-width: 768px) {
  .posts-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "center";
    max-width: 640px;
    padding: 0 clamp(12px, 4vw, 20px);
  }
  .posts-right-sidebar { display: none; }
  .posts-page {
    padding-top: calc(var(--nav-height) + 16px);
    padding-bottom: 48px;
  }
}

/* ── 480px ── */
@media (max-width: 480px) {
  .posts-layout { padding: 0 12px; }
}

/* ── 360px ── */
@media (max-width: 360px) {
  .posts-layout { padding: 0 10px; }
}

/* ── Ultrawide (≥ 1600px) — constrain and center ── */
@media (min-width: 1600px) {
  .posts-layout {
    max-width: 1360px;
    grid-template-columns: 260px minmax(0, 1fr) 260px;
  }
}

/* ============================================================
   LEFT SIDEBAR — PROFILE CARD
   ============================================================ */
.profile-sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

/* Skeleton */
.profile-sidebar-skeleton { padding-bottom: 20px; }
.pss-banner {
  height: 72px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  opacity: 0.15;
}
.pss-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-muted);
  margin: -26px 0 0 16px;
  border: 3px solid var(--bg-surface);
  flex-shrink: 0;
}
.pss-line {
  height: 10px; border-radius: var(--radius-full);
  background: var(--bg-muted);
  margin: 8px 16px 0;
  animation: skeleton-pulse 1.5s ease infinite;
}
.pss-line.long   { width: 60%; }
.pss-line.medium { width: 45%; }
.pss-line.short  { width: 30%; }

/* Populated profile card */
.psc-banner {
  height: 72px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
}
.psc-avatar-wrap {
  position: relative;
  margin: -28px 0 0 16px;
  width: 56px;
  flex-shrink: 0;
}
.psc-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid var(--bg-surface);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
  overflow: hidden; cursor: pointer;
  transition: opacity var(--transition-fast);
}
.psc-avatar:hover { opacity: 0.88; }
.psc-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.psc-body { padding: 10px 16px 16px; }
.psc-name {
  font-family: var(--font-heading);
  font-size: 15px; font-weight: 800;
  color: var(--text-heading); cursor: pointer;
  letter-spacing: -0.02em;
  transition: color var(--transition-fast);
  overflow-wrap: break-word; word-break: break-word;
}
.psc-name:hover { color: var(--brand-primary); }
.psc-sub {
  font-size: 12.5px; color: var(--text-muted);
  margin-top: 2px; line-height: 1.5;
  overflow-wrap: break-word;
}
.psc-bio {
  font-size: 13px; color: var(--text-body);
  margin-top: 8px; line-height: 1.55;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  overflow-wrap: break-word;
}
.psc-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 12px;
}
.psc-stat {
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  padding: 8px 6px; text-align: center;
  cursor: pointer;
  transition: background var(--transition-fast);
  min-width: 0;
}
.psc-stat:hover { background: var(--border-color); }
.psc-stat-value {
  font-family: var(--font-heading);
  font-size: 17px; font-weight: 800;
  color: var(--brand-primary); display: block;
}
.psc-stat-label {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.psc-completion {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border-color);
}
.psc-completion-label {
  font-size: 12px; color: var(--text-muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px;
  margin-bottom: 5px;
}
.psc-completion-bar {
  height: 5px; border-radius: var(--radius-full);
  background: var(--bg-muted); overflow: hidden;
}
.psc-completion-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ---- Quick nav card ---- */
.left-sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
}
.quick-nav { display: flex; flex-direction: column; }
.quick-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-body); text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quick-nav-item:last-child { border-bottom: none; }
.quick-nav-item:hover { background: var(--bg-muted); color: var(--brand-primary); }
.quick-nav-item.active {
  color: var(--brand-primary); font-weight: 700;
  background: rgba(26,86,232,0.05);
}
.qni-icon { font-size: 15px; flex-shrink: 0; }

/* ============================================================
   RIGHT SIDEBAR
   ============================================================ */
.right-sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}
.rsc-title {
  font-family: var(--font-heading);
  font-size: 12.5px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 12px;
}
.rsc-stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border-color);
  font-size: 13px; gap: 8px;
}
.rsc-stat-row:last-child { border-bottom: none; }
.rsc-stat-label { color: var(--text-muted); font-weight: 500; }
.rsc-stat-value { color: var(--text-heading); font-weight: 700; font-family: var(--font-heading); flex-shrink: 0; }
.rsc-tip {
  font-size: 12.5px; color: var(--text-muted);
  line-height: 1.6; margin-bottom: 10px;
  overflow-wrap: break-word;
}
.rsc-tip:last-child { margin-bottom: 0; }
.rsc-tip strong {
  display: block; color: var(--text-heading);
  font-weight: 600; margin-bottom: 2px; font-size: 13px;
}
.rsc-link {
  display: block; font-size: 13px;
  color: var(--brand-primary); font-weight: 500;
  text-decoration: none; padding: 5px 0;
  border-bottom: 1px solid var(--border-color);
  transition: color var(--transition-fast);
}
.rsc-link:last-child { border-bottom: none; }
.rsc-link:hover { color: var(--brand-secondary); }

/* ============================================================
   AUTH WALL
   ============================================================ */
.posts-auth-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  gap: 16px;
  padding: 40px 20px;
}
.posts-auth-icon { font-size: 48px; margin-bottom: 8px; }
.posts-auth-wall h2 {
  font-family: var(--font-heading);
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 800; color: var(--text-heading); letter-spacing: -0.03em;
}
.posts-auth-wall p {
  font-size: 14px; color: var(--text-muted);
  max-width: 340px; line-height: 1.6;
}
.posts-auth-wall .btn { margin-top: 8px; }

/* ============================================================
   COMPOSER CARD
   ============================================================ */
.composer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  width: 100%;
  min-width: 0;
}
.composer-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(26,86,232,0.2);
}
.composer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.composer-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: white;
  flex-shrink: 0; overflow: hidden; cursor: pointer;
  transition: opacity var(--transition-fast);
}
.composer-avatar:hover { opacity: 0.85; }
.composer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.composer-trigger {
  flex: 1;
  min-width: 0;
  background: var(--bg-muted);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.composer-trigger:hover {
  background: var(--bg-elevated);
  border-color: var(--brand-primary);
  color: var(--text-body);
}
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.composer-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-height: 36px;
  touch-action: manipulation;
}
.composer-action-btn:hover {
  background: var(--bg-muted);
  color: var(--text-heading);
  border-color: var(--text-muted);
}

@media (max-width: 480px) {
  .composer-card    { padding: 12px 14px; margin-bottom: 14px; }
  .composer-row     { gap: 10px; }
  .composer-trigger { font-size: 13px; padding: 9px 14px; }
  .composer-avatar  { width: 36px; height: 36px; font-size: 13px; }
  .composer-actions { gap: 6px; margin-top: 10px; padding-top: 10px; }
  .composer-action-btn { padding: 6px 10px; font-size: 12px; gap: 4px; }
}

@media (max-width: 360px) {
  .composer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .composer-action-btn { justify-content: center; width: 100%; padding: 8px 6px; font-size: 12px; }
}

/* ============================================================
   CATEGORY BAR
   ============================================================ */
.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  padding-right: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  /* mask trailing edge so scroll is obvious */
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
}
.category-bar::-webkit-scrollbar { display: none; }

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  touch-action: manipulation;
  min-height: 36px;
}
.cat-pill:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(26,86,232,0.05);
}
.cat-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26,86,232,0.3);
}

@media (max-width: 768px) {
  .cat-pill { padding: 6px 12px; font-size: 12.5px; gap: 4px; }
}
@media (max-width: 480px) {
  .category-bar { gap: 6px; margin-bottom: 12px; }
  .cat-pill     { padding: 6px 11px; font-size: 12px; }
}
@media (max-width: 360px) {
  .cat-pill { padding: 5px 10px; font-size: 11.5px; }
}

/* ============================================================
   FEED
   ============================================================ */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

@media (max-width: 768px) { .feed-list { gap: 12px; } }
@media (max-width: 480px) { .feed-list { gap: 10px; } }

/* ============================================================
   POST CARD
   ============================================================ */
.post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  animation: post-appear 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
  width: 100%;
  min-width: 0;
  overflow: hidden;          /* prevent any child from blowing out width */
}

@keyframes post-appear {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(26,86,232,0.15);
}

/* ── Post header ── */
.post-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  min-width: 0;
}

.post-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: white;
  flex-shrink: 0; overflow: hidden; cursor: pointer;
  transition: opacity var(--transition-fast);
}
.post-avatar:hover { opacity: 0.85; }
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-meta { flex: 1; min-width: 0; }
.post-author-name {
  font-family: var(--font-heading);
  font-size: 14.5px; font-weight: 700;
  color: var(--text-heading); cursor: pointer;
  letter-spacing: -0.01em;
  transition: color var(--transition-fast);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.post-author-name:hover { color: var(--brand-primary); }
.post-time { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.post-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Category badge ── */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid;
  white-space: nowrap;
  flex-shrink: 0;
}

.cat-badge.team-recruitment { background:rgba(26,86,232,0.08);  border-color:rgba(26,86,232,0.25);  color:var(--brand-primary); }
.cat-badge.event            { background:rgba(255,107,53,0.08); border-color:rgba(255,107,53,0.25); color:var(--brand-accent); }
.cat-badge.internship       { background:rgba(14,201,165,0.08); border-color:rgba(14,201,165,0.25); color:#0a9a7e; }
.cat-badge.hackathon        { background:rgba(139,92,246,0.08); border-color:rgba(139,92,246,0.25); color:#7c3aed; }
.cat-badge.project-showcase { background:rgba(236,72,153,0.08); border-color:rgba(236,72,153,0.25); color:#be185d; }
.cat-badge.discussion       { background:rgba(245,158,11,0.08); border-color:rgba(245,158,11,0.25); color:#b45309; }
.cat-badge.doubt-help       { background:rgba(239,68,68,0.08);  border-color:rgba(239,68,68,0.25);  color:#dc2626; }

[data-theme="dark"] .cat-badge.internship { color:var(--brand-secondary); }
[data-theme="dark"] .cat-badge.hackathon  { color:#a78bfa; }

/* ── Options menu ── */
.post-options-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: none; background: transparent;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
  touch-action: manipulation;
}
.post-options-btn:hover { background: var(--bg-muted); color: var(--text-heading); }

.post-options-menu {
  position: absolute;
  right: 0; top: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
  display: none;
}
.post-options-menu.open { display: block; animation: menu-pop 0.15s ease both; }

@keyframes menu-pop {
  from { opacity: 0; transform: scale(0.95) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.post-options-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-body); cursor: pointer;
  transition: background var(--transition-fast);
  touch-action: manipulation;
}
.post-options-item:hover { background: var(--bg-muted); }
.post-options-item.danger { color: #ef4444; }
.post-options-item.danger:hover { background: rgba(239,68,68,0.08); }

/* ── Post body ── */
.post-body {
  margin-bottom: 14px;
  min-width: 0;
  overflow: hidden;
}

.post-structured {
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  min-width: 0;
  overflow: hidden;
}
.post-structured-row {
  display: flex;
  gap: 8px;
  margin-bottom: 7px;
  align-items: flex-start;
  min-width: 0;
}
.post-structured-row:last-child { margin-bottom: 0; }

.post-field-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  min-width: 80px; flex-shrink: 0;
  padding-top: 1px;
}
.post-field-value {
  font-size: 13.5px; color: var(--text-body);
  line-height: 1.5;
  overflow-wrap: break-word; word-break: break-word;
  min-width: 0; flex: 1;
}
.post-field-value a { color: var(--brand-primary); text-decoration: none; font-weight: 500; }
.post-field-value a:hover { text-decoration: underline; }

.post-field-value.skills-list { display: flex; flex-wrap: wrap; gap: 5px; }

.skill-chip {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(26,86,232,0.1);
  color: var(--brand-primary);
  font-size: 12px; font-weight: 600;
  border: 1px solid rgba(26,86,232,0.2);
  white-space: nowrap;
}

.post-optional-text {
  font-size: 14px; color: var(--text-body);
  line-height: 1.65; margin-top: 8px;
  white-space: pre-wrap;
  overflow-wrap: break-word; word-break: break-word;
}

/* ── Post image ── */
.post-image-wrap {
  margin-top: 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-muted);
  width: 100%;
  /* responsive aspect ratio container */
  aspect-ratio: 16 / 9;
  max-height: 320px;
}
.post-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: opacity var(--transition-fast);
}

/* ── Post footer / actions ── */
.post-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  min-width: 0;
}
.post-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: none; background: transparent;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 36px;
  touch-action: manipulation;
  white-space: nowrap;
}
.post-action-btn:hover { background: var(--bg-muted); color: var(--text-heading); }
.post-action-btn.liked { color: #ef4444; background: rgba(239,68,68,0.07); }
.post-action-btn .action-count { font-size: 12px; font-weight: 600; }

.post-edit-badge {
  margin-left: auto;
  font-size: 11px; color: var(--text-muted); font-weight: 500;
  padding: 3px 8px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Post card responsive ── */
@media (max-width: 768px) {
  .post-card     { padding: 16px; }
  .post-header   { gap: 10px; margin-bottom: 12px; }
  .post-body     { margin-bottom: 12px; }
  .post-structured { padding: 12px 14px; }
  .post-footer   { gap: 2px; padding-top: 10px; }
  .post-action-btn { padding: 7px 10px; font-size: 12.5px; }
  .post-image-wrap { max-height: 260px; }
}

@media (max-width: 480px) {
  .post-card     { padding: 14px; border-radius: var(--radius-md); }
  .post-header   { gap: 9px; }
  .post-avatar   { width: 36px; height: 36px; font-size: 13px; }
  .post-author-name { font-size: 13.5px; }
  .post-time     { font-size: 11.5px; }
  .cat-badge     { font-size: 10.5px; padding: 2px 7px; }
  .post-options-btn { width: 36px; height: 36px; font-size: 16px; }
  .post-structured  { padding: 10px 12px; }
  .post-structured-row { flex-direction: column; gap: 2px; margin-bottom: 8px; }
  .post-field-label { min-width: unset; font-size: 11px; }
  .post-field-value { font-size: 13px; }
  .post-optional-text { font-size: 13px; }
  .post-footer   { gap: 0; }
  .post-action-btn { padding: 7px 8px; font-size: 12px; gap: 4px; }
  .post-edit-badge { font-size: 10px; padding: 2px 6px; }
  .skill-chip    { font-size: 11px; padding: 2px 7px; }
  .post-image-wrap { max-height: 200px; }
}

@media (max-width: 360px) {
  .post-card { padding: 12px; }
  .post-header-right { gap: 4px; }
  .cat-badge { font-size: 10px; padding: 2px 6px; }
  .post-footer { flex-wrap: wrap; }
  .post-edit-badge { width: 100%; margin-left: 0; margin-top: 4px; text-align: center; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.feed-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px; text-align: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  animation: post-appear 0.3s ease both;
  width: 100%;
}
.feed-empty-icon { font-size: 40px; }
.feed-empty h3 {
  font-family: var(--font-heading);
  font-size: 17px; font-weight: 700;
  color: var(--text-heading); letter-spacing: -0.02em;
}
.feed-empty p {
  font-size: 13.5px; color: var(--text-muted);
  max-width: 280px; line-height: 1.6;
  overflow-wrap: break-word;
}

@media (max-width: 480px) {
  .feed-empty { padding: 40px 16px; }
  .feed-empty-icon { font-size: 32px; }
  .feed-empty h3   { font-size: 15px; }
  .feed-empty p    { font-size: 13px; }
}

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  animation: skeleton-pulse 1.5s ease infinite;
  width: 100%;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}
.skeleton-line {
  height: 12px; border-radius: var(--radius-full);
  background: var(--bg-muted); margin-bottom: 10px;
}
.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.full   { width: 100%; }

/* ============================================================
   MODAL
   ============================================================ */
.post-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,15,26,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  overflow: hidden;
}
.post-modal-overlay.open { opacity: 1; visibility: visible; }

.post-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.post-modal-overlay.open .post-modal { transform: translateY(0) scale(1); }

.post-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0;
  background: var(--bg-surface);
  z-index: 10;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  gap: 12px;
}
.post-modal-title {
  font-family: var(--font-heading);
  font-size: 18px; font-weight: 800;
  color: var(--text-heading); letter-spacing: -0.03em;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-modal-close {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted);
  transition: all var(--transition-fast);
  touch-action: manipulation;
}
.post-modal-close:hover { background: var(--border-color); color: var(--text-heading); }

.post-modal-body {
  padding: 20px 24px 24px;
  min-width: 0;
  overflow: hidden;
}

/* ── Category grid in modal ── */
.modal-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.modal-cat-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  color: var(--text-body);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  touch-action: manipulation;
  min-height: 40px;
  overflow: hidden;
  word-break: break-word;
}
.modal-cat-btn:hover { border-color:var(--brand-primary); color:var(--brand-primary); background:rgba(26,86,232,0.05); }
.modal-cat-btn.selected { border-color:var(--brand-primary); background:rgba(26,86,232,0.09); color:var(--brand-primary); font-weight:600; }

/* ── Form fields ── */
.post-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.form-label .required { color: #ef4444; margin-left: 2px; }

.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg-muted);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  min-width: 0;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:focus, .form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-glow);
  background: var(--bg-surface);
}
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.form-image-preview {
  width: 100%; max-height: 160px; object-fit: cover;
  border-radius: var(--radius-sm); margin-top: 6px;
  display: none; border: 1px solid var(--border-color);
}

.modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: 4px; flex-wrap: wrap;
}

/* ── Profile warning ── */
.profile-warning {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(245,158,11,0.08);
  border: 1.5px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 16px;
  font-size: 13.5px; color: var(--text-body); line-height: 1.55;
  overflow-wrap: break-word;
}
.profile-warning .warn-icon { font-size: 18px; flex-shrink: 0; }
.profile-warning strong { display: block; font-weight: 700; color: #b45309; margin-bottom: 3px; }

/* ── Modal responsive ── */
@media (max-width: 768px) {
  .post-modal-overlay { padding: 16px; }
  .post-modal { max-height: 90vh; }
  .post-modal-header { padding: 16px 20px 14px; }
  .post-modal-body   { padding: 16px 20px 20px; }
  .modal-category-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; margin-bottom: 16px; }
  .modal-cat-btn { padding: 9px 10px; font-size: 12.5px; }
  .modal-footer { gap: 8px; }
  .modal-footer .btn { flex: 1; justify-content: center; }
}

@media (max-width: 480px) {
  .post-modal-overlay { align-items: flex-end; padding: 0; }
  .post-modal {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 94vh; width: 100%; max-width: 100%;
  }
  .post-modal-overlay.open .post-modal { transform: translateY(0) scale(1); }
  .post-modal-header { padding: 14px 16px 12px; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .post-modal-title  { font-size: 16px; }
  .post-modal-body   { padding: 14px 16px 24px; }
  .modal-category-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .modal-cat-btn     { padding: 8px 10px; font-size: 12px; gap: 5px; }
  /* Prevent iOS zoom on inputs */
  .form-input, .form-textarea { font-size: 16px; padding: 10px 12px; }
  .form-label { font-size: 11.5px; }
  .form-hint  { font-size: 11px; }
  .post-form  { gap: 12px; }
}

@media (max-width: 360px) {
  .post-modal-header { padding: 12px 14px 10px; }
  .post-modal-body   { padding: 12px 14px 20px; }
  .modal-category-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
  .modal-cat-btn     { padding: 8px; font-size: 11.5px; gap: 4px; }
}

/* ============================================================
   MISC UI
   ============================================================ */
/* Expired badge */
.expired-notice {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-muted); border-radius: var(--radius-full);
  padding: 2px 8px; border: 1px solid var(--border-color);
}

/* Report / delete confirm */
.report-confirm {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px 24px;
}
.report-confirm h3 {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 700; color: var(--text-heading);
}
.report-confirm p {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.55;
  overflow-wrap: break-word;
}
.report-confirm .modal-footer { padding-top: 12px; margin-top: 0; }

/* ── Toast ── */
#post-toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 8000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

@media (max-width: 768px) {
  #post-toast-container { bottom: 16px; right: 12px; left: 12px; }
}

/* ============================================================
   SIDEBAR-LEGACY (unused stubs kept for style.css compat)
   ============================================================ */
.sidebar-card {
  background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.sidebar-card-title {
  font-family: var(--font-heading); font-size: 13px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 14px;
}
.sidebar-stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border-color); font-size: 13.5px;
}
.sidebar-stat-row:last-child { border-bottom: none; }
.sidebar-stat-label { color: var(--text-muted); font-weight: 500; }
.sidebar-stat-value { color: var(--text-heading); font-weight: 700; font-family: var(--font-heading); }
.sidebar-tip { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.sidebar-tip strong { display: block; color: var(--text-heading); font-weight: 600; margin-bottom: 4px; font-size: 13.5px; }
