/* =========================================================
   TickTech blog: index, category archives and single posts
   Uses tokens from ticktech-site.css.
   ========================================================= */

.tth-blog {
  background: var(--tt-bg); color: var(--tt-ink);
  font-family: var(--tt-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
.tth-blog *, .tth-blog *::before, .tth-blog *::after { box-sizing: border-box; }
.tth-blog h1, .tth-blog h2, .tth-blog h3 { font-family: var(--tt-head); color: var(--tt-ink); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.tth-blog p { margin: 0; color: var(--tt-muted); }
.tth-blog a { text-decoration: none; }
.tth-blog img { max-width: 100%; height: auto; display: block; }

/* Buttons (same as homepage) */
.tth-blog .tth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--tt-body); font-weight: 700; font-size: 16px; line-height: 1;
  padding: 15px 24px; border-radius: 999px; border: 0; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.tth-blog .tth-btn--primary {
  background: linear-gradient(90deg, #7C3AED 0%, #A445E4 55%, #C24FD8 100%);
  color: #fff !important; box-shadow: 0 10px 24px rgba(124, 58, 237, .32);
}
.tth-blog .tth-btn--primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.tth-blog .tth-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--tt-accent); }
.tth-blog .tth-link:hover .tth-ico, .tth-blog .tth-btn:hover .tth-ico { transform: translateX(3px); }
.tth-blog .tth-ico { transition: transform .2s ease; }

/* Shared meta line */
.tth-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--tt-muted); }
.tth-meta span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; margin-right: 16px; vertical-align: middle; }
.tth-meta--light { color: #C4BFDD; }

/* ---------- Dark hero bands (continue the dark header) ---------- */
.tth-bhero, .tth-phero {
  position: relative; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(640px 420px at 85% 0%, rgba(124, 58, 237, .40), transparent 65%),
    radial-gradient(520px 380px at 0% 100%, rgba(194, 79, 216, .16), transparent 70%),
    linear-gradient(180deg, #181430 0%, #1B1636 100%);
}
.tth-bhero::before, .tth-phero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1.2px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(60% 90% at 80% 20%, #000 0%, transparent 75%);
          mask-image: radial-gradient(60% 90% at 80% 20%, #000 0%, transparent 75%);
}
.tth-bhero { padding: 76px 0 64px; }
.tth-blog .tth-bhero h1, .tth-blog .tth-phero h1 { color: #fff; }
.tth-bhero h1 { font-size: clamp(38px, 5vw, 60px); line-height: 1.04; font-weight: 800; letter-spacing: -0.03em; }
.tth-bhero h1 mark, .tth-phero h1 mark {
  background: linear-gradient(90deg, #B794FF 0%, #E28BE0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  padding-bottom: .06em;
}
.tth-blog .tth-bhero .tth-lead { margin-top: 16px; font-size: 19px; color: #C4BFDD; max-width: 52ch; }
.tth-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.tth-chips a {
  padding: 8px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  color: #D9D4EE; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.tth-chips a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.tth-chips a.is-active { background: #fff; color: var(--tt-ink); border-color: #fff; }

/* ---------- Blog list ---------- */
.tth-blist { padding: 56px 0 88px; }

.tth-feat {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; align-items: stretch;
  background: #fff; border: 1px solid var(--tt-line); border-radius: 24px; overflow: hidden;
  color: var(--tt-ink); box-shadow: var(--tt-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.tth-feat:hover { transform: translateY(-4px); box-shadow: var(--tt-shadow-lg); }
.tth-feat__img { background: #17132B; display: flex; align-items: center; }
.tth-feat__img img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; }
.tth-feat__body { padding: 40px 44px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.tth-feat__tag, .tth-pcard__tag, .tth-phero__tag {
  align-self: flex-start; display: inline-block;
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tt-accent); background: var(--tt-accent-soft); padding: 5px 11px; border-radius: 999px;
}
.tth-feat h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; }
.tth-feat p { font-size: 16.5px; }
.tth-readmore { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--tt-accent); margin-top: 4px; }
.tth-feat:hover .tth-readmore .tth-ico { transform: translateX(3px); }

.tth-blog .tth-blist__head { font-size: 26px; margin: 64px 0 24px; }

.tth-pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tth-pcard {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--tt-line); border-radius: var(--tt-r); overflow: hidden;
  color: var(--tt-ink);
  transition: transform .2s ease, box-shadow .2s ease;
}
.tth-pcard:hover { transform: translateY(-4px); box-shadow: var(--tt-shadow); }
.tth-pcard__img { aspect-ratio: 3 / 2; background: #17132B; overflow: hidden; }
.tth-pcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tth-pcard:hover .tth-pcard__img img { transform: scale(1.03); }
.tth-pcard__body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tth-blog .tth-pcard h3 { font-size: 19px; line-height: 1.25; }
.tth-pcard p { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tth-pcard .tth-meta { margin-top: auto; padding-top: 6px; font-size: 13.5px; }

.tth-pager { margin-top: 48px; display: flex; justify-content: center; }
.tth-pager ul { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tth-pager a, .tth-pager span {
  display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--tt-line); color: var(--tt-ink); font-weight: 600;
}
.tth-pager a:hover { border-color: var(--tt-accent); color: var(--tt-accent); }
.tth-pager .current { background: var(--tt-accent); border-color: var(--tt-accent); color: #fff; }

.tth-empty { text-align: center; padding: 40px 0; }
.tth-empty p { margin: 12px auto 24px; max-width: 44ch; }

/* ---------- Single post ---------- */
.tth-phero { padding: 56px 0 150px; }
.tth-phero__inner { max-width: 880px; text-align: center; }
.tth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: #C4BFDD; margin-bottom: 26px; }
.tth-back:hover { color: #fff; }
.tth-phero__inner { display: flex; flex-direction: column; align-items: center; }
.tth-phero__tag { align-self: center; background: rgba(255, 255, 255, .10); color: #D9C9FF; margin-bottom: 18px; }
.tth-phero h1 { font-size: clamp(32px, 4.4vw, 54px); line-height: 1.08; font-weight: 800; letter-spacing: -0.028em; }
.tth-phero .tth-meta { justify-content: center; margin-top: 20px; }

.tth-pcover {
  position: relative; z-index: 2; margin: -110px auto 0; max-width: 1000px;
  border-radius: 24px; overflow: hidden; background: var(--tt-surface);
  box-shadow: 0 30px 60px rgba(23, 19, 43, .18);
}
.tth-pcover img { width: 100%; height: auto; }

.tth-pbody {
  display: grid; grid-template-columns: minmax(0, 720px) 280px; justify-content: center; gap: 64px;
  padding-top: 56px; padding-bottom: 72px;
}
.tth-pbody--solo { grid-template-columns: minmax(0, 720px); }

/* Article typography */
.tth-article { min-width: 0; font-size: 18px; line-height: 1.75; color: #3B3654; }
.tth-article p, .tth-article ul, .tth-article ol, .tth-article blockquote, .tth-article figure, .tth-article table { margin: 0 0 1.3em; }
.tth-blog .tth-article p { color: #3B3654; }
.tth-article > *:first-child { margin-top: 0; }
.tth-blog .tth-article h2 { font-size: 30px; line-height: 1.18; margin: 1.8em 0 .6em; scroll-margin-top: 110px; }
.tth-blog .tth-article h3 { font-size: 22px; line-height: 1.25; margin: 1.6em 0 .5em; scroll-margin-top: 110px; }
.tth-blog .tth-article h4 { font-family: var(--tt-head); font-size: 19px; margin: 1.4em 0 .4em; color: var(--tt-ink); }
.tth-article strong, .tth-article b { color: var(--tt-ink); font-weight: 700; }
.tth-article a { color: var(--tt-accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.tth-article ul, .tth-article ol { padding-left: 1.3em; }
.tth-article li { margin-bottom: .45em; }
.tth-article li::marker { color: var(--tt-accent); }
.tth-article blockquote {
  border-left: 4px solid var(--tt-accent); background: var(--tt-surface);
  padding: 18px 22px; border-radius: 0 16px 16px 0; font-size: 19px; color: var(--tt-ink);
}
.tth-article blockquote p:last-child { margin-bottom: 0; }
.tth-article img { border-radius: 16px; }
.tth-article figcaption { font-size: 14px; color: var(--tt-muted); margin-top: 8px; text-align: center; }
.tth-article table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.tth-article th, .tth-article td { border: 1px solid var(--tt-line); padding: 10px 14px; text-align: left; }
.tth-article th { background: var(--tt-surface); color: var(--tt-ink); }
.tth-article hr { border: 0; border-top: 1px solid var(--tt-line); margin: 2em 0; }

.tth-article__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--tt-line);
  font-size: 15px;
}
.tth-article__foot span { font-weight: 700; color: var(--tt-ink); margin-right: 6px; }
.tth-article .tth-article__foot a {
  text-decoration: none; color: var(--tt-ink); font-weight: 600;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--tt-line);
}
.tth-article .tth-article__foot a:hover { border-color: var(--tt-accent); color: var(--tt-accent); }

/* Sidebar */
.tth-paside { min-width: 0; }
.tth-paside__sticky { position: sticky; top: 108px; display: flex; flex-direction: column; gap: 20px; }
.tth-toc { border-left: 2px solid var(--tt-line); padding-left: 18px; }
.tth-toc summary {
  list-style: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tt-muted);
  margin-bottom: 12px;
}
.tth-toc summary::-webkit-details-marker { display: none; }
.tth-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tth-toc a { font-size: 14.5px; line-height: 1.4; color: var(--tt-muted); display: block; transition: color .2s ease; }
.tth-toc a:hover, .tth-toc a.is-current { color: var(--tt-accent); }
.tth-democard { background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: var(--tt-r); padding: 22px; }
.tth-blog .tth-democard h3 { font-size: 18px; }
.tth-democard p { font-size: 14.5px; margin: 8px 0 16px; }
.tth-democard .tth-btn { width: 100%; padding: 13px 18px; font-size: 15px; }

/* Related + CTA */
.tth-related { padding: 72px 0; background: var(--tt-surface); border-top: 1px solid var(--tt-line); }
.tth-related__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.tth-blog .tth-related__head h2 { font-size: 30px; }

.tth-bcta { padding: 72px 0 88px; }
.tth-bcta__card {
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding: 44px 52px; border-radius: 28px;
  background:
    radial-gradient(420px 260px at 92% 0%, rgba(124, 58, 237, .45), transparent 70%),
    linear-gradient(135deg, #1B1636 0%, #241C4A 100%);
}
.tth-blog .tth-bcta h2 { color: #fff; font-size: clamp(26px, 3vw, 38px); }
.tth-blog .tth-bcta p { color: #C4BFDD; margin-top: 10px; max-width: 52ch; }
.tth-related + .tth-bcta { padding-top: 72px; }

/* Reveal (stays visible if JS never runs) */
.js-tth .tth-blog .tth-reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.js-tth .tth-blog .tth-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-tth .tth-blog .tth-reveal { opacity: 1; transform: none; transition: none; }
  .tth-feat, .tth-pcard, .tth-pcard__img img { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tth-pbody { grid-template-columns: minmax(0, 720px); gap: 0; }
  .tth-paside { order: -1; margin-bottom: 32px; }
  .tth-paside__sticky { position: static; }
  .tth-toc { border-left: 0; padding: 16px 20px; background: var(--tt-surface); border-radius: 16px; }
  .tth-toc summary { margin-bottom: 0; }
  .tth-toc[open] summary { margin-bottom: 12px; }
  .tth-democard { display: none; }
}
@media (max-width: 960px) {
  .tth-feat { grid-template-columns: 1fr; }
  .tth-feat__body { padding: 28px; }
  .tth-pgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .tth-blog { font-size: 16px; }
  .tth-bhero { padding: 52px 0 44px; }
  .tth-pgrid { grid-template-columns: 1fr; }
  .tth-phero { padding: 40px 0 96px; }
  .tth-pcover { margin-top: -64px; border-radius: 16px; }
  .tth-pbody { padding-top: 36px; }
  .tth-article { font-size: 17px; }
  .tth-blog .tth-article h2 { font-size: 25px; }
  .tth-bcta__card { padding: 32px 24px; }
  .tth-bcta__card .tth-btn { width: 100%; }
}
