/* HeyAban Insights. Loaded after site.css and reuses its tokens; values stay on the landing page design scale. */

.insights .nav-actions .button.small {
  box-shadow: none;
}
/* Content stays visible if the script never runs; reveals only apply once insights.js is active. */
.insights:not(.js-ready) .reveal {
  opacity: 1;
  transform: none;
}
.insights-hero .hero-title,
.insights-hero .hero-sub {
  margin-inline: 0;
}

/* ---------- hero ---------- */

.insights-hero {
  padding: 128px 0 48px;
}
.insights-hero .hero-title {
  font-size: 3rem;
  line-height: 1;
}
.insights-hero .hero-sub {
  margin-top: 16px;
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--lav-200);
}
.crumbs a {
  color: var(--text);
  text-decoration: none;
  transition: color 300ms var(--ease);
}
.crumbs a:hover {
  color: var(--purple-600);
  text-decoration: underline;
}
.crumbs [aria-current] {
  display: inline-block;
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.search {
  position: relative;
  max-width: 480px;
  margin-top: 32px;
}
.search .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--purple);
  pointer-events: none;
}
.search input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px 12px 48px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5rem;
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.search input::placeholder {
  color: var(--muted);
}
.search input:hover {
  border-color: var(--lav-200);
}
.search input:focus-visible {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--lav-200);
}

/* ---------- filters and cards ---------- */

.insights-list {
  padding-top: 0;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--paper);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 300ms var(--ease),
    color 300ms var(--ease),
    transform 500ms var(--ease);
}
.filter-chip:hover {
  background: var(--lav-50);
  color: var(--purple-600);
  transform: translateY(-2px);
}
.filter-chip:active {
  transform: scale(0.98);
}
.filter-chip[aria-current] {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}
.filter-chip .count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  padding: 0 8px;
  border-radius: 9999px;
  background: var(--lav-100);
  color: var(--purple-600);
  font-size: 0.75rem;
  line-height: 1rem;
}
.filter-chip[aria-current] .count {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}
.search-status:empty {
  display: none;
}
.search-status {
  margin-bottom: 16px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.post-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--paper);
  overflow: hidden;
  transition:
    transform 500ms var(--ease),
    box-shadow 500ms var(--ease),
    opacity 700ms var(--ease);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.post-card:focus-within {
  box-shadow: 0 0 0 3px var(--lav-200);
}
.post-cover {
  display: block;
  background: var(--lav-50);
}
.post-cover img {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}
.post-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px;
}
.cat-chip {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--lav-100);
  color: var(--purple-600);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 300ms var(--ease);
}
.cat-chip:hover {
  background: var(--lav-200);
}
.post-title {
  font-size: 1.25rem;
  line-height: 1.75rem;
}
.post-title a {
  color: inherit;
  text-decoration: none;
}
/* The whole card is clickable through the title link. */
.post-card {
  position: relative;
}
.post-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.post-title a:focus-visible {
  outline: none;
}
.cat-chip {
  position: relative;
  z-index: 1;
}
.post-dek {
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1rem;
}
.post-card.featured {
  grid-template-columns: 1.15fr 1fr;
  grid-template-rows: none;
  margin-bottom: 24px;
}
.post-card.featured .post-cover img {
  height: 100%;
}
.post-card.featured .post-body {
  justify-content: center;
  gap: 16px;
  padding: 40px;
}
.post-card.featured .post-title {
  font-size: 1.875rem;
  line-height: 2.25rem;
}
.post-card.featured .post-dek {
  font-size: 1rem;
  line-height: 1.5rem;
}
.post-card.featured .post-meta {
  margin-top: 0;
}
.draft-pill {
  background: var(--peach);
  color: var(--peach-ink);
}

.insights-empty,
.search-empty {
  padding: 48px 24px;
}
.insights-empty img,
.search-empty img {
  width: 132px;
}
.insights-empty h2,
.search-empty h2 {
  font-size: 1.5rem;
  line-height: 2rem;
}
.insights-empty p,
.search-empty p {
  max-width: 480px;
}
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

/* ---------- call to action ---------- */

.insight-cta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  margin: 64px 0 0;
  padding: 32px;
  border-radius: 24px;
  background: var(--lav-100);
}
.insights-list + .container .insight-cta {
  margin: 0 0 96px;
}
.insight-cta img {
  width: 96px;
}
.insight-cta h2 {
  font-size: 1.5rem;
  line-height: 2rem;
}
.insight-cta p {
  margin-top: 8px;
}
.prose .insight-cta h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2rem;
}
.prose .insight-cta p {
  margin: 8px 0 0;
  font-size: 1rem;
  line-height: 1.5rem;
}

/* ---------- article ---------- */

.post-head {
  padding-top: 128px;
  max-width: 880px;
}
.post-h1 {
  margin-top: 16px;
  max-width: 680px;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #45325f, #9077c9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 8px;
}
.post-lede {
  margin-top: 16px;
  max-width: 680px;
  font-size: 1.25rem;
  line-height: 1.75rem;
}
.post-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.post-info li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.post-info .icon {
  color: var(--purple);
}
.post-hero {
  margin-top: 40px;
  margin-bottom: 0;
}
.post-hero img {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--lav-50);
}
.post-hero figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: center;
}

