/* ============================================
   Coinlio — blog index + article pages
   Emitted pages link this file; see scripts/generate-blog.js
   ============================================ */

/* ── Hero ── */
.blog-hero {
  text-align: center;
  padding: 84px var(--gutter) 40px;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 480px;
  background: radial-gradient(ellipse, rgba(255, 138, 102, 0.13), transparent 70%);
  pointer-events: none;
}

.blog-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--brand-tint);
  border: 1px solid var(--border-brand);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-start);
  margin-bottom: 20px;
}

.blog-hero h1 {
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text-primary);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.blog-hero p {
  font-size: clamp(15px, 1.5vw, 17px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Index ── */
.blog-index {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px var(--gutter) 88px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}

.post-card:hover {
  border-color: var(--border-brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.post-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.post-card-pillar {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-start);
}

.post-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.32;
  margin-bottom: 10px;
}

.post-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 14px;
}

.post-card-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  gap: 12px;
  align-items: center;
}

.post-card-series {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border: 1px solid var(--hairline);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.post-card:hover .post-card-series {
  color: var(--text-secondary);
  border-color: var(--hairline-strong);
}

.post-card-new {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text-on-brand);
  background: var(--brand-gradient);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 10px rgba(255, 138, 102, 0.35);
}

@media (min-width: 680px) {
  .post-card.featured {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .post-card.featured h3 {
    font-size: 23px;
  }
}

.post-card[data-hidden='true'] {
  display: none !important;
}

.no-posts {
  text-align: center;
  padding: 60px var(--gutter);
  color: var(--text-tertiary);
  font-size: 15px;
  grid-column: 1 / -1;
  display: none;
}

/* ── Filter + search ── */
.blog-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 11px 15px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}

.blog-search:focus-within {
  border-color: var(--border-brand);
}

.blog-search svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.blog-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14.5px;
  font-family: inherit;
}

.blog-search input::placeholder {
  color: var(--text-tertiary);
}

.blog-search-clear {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  display: none;
}

.blog-search-clear.visible {
  display: block;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  font-size: 13px;
  font-weight: 550;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  white-space: nowrap;
  font-family: inherit;
}

.filter-pill svg {
  flex: none;
  opacity: 0.65;
}

.filter-pill:hover {
  border-color: var(--border-brand);
  color: var(--text-primary);
}

.filter-pill:hover svg,
.filter-pill.active svg {
  opacity: 1;
}

.filter-pill.active {
  background: var(--brand-tint);
  border-color: var(--border-brand);
  color: var(--brand-start);
}

.pill-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--wash-strong);
  color: inherit;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

/* ── Article ── */
.article-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px var(--gutter) 88px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--brand-start);
  text-decoration: none;
  margin-bottom: 22px;
}

.back-link:hover {
  text-decoration: underline;
}

.article-series-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-end);
  text-decoration: none;
  margin-bottom: 8px;
}

.article-series-badge:hover {
  text-decoration: underline;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--hairline);
}

.article-pillar {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-start);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--brand-tint);
  border: 1px solid var(--border-brand);
}

.article-date,
.article-reading {
  font-size: 13px;
  color: var(--text-tertiary);
}

.article-author {
  font-size: 13px;
  color: var(--text-secondary);
}

.article-page h2 {
  font-size: 25px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 44px 0 16px;
  line-height: 1.26;
}

.article-page h3 {
  font-size: 20px;
  font-weight: 650;
  color: var(--text-primary);
  margin: 32px 0 12px;
  line-height: 1.3;
}

.article-page p {
  font-size: 16.5px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 18px;
}

.article-page ul,
.article-page ol {
  margin: 0 0 18px 24px;
  color: var(--text-secondary);
  font-size: 16.5px;
  line-height: 1.8;
}

.article-page li {
  margin-bottom: 7px;
}

.article-page strong {
  color: var(--text-primary);
  font-weight: 650;
}

.article-page a {
  color: var(--brand-start);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 138, 102, 0.3);
}

.article-page a:hover {
  border-bottom-color: var(--brand-start);
}

.article-page blockquote {
  margin: 26px 0;
  padding: 16px 24px;
  border-left: 2px solid var(--brand-start);
  background: rgba(255, 138, 102, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.article-page img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 26px 0;
}

.article-page code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--brand-start);
}

.article-page pre {
  background: var(--surface-sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto;
  margin: 22px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.article-page pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ── Table of contents ── */
.article-toc {
  margin: 24px 0 32px;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}

.article-toc-title {
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-start);
  margin-bottom: 12px;
}

.article-toc ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.article-toc li {
  padding: 6px 0;
  margin: 0 !important;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}

.article-toc li:last-child {
  border-bottom: none;
}

.article-toc a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: none;
  display: block;
  transition: color 0.15s;
}

