/* ============================================================
   social.css — Plantoria Community
   Aesthetic: warm cream + leaf-green accent, Playfair display
   headlines, DM Sans body. Light theme with ink-on-cream contrast.
   ============================================================ */

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

:root {
  --bg: #f5f0e3;
  --bg-warm: #ede6d4;
  --surface: #fdfbf5;
  --surface-2: #f5f0e3;
  --surface-3: #ede6d4;
  --border: rgba(40, 50, 30, 0.10);
  --border-2: rgba(40, 50, 30, 0.18);
  --ink: #0e1a0c;
  --cream: #1a2618;
  --cream-mid: rgba(26, 38, 24, 0.68);
  --cream-dim: rgba(26, 38, 24, 0.45);
  --cream-ghost: rgba(26, 38, 24, 0.05);
  --accent: #5b8a1f;
  --accent-hot: #6ea22a;
  --accent-dim: rgba(91, 138, 31, 0.14);
  --gold: #b48421;
  --rose: #c46688;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow-card: 0 4px 18px rgba(40, 50, 30, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

html {
  scroll-behavior: smooth;
  /* Lock horizontal scrolling on the document itself. body's overflow-x
     alone isn't enough on iOS Safari — html needs it too, otherwise an
     overflowing descendant lets the user swipe-pan the whole page. */
  overflow-x: hidden;
  width: 100%;
  /* Vertical scroll only — block horizontal pan/zoom gestures so the page
     can't be dragged sideways on mobile. */
  touch-action: pan-y;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--cream);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ---- Nav (matches plantoria.net landing) ---- */
.social-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(245, 240, 227, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(40, 50, 30, 0.08);
  transition: padding 0.3s;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
}
.nav-logo img {
  height: 56px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(40, 50, 30, 0.18));
  transition: height 0.3s;
}
.nav-actions {
  display: flex; align-items: center; gap: 0.4rem;
}
.nav-link {
  padding: 0.5rem 1.05rem;
  font-size: 0.85rem; font-weight: 500;
  color: var(--cream-mid);
  border-radius: 8px;
  letter-spacing: 0.01em;
  transition: color 0.25s, background 0.25s;
}
.nav-link:hover { color: var(--cream); background: var(--cream-ghost); }
.nav-link.is-active { color: var(--accent); }
.nav-cta {
  padding: 0.55rem 1.4rem;
  font-size: 0.85rem; font-weight: 600;
  color: #fdfbf5;
  background: var(--ink);
  border-radius: 100px;
  letter-spacing: 0.01em;
  transition: all 0.3s;
}
.nav-cta:hover {
  background: #1a2618;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(14, 26, 12, 0.25);
}
@media (max-width: 540px) {
  .social-nav { padding: 0.75rem 1rem; }
  .nav-logo img { height: 44px; }
  .nav-link { padding: 0.45rem 0.7rem; font-size: 0.82rem; }
  .nav-cta { padding: 0.5rem 1.05rem; }
}

/* ---- Hero (compact light banner) ---- */
.hero {
  padding: 2.4rem 2rem 1.6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -30% 10% auto;
  height: 80%;
  background: radial-gradient(ellipse at 50% 0%, rgba(91, 138, 31, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--cream);
  margin-bottom: 0.55rem;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.hero-sub {
  font-size: clamp(0.88rem, 1.5vw, 0.98rem);
  font-weight: 400;
  color: var(--cream-mid);
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto 1rem;
}

/* Stats row (inline pills, not boxes) */
.hero-stats {
  display: flex; gap: 0.9rem; align-items: center; justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.stat { display: inline-flex; align-items: baseline; gap: 0.35rem; }
.stat-num {
  font-family: var(--serif); font-weight: 600; font-style: italic;
  font-size: 1.15rem;
  color: var(--accent);
}
.stat-label {
  font-size: 0.74rem;
  color: var(--cream-dim);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}
.stat-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border-2);
}

.hero-cta-group {
  display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap;
}

/* Ink pill CTA (light theme) */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.8rem;
  font-family: var(--sans);
  font-size: 0.92rem; font-weight: 600;
  color: #fdfbf5;
  background: var(--ink);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: all 0.3s;
}
.btn-primary:hover {
  background: #1a2618;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 26, 12, 0.22);
}
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  padding: 0.78rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.92rem; font-weight: 500;
  color: var(--cream);
  background: rgba(40, 50, 30, 0.06);
  border: 1px solid rgba(40, 50, 30, 0.16);
  border-radius: 100px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}
