/* ========== Variables ========== */
:root {
  --bg:        #fff8f2;
  --bg2:       #ffeedd;
  --surface:   #ffffff;
  --surface2:  #fff4ec;
  --border:    #f5d9c0;
  --border2:   #f0c4a0;
  --accent:    #e85d26;
  --accent2:   #f5923e;
  --accent3:   #fbb87a;
  --success:   #22c55e;
  --danger:    #dc2626;
  --warning:   #d97706;
  --muted:     #b8896a;
  --text:      #2d1a0e;
  --text2:     #6b3d22;
  --sans:      'Nunito', sans-serif;
  --display:   'Quicksand', sans-serif;
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ========== Base ========== */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 5% 0%, rgba(245,146,62,.20) 0%, transparent 65%),
    radial-gradient(ellipse 55% 40% at 95% 10%, rgba(232,93,38,.11) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 105%, rgba(251,184,122,.13) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent3); border-radius: 3px; }

/* ========== Header ========== */
.main-header {
  display: flex;
  align-items: center;
  padding: 12px 32px;
  gap: 16px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 20px rgba(232,93,38,.06);
}

.logo a { display: flex; align-items: center; gap: 10px; text-decoration: none; }

.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(140deg, #e85d26 0%, #f5923e 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(232,93,38,.30);
  flex-shrink: 0;
}
.logo-mark svg { width: 20px; height: 20px; fill: #fff; }

.logo-text { display: flex; flex-direction: column; }
.logo-text .logo-main {
  font-family: var(--display); font-size: 20px; font-weight: 700;
  color: var(--text); letter-spacing: -0.3px;
}
.logo-text .logo-main span { color: var(--accent); }
.logo-text .logo-sub {
  font-size: 9.5px; font-weight: 600; color: var(--muted);
  letter-spacing: .7px; text-transform: uppercase; margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-search {
  display: flex; align-items: center; gap: 8px;
  max-width: 360px;
}
.header-search input[type="text"] {
  flex: 1; padding: 9px 15px; font-size: 14px;
  background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: 10px; outline: none; color: var(--text);
  font-family: var(--sans); transition: border-color .2s, box-shadow .2s;
}
.header-search input[type="text"]::placeholder { color: var(--muted); }
.header-search input[type="text"]:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,93,38,.10);
}
.header-search button {
  padding: 9px 16px; background: var(--accent); border: none;
  border-radius: 9px; color: #fff; font-family: var(--sans);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .1s; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(232,93,38,.26);
}
.header-search button:hover  { background: #c94b17; }
.header-search button:active { transform: scale(.97); }

/* ========== Homepage Hero ========== */
.hero-wrap {
  padding: 72px 24px 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,93,38,.09);
  border: 1px solid rgba(232,93,38,.2);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .4px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero-wrap h1 {
  font-family: var(--display);
  font-size: 52px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 18px;
  max-width: 640px;
}

.hero-wrap h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 17px;
  color: var(--text2);
  line-height: 1.65;
  max-width: 500px;
  margin-bottom: 34px;
}

/* ========== Search Box ========== */
.search-box {
  width: 100%;
  max-width: 540px;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 2px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(232,93,38,.10);
  transition: border-color .2s, box-shadow .2s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(232,93,38,.18);
}

.search-box input {
  flex: 1;
  padding: 15px 18px;
  font-size: 15px;
  font-family: var(--sans);
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  min-width: 0;
}
.search-box input::placeholder { color: var(--muted); }

.search-box button {
  padding: 0 22px;
  font-size: 14px;
  font-family: var(--sans);
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.search-box button:hover { background: #c94b17; }

/* Feature pills */
.feature-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 22px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 50px;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
}
.pill i { color: var(--accent); font-size: 11px; }

/* ========== Feed Section ========== */
.feed-section {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto 40px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.section-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.8); }
}

/* ========== Container ========== */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 20px auto;
}

/* ========== User Cards — NEW DESIGN ========== */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 4px 0 20px;
}

.user-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 2px 10px rgba(232,93,38,.05);
  transition: box-shadow .25s, transform .2s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.user-info:hover {
  box-shadow: 0 8px 28px rgba(232,93,38,.13);
  transform: translateY(-3px);
}

/* Top accent stripe */
.user-info::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
}

.user-inner {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.user-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.user-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.user-header img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--surface);
  box-shadow: 0 0 0 2px var(--border2);
  display: block;
}

.user-meta { flex: 1; min-width: 0; }

.user-meta strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta small { display: block; margin-top: 2px; }

.user-meta small a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
}
.user-meta small a:hover { text-decoration: underline; }

