/* Crowdfunding TH theme — clean white canvas, deep green + saffron gold, Thai-friendly type.
   Loaded after kindling.css (layout primitives) and overrides its tokens and key components. */
:root {
    --paper: #FFFFFF;
    --paper-deep: #F3F6F4;
    --card: #FFFFFF;
    --ink: #10231B;
    --ink-soft: #4A5D55;
    --ink-faint: #8A9A93;
    --line: #E3E9E6;
    --line-strong: #C9D4CF;
    --primary: #0B8F5C;
    --primary-dark: #087048;
    --primary-tint: #E6F6EE;
    --green: #0B8F5C;
    --green-tint: #E6F6EE;
    --gold: #F5B82E;
    --gold-tint: #FFF6DC;
    --deep: #073B29;
    --radius: 6px;
    --serif: "Prompt", "IBM Plex Sans Thai", system-ui, sans-serif;
    --sans: "IBM Plex Sans Thai", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --shadow: 0 1px 2px rgba(16, 35, 27, .05), 0 10px 28px rgba(16, 35, 27, .08);
}
body { font-size: 16px; line-height: 1.65; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0; line-height: 1.25; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h2 { font-size: 1.5rem; }
.en { font-family: var(--sans); font-weight: 400; color: var(--ink-faint); font-size: .78em; margin-left: .35em; }
.kicker { color: var(--primary); letter-spacing: .08em; }
.bleed { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* ---------- header: Kickstarter-like three-zone bar + category strip ---------- */
.topbar { background: #fff; backdrop-filter: none; border-bottom: 1px solid var(--line); }
.nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; min-height: 72px; }
.nav-left { display: flex; gap: 22px; }
.nav-left a, .nav-actions > a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.nav-left a:hover, .nav-left a.active, .nav-actions > a:hover { color: var(--primary); }
.nav-left .en, .nav-actions .en { display: none; }
.brand { justify-self: center; }
.brand img { display: block; height: 40px; width: auto; }
.nav-actions { justify-self: end; gap: 16px; }
.nav-search { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 4px 0 12px; background: var(--paper-deep); }
.nav-search input[type=search] { border: 0; background: transparent; padding: 7px 4px; width: 150px; font-size: .9rem; }
.nav-search input:focus { outline: none; }
.nav-search button { border: 0; background: none; color: var(--ink-soft); cursor: pointer; padding: 6px; display: flex; }
.catbar { border-top: 1px solid var(--line); background: #fff; }
.catbar .wrap { display: flex; justify-content: center; gap: 4px 26px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.catbar a { color: var(--ink-soft); text-decoration: none; font-size: .92rem; font-weight: 500; display: flex; flex-direction: column; align-items: center; line-height: 1.25; padding: 2px 0; border-bottom: 2px solid transparent; }
.catbar a .en { margin: 0; font-size: .68rem; letter-spacing: .02em; }
.catbar a:hover, .catbar a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- buttons, badges ---------- */
.btn { border-radius: 4px; font-weight: 600; padding: 11px 20px; }
.btn.light { background: #fff; border-color: #fff; color: var(--deep); }
.btn.light:hover { background: var(--gold-tint); color: var(--deep); }
.badge { text-transform: none; letter-spacing: 0; font-size: .76rem; }
.badge.community { background: var(--gold-tint); color: #8A5A00; border-color: #F6DFA0; }

/* ---------- hero banner ---------- */
.hero-banner { color: #fff; background-color: #05301F;
    background-image: linear-gradient(90deg, rgba(5,48,31,.92) 0, rgba(5,48,31,.6) 38%, rgba(5,48,31,0) 62%), var(--hero-art);
    background-size: cover, cover; background-position: center, right bottom; background-repeat: no-repeat; }
.hero-inner { min-height: clamp(420px, 40vw, 700px); display: flex; flex-direction: column; justify-content: center; padding-top: 48px; padding-bottom: 96px; }
.hero-kicker { display: inline-flex; align-self: flex-start; background: rgba(245, 184, 46, .16); color: var(--gold); border: 1px solid rgba(245, 184, 46, .45); border-radius: 999px; padding: 3px 12px; font-weight: 600; font-size: .85rem; margin-bottom: 18px; }
.hero-banner h1 { font-size: clamp(2.2rem, 4.6vw, 3.8rem); line-height: 1.15; margin: 0 0 14px; max-width: 14ch; color: #fff; }
.hero-banner h1 span { color: var(--gold); }
.hero-sub { font-size: 1.15rem; max-width: 44ch; color: rgba(255,255,255,.86); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.hero-banner .btn:not(.light) { background: var(--gold); border-color: var(--gold); color: var(--deep); }
.hero-banner .btn:not(.light):hover { background: #FFD666; }

.stat-band { background: var(--deep); color: #fff; border-top: 1px solid rgba(255,255,255,.08); }
.stat-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.stat-lead { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 0; }
.stat-lead span { display: block; font-family: var(--sans); font-weight: 400; font-size: .85rem; color: rgba(255,255,255,.65); }
.stat-row { display: flex; gap: 40px; flex-wrap: wrap; }
.stat-row strong { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--gold); line-height: 1.1; }
.stat-row span { font-size: .82rem; color: rgba(255,255,255,.72); }

/* ---------- featured + recommended ---------- */
.featured-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; }
.eyebrow { font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
.featured-cover { display: block; }
.featured-cover .cover { aspect-ratio: 16 / 9; border-radius: var(--radius) var(--radius) 0 0; }
.featured-title { font-size: 1.6rem; margin: 18px 0 6px; }
.featured-title a, .rec-list h3 a { color: var(--ink); text-decoration: none; }
.featured-title a:hover, .rec-list h3 a:hover { color: var(--primary); text-decoration: underline; }
.by { color: var(--ink-soft); font-size: .88rem; margin: 0; }
.rec-list { list-style: none; margin: 0; padding: 0; }
.rec-list li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rec-list li:first-child { padding-top: 0; }
.rec-thumb .cover { aspect-ratio: 3 / 2; border-radius: 4px; }
.rec-list h3 { font-size: 1.02rem; margin: 0 0 4px; }
.rec-funded { color: var(--primary); font-weight: 600; font-size: .88rem; margin: 0; }
.more { display: inline-block; margin-top: 14px; font-weight: 600; }

/* ---------- section heads ---------- */
section.block { padding: 44px 0 4px; }
.section-head h2 { font-size: 1.45rem; }
.section-head a { font-weight: 600; text-decoration: none; }

/* ---------- project cards ---------- */
.grid { gap: 28px 24px; }
.card { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.card:hover { box-shadow: none; }
.card .cover { aspect-ratio: 16 / 10; border-radius: var(--radius); transition: transform .2s, box-shadow .2s; }
.card:hover .cover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-body { padding: 14px 0 0; gap: 8px; }
.card-head { display: flex; gap: 10px; align-items: flex-start; }
.card-head .avatar { width: 32px; height: 32px; font-size: .9rem; margin-top: 2px; }
.card-body h3 { font-family: var(--serif); font-size: 1.06rem; font-weight: 600; line-height: 1.3; }
.card-body h3 a:hover { color: var(--primary); text-decoration: underline; }
.card-body .summary { font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 0; }
.card-stats { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--ink-soft); flex-wrap: wrap; }
.card-stats strong { color: var(--ink); font-weight: 700; }
.card-stats span:nth-child(2) strong { color: var(--primary); }
.card-tags { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-faint); }
.card-tags a { color: var(--ink-faint); text-decoration: none; }
.card-tags a:hover { color: var(--primary); text-decoration: underline; }
.cover { background: var(--accent, #0B8F5C); overflow: hidden; }
.cover svg { display: block; width: 100%; height: 100%; }
.cover .initial { display: none; }
.bar { background: var(--line); border: 0; height: 8px; border-radius: 0; }
.bar.thin { height: 4px; }
.bar .fill, .bar .fill.done { background: var(--primary); border-radius: 0; }
.mode-tile:hover { border-color: var(--primary); }

/* ---------- project page ---------- */
.project-head { text-align: center; padding: 40px 0 20px; max-width: 820px; margin: 0 auto; }
.project-head h1 { margin: 10px 0 8px; }
.project-head .lede { margin: 0 auto; font-size: 1.12rem; }
.center-badges { justify-content: center; }
.project-top { display: grid; grid-template-columns: 1.7fr 1fr; gap: 40px; padding: 8px 0 32px; }
.project-media .cover { aspect-ratio: 16 / 9; border-radius: var(--radius); }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 14px; font-size: .9rem; color: var(--ink-soft); }
.project-meta a { color: var(--ink-soft); }
.project-stats { display: flex; flex-direction: column; gap: 16px; }
.stats-box .bar { order: -1; margin-bottom: 8px; }
.stats-box .funding { display: flex; flex-direction: column; }
.funding-numbers { grid-template-columns: 1fr; gap: 14px; }
.funding-numbers strong { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; }
.funding-numbers > div:first-child strong { color: var(--primary); font-size: 2.3rem; }
.funding-numbers span { font-size: .9rem; }
.stats-box .btn.block, .project-stats .btn.block { padding: 15px 20px; font-size: 1.02rem; }
.project-stats form, .project-stats .panel { margin: 0; }
.project-stats .panel { padding: 16px; }
.tabs { position: sticky; top: 0; background: #fff; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 0; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); padding: 0 max(24px, calc(50vw - 566px)); }
.tabs-inner { display: flex; gap: 2px; overflow-x: auto; }
.tabs a { color: var(--ink); padding: 16px 14px; border-bottom-width: 3px; }
.tabs a.active { color: var(--primary); }
.tabs-cta { flex-shrink: 0; }
.detail-layout { grid-template-columns: 1fr 340px; }
.sidebar { top: 72px; }
.creator-card .creator-line { margin: 0; }
.support-list h3 { font-size: 1.1rem; margin-bottom: 10px; }
.reward-mini { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); padding: 16px; transition: border-color .15s; }
.reward-mini + .reward-mini { margin-top: 12px; }
.reward-mini:hover { border-color: var(--primary); color: var(--ink); }
.reward-mini .price { color: var(--primary); font-weight: 600; font-size: .95rem; }
.reward-mini.sold-out { opacity: .55; }
.reward .price { font-family: var(--serif); color: var(--primary); }
.plan-grid h3, .timeline strong { color: var(--primary); }
.avatar { background: var(--primary-tint); color: var(--primary); font-family: var(--serif); }

/* ---------- creator CTA + footer ---------- */
.creator-cta { margin: 56px 0 0; background: var(--gold-tint); border: 1px solid #F6DFA0; border-radius: 10px; padding: 32px 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.creator-cta h2 { margin: 0 0 6px; }
.creator-cta h2 span { display: block; font-family: var(--sans); font-size: 1rem; font-weight: 400; color: var(--ink-soft); }
.creator-cta p { margin: 0; max-width: 60ch; color: var(--ink-soft); }
footer.site { background: var(--deep); color: rgba(255,255,255,.75); border-top: 0; margin-top: 72px; padding: 48px 0 28px; }
footer.site .footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
footer.site h4 { color: #fff; font-family: var(--serif); font-size: 1rem; margin-bottom: 12px; }
footer.site h4 .en { color: rgba(255,255,255,.5); }
footer.site a { display: block; color: rgba(255,255,255,.78); text-decoration: none; font-size: .9rem; padding: 3px 0; }
footer.site a:hover { color: var(--gold); }
footer.site .footer-brand img { height: 40px; width: auto; margin-bottom: 12px; }
footer.site .footer-brand p:first-of-type { color: var(--gold); font-weight: 600; }
.footer-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px; font-size: .8rem; color: rgba(255,255,255,.55); }

@media (max-width: 960px) {
    .nav { grid-template-columns: auto 1fr; }
    .nav-left { display: none; }
    .brand { justify-self: start; }
    .nav-search input[type=search] { width: 110px; }
    .featured-layout, .project-top { grid-template-columns: 1fr; }
    footer.site .footer-grid { grid-template-columns: 1fr 1fr; }
    .catbar .wrap { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; }
}
@media (max-width: 620px) {
    .hero-banner { background-image: linear-gradient(180deg, rgba(5,48,31,.55) 0, rgba(5,48,31,.88) 100%), var(--hero-art); }
    .nav-search { display: none; }
    .brand img { height: 32px; }
    .hero-inner { min-height: 380px; }
    .rec-list li { grid-template-columns: 110px 1fr; }
    footer.site .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- project builder, media, payouts (Kickstarter-style post structure) ---------- */
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .02em; }
.narrow { max-width: 820px; margin: 40px auto 0; }
.step-th { display: block; font-weight: 400; font-size: .78rem; color: var(--ink-faint); }
.steps a, .steps span { align-items: flex-start; line-height: 1.3; }
.builder-cover-preview .cover { aspect-ratio: 16 / 9; border-radius: var(--radius); }
.cover.has-image { background: var(--paper-deep); }
.cover.has-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Images inside rendered markdown (story, updates, FAQ): capped, centered, never wider than the column. */
.story-body img, .update-body img, .faq-body img, .md-body img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 480px;
  object-fit: contain; margin: 20px auto; border-radius: var(--radius);
  background: var(--surface-soft, #f4f6f5); box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.story-body p:has(> img:only-child) { margin: 0; }
@media (max-width: 640px) {
  .story-body img, .update-body img, .faq-body img, .md-body img { max-height: 320px; margin: 14px auto; }
}
.story-body h2, .story-body h3 { margin-top: 1.3em; }
.story-body blockquote { border-left: 3px solid var(--primary); margin: 1em 0; padding: 4px 16px; color: var(--ink-soft); }
.reward-items { margin: 4px 0 10px; padding-left: 20px; }
.reward-facts { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 8px 0 0; font-size: .85rem; }
.reward-facts dt { color: var(--ink-faint); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.reward-facts dd { margin: 0; font-weight: 600; }
.addon-pick { background: var(--paper-deep); }
.payout-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 16px 20px; }

/* ---------- Language switcher (t15 i18n) ---------- */
.lang-switch { position: relative; display: inline-block; font-size: .9rem; }
.lang-switch > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line, #dcdcd6); border-radius: 999px; color: inherit; white-space: nowrap; user-select: none; }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary:hover, .lang-switch[open] > summary { border-color: currentColor; }
.lang-switch > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.lang-switch ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 160px; margin: 0; padding: 6px; list-style: none; background: #fff; color: var(--ink, #1c1c1c); border: 1px solid var(--line, #dcdcd6); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.lang-switch li a { display: block; padding: 8px 12px; border-radius: 6px; color: inherit; text-decoration: none; }
.lang-switch li a:hover { background: var(--primary-tint, #e7f4ee); }
.lang-switch li a.current { font-weight: 600; color: var(--primary, #0B8F5C); }
.lang-switch li a.current::before { content: "✓ "; }
.lang-switch.up ul { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
footer.site .lang-switch { margin-top: 14px; }
footer.site .lang-switch > summary { border-color: rgba(255,255,255,.3); color: #fff; }

/* Per-script fonts: only the active locale's Noto family is requested in <head>. */
html:lang(ja) { --sans: "Noto Sans JP", "IBM Plex Sans Thai", system-ui, sans-serif; --serif: "Noto Sans JP", "Prompt", system-ui, sans-serif; }
html:lang(zh-Hans) { --sans: "Noto Sans SC", "IBM Plex Sans Thai", system-ui, sans-serif; --serif: "Noto Sans SC", "Prompt", system-ui, sans-serif; }
html:lang(hi) { --sans: "Noto Sans Devanagari", "Inter", system-ui, sans-serif; --serif: "Noto Sans Devanagari", "Prompt", system-ui, sans-serif; }
html:lang(ja) .eyebrow, html:lang(zh-Hans) .eyebrow, html:lang(hi) .eyebrow { letter-spacing: .02em; }
html:lang(hi) body { line-height: 1.7; }
