/* ================================================================
   AI Trend Hub v4.0 — public.css
   Satu file, tidak ada duplikasi class.
   Widget/shortcode styles dipisah di bagian akhir.
================================================================ */

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ff-head: 'Instrument Serif', Georgia, serif;
  --ff-body: 'DM Sans', system-ui, sans-serif;
  --amber:   #f59e0b;
  --sky:     #0ea5e9;
  --text:    #1e293b;
  --muted:   #64748b;
  --soft:    #475569;
  --border:  #e2e8f0;
  --surface: #fff;
  --bg:      #f8fafc;
  --pos:     #10b981;
  --neg:     #f43f5e;
  --neu:     #64748b;
  /* legacy aliases kept for JS compat */
  --accent:  #f59e0b;
  --accent2: #0ea5e9;
}

body.aith-body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ── NAV ─────────────────────────────────────────────────── */
.aith-nav {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid #f1f5f9;
  padding: 12px 24px;
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.aith-brand { font-weight: 700; font-size: 15px; color: #0f172a; letter-spacing: -.2px; }
.aith-bc { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #94a3b8; }
.aith-bc a { color: #64748b; }
.aith-bc a:hover { color: #0f172a; }
.aith-bc span { color: #cbd5e1; }

/* ── HERO ────────────────────────────────────────────────── */
.aith-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f2744 100%);
  padding: 44px 0 36px;
  position: relative;
  overflow: hidden;
}
.aith-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 50%, rgba(245,158,11,.13), transparent);
  pointer-events: none;
}
.aith-hero-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  position: relative; z-index: 1;
}

/* chips row */
.aith-hero-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px; align-items: center;
}
.aith-type-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: color-mix(in srgb, var(--tc, #f59e0b) 15%, transparent);
  color: var(--tc, #f59e0b);
  border: 1px solid color-mix(in srgb, var(--tc, #f59e0b) 35%, transparent);
  padding: 4px 11px 4px 9px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: .2px;
}
.aith-chip-hero {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.13);
  color: rgba(255,255,255,.72);
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
}

/* hero title */
.aith-hero-title {
  font-family: var(--ff-head);
  font-size: clamp(26px, 4.5vw, 50px);
  font-weight: 400; font-style: italic;
  letter-spacing: -.3px; line-height: 1.15;
  color: #fff; margin-bottom: 18px;
}

/* hero footer */
.aith-hero-foot {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.aith-hero-date {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: rgba(255,255,255,.85);
}
.aith-score-wrap { display: flex; align-items: center; gap: 10px; }
.aith-score-track {
  width: 110px; height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 2px; overflow: hidden;
}
.aith-score-fill { height: 100%; border-radius: 2px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.aith-score-label { font-size: 12px; font-weight: 600; }

/* sentiment badge — solid agar terbaca di hero gelap */
.aith-sentiment-badge { padding: 5px 13px; border-radius: 20px; font-size: 12px; font-weight: 700; letter-spacing: .2px; }
.aith-s-positif { background: #16a34a; color: #fff; border: none; }
.aith-s-negatif { background: #dc2626; color: #fff; border: none; }
.aith-s-netral  { background: #94a3b8; color: #fff; border: none; }

/* ── MAIN LAYOUT ─────────────────────────────────────────── */
.aith-wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.aith-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  padding: 28px 0 52px;
  align-items: start;
}
@media(max-width: 820px) { .aith-layout { grid-template-columns: 1fr; } }

/* ── SECTION CARD ────────────────────────────────────────── */
.aith-sec {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.02);
}
.aith-v4-sec { border-color: #e8f0fe; }

.aith-sec-hd {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 800;
  letter-spacing: .4px; text-transform: uppercase;
  color: #1e293b;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid #f1f5f9;
}
.aith-sec-hd svg { color: #f59e0b; flex-shrink: 0; width: 17px; height: 17px; }

/* ── SKELETON ────────────────────────────────────────────── */
.aith-skel-wrap { padding: 2px 0; }
.aith-skel {
  height: 13px;
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 200% 100%;
  border-radius: 6px; margin-bottom: 10px;
  animation: aith-shimmer 1.6s ease-in-out infinite;
}
@keyframes aith-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.aith-load-txt { color: #94a3b8; font-size: 12.5px; margin-top: 4px; }

/* ── AI SUMMARY ──────────────────────────────────────────── */
.aith-summary p { margin-bottom: 14px; line-height: 1.8; color: #334155; }

/* ── AI SECTIONS (sub-heading + paragraphs) ──────────────── */
.aith-sec-item { margin-bottom: 28px; }
.aith-sec-item:last-child { margin-bottom: 0; }
.aith-sec-heading {
  font-family: var(--ff-head);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 400;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
}
.aith-sec-body {
  font-size: 15px;
  line-height: 1.8;
  color: #334155;
  margin-bottom: 12px;
}
.aith-sec-body:last-child { margin-bottom: 0; }

/* ── KEY POINTS ──────────────────────────────────────────── */
.aith-kp-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.aith-kp-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: #334155; }
.aith-kp-list li::before {
  content: ''; width: 6px; height: 6px; min-width: 6px;
  background: var(--amber); border-radius: 50%; margin-top: 8px;
}

/* ── TIMELINE ────────────────────────────────────────────── */
.aith-timeline { display: flex; flex-direction: column; }
.aith-tl-item { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f8fafc; }
.aith-tl-item:last-child { border-bottom: none; }
.aith-tl-date { font-size: 12.5px; font-weight: 600; color: var(--amber); }
.aith-tl-ev { font-size: 14px; color: #334155; }
@media(max-width: 540px) { .aith-tl-item { grid-template-columns: 1fr; gap: 3px; } }

/* ── ENTITY PILLS ────────────────────────────────────────── */
.aith-entity-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.aith-entity-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--eb, #f5f3ff);
  border: 1px solid color-mix(in srgb, var(--ec, #7c3aed) 18%, transparent);
  border-radius: 24px;
  padding: 5px 12px 5px 8px;
  transition: transform .15s, box-shadow .15s;
  cursor: default;
}
.aith-entity-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ec, #7c3aed) 18%, transparent);
}
.aith-entity-icon {
  width: 20px; height: 20px;
  background: color-mix(in srgb, var(--ec, #7c3aed) 14%, transparent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--ec, #7c3aed);
}
.aith-entity-type {
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--ec, #7c3aed); opacity: .7;
}
.aith-entity-name { font-size: 13px; font-weight: 500; color: #1e293b; }

/* ── RELATED QUERIES ─────────────────────────────────────── */
.aith-query-list { display: flex; flex-wrap: wrap; gap: 8px; }
.aith-query-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 7px 13px;
  font-size: 13px; color: #334155;
  transition: all .15s;
}
.aith-query-chip:hover { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.aith-query-chip svg { color: #94a3b8; flex-shrink: 0; }
.aith-query-chip:hover svg { color: #3b82f6; }

/* ── SOURCE LIST ─────────────────────────────────────────── */
.aith-src-grid { display: flex; flex-direction: column; gap: 10px; }
.aith-src-item { display: flex; align-items: flex-start; gap: 10px; }
.aith-src-dot { width: 7px; height: 7px; min-width: 7px; background: var(--amber); border-radius: 50%; margin-top: 6px; }
.aith-src-name { font-size: 11px; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.aith-src-title { font-size: 13px; color: #475569; line-height: 1.4; }

/* ── FAQ ─────────────────────────────────────────────────── */
.aith-faq-item { border-bottom: 1px solid #f8fafc; }
.aith-faq-item:last-child { border-bottom: none; }
.aith-faq-q {
  width: 100%; background: none; border: none;
  color: #1e293b; font-family: var(--ff-body);
  font-size: 14.5px; font-weight: 500;
  padding: 14px 0; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  text-align: left;
}
.aith-faq-q:hover { color: var(--amber); }
.aith-faq-q svg { flex-shrink: 0; transition: transform .25s; color: #cbd5e1; }
.aith-faq-q[aria-expanded='true'] svg { transform: rotate(180deg); color: var(--amber); }
.aith-faq-a { padding: 0 0 14px; color: #64748b; font-size: 14px; line-height: 1.75; }

/* ── ERROR BOX ───────────────────────────────────────────── */
.aith-err-box {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 10px; padding: 14px 16px;
  color: #b91c1c; font-size: 13.5px;
}

/* ── NEWS STACK (sidebar) ────────────────────────────────── */
.aith-news-stack { display: flex; flex-direction: column; gap: 8px; }
.aith-news-card {
  display: block; padding: 12px 14px;
  background: #fafafa; border: 1px solid #f1f5f9;
  border-radius: 10px;
  transition: border-color .15s, background .15s, transform .15s;
}
.aith-news-card:hover { background: #fffbeb; border-color: rgba(245,158,11,.35); transform: translateX(2px); }
.aith-news-src { font-size: 10.5px; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.aith-news-ttl { font-size: 13.5px; font-weight: 500; line-height: 1.4; color: #1e293b; margin-bottom: 4px; }
.aith-news-snip { font-size: 12px; color: #94a3b8; line-height: 1.5; margin-bottom: 6px; }
.aith-news-ft { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #cbd5e1; }
.aith-side-empty { color: #94a3b8; font-size: 13px; }

/* ── TRENDING TERKAIT (sidebar) ──────────────────────────── */
.aith-related-stack { display: flex; flex-direction: column; gap: 6px; }
.aith-related-item {
  display: block; padding: 10px 12px;
  background: #fafafa; border: 1px solid #f1f5f9;
  border-radius: 10px; transition: all .15s; text-decoration: none;
}
.aith-related-item:hover { background: #f0fdf4; border-color: rgba(22,163,74,.3); transform: translateX(2px); }
.aith-related-kw { font-size: 13.5px; font-weight: 500; color: #1e293b; margin-bottom: 6px; }
.aith-related-foot { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.aith-related-traffic { font-size: 11px; color: #94a3b8; }
.aith-related-score { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; margin-left: auto; }
.aith-related-bar { height: 3px; background: #f1f5f9; border-radius: 2px; overflow: hidden; }
.aith-related-bar div { height: 100%; border-radius: 2px; transition: width .6s; }

/* ── TOPIK TERKAIT (AI tags) ─────────────────────────────── */
.aith-tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.aith-tag {
  display: inline-flex; align-items: center;
  background: #f8fafc; border: 1px solid #e2e8f0;
  color: #475569; padding: 5px 12px;
  border-radius: 20px; font-size: 12.5px; transition: all .15s;
}
.aith-tag:hover { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
/* legacy compat */
.aith-tag-link { cursor: pointer; }
.aith-tag-arrow { margin-left: 4px; opacity: .5; font-size: 11px; }

/* ── FOOTER ──────────────────────────────────────────────── */
.aith-footer {
  border-top: 1px solid #f1f5f9; padding: 20px 24px;
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #94a3b8;
}
.aith-footer a { display: flex; align-items: center; gap: 6px; color: #64748b; }
.aith-footer a:hover { color: #0f172a; }

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes aith-reveal { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.aith-ai-sec.aith-reveal { animation: aith-reveal .35s ease both; }
.aith-v4-sec { animation: aith-reveal .4s ease both; }
@media(prefers-reduced-motion:reduce) { .aith-skel,.aith-ai-sec.aith-reveal,.aith-v4-sec { animation:none; } }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media(max-width: 600px) {
  .aith-hero { padding: 28px 0 22px; }
  .aith-hero-title { font-size: 26px; }
  .aith-score-track { width: 80px; }
  .aith-wrap, .aith-footer { padding-left: 16px; padding-right: 16px; }
  .aith-sec { padding: 16px 18px; border-radius: 10px; }
  .aith-tl-item { grid-template-columns: 1fr; gap: 3px; }
  .aith-bc { font-size: 11.5px; }
  /* Breadcrumb: sembunyikan "Home /" di mobile */
  .aith-bc-hide-mobile { display: none; }
}

/* ════════════════════════════════════════════════════════════
   WIDGET / SHORTCODE styles (dipakai di luar halaman trending)
════════════════════════════════════════════════════════════ */
.aith-w-wrap { font-family: var(--ff-body, system-ui, sans-serif); }
.aith-w-empty { font-size: 13px; color: #888; }
.aith-sc-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; }

.aith-w-card {
  display: block; padding: 10px 12px; margin-bottom: 7px;
  border-radius: 8px; text-decoration: none; color: inherit;
  background: rgba(0,0,0,.04); border: 1px solid rgba(0,0,0,.08);
  transition: all .18s ease;
}
.aith-w-card:hover { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.35); transform: translateX(3px); }
.aith-w-card.aith-w-cached { border-left: 3px solid #10b981; }
.aith-w-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.aith-w-kw { font-size: 14px; font-weight: 600; line-height: 1.3; }
.aith-w-traffic { font-size: 12px; color: var(--amber, #f59e0b); font-weight: 700; white-space: nowrap; }
.aith-w-geo { font-size: 11px; background: rgba(0,0,0,.06); padding: 2px 6px; border-radius: 4px; color: #777; margin-top: 4px; display: inline-block; }

.aith-w-list { border-bottom: 1px solid rgba(0,0,0,.07); padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aith-w-list:last-child { border-bottom: none; }
.aith-w-list-kw { font-size: 14px; font-weight: 500; }
.aith-w-list-tr { font-size: 12px; color: var(--amber, #f59e0b); font-weight: 600; }

.aith-w-compact { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 6px; transition: background .15s; }
.aith-w-compact:hover { background: rgba(245,158,11,.07); }
.aith-w-compact-kw { font-size: 13px; font-weight: 500; }
.aith-w-compact-meta { font-size: 11px; color: #888; }

@media(prefers-color-scheme:dark) {
  .aith-w-card { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }
  .aith-w-card:hover { background: rgba(245,158,11,.08); }
  .aith-w-list { border-bottom-color: rgba(255,255,255,.08); }
  .aith-w-geo { background: rgba(255,255,255,.08); color: #aaa; }
  .aith-w-compact:hover { background: rgba(245,158,11,.07); }
}

/* Legacy class aliases — dipakai JS lama, jangan dihapus */
.aith-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.aith-section { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 18px; }
.aith-section-hd { font-family: var(--ff-head); font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--amber); text-transform: uppercase; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.aith-summary-text p { margin-bottom: 14px; color: var(--text); line-height: 1.8; }
.aith-error-box { background: rgba(244,63,94,.08); border: 1px solid rgba(244,63,94,.2); border-radius: 8px; padding: 14px 16px; color: #b91c1c; font-size: 14px; }
.aith-skeleton-wrap { padding: 4px 0; }
.aith-loading-txt { color: var(--muted); font-size: 13px; margin-top: 6px; font-style: italic; }