.bio {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ========== Post Grid — Masonry (KEEP) ========== */
.post-grid {
  column-count: 3;
  column-gap: 16px;
  padding: 4px 0 20px;
}

/* Profile page: 2 columns (sidebar takes space) */
.profile-content .post-grid {
  column-count: 2;
}

/* ========== Post Card ========== */
.post {
  display: inline-block;
  width: 100%;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(232,93,38,.05);
  break-inside: avoid;
  transition: box-shadow .2s, transform .15s;
}

.post:hover {
  box-shadow: 0 8px 28px rgba(232,93,38,.12);
  transform: translateY(-2px);
}

.post-body { padding: 14px 16px 12px; }

.post p {
  margin: 0 0 10px;
  line-height: 1.6;
  font-size: 13.5px;
  color: var(--text);
}

.post img { max-width: 100%; display: block; }
.post small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.post a { color: var(--accent); text-decoration: none; }

/* Post author row */
.post-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.post-author-left { display: flex; align-items: center; gap: 9px; }
.post-author-left img {
  width: 38px; height: 38px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border2);
}
.post-author-name { font-weight: 700; color: var(--text); font-size: 13px; }
.post-author-handle { font-size: 11.5px; color: var(--accent); }
.post-timestamp { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Post stats row */
.post-stats {
  display: flex;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface2);
}
.post-stats span { display: flex; align-items: center; gap: 4px; }

/* ========== Card Box (Embeds) ========== */
.card-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--surface2);
  box-shadow: 0 1px 4px rgba(232,93,38,.04);
  transition: box-shadow .2s, transform .15s;
}
.card-box:hover { box-shadow: 0 6px 20px rgba(232,93,38,.13); }
.card-box img { width: 100%; height: auto; display: block; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-meta { padding: 9px 13px; }
.card-meta small { color: var(--muted); display: block; margin-bottom: 3px; font-size: 12px; }
.card-meta strong { font-size: 13px; display: block; color: var(--text); }

/* ========== YouTube Thumb ========== */
.youtube-thumb { position: relative; width: 100%; padding-bottom: 56.25%; background: #000; }
.youtube-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.youtube-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; color: #fff;
}

/* ========== Profile Layout — NEW: Sidebar ========== */
.profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  width: 90%;
  max-width: 1200px;
  margin: 30px auto;
  align-items: start;
}

/* Profile Sidebar Card */
.profile-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(232,93,38,.07);
  position: sticky;
  top: 80px;
}

.profile-banner {
  height: 90px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.profile-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.15);
}

.profile-avatar-wrap {
  position: relative;
  margin: -38px 0 0 20px;
  z-index: 2;
  display: inline-block;
}

.profile-avatar-wrap img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  object-fit: cover;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  display: block;
}

.profile-sidebar-body {
  padding: 10px 20px 22px;
}

.profile-display-name {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 8px;
  line-height: 1.2;
}

.profile-handle {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 3px;
  margin-bottom: 12px;
}

.profile-bio {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-stat-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}

.profile-stat-box strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--display);
}

.profile-stat-box span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 600;
}

.profile-nav {
  display: flex;
  gap: 8px;
  flex-direction: column;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.profile-nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s;
  border: 1px solid transparent;
}

.profile-nav-btn i { width: 16px; text-align: center; color: var(--muted); }
.profile-nav-btn.active {
  background: rgba(232,93,38,.08);
  color: var(--accent);
  border-color: rgba(232,93,38,.15);
}
.profile-nav-btn.active i { color: var(--accent); }
.profile-nav-btn:hover:not(.active) { background: var(--bg2); color: var(--text); }

/* Profile main content area */
.profile-content {
  min-width: 0;
}

.profile-content-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.profile-content-header h2 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ========== Load More ========== */
.load-more-btn {
  padding: 10px 28px;
  border-radius: 50px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 2px 8px rgba(232,93,38,.08);
}
.load-more-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.load-more-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ========== Page Content (About / Privacy / Terms) ========== */
.page-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 36px;
  box-shadow: 0 2px 18px rgba(232,93,38,.05);
}
.page-content h2 { color: var(--text); font-family: var(--display); }
.page-content p, .page-content li { color: #5c3520; line-height: 1.78; }
.page-content a { color: var(--accent); text-decoration: none; }
.page-content a:hover { text-decoration: underline; }

/* ========== Footer ========== */
footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 13.5px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 20px;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(10px);
}
.footer-links {
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  gap: 4px; flex-wrap: wrap;
}
.footer-links a {
  color: var(--text2); text-decoration: none;
  padding: 4px 10px; border-radius: 20px; transition: background .15s;
}
.footer-links a:hover { background: var(--bg2); }
.footer-links .sep { color: var(--border2); }