.btn-ghost:hover {
  background: rgba(40, 50, 30, 0.10);
  border-color: rgba(40, 50, 30, 0.28);
  transform: translateY(-2px);
}

.hero-tag .hero-title em { font-style: italic; }
.hero-tag .hero-title { font-style: normal; }

/* ---- Layout ---- */
.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.6rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.2rem;
  align-items: flex-start;
}
.layout-narrow { max-width: 880px; grid-template-columns: minmax(0, 1fr) 280px; }

@media (max-width: 880px) {
  .layout, .layout-narrow { grid-template-columns: 1fr; }
  .rail { order: 2; }
  .feed-col { order: 1; }
}

.feed-col { min-width: 0; display: flex; flex-direction: column; gap: 1.4rem; }
.rail { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 80px; }
@media (max-width: 880px) { .rail { position: static; } }

/* ---- Category tabs ---- */
.cat-tabs {
  display: flex; gap: 0.45rem; flex-wrap: wrap;
  padding-bottom: 0.6rem;
}
.cat-tab {
  padding: 0.55rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--cream-mid);
  font-size: 0.92rem; font-weight: 500;
  transition: all 0.18s;
}
.cat-tab:hover { color: var(--cream); border-color: var(--border-2); transform: translateY(-1px); }
.cat-tab.active {
  color: var(--ink);
  background: var(--cat, var(--accent));
  border-color: transparent;
  font-weight: 600;
}

/* ---- Composer ---- */
.composer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.65rem;
  position: relative;
}
.composer-card textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  font: inherit;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  color: var(--cream);
  outline: none;
  transition: border-color 0.15s;
}
.composer-card textarea:focus { border-color: var(--accent); }

/* Compose category pills */
.cat-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.cat-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem; font-weight: 500;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--cream-mid);
  transition: all 0.16s;
  cursor: pointer;
}
.cat-pill:hover { color: var(--cream); border-color: var(--border-2); }
.cat-pill.active {
  background: var(--cat, var(--accent));
  color: var(--ink);
  border-color: transparent;
  font-weight: 600;
}

/* Char counter overlaid bottom-right of textarea */
.composer-input-wrap { position: relative; }
.char-counter {
  position: absolute;
  right: 0.7rem; bottom: 0.45rem;
  font-size: 0.72rem;
  color: var(--cream-dim);
  pointer-events: none;
}
.char-counter.warn  { color: var(--gold); }
.char-counter.danger { color: #ff6b6b; }

/* Toolbar */
.composer-toolbar, .comment-toolbar {
  display: flex; gap: 0.5rem; justify-content: space-between; align-items: center;
}
.toolbar-left { display: flex; gap: 0.3rem; }
.tool-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--cream-mid);
  font-size: 1.05rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* Media previews (photo / gif / sticker) */
