/* ============================================================
   AE Flow Tools — blog styles (index + articles)
   Builds on /styles.css tokens. Keep articles readable: ~720px column.
   ============================================================ */

.bd-only { display: none; }

:root { --surface: #18181b; --border-2: #2a2a30; --good: #4ade80; }
.kicker { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 12px; }

/* ---------- Blog index ---------- */
.blog-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 980px; margin: 0 auto; }
.post-card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-card:hover { border-color: #3f3f46; transform: translateY(-2px); }
.post-card .thumb { aspect-ratio: 1200 / 630; background: #0f0f12; border-bottom: 1px solid var(--border); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.post-card:hover .thumb img { transform: scale(1.02); }
.post-card .body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex-grow: 1; }
.post-card .tag { align-self: flex-start; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 10px; }
.post-card h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 8px; }
.post-card p { color: var(--muted); font-size: 14.5px; flex-grow: 1; margin-bottom: 16px; }
.post-card .meta { font-size: 13px; color: var(--faint); }

/* ---------- Article ---------- */
.article { position: relative; z-index: 1; padding: 56px 0 24px; }
.article .wrap { max-width: 740px; margin: 0 auto; padding: 0 24px; }
.crumbs { font-size: 13.5px; color: var(--faint); margin-bottom: 22px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.article h1 { font-size: clamp(30px, 4.6vw, 46px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 18px; }
.article .dek { font-size: clamp(16.5px, 2vw, 19px); color: var(--muted); line-height: 1.55; margin-bottom: 24px; }
.byline { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: 34px; }
.byline .av { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #1e3a8a); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 14px; flex-shrink: 0; }
.byline strong { color: var(--text); font-weight: 600; }

.prose { font-size: 17px; line-height: 1.75; color: #d4d4d8; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; color: var(--text); margin-top: 2.2em; scroll-margin-top: 84px; }
.prose h3 { font-size: 20px; font-weight: 650; letter-spacing: -0.015em; color: var(--text); margin-top: 1.8em; scroll-margin-top: 84px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a:not(.btn) { color: var(--accent-2); text-decoration: underline; text-decoration-color: rgba(96,165,250,0.35); text-underline-offset: 3px; }
.prose a:not(.btn):hover { text-decoration-color: var(--accent-2); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--faint); }
.prose code, .prose kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; background: var(--surface); border: 1px solid var(--border-2); border-radius: 6px; padding: 1px 6px; color: var(--text); }

/* quick-answer / note boxes */
.callout { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; padding: 18px 20px; font-size: 16px; line-height: 1.65; }
.callout .lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 6px; }
.callout.warn { border-left-color: #fbbf24; }
.callout.warn .lbl { color: #fbbf24; }

/* table of contents */
.toc { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; }
.toc .lbl { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; display: block; }
.toc ol { padding-left: 1.2em; font-size: 15.5px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }

/* method comparison table */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { font-size: 12.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; background: var(--bg-soft); }
.tbl td:first-child { color: var(--text); font-weight: 600; }
.tbl .y { color: var(--good); }
.tbl .n { color: #f87171; }
.tbl .m { color: #fbbf24; }
.tbl tr.hl td { background: rgba(59,130,246,0.06); }

/* numbered steps */
.steps { list-style: none; padding: 0 !important; counter-reset: s; display: grid; gap: 12px; }
.steps > li { counter-increment: s; position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px 18px 64px; margin: 0 !important; }
.steps > li::before { content: counter(s); position: absolute; left: 18px; top: 17px; width: 30px; height: 30px; border-radius: 9px; background: rgba(59,130,246,0.14); color: #93c5fd; font-weight: 700; font-size: 14.5px; display: flex; align-items: center; justify-content: center; }
.steps > li strong:first-child { display: block; margin-bottom: 2px; }

/* media */
.figure { margin-left: 0; margin-right: 0; }
.figure .frame { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #000; }
.figure iframe { display: block; width: 100%; aspect-ratio: 16 / 10; border: 0; }
.figure figcaption { font-size: 13.5px; color: var(--faint); margin-top: 10px; text-align: center; }
.article .wide { max-width: 1040px; margin-left: auto; margin-right: auto; padding: 0 24px; }

/* in-article CTA */
.post-cta { background: linear-gradient(180deg, rgba(59,130,246,0.10), rgba(59,130,246,0.03)); border: 1px solid rgba(59,130,246,0.35); border-radius: 16px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.post-cta h4 { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; margin-bottom: 2px; }
.post-cta p { font-size: 14.5px; color: var(--muted); margin: 0; }
.post-cta .btn { text-decoration: none; flex-shrink: 0; }

/* FAQ inside an article */
.prose .faq-q { border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.prose .faq-q summary { cursor: pointer; list-style: none; padding: 15px 18px; font-weight: 600; color: var(--text); font-size: 16px; }
.prose .faq-q summary::-webkit-details-marker { display: none; }
.prose .faq-q div { padding: 0 18px 16px; font-size: 15.5px; color: var(--muted); }
.prose .faq-q + .faq-q { margin-top: 10px; }

@media (max-width: 760px) {
  .blog-list { grid-template-columns: 1fr; }
  .prose { font-size: 16.5px; }
  .steps > li { padding-left: 58px; }
  .post-cta { flex-direction: column; align-items: flex-start; }
}

/* ---------- UI Flow vs AEUX visual comparison (filled by /uiflow/compare.js) ---------- */
.vs { max-width: 1040px; margin: 0 auto; }
.vs-cases { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.vs-case {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--card);
  color: var(--muted); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.vs-case:hover { color: var(--text); border-color: #33333a; }
.vs-case.active { background: #fafafa; color: #09090b; border-color: #fafafa; }
.vs-stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.vs-panel { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.vs-panel.good { border-color: rgba(74,222,128,0.45); box-shadow: 0 0 0 1px rgba(74,222,128,0.12), 0 24px 60px -30px rgba(74,222,128,0.35); }
.vs-panel.bad { border-color: rgba(248,113,113,0.3); }
.vs-head { display: flex; align-items: center; gap: 9px; padding: 11px 14px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
.vs-ic { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; }
.vs-ic svg { width: 11px; height: 16px; }
.vs-ic.src { background: var(--surface); border: 1px solid #27272a; }
.vs-ic.good { background: rgba(74,222,128,0.14); color: var(--good); }
.vs-ic.bad { background: rgba(248,113,113,0.14); color: #f87171; }
/* images are square with a caption bar baked into the bottom ~6% — crop it off */
.vs-img { display: block; width: 100%; aspect-ratio: 1 / 0.94; overflow: hidden; background: #fff; border: 0; padding: 0; cursor: zoom-in; }
.vs-img img { display: block; width: 100%; height: auto; }
.vs-img:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.vs-note { padding: 11px 14px; font-size: 13px; font-weight: 500; border-top: 1px solid var(--border); color: var(--faint); min-height: 42px; }
.vs-panel.good .vs-note { color: var(--good); }
.vs-panel.bad .vs-note { color: #f87171; }
.vs-foot { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.vs-nav {
  width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid #27272a; color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.vs-nav:hover { background: #1f1f23; border-color: #3f3f46; }
.vs-count { min-width: 56px; text-align: center; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vs-hint { text-align: center; font-size: 12.5px; color: var(--faint); margin-top: 10px; }
.vs-hint-mob { display: none; }
@media (max-width: 720px) {
  .vs-cases { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 0 2px 4px; scrollbar-width: none; }
  .vs-cases::-webkit-scrollbar { display: none; }
  .vs-stage { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
  .vs-stage::-webkit-scrollbar { display: none; }
  .vs-panel { scroll-snap-align: center; }
  .vs-hint-desk { display: none; } .vs-hint-mob { display: inline; }
}

/* ---------- Image lightbox (driven by /uiflow/compare.js) ---------- */
.lb-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.lb-overlay.open { opacity: 1; pointer-events: auto; }
.lb-img {
  max-width: 90vw; max-height: 82vh; border-radius: 14px; background: #fff;
  user-select: none; -webkit-user-drag: none; touch-action: pan-y;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.lb-close {
  position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 10px;
  background: #18181b; border: 1px solid #2a2a30; color: #fafafa; font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 10px;
  background: #18181b; border: 1px solid #2a2a30; color: #fafafa; font-size: 24px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-close:hover, .lb-nav:hover { background: #222226; border-color: #3f3f46; }
.lb-cap { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: #cbd5e1; font-size: 13.5px; }
@media (max-width: 680px) {
  .lb-nav { width: 42px; height: 42px; font-size: 22px; }
  .lb-prev { left: 6px; } .lb-next { right: 6px; }
  .lb-close { top: 10px; right: 10px; }
  .lb-img { max-width: 94vw; max-height: 78vh; }
}

