/**
 * Evabiz hashtags — chips + topic page
 * Tokens aligned with site-shell / social (cream · plum · coral)
 */

/* ── Tokens ───────────────────────────────────────────── */
:root {
  --eb-hash-ink: #1c1410;
  --eb-hash-soft: #3d342e;
  --eb-hash-muted: #7a7068;
  --eb-hash-faint: #a39a90;
  --eb-hash-line: rgba(28, 20, 16, 0.09);
  --eb-hash-cream: #f6f1ea;
  --eb-hash-cream-deep: #ebe3d8;
  --eb-hash-surface: #ffffff;
  --eb-hash-plum: #3d2a32;
  --eb-hash-plum-deep: #2a1c22;
  --eb-hash-coral: #e07a5f;
  --eb-hash-coral-hot: #d4654a;
  --eb-hash-radius-pill: 999px;
  --eb-hash-shadow: 0 1px 2px rgba(28, 20, 16, 0.06), 0 4px 16px rgba(28, 20, 16, 0.04);
  --eb-hash-font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ── Chips (global on public shells) ──────────────────── */
a.eb-tag,
.eb-tag-link,
button.eb-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  max-width: 100%;
  padding: 0.28rem 0.72rem 0.28rem 0.55rem;
  border-radius: var(--eb-hash-radius-pill);
  background: var(--eb-hash-cream);
  border: 1px solid var(--eb-hash-line);
  font-family: var(--eb-hash-font) !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.01em;
  color: var(--eb-hash-plum) !important;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

/* Leading # glyph — softer accent */
a.eb-tag::before,
.eb-tag-link::before {
  content: "";
  /* hash drawn via content on .eb-tag-hash if present; fallback keep text # from label */
}

a.eb-tag:hover,
.eb-tag-link:hover {
  background: var(--eb-hash-plum) !important;
  border-color: var(--eb-hash-plum) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(61, 42, 50, 0.22);
  transform: translateY(-1px);
}

a.eb-tag:active,
.eb-tag-link:active {
  transform: translateY(0);
  background: var(--eb-hash-plum-deep) !important;
}

a.eb-tag:focus-visible,
.eb-tag-link:focus-visible {
  outline: 2px solid var(--eb-hash-coral);
  outline-offset: 2px;
}

/* Compact on feed cards */
.eb-feed-tags a.eb-tag {
  font-size: 0.72rem !important;
  padding: 0.22rem 0.6rem 0.22rem 0.5rem;
  background: rgba(246, 241, 234, 0.95);
}

.eb-feed-tags a.eb-tag:hover {
  background: var(--eb-hash-coral) !important;
  border-color: var(--eb-hash-coral) !important;
}

/* Article detail — slightly larger */
.eb-article-tags a.eb-tag {
  font-size: 0.8rem !important;
  padding: 0.35rem 0.8rem 0.35rem 0.65rem;
}

.eb-article-tags,
.eb-hash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.1rem 0 0.5rem;
  align-items: center;
}

.eb-feed-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.15rem 0.9rem 0.7rem;
  margin: 0;
}

/* ── Topic page ─────────────────────────────────────────
 * Shell + feed use the shared site rail (header ~1180).
 * Single-column page — full rail, not nested narrow feed.
 */
:root {
  --eb-content-max: var(--eb-site-rail, 1180px); /* feed column = site rail */
  --eb-shell-max: var(--eb-site-rail, 1180px);   /* hero + body shell */
  --eb-gutter: 1rem;         /* side padding mobile */
  --eb-gutter-md: 1.25rem;   /* ≥768 */
}

body.eb-hash-shell,
body.eb-site-shell.eb-hash-shell {
  background: var(--eb-hash-cream) !important;
}

.eb-hash {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--eb-shell-max);
  margin: 0 auto;
  padding: 0.75rem var(--eb-gutter) 3.5rem;
  font-family: var(--eb-hash-font);
  color: var(--eb-hash-ink);
  /* prevent horizontal scroll from bleed margins */
  overflow-x: clip;
}

@media (min-width: 768px) {
  .eb-hash {
    padding: 1rem var(--eb-gutter-md) 4rem;
  }
}

/* Hero — no negative margin (was clipping/overlapping chrome) */
.eb-hash-hero {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  margin: 0 0 1.25rem;
  padding: 1.5rem 1.15rem 1.35rem;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 90% 80% at 100% 0%, rgba(224, 122, 95, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(61, 42, 50, 0.5) 0%, transparent 50%),
    linear-gradient(145deg, #1f1519 0%, #3d2a32 48%, #5a3d42 100%);
  color: #fff;
  box-shadow: var(--eb-hash-shadow);
}

@media (min-width: 768px) {
  .eb-hash-hero {
    margin: 0 0 1.5rem;
    border-radius: 18px;
    padding: 1.85rem 1.75rem 1.65rem;
  }
}

.eb-hash-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 100%; /* full shell width on desktop */
  min-width: 0;
}

.eb-hash-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--eb-hash-radius-pill);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.eb-hash-badge i {
  font-size: 0.7rem;
  opacity: 0.9;
  color: var(--eb-hash-coral);
}

/* Defeat theme `header h1 { text-indent: -99999px }` and similar hacks */
body.eb-hash-shell .eb-hash h1.eb-hash-title,
.eb-hash .eb-hash-title,
h1.eb-hash-title {
  display: block !important;
  visibility: visible !important;
  position: static !important;
  height: auto !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 0 0.55rem !important;
  padding: 0 !important;
  font-size: clamp(1.4rem, 3.5vw, 2rem) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em;
  color: #fff !important;
  text-indent: 0 !important;
  clip: auto !important;
  overflow: visible !important;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.eb-hash-title .eb-hash-hash {
  color: var(--eb-hash-coral);
  font-weight: 700;
  margin-right: 0.05em;
}

.eb-hash-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.45;
}