[hidden] { display: none !important; }
.media-preview {
  position: relative;
  display: inline-block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-warm);
  max-width: 220px;
  align-self: flex-start;
}
.media-preview img { display: block; max-width: 100%; max-height: 160px; }
.media-preview.sticker-preview {
  width: 70px; height: 70px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 2.5rem;
  border: 1px solid var(--border);
}
.preview-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.preview-remove:hover { background: #d43; }

/* Pickers */
.picker {
  background: var(--bg-warm);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  max-height: 280px;
  overflow-y: auto;
}
.picker-tabs {
  display: flex; gap: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.picker-tab {
  flex: 1;
  padding: 0.35rem;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--cream-mid);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.picker-tab:hover { background: var(--cream-ghost); }
.picker-tab.active { background: var(--accent-dim); color: var(--accent); }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 0.18rem;
}
.picker-grid button {
  background: transparent;
  border: none;
  font-size: 1.45rem;
  padding: 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}
.picker-grid button:hover { background: var(--cream-ghost); transform: scale(1.15); }
.sticker-grid button { font-size: 1.7rem; }

/* GIF picker */
.gif-picker .gif-search {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--cream);
  font: inherit;
  outline: none;
  margin-bottom: 0.5rem;
}
.gif-picker .gif-search:focus { border-color: var(--accent); }
.gif-suggestions {
  display: flex; gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.gif-tag {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--cream-mid);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.gif-tag:hover { color: var(--accent); border-color: var(--accent); }
.gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.3rem;
  min-height: 90px;
}
.gif-grid img {
  width: 100%; height: 90px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.12s;
}
.gif-grid img:hover { transform: scale(1.04); }
.gif-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem;
  color: var(--cream-dim);
  font-size: 0.9rem;
}
.gif-powered {
  font-size: 0.7rem;
  color: var(--cream-dim);
  text-align: right;
  margin-top: 0.4rem;
  letter-spacing: 0.05em;
}

.composer-guest { text-align: center; gap: 0.9rem; padding: 1.4rem; }
.composer-guest p { color: var(--cream-mid); font-size: 0.98rem; margin-bottom: 0.7rem; }

/* ---- Post card ---- */
.post-list { display: flex; flex-direction: column; gap: 1rem; }

.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cat, var(--accent));
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  color: var(--cream);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
  border-left-color: var(--cat, var(--accent));
  box-shadow: var(--shadow-card);
}

/* Stretched-link overlay: full-card click target without nesting links/buttons inside <a>.
   Inner interactive elements raise their z-index to stay clickable. */
.post-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  text-indent: -9999px;
  overflow: hidden;
  background: transparent;
}
.post-card .hashtag,
.post-card .post-action,
.post-card .post-likers,
.post-card .user-link,
.post-card .post-avatar-link {
  position: relative;
  z-index: 2;
}

.post-head {
  display: flex; gap: 0.7rem; align-items: center; margin-bottom: 0.55rem;
}
.post-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem;
  color: var(--ink);
  flex-shrink: 0;
  text-transform: uppercase;
}
.post-avatar-link {
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.post-avatar-link:hover {
  transform: scale(1.06);
  box-shadow: 0 2px 8px rgba(40, 50, 30, 0.2);
}
.user-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.user-link:hover { color: var(--accent); }
.post-head-text { display: flex; flex-direction: column; min-width: 0; }
.post-author { font-weight: 600; font-size: 0.98rem; display: flex; align-items: center; gap: 0.5rem; }
.post-level {
  font-size: 0.72rem; font-weight: 600;
  background: var(--cream-ghost);
  color: var(--cream-mid);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}
.post-meta { font-size: 0.8rem; color: var(--cream-dim); display: flex; gap: 0.45rem; align-items: center; }
.post-cat {
  color: var(--cat, var(--accent));
  font-weight: 600;
}

.post-body {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--cream);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.post-body-detail { font-size: 1.08rem; }
.hashtag {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.hashtag:hover { color: var(--accent-hot); text-decoration: underline; }

.post-photo {
  margin: 0.85rem -0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: var(--bg-warm);
  aspect-ratio: 16 / 10;
}
.post-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.post-photo-multi .photo-count {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,0.7);
  color: #fdfbf5;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
}
.post-photo-gallery {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  aspect-ratio: auto;
  margin: 0.85rem 0 0.4rem;
}
.post-photo-gallery img {
  cursor: zoom-in;
  border-radius: 6px;
  aspect-ratio: 4 / 3;
}
.post-sticker {
  font-size: 5rem;
  text-align: center;
  padding: 1.5rem 0;
}

/* Discovery fallback artwork */
.post-fallback {
  aspect-ratio: 16 / 9;
  background: radial-gradient(circle at 50% 50%, var(--acc, var(--accent)), var(--bg-warm) 75%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.fb-orb {
  position: absolute; inset: 30% 30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.45), transparent 70%);
  filter: blur(20px);
}
.fb-petal { position: absolute; font-size: 1.5rem; opacity: 0.8; animation: fbFloat 6s ease-in-out infinite; }
.fb-1 { top: 14%; left: 18%; }
.fb-2 { top: 20%; right: 22%; animation-delay: 1.2s; }
.fb-3 { bottom: 22%; left: 24%; animation-delay: 2.4s; }
.fb-4 { bottom: 16%; right: 18%; animation-delay: 3.6s; }
.fb-dna { font-size: 3.5rem; z-index: 2; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4)); }
.fb-label {
  position: absolute; bottom: 10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  color: #fdfbf5;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
}
@keyframes fbFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-10px) rotate(8deg); }
}

