/* home-v1 — forked from developdoc/pulse_style_guide/sample_001/style.css.
   Self-contained per prototype principle (no shared base.css).
   Tokens come from ../shared/tokens.css. */

*  { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

input { font: inherit; color: inherit; background: none; border: 0; outline: 0; }

/* ============ APP SHELL (3-column desktop) ============ */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 680px) 320px;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

/* ============ SIDEBAR ============ */
.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 36px;
  color: var(--text);
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

nav a {
  padding: 14px 18px;
  color: var(--text-soft);
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

nav a.active,
nav a:hover {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.new-post {
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-weight: 700;
  padding: 14px 22px;
  font-size: 16px;
}

/* ============ FEED ============ */
.feed { min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.topbar h1 { font-size: 28px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }

/* Brand in topbar — mobile only (desktop shows brand in sidebar instead) */
.topbar-brand { display: none; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.topbar-brand img { width: 24px; height: 24px; object-fit: contain; }

.topbar .filter {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  padding: 10px 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.composer { padding: 18px; margin-bottom: 18px; }
.composer-row { display: flex; align-items: center; gap: 12px; }
.composer input { flex: 1; font-size: 16px; }
.composer input::placeholder { color: var(--text-muted); }

.composer-tools {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  color: var(--text-soft);
  font-size: 14px;
}
.composer-tools .tool { cursor: pointer; }
.composer-tools .tool:hover { color: var(--text); }
.composer-tools .post-btn {
  margin-left: auto;
  border-radius: 999px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 700;
}

/* avatars */
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  flex-shrink: 0;
  user-select: none;
}
.avatar.g1 { background: linear-gradient(135deg, var(--primary), var(--ai)); }
.avatar.g2 { background: linear-gradient(135deg, var(--ai), var(--info)); }
.avatar.g3 { background: linear-gradient(135deg, var(--success), var(--ai)); }
.avatar.g4 { background: linear-gradient(135deg, var(--accent), var(--accent-warm)); }
.avatar.g5 { background: linear-gradient(135deg, var(--primary), var(--accent)); }

/* posts */
.post { padding: 18px; margin-bottom: 18px; }

.post-head { display: flex; align-items: center; gap: 12px; }
.post-head .who { flex: 1; min-width: 0; }
.post-head .who strong { display: block; font-weight: 700; }
.post-head .who small { display: block; color: var(--text-soft); margin-top: 2px; font-size: 12px; }
.post-head .more { color: var(--text-muted); font-size: 18px; padding: 4px 10px; border-radius: 999px; }
.post-head .more:hover { background: var(--surface-soft); }

.post-body {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.tags { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.tags a { color: var(--primary-dark); font-size: 14px; font-weight: 600; }

.actions {
  display: flex;
  gap: 24px;
  color: var(--text-soft);
  margin-top: 14px;
  font-size: 14px;
}
.actions .act { cursor: pointer; padding: 4px 8px; margin: -4px -8px; border-radius: 999px; transition: background 0.15s, color 0.15s; }
.actions .act:hover { background: var(--surface-soft); color: var(--text); }
.actions .act.liked { color: var(--like); }

/* ============ RIGHT PANEL ============ */
.right-panel { display: flex; flex-direction: column; gap: 18px; }

.search {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  padding: 14px 20px;
}

.right-panel .card { padding: 18px; }
.right-panel h2 { font-size: 18px; margin: 0 0 16px; font-weight: 700; }

.trend-list { list-style: none; padding: 0; margin: 0; }
.trend-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.trend-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.trend-list b { font-weight: 700; }
.trend-list span { color: var(--text-soft); font-size: 13px; }

.ai-card { background: linear-gradient(180deg, var(--surface), var(--primary-soft)); }
.ai-card p { line-height: 1.65; margin: 0; }
.ai-card .mini-graph {
  height: 72px;
  margin-top: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(56,189,248,.25));
}

.wallet-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.wallet-card h2 { color: rgba(255,255,255,.85); }
.wallet-card .balance { font-size: 30px; font-weight: 800; }
.wallet-card .balance small { font-size: 13px; margin-left: 4px; opacity: .85; }
.wallet-card p { color: rgba(255,255,255,.78); margin: 8px 0 0; font-size: 13px; }

/* ============ MOBILE NAV (hidden on desktop) ============ */
.mobile-nav { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
    padding-bottom: 96px;
    gap: 12px;
  }
  .sidebar,
  .right-panel { display: none; }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 4px;
    margin: 0 0 12px;
  }
  .topbar h1 { display: none; }
  .topbar-brand { display: inline-flex; }

  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 10px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 20;
  }
  .mobile-nav a {
    text-align: center;
    font-size: 12px;
    color: var(--text-soft);
    padding: 8px 4px;
  }
  .mobile-nav a.active { color: var(--text); font-weight: 600; }
  .mobile-nav .compose-btn {
    width: 46px;
    height: 46px;
    margin: auto;
    padding: 0;
    border-radius: 50%;
    background: var(--cta-bg);
    color: var(--cta-text);
    display: grid;
    place-items: center;
    line-height: 1;
  }
}