.eb-hash-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

.eb-hash-stat strong {
  font-weight: 700;
  color: #fff;
}

.eb-hash-hint {
  margin: 0.65rem 0 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.eb-hash-hint code {
  background: rgba(255, 255, 255, 0.12);
  padding: 0.08rem 0.4rem;
  border-radius: 5px;
  font-size: 0.84em;
  color: #fff;
}

.eb-hash-thin {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: rgba(255, 230, 200, 0.85);
}

.eb-hash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.eb-hash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.45rem 1.05rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease;
}

.eb-hash-btn-primary {
  background: var(--eb-hash-coral);
  color: #fff !important;
}

.eb-hash-btn-primary:hover {
  background: var(--eb-hash-coral-hot);
  color: #fff !important;
}

.eb-hash-btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.eb-hash-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Body / feed — full shell width (site rail), not a nested narrow column */
.eb-hash-body {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  min-width: 0;
}

.eb-hash-section-label {
  margin: 0 0 0.75rem;
  padding: 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eb-hash-muted);
}

.eb-hash-feed {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  width: 100%;
}

/* Feed cards on hashtag (and site-shell contexts using post-summary) */
.eb-hash-feed .fb-feed-card,
.eb-hash-feed .post-item,
body.eb-hash-shell .fb-feed-card,
body.eb-hash-shell .post-item {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  float: none !important;
  border-radius: 12px !important;
  overflow: visible !important; /* reaction tray */
  box-shadow: var(--eb-hash-shadow) !important;
  min-width: 0 !important;
}

.eb-hash-feed .fb-post-header,
.eb-hash-feed .fb-post-body,
.eb-hash-feed .fb-action-bar,
.eb-hash-feed .eb-ig-actions,
.eb-hash-feed .eb-feed-tags {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.eb-hash-feed .fb-post-body,
body.eb-hash-shell .fb-feed-card .fb-post-body {
  padding: 0.65rem 0.95rem 0.5rem !important;
}

.eb-hash-feed .article-title,
.eb-hash-feed .article-title a,
body.eb-hash-shell .fb-feed-card .article-title a {
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal !important;
  text-indent: 0 !important;
}

.eb-hash-feed .summary,
.eb-hash-feed .nang-card-excerpt {
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.eb-hash-feed .fb-post-media,
.eb-hash-feed .fb-post-cover,
.eb-hash-feed img {
  max-width: 100% !important;
  height: auto;
}

.eb-hash-feed .fb-post-media {
  overflow: hidden;
  border-radius: 0;
}

.eb-hash-feed .eb-feed-tags {
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

/* Action bar: wrap on narrow screens, no overflow hide */
.eb-hash-feed .fb-action-bar,
.eb-hash-feed .eb-ig-actions {
  flex-wrap: wrap;
  gap: 0.15rem;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

@media (max-width: 575.98px) {
  .eb-hash {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: 4.5rem; /* room for mobile chrome */
  }
  .eb-hash-hero {
    padding: 1.25rem 1rem 1.15rem;
    border-radius: 14px;
  }
  .eb-hash-actions {
    gap: 0.4rem;
  }
  .eb-hash-btn {
    flex: 1 1 auto;
    min-height: 40px;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }
  .eb-hash-feed .fb-post-header {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  .eb-hash-feed .fb-post-body {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  .eb-hash-feed .eb-feed-tags {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Empty */
.eb-hash-empty {
  text-align: center;
  background: var(--eb-hash-surface);
  border-radius: 16px;
  padding: 2.75rem 1.5rem;
  border: 1px solid var(--eb-hash-line);
  box-shadow: var(--eb-hash-shadow);
}

.eb-hash-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--eb-hash-cream) 0%, var(--eb-hash-cream-deep) 100%);
  color: var(--eb-hash-coral);
  font-size: 1.35rem;
}

.eb-hash-empty h2 {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  margin: 0 0 0.45rem !important;
  color: var(--eb-hash-ink) !important;
}

.eb-hash-empty p {
  margin: 0 auto;
  max-width: 22rem;
  font-size: 0.92rem;
  color: var(--eb-hash-muted);
  line-height: 1.5;
}

.eb-hash-empty .eb-hash-btn {
  margin-top: 1.15rem;
}

/* Suggest dropdown (composer) */
#eb-hash-suggest {
  position: relative;
  z-index: 20;
  margin-top: 0.4rem;
  background: #fff;
  border: 1px solid var(--eb-hash-line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(28, 20, 16, 0.1);
  max-height: 220px;
  overflow-y: auto;
  padding: 0.3rem;
}

.eb-hash-suggest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--eb-hash-plum);
  cursor: pointer;
  font-family: var(--eb-hash-font);
}

.eb-hash-suggest-item:hover,
.eb-hash-suggest-item:focus {
  background: var(--eb-hash-cream);
  outline: none;
}

.eb-hash-suggest-item .text-muted,
.eb-hash-suggest-item span {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--eb-hash-faint);
}

#eb-hash-hint {
  font-size: 0.8rem !important;
  color: var(--eb-hash-muted) !important;
}

#eb-hash-hint strong {
  color: var(--eb-hash-coral);
  font-weight: 700;
}

/* Dark shells: keep chips readable on cream cards */
body.eb-social-home a.eb-tag,
body.eb-entity-shell a.eb-tag,
body.eb-site-shell a.eb-tag {
  /* inherits above */
}

@media (prefers-reduced-motion: reduce) {
  a.eb-tag,
  .eb-tag-link,
  .eb-hash-btn {
    transition: none;
  }
  a.eb-tag:hover {
    transform: none;
  }
}
