/* ========== 技術文章 / Technical Articles (erv.hk) ========== */
/* Dense 3-column grid with numbered articles and square thumbnails */

.ta-hero {
  padding: 100px 0 70px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.ta-hero::after {
  content: '';
  position: absolute;
  top: 100px;
  right: -120px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, var(--primary-tint), transparent 65%);
  pointer-events: none;
  opacity: 0.55;
}
.ta-hero .container { position: relative; max-width: 1240px; }
.ta-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 60px;
  align-items: end;
}
html[lang^="zh"] .ta-hero h1 { letter-spacing: 0.01em; }
.ta-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 18px;
  padding: 7px 14px;
  border: 1px solid var(--primary-tint);
  border-radius: 100px;
  background: var(--bg-alt);
}
.ta-hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.ta-hero .ta-sub {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 660px;
}
.ta-meta-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
}
.ta-meta-card dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.ta-meta-card dd {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}
.ta-meta-card dd:last-child { margin-bottom: 0; }

/* Filter chips */
.ta-filters {
  padding: 36px 0 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}
.ta-filters .container { max-width: 1240px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ta-filters .label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 12px;
}
.ta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 100px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ta-chip:hover { background: var(--bg-alt); }
.ta-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.ta-chip .num { font-size: 0.74rem; opacity: 0.7; }

/* Dense grid of numbered articles */
.ta-grid-wrap {
  padding: 56px 0 100px;
  background: var(--bg);
}
.ta-grid-wrap .container { max-width: 1240px; }
.ta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 28px;
}

.ta-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.ta-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 24px 60px -20px rgba(0,35,255,0.12);
}
.ta-card-img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
}
.ta-card-img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.6s var(--ease);
}
.ta-card:hover .ta-card-img img { transform: scale(1.06); }
.ta-num {
  position: absolute;
  top: 14px; left: 14px;
  width: 38px; height: 38px;
  background: rgba(10,14,31,0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}
.ta-card-body {
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.ta-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}
.ta-card-tag .min { color: var(--muted); font-weight: 500; letter-spacing: 0.08em; }
.ta-card h3 {
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ink);
}
html[lang^="zh"] .ta-card h3 { font-size: 1.05rem; line-height: 1.55; letter-spacing: 0.005em; }
.ta-card p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
}
html[lang^="zh"] .ta-card p { font-size: 0.86rem; line-height: 1.78; }
.ta-card-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
}

/* ========== ARTICLE PAGE ========== */
.article-hero {
  padding: 110px 0 50px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.article-hero .container { max-width: 820px; }
.article-breadcrumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 18px; }
.article-breadcrumb a { color: var(--muted); border-bottom: 1px solid transparent; }
.article-breadcrumb a:hover { border-bottom-color: var(--primary); color: var(--primary); }
.article-meta { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--primary); margin-bottom: 18px; }
.article-meta .dot { display: inline-block; margin: 0 8px; color: var(--muted); }
.article-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin-bottom: 18px; line-height: 1.2; }
html[lang^="zh"] .article-hero h1 { letter-spacing: 0.005em; }
.article-hero .lead { font-size: 1.15rem; max-width: 720px; }

.article-cover {
  max-width: 1120px;
  margin: 40px auto -20px;
  padding: 0 32px;
}
.article-cover img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 24px;
}

.prose {
  max-width: 740px;
  margin: 0 auto;
  padding: 80px 32px 100px;
  font-size: 1.06rem;
  line-height: 1.78;
  color: var(--ink-soft);
}
html[lang^="zh"] .prose { line-height: 1.95; font-size: 1.05rem; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.55rem; margin-top: 2.2em; margin-bottom: 0.5em; color: var(--ink); }
.prose h3 { font-size: 1.2rem; margin-top: 1.8em; margin-bottom: 0.3em; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.4em 0; }
.prose li::marker { color: var(--muted); }
.prose a { color: var(--primary); border-bottom: 1px solid var(--primary-tint); }
.prose a:hover { border-bottom-color: var(--primary); }
.prose figure { margin: 2.4em -8px; }
.prose figure img {
  width: 100%; height: auto;
  border-radius: 14px;
  background: var(--bg-alt);
}
.prose figcaption {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}
.prose .callout {
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 1.8em 0;
  font-size: 0.98rem;
}
.prose .callout h4 { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--primary); margin-bottom: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 0.95rem; }
.prose th, .prose td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 700; color: var(--ink); background: var(--bg-alt); }

/* Bilingual switching for whole prose blocks */
.prose[lang-en] { display: none; }
html[data-lang="en"] .prose[lang-zh] { display: none; }
html[data-lang="en"] .prose[lang-en] { display: block; }
.article-hero [lang-en], .ta-card-body [lang-en] { display: none; }
html[data-lang="en"] .article-hero [lang-zh], html[data-lang="en"] .ta-card-body [lang-zh] { display: none; }
html[data-lang="en"] .article-hero [lang-en], html[data-lang="en"] .ta-card-body [lang-en] { display: block; }

.article-cta {
  background: var(--bg-deep);
  color: #fff;
  padding: 80px 0;
}
.article-cta .container { max-width: var(--max-narrow); text-align: center; }
.article-cta .eyebrow { color: var(--accent); }
.article-cta h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 14px; color: #fff; }
.article-cta p { color: rgba(255,255,255,0.78); margin-bottom: 26px; }
.article-cta [lang-en] { display: none; }
html[data-lang="en"] .article-cta [lang-zh] { display: none; }
html[data-lang="en"] .article-cta [lang-en] { display: block; }
.article-cta .btn-pill {
  background: #fff;
  color: var(--bg-deep);
  padding: 14px 30px;
  border-radius: 100px;
  display: inline-block;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.2s, background 0.2s;
}
.article-cta .btn-pill:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }

.related {
  padding: 80px 0;
  border-top: 1px solid var(--line);
}
.related h3 { margin-bottom: 32px; font-size: 1.3rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.related-card {
  display: flex; flex-direction: column;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.related-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.related-card p.tag { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.related-card h4 { font-size: 1.05rem; line-height: 1.35; }

@media (max-width: 1000px) {
  .ta-grid { grid-template-columns: repeat(2, 1fr); }
  .ta-hero-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .ta-grid { grid-template-columns: 1fr; gap: 28px; }
  .article-cover { padding: 0 16px; }
  .prose { padding: 50px 22px 70px; font-size: 1rem; }
}
