/* search.christianpost.com — AI answer + site search results.
   Same palette/type as the chat UI and christianpost.com. */
:root {
  --ink: #0f112e; --text: #22243a; --muted: #5b5e70; --faint: #9a9cab;
  --rule: #e3e4ea; --rule-soft: #eeeff3; --paper: #ffffff; --wash: #f3f4f7; --wash-2: #f8f9fb;
  --accent: #1774ce; --focus: #1774ce;
  --serif: proxima-nova, "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --sans: proxima-nova, "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --col: 800px; --gutter: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--text); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 var(--gutter); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; min-width: 0; overflow: hidden; }
.brand-logo { display: block; height: 26px; width: 200px; max-width: 100%; object-fit: contain; object-position: left center; }
.brand-divider { width: 1px; height: 26px; background: var(--rule); }
.brand-product { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lang-picker { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px; border-radius: 18px; cursor: pointer; font-size: 13px; font-weight: 600; }
.lang-picker:hover { background: var(--wash); }
.lang-picker svg { width: 18px; height: 18px; }
.lang-picker select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-weight: 600; cursor: pointer; }
.lang-picker select:focus { outline: none; }
.pill-link { white-space: nowrap; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 18px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.pill-link:hover { background: var(--wash); }

/* Page */
.page { max-width: var(--col); margin: 0 auto; padding: 0 var(--gutter) 64px; }
.hero { padding: 64px 0 20px; }
.kicker { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); }
.hero-title { margin: 0 0 10px; font: 700 clamp(30px, 4.6vw, 42px)/1.15 var(--serif); color: var(--ink); }
.hero-sub { margin: 0; color: var(--muted); max-width: 600px; }
.has-query .hero { display: none; }
.has-query .page { padding-top: 24px; }