.post-foot {
  display: flex; gap: 1.4rem; align-items: center;
  margin-top: 0.6rem;
}
.post-action {
  display: flex; align-items: center; gap: 0.35rem;
  color: var(--cream-mid);
  font-size: 0.88rem;
  padding: 0.15rem 0;
  background: none;
  border-radius: 6px;
  transition: color 0.15s;
}
.post-action:hover { color: var(--accent); background: none; }
.post-card[data-liked="1"] .post-like { color: #ff5577; }
.post-action.post-like .like-icon { font-size: 1.05rem; }

/* ---- Detail page ---- */
.post-card-detail {
  cursor: default;
}
.post-card-detail:hover { transform: none; }
.crumb { font-size: 0.92rem; color: var(--cream-mid); margin-bottom: 0.4rem; }
.crumb a:hover { color: var(--accent); }

/* ---- Comments ---- */
.comments-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem;
}
.comments-title {
  font-family: var(--serif); font-weight: 600;
  font-size: 1.25rem; margin-bottom: 1rem;
}
.comment-composer {
  display: flex; flex-direction: column; gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.comment-composer textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  font: inherit;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  color: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  outline: none;
}
.comment-composer textarea:focus { border-color: var(--accent); }
.comment-composer button { align-self: flex-end; }

.comment-composer-guest {
  background: var(--bg-warm);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  text-align: center;
  margin-bottom: 1.2rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.comment-composer-guest p { color: var(--cream-mid); margin-bottom: 0.4rem; }
.comment-composer-guest .btn-link { display: inline-block; }

.comment-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.comment-replies { list-style: none; margin-top: 0.7rem; padding-left: 0.5rem; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 0.7rem; }
.comment-item { display: flex; gap: 0.7rem; align-items: flex-start; }
.comment-avatar { width: 32px; height: 32px; font-size: 0.85rem; }
.comment-body { flex: 1; min-width: 0; }
.comment-head {
  font-size: 0.82rem; color: var(--cream-mid);
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 0.18rem;
}
.comment-head strong { color: var(--cream); font-weight: 600; }
.comment-head time { color: var(--cream-dim); }
.comment-text {
  font-size: 0.95rem; line-height: 1.5;
  background: var(--bg-warm);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.comment-media {
  display: block;
  max-width: 280px;
  max-height: 220px;
  border-radius: var(--radius-sm);
  margin-top: 0.4rem;
  cursor: zoom-in;
}
.comment-meta {
  display: flex; gap: 0.6rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--cream-dim);
}
.reply-btn {
  background: transparent;
  border: none;
  color: var(--cream-mid);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.reply-btn:hover { color: var(--accent); background: var(--cream-ghost); }
.comment-like {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: transparent;
  border: none;
  color: var(--cream-mid);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.comment-like:hover { color: #ff5577; background: var(--cream-ghost); }
.comment-like .like-icon { font-size: 0.95rem; line-height: 1; }
.comment-like .like-count { font-variant-numeric: tabular-nums; }
.comment-item[data-liked="1"] .comment-like { color: #ff5577; }
.reply-form-slot:not(:empty) { margin-top: 0.6rem; }
.reply-composer {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.reply-composer textarea {
  width: 100%;
  min-height: 50px;
  resize: vertical;
  font: inherit;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--cream);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  outline: none;
}
.reply-composer textarea:focus { border-color: var(--accent); }
.comments-empty { color: var(--cream-dim); font-style: italic; }

/* Likers + load-more buttons */
.post-likers {
  font-weight: 500;
  font-size: 0.85rem;
}
.post-likers[hidden] { display: none; }
.btn-load-more {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  color: var(--cream);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  align-self: center;
  transition: all 0.18s;
}
.btn-load-more:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.btn-load-more:disabled { opacity: 0.6; cursor: wait; }

/* ---- Rail / sidebar ---- */
.rail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.rail-title {
  font-family: var(--serif); font-weight: 600;
  font-size: 1.1rem; margin-bottom: 0.8rem;
  letter-spacing: 0.01em;
}
.tag-list { list-style: none; display: flex; flex-direction: column; gap: 0.18rem; }
.tag-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: var(--cream-mid);
  font-size: 0.95rem;
  transition: all 0.15s;
}
.tag-list a:hover { background: var(--cream-ghost); color: var(--accent); }
.tag-list em {
  font-style: normal;
  font-size: 0.78rem; color: var(--cream-dim);
  font-weight: 500;
}
.rail-empty { color: var(--cream-dim); font-style: italic; font-size: 0.9rem; }

.rail-cta { text-align: center; }
.rail-cta .cta-emoji { font-size: 2.3rem; margin-bottom: 0.4rem; }
.rail-cta h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: 1.2rem; margin-bottom: 0.4rem;
}
.rail-cta p { color: var(--cream-mid); font-size: 0.92rem; margin-bottom: 1rem; }

/* ---- Buttons ---- */
/* `.btn` is the in-app smaller button used in composer/comments.
   `.btn-primary` (alone, on hero/footer/CTAs) is the cream landing pill.
   When BOTH classes appear, `.btn .btn-primary` shrinks the cream pill
   to fit composers/forms. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.4rem;
  font: inherit; font-weight: 600; font-size: 0.9rem;
  border-radius: 100px;
  cursor: pointer;
  transition: transform 0.1s, background 0.18s, color 0.18s, box-shadow 0.18s;
  border: none; outline: none;
  text-align: center;
  letter-spacing: 0.01em;
}
.btn.btn-primary {
  /* Override the larger landing-style padding for in-form buttons */
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; }
.btn-link {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--cream-mid);
  font-size: 0.88rem;
}
.btn-link:hover { color: var(--accent); text-decoration: underline; }

/* ---- Pagination ---- */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 0; font-size: 0.95rem;
  color: var(--cream-mid);
}
.pagination a {
  color: var(--accent);
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
}
.pagination a:hover { background: var(--accent-dim); }