/* ========== Responsive ========== */
@media (max-width: 960px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    position: static;
  }
  .profile-avatar-wrap {
    margin-left: 16px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .post-grid { column-count: 2; }
  .user-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 767px) {
  .post-grid,
  .home-feed .post-grid,
  .hashtag-layout > div:first-child .post-grid,
  .profile-content .post-grid { column-count: 1; }
  .user-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero-wrap h1 { font-size: 34px; }
  .hero-sub     { font-size: 15px; }
  .main-header  { padding: 10px 16px; }
  .container    { padding: 0 16px 36px; }
  .feed-section { width: 95%; }
  .profile-layout { width: 95%; }
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* slogan alias for static pages */
.slogan {
  font-size: 17px;
  color: var(--text2);
  margin-bottom: 28px;
  max-width: 560px;
  line-height: 1.65;
}

/* ========== Main Nav ========== */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text2);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.nav-link i { font-size: 12px; }
.nav-link:hover { background: var(--bg2); color: var(--text); }
.nav-link.active { background: rgba(232,93,38,.1); color: var(--accent); }

/* ========== Hamburger Button ========== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .2s, width .2s;
  transform-origin: center;
}

.hamburger.open { background: rgba(232,93,38,.1); border-color: rgba(232,93,38,.3); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== Mobile Menu Dropdown ========== */
.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 57px;
  z-index: 99;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  overflow: hidden;
  max-height: 0;
  padding: 0 16px;
  box-shadow: none;
  transition: max-height .28s ease, padding .25s ease, border-color .2s, box-shadow .25s;
}

.mobile-menu.open {
  max-height: 300px;
  padding: 14px 16px;
  border-color: var(--border);
  box-shadow: 0 6px 20px rgba(232,93,38,.08);
}

.mobile-menu-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu-search input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  font-family: var(--sans);
  transition: border-color .2s, box-shadow .2s;
}

.mobile-menu-search input[type="text"]::placeholder { color: var(--muted); }
.mobile-menu-search input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,93,38,.10);
}

.mobile-menu-search button {
  padding: 10px 16px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
  box-shadow: 0 2px 8px rgba(232,93,38,.26);
}

.mobile-menu-search button:hover { background: #c94b17; }

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: background .15s, color .15s;
}

.mobile-menu-link i { color: var(--accent); font-size: 13px; }
.mobile-menu-link:hover,
.mobile-menu-link.active {
  background: rgba(232,93,38,.08);
  color: var(--accent);
  border-color: rgba(232,93,38,.2);
}

@media (max-width: 600px) {
  .header-right { display: none; }
  .hamburger    { display: flex; }
  .main-header  { padding: 10px 16px; }
}

/* ========== Trending Page ========== */

/* Hero */
.trending-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 60%, var(--accent3) 100%);
  padding: 52px 24px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.trending-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 120%, rgba(255,255,255,.18) 0%, transparent 70%);
  pointer-events: none;
}

.trending-hero-inner { position: relative; z-index: 1; }

.trending-hero .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50px;
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
}

.trending-hero h1 {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.trending-hero h1 em {
  font-style: normal;
  color: rgba(255,255,255,.85);
  text-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.trending-hero .hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,.88);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Layout */
.trending-layout {
  width: 90%;
  max-width: 1120px;
  margin: 36px auto 48px;
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 26px;
  align-items: start;
}

.trending-main { min-width: 0; }

/* Spotlight row — top 3 */
.trend-spotlight-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}

.trend-spotlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 22px 14px 18px;
  border-radius: 18px;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s;
  border: 1px solid transparent;
}

.trend-spotlight:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(232,93,38,.15);
}