.searchbox { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding: 6px 6px 6px 16px; border: 1px solid var(--rule); border-radius: 28px; background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05); }
.has-query .searchbox { margin-top: 0; }
.searchbox:focus-within { border-color: #9a9a9a; }
.searchbox-icon { flex: none; color: var(--faint); }
.searchbox input[type=search] { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 10px 4px; font-size: 17px; color: var(--ink); }
.searchbox input::-webkit-search-cancel-button { cursor: pointer; }
.searchbox-btn { flex: none; height: 44px; padding: 0 22px; border: 0; border-radius: 22px; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; }
.searchbox-btn:hover { background: #000; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.has-query .chips { display: none; }
.chip { border: 1px solid var(--rule); background: var(--paper); border-radius: 18px; padding: 7px 14px; font-size: 14px; cursor: pointer; color: var(--ink); }
.chip:hover { background: var(--wash); }

/* AI answer card */
.ai { margin-top: 24px; border: 1px solid var(--rule); border-radius: 16px; padding: 18px 20px 14px; background: linear-gradient(180deg, #fbfbfb, #fff 120px); }
.ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.ai-badge svg { width: 16px; height: 16px; fill: var(--accent); stroke: none; }
.ai-tool { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 15px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.ai-tool:hover { background: var(--wash); color: var(--ink); }
.ai-tool svg { width: 15px; height: 15px; }

.ai-body { position: relative; }
.ai-body.clamped { max-height: 380px; overflow: hidden; }
.ai-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(rgba(255,255,255,0), #fff); pointer-events: none; }
.ai-more { display: block; margin: 6px auto 0; border: 1px solid var(--rule); background: var(--paper); border-radius: 18px; padding: 6px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ai-more:hover { background: var(--wash); }

.turn-q { margin: 18px 0 8px; font: 700 17px/1.35 var(--serif); color: var(--ink); }
.turn-q:first-child { display: none; } /* first question is already in the search box */
.answer { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.answer > :first-child { margin-top: 0; }
.answer > :last-child { margin-bottom: 0; }
.answer p { margin: 0 0 10px; }
.answer h1, .answer h2, .answer h3 { font-family: var(--serif); color: var(--ink); font-size: 18px; margin: 16px 0 6px; }
.answer strong { color: var(--ink); }
.answer a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.answer a:hover { text-decoration-color: var(--ink); }
.answer ul, .answer ol { margin: 0 0 10px; padding-left: 0; list-style: none; }
.answer ol { counter-reset: n; }
.answer > ol > li, .answer > ul > li { position: relative; padding: 10px 0 10px 32px; border-top: 1px solid var(--rule-soft); }
.answer > ol > li::before { counter-increment: n; content: counter(n); position: absolute; left: 0; top: 11px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 12px/22px var(--sans); text-align: center; }
.answer > ul > li::before { content: ""; position: absolute; left: 8px; top: 21px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.answer > ol > li > strong:first-child, .answer > ul > li > strong:first-child,
.answer > ol > li > a:first-child, .answer > ul > li > a:first-child,
.answer li > p:first-child > strong:first-child, .answer li > p:first-child > a:first-child { display: block; margin-bottom: 2px; }
.answer li > a:first-child, .answer li > strong:first-child > a, .answer li > p:first-child > a:first-child, .answer li > p:first-child > strong:first-child > a { font: 700 16px/1.35 var(--serif); text-decoration: none; }
.answer li > a:first-child:hover, .answer li > strong:first-child > a:hover { text-decoration: underline; }
.answer li li { padding: 2px 0 2px 16px; position: relative; border: 0; }
.answer li li::before { content: ""; position: absolute; left: 3px; top: 12px; width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.answer li p { margin: 0 0 4px; }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; background: var(--ink); vertical-align: text-bottom; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.thinking { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.error-note { color: var(--accent); }
.search-suggestions { margin-top: 10px; max-width: 100%; overflow: hidden; }

.followup { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 4px 4px 4px 14px; border: 1px solid var(--rule); border-radius: 22px; }
.followup:focus-within { border-color: #9a9a9a; }
.followup input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 8px 0; }
.followup-btn { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; }
.followup-btn:disabled { background: var(--rule); cursor: default; }
.followup-btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.ai-note { margin: 10px 0 0; font-size: 12px; color: var(--faint); }

/* Results (Google Programmable Search) */
.results { margin-top: 36px; }
.results-title { margin: 0 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); font: 700 20px/1.3 var(--serif); color: var(--ink); }
.results .gsc-control-cse { border: 0 !important; background: transparent !important; padding: 0 !important; font-family: var(--sans) !important; }
.results .gsc-above-wrapper-area { border-bottom: 1px solid var(--rule-soft) !important; padding: 8px 0 !important; }
.results .gsc-result-info { padding-left: 0 !important; color: var(--muted) !important; }
.results .gsc-webResult.gsc-result { border: 0 !important; border-bottom: 1px solid var(--rule-soft) !important; padding: 16px 0 !important; margin: 0 !important; background: transparent !important; }
.results .gs-title, .results .gs-title * { font-family: var(--serif) !important; font-size: 18px !important; font-weight: 700 !important; color: var(--ink) !important; text-decoration: none !important; height: auto !important; }
.results .gs-title:hover * { text-decoration: underline !important; }
.results .gs-visibleUrl { color: var(--muted) !important; font-size: 13px !important; }
.results .gs-snippet { color: var(--text) !important; font-size: 15px !important; line-height: 1.55 !important; }
.results .gsc-cursor-box { margin: 18px 0 !important; text-align: center; }
.results .gsc-cursor-page { color: var(--ink) !important; border-radius: 50%; padding: 4px 9px; text-decoration: none !important; }
.results .gsc-cursor-current-page { background: var(--ink) !important; color: #fff !important; }


@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .topbar { height: 56px; gap: 10px; }
  .brand-logo { height: 20px; width: 150px; }
  .brand-divider, .brand-product { display: none; }
  .pill-link { padding: 0 12px; }
  .hero { padding-top: 36px; }
  .searchbox-btn { padding: 0 16px; }
  .ai { padding: 16px 14px 12px; border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) { .dots i, .cursor::after { animation: none; } }

/* ---------- The Christian Post brand layer ---------- */
h1, h2, h3, .answer h1, .answer h2, .answer h3 { letter-spacing: -.3px; }
.brand-logo { height: 18px !important; width: 300px !important; }
.brand-product { color: var(--accent); letter-spacing: 1.4px; }
.kicker { color: var(--accent); letter-spacing: 1.6px; }
.answer a { text-decoration-color: rgba(23,116,206,.35); }
.answer a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.answer li > a:first-child, .answer li > strong:first-child > a,
.answer li > p:first-child > a:first-child, .answer li > p:first-child > strong:first-child > a { font-weight: 800; letter-spacing: -.2px; }
.answer li > a:first-child:hover, .answer li > strong:first-child > a:hover { color: var(--accent); text-decoration: none; }
.answer > ol > li::before { background: var(--ink); }
html[lang="zh"] body { letter-spacing: 0; }
@media (max-width: 560px) { .brand-logo { height: 13px !important; width: 210px !important; } }

.hero-title { font-weight: 800; letter-spacing: -1px; }
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,116,206,.12), 0 4px 16px rgba(15,17,46,.06); }
.searchbox-btn { background: var(--accent); border-radius: 100px; font-weight: 700; }
.searchbox-btn:hover { background: #125fa9; }
.chip { border-radius: 100px; font-weight: 600; }
.chip:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.pill-link { border-radius: 100px; }
.pill-link:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.ai { border-color: var(--rule); background: linear-gradient(180deg, #f5f8fd, #fff 140px); }
.ai-badge svg { fill: var(--accent); }
.followup:focus-within { border-color: var(--accent); }
.followup-btn { background: var(--accent); }
.results-title { border-bottom: 3px solid var(--ink); text-transform: uppercase; font-size: 17px; font-weight: 800; letter-spacing: .4px; }
.results .gs-title, .results .gs-title * { font-weight: 800 !important; letter-spacing: -.2px; }
.results .gs-title:hover * { color: var(--accent) !important; text-decoration: none !important; }
.results .gsc-cursor-current-page { background: var(--accent) !important; }
/* Hide the "Search … on Google" link under the results */
.results .gcsc-more-maybe-branding-root, .results .gcsc-find-more-on-google-root, .results .gcsc-find-more-on-google { display: none !important; }
/* Empty state: sit the hero a little lower so the page feels balanced without a footer */
body:not(.has-query) .hero { padding-top: clamp(64px, 16vh, 180px); }