/* ---- Empty / placeholder ---- */
.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
}
.empty-emoji { font-size: 3rem; margin-bottom: 0.6rem; }
.empty h2 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 0.4rem; }
.empty p { color: var(--cream-mid); margin-bottom: 1rem; }

/* ---- Sticky guest banner ---- */
.join-banner {
  position: fixed;
  bottom: 1rem; left: 1rem; right: 1rem;
  z-index: 40;
  background: rgba(14, 26, 12, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fdfbf5;
  border-radius: 100px;
  padding: 0.75rem 1rem 0.75rem 1.4rem;
  box-shadow: 0 8px 30px rgba(40, 50, 30, 0.22);
  border: 1px solid rgba(245, 240, 227, 0.10);
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  animation: bannerIn 0.6s 1.2s backwards;
}
@keyframes bannerIn {
  from { transform: translateY(140%); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.join-inner {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  width: 100%;
}
.join-text h3 {
  font-family: var(--serif);
  font-size: 1rem; font-weight: 500;
  margin-bottom: 0.05rem;
  color: #fdfbf5;
  font-style: italic;
}
.join-text p { font-size: 0.78rem; color: rgba(253, 251, 245, 0.65); }
.join-cta {
  padding: 0.55rem 1.4rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.join-banner .btn-primary {
  color: var(--ink);
  background: #fdfbf5;
}
.join-banner .btn-primary:hover {
  background: #fff;
  box-shadow: 0 4px 18px rgba(253, 251, 245, 0.25);
}

@media (max-width: 540px) {
  .join-banner { padding: 0.65rem 0.7rem 0.65rem 1.1rem; }
  .join-text h3 { font-size: 0.9rem; }
  .join-text p { display: none; }
  .join-cta { padding: 0.5rem 1.1rem; }
}

/* ---- Footer (matches landing footer) ---- */
.social-footer {
  padding: 4rem 2rem 5rem;
  text-align: center;
  position: relative;
}
.footer-divider {
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cream-ghost), transparent);
}
.footer-logo { display: inline-block; margin-bottom: 1.2rem; }
.footer-logo img {
  height: 140px;
  width: auto;
  filter: drop-shadow(0 4px 10px rgba(40, 50, 30, 0.18));
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.8rem;
  color: var(--cream-dim);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--cream-mid); }
.footer-copy {
  font-size: 0.7rem;
  color: var(--cream-dim);
  letter-spacing: 0.04em;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 6px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%; bottom: 5rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-3);
  color: var(--cream);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 110;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- User profile page ---- */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.6rem 1.4rem;
  margin-bottom: 1.2rem;
}
.profile-head {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.2rem;
}
.profile-avatar {
  width: 72px; height: 72px;
  font-size: 1.8rem;
}
.profile-id { min-width: 0; }
.profile-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.1;
  margin-bottom: 0.3rem;
  word-break: break-word;
}
.profile-sub {
  display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
  font-size: 0.86rem; color: var(--cream-mid);
}
.profile-joined { color: var(--cream-dim); }
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.profile-stat {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 0.4rem 0.2rem;
}
.profile-stat-num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--cream);
  line-height: 1.1;
}
.profile-stat-label {
  font-size: 0.78rem;
  color: var(--cream-mid);
  margin-top: 0.15rem;
}
.profile-section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0.2rem 0 0.8rem;
  color: var(--cream);
}
.profile-stat-sale .profile-stat-num { color: #b48421; }

/* ---- Shop section on profile ---- */
.shop-section { margin-bottom: 1.6rem; }
.shop-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.8rem;
  margin: 0.2rem 0 0.8rem;
  flex-wrap: wrap;
}
.shop-visit-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  transition: color 0.15s;
}
.shop-visit-link:hover { color: var(--accent-hot); text-decoration: underline; }