.trend-spotlight--1 {
  background: linear-gradient(160deg, #fff6ee 0%, #ffebd6 100%);
  border-color: rgba(232,93,38,.22);
}

.trend-spotlight--2 {
  background: linear-gradient(160deg, #f8f8f8 0%, #efefef 100%);
  border-color: rgba(0,0,0,.08);
}

.trend-spotlight--3 {
  background: linear-gradient(160deg, #fdf4ec 0%, #f5e6d4 100%);
  border-color: rgba(180,110,50,.18);
}

.trend-spotlight-icon {
  font-size: 26px;
  line-height: 1;
}

.trend-spotlight--1 .trend-spotlight-icon { color: #e8a010; }
.trend-spotlight--2 .trend-spotlight-icon { color: #9e9e9e; }
.trend-spotlight--3 .trend-spotlight-icon { color: #b46a2a; }

.trend-spotlight-rank {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}

.trend-spotlight-topic {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
  line-height: 1.3;
}

.trend-spotlight--1 .trend-spotlight-topic { color: var(--accent); }

.trend-spotlight-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(232,93,38,.07);
  border-radius: 50px;
  padding: 2px 10px;
}

/* Trend cards */
.trend-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px 18px 18px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(232,93,38,.04);
  transition: box-shadow .2s, transform .15s, border-color .15s;
}

.trend-card:hover {
  box-shadow: 0 8px 28px rgba(232,93,38,.12);
  transform: translateY(-2px);
  border-color: var(--border2);
}

.trend-card--top {
  border-color: rgba(232,93,38,.18);
  background: linear-gradient(135deg, #fff 60%, #fff8f2 100%);
}

/* Rank badge */
.trend-rank-badge {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
  color: var(--muted);
  margin-top: 2px;
}

.trend-rank-badge.rank-gold {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
  color: #b45309;
}

.trend-rank-badge.rank-silver {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-color: #9ca3af;
  color: #6b7280;
}

.trend-rank-badge.rank-bronze {
  background: linear-gradient(135deg, #fdf4ec 0%, #f5d9b4 100%);
  border-color: #d97706;
  color: #92400e;
}

.trend-card-body { flex: 1; min-width: 0; }

.trend-topic-link {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 5px;
  line-height: 1.2;
  transition: color .15s;
}

.trend-topic-link:hover { color: var(--accent); }

.trend-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 10px;
}

.trend-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trend-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(232,93,38,.08);
  border: 1px solid rgba(232,93,38,.15);
  border-radius: 50px;
  padding: 3px 10px;
  font-weight: 700;
  color: var(--accent);
  font-size: 12px;
}

.trend-browse-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  opacity: .8;
  margin-left: auto;
  transition: opacity .15s;
}

.trend-browse-link:hover { opacity: 1; }

/* Sample posts inside card */
.trend-samples {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trend-sample-post {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.trend-sample-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border2);
}

.trend-sample-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.trend-sample-text {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.5;
  margin: 0;
}

/* Empty state */
.trend-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.trend-empty-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

/* Topics sidebar */
.topics-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(232,93,38,.05);
  position: sticky;
  top: 80px;
}

.topics-sidebar-header {
  padding: 14px 18px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
}

.topic-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}

.topic-item:last-child { border-bottom: none; }
.topic-item:hover { background: var(--bg2); }

.topic-item-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.topic-item-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-item-label span { color: var(--accent); }

/* Responsive */
@media (max-width: 860px) {
  .trending-layout {
    grid-template-columns: 1fr;
    width: 94%;
  }

  .topics-sidebar { position: static; }

  .trend-spotlight-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .trending-hero h1 { font-size: 30px; }
  .trend-spotlight-row { grid-template-columns: 1fr; }
  .trend-card { gap: 12px; padding: 14px 14px 14px 14px; }
  .trend-rank-badge { width: 36px; height: 36px; font-size: 14px; }
  .trend-topic-link { font-size: 16px; }
}

/* ========== Hashtag Page ========== */
.hashtag-layout {
  width: 90%;
  max-width: 1100px;
  margin: 30px auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.hashtag-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 22px;
  color: #fff;
}

.hashtag-hero h1 {
  font-size: 32px;
  font-family: var(--display);
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.hashtag-hero p {
  font-size: 14px;
  opacity: .85;
}

.sort-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.sort-tab {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text2);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all .15s;
}

.sort-tab.active, .sort-tab:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}


/* ========== Inline Hashtag Links ========== */
.post-text a.hashtag-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.post-text a.hashtag-link:hover {
  text-decoration: underline;
}

/* ========== Trending Topics Sidebar (homepage) ========== */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto 40px;
}

.home-feed { min-width: 0; }

/* Home page: sidebar takes space → 2 col feed */
.home-feed .post-grid { column-count: 2; }

/* Hashtag page: sidebar takes space → 2 col feed */
.hashtag-layout > div:first-child .post-grid { column-count: 2; }

@media (max-width: 767px) {
  .home-feed .post-grid,
  .hashtag-layout > div:first-child .post-grid { column-count: 1; }
}

.home-sidebar {
  min-width: 0;
  position: sticky;
  top: 80px;
  align-self: start;
}

@media (max-width: 900px) {
  .trending-layout,
  .hashtag-layout,
  .home-layout {
    grid-template-columns: 1fr;
  }
  .topics-sidebar,
  .home-sidebar { position: static; }
}