.post-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px);
  justify-content: center;
  gap: 64px;
  padding: 64px 0 96px;
}
.post-aside {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 32px;
}
.toc summary {
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.toc summary::-webkit-details-marker {
  display: none;
}
.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.toc summary::after {
  content: "";
  width: 20px;
  height: 20px;
  flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%237055a8'%3E%3Cpath d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E")
    center / 16px no-repeat;
  transition: transform 500ms var(--ease);
}
.toc[open] summary::after {
  transform: rotate(180deg);
}
.toc ol {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.toc a {
  display: block;
  padding: 4px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-decoration: none;
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
.toc a:hover,
.toc a[aria-current] {
  background: var(--lav-100);
  color: var(--purple-600);
}
.share-label {
  color: var(--ink);
  font-weight: 600;
}
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.share-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9999px;
  background: var(--lav-100);
  color: var(--purple-600);
  cursor: pointer;
  transition:
    background-color 300ms var(--ease),
    transform 500ms var(--ease);
}
.share-btn:hover {
  background: var(--lav-200);
  transform: translateY(-2px);
}
.share-btn:active {
  transform: scale(0.98);
}
.copy-status {
  margin-top: 8px;
  color: var(--sage-ink);
}
.copy-status:empty {
  display: none;
}

.prose {
  min-width: 0;
  color: var(--text);
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.prose > * + * {
  margin-top: 24px;
}
.prose h2 {
  margin-top: 64px;
  font-size: 1.875rem;
  line-height: 2.25rem;
  letter-spacing: -0.01em;
  scroll-margin-top: 96px;
}
.prose > h2:first-child {
  margin-top: 0;
}
.prose h3 {
  margin-top: 40px;
  font-size: 1.25rem;
  line-height: 1.75rem;
  scroll-margin-top: 96px;
}
.prose h2 + p,
.prose h3 + p {
  margin-top: 16px;
}
.prose a {
  color: var(--purple-600);
  text-decoration: underline;
  text-decoration-color: var(--lav-200);
  text-underline-offset: 4px;
  transition: text-decoration-color 300ms var(--ease);
}
.prose a:hover {
  text-decoration-color: currentColor;
}
/* Buttons inside an article (the Telegram CTA) keep button styling, not link styling. */
.prose .insight-cta a.button,
.prose .insight-cta a.button:hover {
  color: #fff;
  text-decoration: none;
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}
.prose ul,
.prose ol {
  display: grid;
  gap: 12px;
  padding-left: 24px;
}
.prose li::marker {
  color: var(--purple);
}
.prose code {
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--lav-100);
  color: var(--ink);
  font-size: 0.875em;
}
.callout {
  padding: 24px;
  border-radius: 16px;
  background: var(--lav-50);
  border: 1px solid var(--border);
  color: var(--ink);
}
.inline-figure {
  margin-left: 0;
  margin-right: 0;
}
.inline-figure img {
  border-radius: 16px;
  border: 1px solid var(--border);
}
.inline-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.faq-block {
  display: grid;
  gap: 12px;
}
.faq-block h2 {
  margin-bottom: 12px;
}
.prose .faq-block h2 + .qa {
  margin-top: 0;
}
.qa {
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--paper);
}
.qa h3 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.qa p {
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.5rem;
}

.sources {
  margin-top: 64px;
  padding: 24px;
  border-radius: 16px;
  background: var(--lav-50);
}
.prose .sources h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.75rem;
}
.sources ol {
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  overflow-wrap: anywhere;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}
.prose .back-link {
  text-decoration: none;
}
.back-link .icon {
  transition: transform 500ms var(--ease);
}
.back-link:hover .icon {
  transform: translateX(-4px);
}

.related {
  padding: 80px 0 96px;
  background: var(--lav-50);
}
.related h2 {
  margin-bottom: 32px;
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.draft-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(720px, 100% - 32px);
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--peach);
  color: #8a4430;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transform: translateX(-50%);
  box-shadow: var(--shadow);
}

/* ---------- responsive ---------- */

@media (max-width: 1023px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .post-card.featured {
    grid-template-columns: 1fr;
  }
  .post-card.featured .post-body {
    padding: 32px;
  }
  .post-layout {
    grid-template-columns: minmax(0, 720px);
    gap: 40px;
    padding-top: 40px;
  }
  .post-aside {
    position: static;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 24px;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--paper);
  }
}

@media (max-width: 640px) {
  .insights-hero,
  .post-head {
    padding-top: 112px;
  }
  .insights-hero .hero-title,
  .post-h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  .post-lede {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }
  .post-grid {
    grid-template-columns: 1fr;
  }
  .post-card.featured .post-body {
    padding: 24px;
  }
  .post-card.featured .post-title {
    font-size: 1.5rem;
    line-height: 2rem;
  }
  .post-hero {
    margin-top: 24px;
  }
  .post-hero img {
    border-radius: 16px;
  }
  .post-aside {
    grid-template-columns: 1fr;
  }
  .prose {
    font-size: 1rem;
    line-height: 1.75rem;
  }
  .prose h2 {
    margin-top: 48px;
    font-size: 1.5rem;
    line-height: 2rem;
  }
  .insight-cta {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 24px;
  }
  .insight-cta img {
    width: 80px;
  }
  .related {
    padding: 64px 0;
  }
  .crumbs [aria-current] {
    max-width: 24ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card:hover,
  .filter-chip:hover,
  .share-btn:hover,
  .back-link:hover .icon {
    transform: none;
  }
}
/* ---------- languages ---------- */
.mobile-menu .mobile-langs a {
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text);
}
.mobile-menu .mobile-langs a[aria-current="true"] {
  color: #fff;
}
.lang-list a {
  text-decoration: none;
}
.translated-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 680px;
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--lav-50);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.translated-note .icon {
  flex: none;
  margin-top: 2px;
  color: var(--purple);
}
.translated-note a {
  color: var(--purple-600);
  font-weight: 600;
}
.lang-zh .prose > p,
.lang-zh .prose > ul li,
.lang-zh .prose > ol li {
  line-height: 2rem;
}