/* Pinterest-style masonry: CSS columns flow card heights naturally. */
.shop-masonry {
  column-count: 3;
  column-gap: 0.9rem;
}
@media (max-width: 880px) { .shop-masonry { column-count: 2; } }
@media (max-width: 480px) { .shop-masonry { column-count: 1; } }

.shop-card {
  display: block;
  margin: 0 0 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  color: var(--cream);
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
}
.shop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(40, 50, 30, 0.16), 0 2px 6px rgba(40, 50, 30, 0.08);
  border-color: var(--rarity, var(--accent));
}

.shop-card-art {
  position: relative;
  background: linear-gradient(135deg, var(--bg-warm) 0%, var(--surface-3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.shop-card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14%;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 6px 16px rgba(40, 50, 30, 0.12));
}
.shop-card:hover .shop-card-art img { transform: scale(1.06); }
.shop-card-fallback {
  font-size: 4rem;
  opacity: 0.65;
}
.shop-card-tier {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  box-shadow: 0 2px 6px rgba(40, 50, 30, 0.18);
}
.shop-card-qty {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(14, 26, 12, 0.78);
  color: #fdfbf5;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
}

.shop-card-info {
  padding: 0.85rem 0.95rem 0.95rem;
}
.shop-card-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--cream);
  margin-bottom: 0.45rem;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.shop-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.shop-card-stage {
  font-size: 0.78rem;
  color: var(--cream-mid);
  font-weight: 500;
}
.shop-card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.shop-card-where {
  font-size: 0.74rem;
  color: var(--cream-dim);
  letter-spacing: 0.01em;
}
.shop-card:hover .shop-card-where { color: var(--accent); }