.article-toc a:hover {
  color: var(--brand-start);
}

@media (min-width: 1180px) {
  .article-toc.sticky {
    position: fixed;
    top: 100px;
    right: max(24px, calc((100% - 760px) / 2 - 290px));
    width: 244px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    margin: 0;
  }
}

/* ── Share ── */
.article-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 16px;
  padding: 13px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}

.article-share-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-right: auto;
}

.share-btn {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s, border-color 0.18s, transform 0.18s var(--ease-out);
  padding: 0;
}

.share-btn:hover {
  border-color: var(--brand-start);
  color: var(--brand-start);
  transform: translateY(-2px);
}

.share-btn svg {
  width: 16px;
  height: 16px;
}

.share-btn.copied {
  background: var(--brand-tint);
  border-color: var(--brand-start);
  color: var(--brand-start);
}

.share-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-raised);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 550;
  border: 1px solid var(--border-brand);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}

.share-toast.visible {
  opacity: 1;
}

/* ── In-article components ── */
.callout {
  margin: 26px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--brand-start);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: rgba(255, 138, 102, 0.06);
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.callout.note {
  border-left-color: var(--info);
  background: rgba(90, 157, 245, 0.06);
}

.callout.warning {
  border-left-color: var(--brand-end);
  background: rgba(245, 176, 66, 0.07);
}

.callout-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.callout.tip .callout-label {
  color: var(--brand-start);
}

.callout.note .callout-label {
  color: var(--info);
}

.callout.warning .callout-label {
  color: var(--brand-end);
}

.callout-label svg {
  flex-shrink: 0;
}

.steps {
  margin: 28px 0;
}

.step {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}

.step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-on-brand);
  font-family: var(--font-mono);
}

.step-body {
  flex: 1;
}

.step-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-text {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.takeaway {
  margin: 30px 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(255, 138, 102, 0.1), rgba(245, 176, 66, 0.06));
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-md);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.takeaway-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--brand-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.takeaway-text {
  font-size: 15.5px;
  color: var(--text-primary);
  line-height: 1.7;
  font-weight: 500;
}

.pull-quote {
  margin: 34px 0;
  padding: 24px 32px;
  text-align: center;
  position: relative;
}

.pull-quote::before {
  content: '\201C';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 68px;
  line-height: 1;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.3;
}

.pull-quote p {
  font-size: 20px !important;
  font-weight: 600;
  color: var(--text-primary) !important;
  line-height: 1.5;
}

.icon-list {
  margin: 22px 0;
  list-style: none !important;
  padding: 0 !important;
}

.icon-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.icon-list li:last-child {
  border-bottom: none;
}

.icon-list .il-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-tint);
}

.icon-list .il-icon svg {
  width: 14px;
  height: 14px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 26px 0;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 14.5px;
}

.comparison-table th,
.comparison-table td {
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-secondary);
}

.comparison-table th {
  background: rgba(255, 138, 102, 0.08);
  color: var(--text-primary);
  font-weight: 650;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

.divider {
  border: none;
  height: 1px;
  margin: 44px auto;
  max-width: 140px;
  background: linear-gradient(90deg, transparent, var(--brand-start), transparent);
}

/* ── End-of-article CTA ── */
.blog-cta {
  margin-top: 48px;
  padding: 34px;
  text-align: center;
  background: linear-gradient(180deg, var(--surface-brand), var(--bg-secondary) 70%);
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-lg);
}

.blog-cta h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.blog-cta p {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

/* ── Related ── */
.related-posts {
  margin: 48px 0 32px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline);
}

.related-posts-title {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-start);
  margin-bottom: 18px;
}

.related-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.related-card {
  display: block;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s var(--ease-out);
}

.related-card:hover {
  border-color: var(--border-brand);
  transform: translateY(-2px);
}

.related-card-pillar {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--brand-start);
}

.related-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-top: 6px;
}

.related-card-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

@media (max-width: 768px) {
  .post-grid {
    grid-template-columns: 1fr;
  }

  .article-page h2 {
    font-size: 22px;
  }

  .filter-bar {
    gap: 6px;
  }

  .filter-pill {
    font-size: 12px;
    padding: 6px 12px;
  }

  .article-toc {
    padding: 16px 18px;
  }

  .article-share {
    flex-wrap: wrap;
    gap: 8px;
  }
}