.shop-view-all {
  display: block;
  text-align: center;
  margin-top: 0.4rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.shop-view-all:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-hot);
}
@media (max-width: 540px) {
  .profile-card { padding: 1.2rem; }
  .profile-avatar { width: 60px; height: 60px; font-size: 1.5rem; }
  .profile-name { font-size: 1.4rem; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Share popover ---- */
.share-popover {
  position: absolute;
  z-index: 200;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 36px rgba(40, 50, 30, 0.18), 0 2px 6px rgba(40, 50, 30, 0.08);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  animation: sharePopIn 0.14s ease-out;
}
@keyframes sharePopIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.share-opt {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-size: 0.92rem; font-weight: 500;
  color: var(--cream);
  text-align: left;
  width: 100%;
  background: transparent;
  border: none;
  transition: background 0.12s;
  cursor: pointer;
}
.share-opt:hover, .share-opt:focus-visible {
  background: var(--cream-ghost);
  outline: none;
}
.share-opt-icon {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  color: #fff;
}
.share-opt-icon svg { width: 14px; height: 14px; }
.share-opt-name { line-height: 1; }
/* Brand colors on the icon disc */
.share-opt-wa .share-opt-icon { background: #25d366; }
.share-opt-tg .share-opt-icon { background: #229ed9; }
.share-opt-tw .share-opt-icon { background: #0f1419; }
.share-opt-fb .share-opt-icon { background: #1877f2; }
.share-opt-li .share-opt-icon { background: #0a66c2; }
.share-opt-rd .share-opt-icon { background: #ff4500; }
.share-opt-em .share-opt-icon { background: #5b8a1f; }
.share-opt-cp .share-opt-icon { background: rgba(26, 38, 24, 0.55); }

/* ===========================================================
   MOBILE POLISH
   --------------------------------
   Mobile-first cleanup. We progressively tighten layout at
   three breakpoints: 760 (tablet), 540 (phone), 380 (small phone).
   Everything below assumes the desktop styles already apply.
   =========================================================== */

/* Tablet */
@media (max-width: 760px) {
  .social-nav { padding: 0.85rem 1.2rem; }
  .nav-actions { gap: 0.3rem; }
  .hero { padding: 2rem 1.4rem 1.3rem; }
  .layout, .layout-narrow { padding: 1.6rem 1.2rem 5rem; }
  .composer-card { padding: 1rem; }
  .post-card { padding: 1rem 1.05rem; }
  .post-photo { aspect-ratio: 4 / 3; }
  .comments-block { padding: 1.1rem; }
  .profile-card { padding: 1.4rem 1.2rem; }
  .profile-name { font-size: 1.5rem; }
  .social-footer { padding: 3rem 1.4rem 4rem; }
  .footer-logo img { height: 110px; }
}

/* Phone */
@media (max-width: 540px) {
  /* Nav */
  .social-nav { padding: 0.7rem 0.9rem; gap: 0.5rem; }
  .nav-logo img { height: 36px; }
  .nav-link { padding: 0.4rem 0.55rem; font-size: 0.82rem; }
  .nav-link.nav-cta { padding: 0.42rem 0.85rem; }

  /* Hero */
  .hero { padding: 1.4rem 1rem 1rem; }
  .hero-eyebrow { font-size: 0.62rem; letter-spacing: 0.14em; }
  .hero-stats { gap: 0.65rem; }
  .stat-num { font-size: 1.05rem; }
  .stat-label { font-size: 0.7rem; }
  .hero-cta-group { width: 100%; }
  .hero-cta-group .btn-primary,
  .hero-cta-group .btn-ghost { flex: 1 1 auto; padding: 0.7rem 1.2rem; font-size: 0.88rem; }

  /* Layout */
  .layout, .layout-narrow { padding: 1.2rem 0.85rem 5.5rem; gap: 1.1rem; }

  /* Category tabs / filter pills */
  .cat-tabs {
    margin: 0 -0.85rem;
    padding: 0 0.85rem 0.6rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { white-space: nowrap; padding: 0.5rem 0.85rem; font-size: 0.86rem; }

  /* Composer */
  .composer-card { padding: 0.9rem; gap: 0.55rem; }
  .composer-card textarea { min-height: 60px; font-size: 16px; /* prevents iOS zoom-on-focus */ padding: 0.6rem 0.75rem; }
  .cat-pill { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
  .composer-toolbar, .comment-toolbar {
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
  }
  .toolbar-left { gap: 0.25rem; flex-wrap: wrap; }
  .tool-btn { width: 38px; height: 38px; font-size: 1rem; }
  .composer-toolbar .btn,
  .comment-toolbar .btn { padding: 0.55rem 1.1rem; font-size: 0.86rem; }

  /* Post card */
  .post-card { padding: 0.9rem 1rem; border-radius: 14px; }
  .post-head { gap: 0.55rem; margin-bottom: 0.5rem; }
  .post-avatar { width: 36px; height: 36px; font-size: 0.95rem; }
  .post-author { font-size: 0.92rem; }
  .post-meta { font-size: 0.74rem; gap: 0.3rem; }
  .post-body { font-size: 0.95rem; }
  .post-photo { margin: 0.75rem -0.15rem 0.35rem; }
  .post-foot { gap: 1rem; flex-wrap: wrap; }
  .post-action { font-size: 0.82rem; padding: 0.25rem 0; }
  .post-action.post-share span:last-child { /* hide "Share" word, keep arrow */ display: none; }

  /* Comments */
  .comments-block { padding: 0.95rem 0.9rem; border-radius: 14px; }
  .comments-title { font-size: 1.1rem; margin-bottom: 0.85rem; }
  .comment-replies { padding-left: 0.45rem; }
  .comment-item { gap: 0.55rem; }
  .comment-avatar { width: 28px; height: 28px; font-size: 0.78rem; }
  .comment-text { font-size: 0.92rem; padding: 0.5rem 0.7rem; }
  .comment-media { max-width: 100%; }
  .comment-composer textarea { min-height: 54px; font-size: 16px; }
  .comment-composer-guest { padding: 0.95rem; }
  .comment-composer-guest .btn-primary { padding: 0.6rem 1.4rem; font-size: 0.88rem; }
  .reply-composer { padding: 0.6rem; gap: 0.45rem; }
  .reply-composer textarea { font-size: 16px; }

  /* Pagination / load more */
  .btn-load-more { width: 100%; padding: 0.8rem; }
  .pagination { font-size: 0.86rem; gap: 0.4rem; }

  /* Profile page */
  .profile-card { padding: 1.1rem 1rem; }
  .profile-head { gap: 0.85rem; margin-bottom: 1rem; }
  .profile-avatar { width: 56px; height: 56px; font-size: 1.4rem; }
  .profile-name { font-size: 1.3rem; }
  .profile-section-title { font-size: 1.05rem; }
  .shop-section-head { gap: 0.4rem; }
  .shop-card-name { font-size: 0.98rem; }
  .shop-card-info { padding: 0.7rem 0.8rem 0.8rem; }

  /* Share popover — clamp inside viewport on phones */
  .share-popover {
    min-width: 0;
    width: calc(100vw - 24px);
    max-width: 280px;
  }

  /* Footer */
  .social-footer { padding: 2.4rem 1rem 3.2rem; }
  .footer-logo img { height: 90px; }
}

/* Small phone (iPhone SE, ≤ 380px) */
@media (max-width: 380px) {
  .nav-link { padding: 0.35rem 0.4rem; font-size: 0.78rem; }
  .nav-link.nav-cta { padding: 0.38rem 0.7rem; }
  .hero { padding: 1.1rem 0.9rem 0.85rem; }
  .hero-stats .stat-dot { display: none; }
  .hero-stats { gap: 0.45rem 0.9rem; }
  .layout, .layout-narrow { padding: 1rem 0.7rem 5rem; }
  .post-card { padding: 0.8rem 0.9rem; }
  .composer-card { padding: 0.8rem 0.85rem; }
  .post-foot { gap: 0.85rem; }
  .post-action { font-size: 0.78rem; }
  .comments-block { padding: 0.8rem 0.75rem; }
  .comment-replies { padding-left: 0.35rem; margin-left: -0.15rem; }
}
