/*
 * modules/intro/site.css — หน้าเว็บของ Intro Builder: layout templates/layouts/site.html · หน้าเริ่ม (intro/builder.html) · /howto
 * Studio และตัวควบคุม (ปุ่ม การ์ด ฟอร์ม) อยู่ใน studio.css (ใช้ร่วมกับ gcms.in.th) — หน้านี้โหลดทั้งสองไฟล์
 * หน้าที่ผู้ใช้สร้าง (ไฟล์ที่ดาวน์โหลด) ไม่ใช้ไฟล์นี้ — CSS ของหน้านั้นอยู่ใน engine.js
 */
.ib {
  min-height: 100vh;
  background: var(--ib-bg);
  color: var(--ib-ink);
  font-family: "Prompt", "Noto Sans Thai", system-ui, sans-serif;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}
.ib-center {
  text-align: center;
}

/* ---------------- header / footer */
.ib-header {
  background: var(--ib-surface);
  border-bottom: 1px solid var(--ib-border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.ib-header-in {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.ib-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ib-ink);
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}
.ib-brand strong {
  display: block;
  font-size: 1.08rem;
}
.ib-brand small {
  display: block;
  color: var(--ib-muted);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ib-mark {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #5b4cf0, #a855f7 55%, #ec4899);
  box-shadow: 0 4px 12px rgba(91, 76, 240, .3);
}
.ib-nav {
  display: flex;
  gap: 4px;
}
.ib-main {
  flex: 1;
  width: 100%;
}
.ib-footer {
  border-top: 1px solid var(--ib-border);
  background: var(--ib-surface);
}
.ib-footer-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: .9rem;
}
.ib-footer p {
  margin: 4px 0 0;
  color: var(--ib-muted);
  max-width: 640px;
}
.ib-footer nav {
  display: flex;
  gap: 16px;
}
.ib-footer a {
  color: var(--ib-ink2);
}
.ib-in-studio .ib-footer {
  display: none;
}

/* ---------------- start screen */
.ib-start {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px 56px;
}
.ib-hero {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 36px;
}
.ib-hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.25;
  margin: 14px 0 12px;
  background: linear-gradient(120deg, #141833 30%, #5b4cf0 70%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ib-hero p {
  color: var(--ib-ink2);
  margin: 0 auto;
  max-width: 720px;
}
.ib-hero-act {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.ib-pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--ib-brand-soft);
  color: var(--ib-brand);
  font-size: .82rem;
  font-weight: 600;
}
.ib-h2 {
  font-size: 1.15rem;
  margin: 34px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ib-h2 span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ib-brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .85rem;
}
.ib-h2 small {
  font-weight: 400;
  color: var(--ib-muted);
  font-size: .82rem;
}
.ib-kinds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.ib-kind {
  display: grid;
  gap: 6px;
  justify-items: start;
  text-align: left;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--ib-border);
  background: var(--ib-surface);
  box-shadow: var(--ib-shadow);
  cursor: pointer;
  color: inherit;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.ib-kind:hover {
  transform: translateY(-3px);
  border-color: var(--ib-brand);
  box-shadow: 0 16px 32px rgba(91, 76, 240, .14);
}
.ib-kind-icon {
  font-size: 1.9rem;
  line-height: 1;
}
.ib-kind strong {
  font-size: 1.05rem;
}
.ib-starters,
.ib-mine {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.ib-card-mine {
  cursor: default;
}
.ib-card-mine:hover {
  transform: none;
}
.ib-card-open {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.ib-card-acts {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}
.ib-card-acts .ib-link {
  font-size: .8rem;
  padding: 4px 8px;
}

/* howto / 404 */
.ib-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}
.ib-hero-sm {
  text-align: center;
  margin-bottom: 28px;
}
.ib-hero-sm h1 {
  margin: 12px 0 8px;
}
.ib-hero-sm p {
  color: var(--ib-ink2);
}
.ib-howto h2 {
  margin: 34px 0 10px;
  font-size: 1.25rem;
}
.ib-howto h3 {
  margin: 20px 0 8px;
  font-size: 1rem;
}
.ib-howto .syntax-highlighter-component,
.ib-howto .highlighted-code {
  margin: 10px 0;
}
/* css/styles.css ตั้ง * { font-family: Kanit } ทับทุก element — เนื้อโค้ดของ SyntaxHighlighterComponent ต้องเป็นตัวอักษรกว้างเท่ากัน */
.ib-howto .highlighted-code .code-content,
.ib-howto .highlighted-code .code-content *,
.ib-howto .highlighted-code .line-number {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.ib-howto :not(pre) > code {
  background: var(--ib-brand-soft);
  color: var(--ib-brand);
  padding: 1px 6px;
  border-radius: 5px;
}
.ib-howto-steps {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
  counter-reset: s;
}
.ib-howto-steps li {
  counter-increment: s;
  position: relative;
  padding: 14px 16px 14px 56px;
  background: #fff;
  border: 1px solid var(--ib-border);
  border-radius: 12px;
}
.ib-howto-steps li::before {
  content: counter(s);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ib-brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: .85rem;
}
.ib-howto-steps p {
  margin: 4px 0 0;
  color: var(--ib-ink2);
}
.ib-big {
  font-size: 3rem;
}

/* ---------------- responsive */
@media (max-width: 1100px) {
  .ib-kinds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  .ib-header-in {
    padding: 8px 16px;
  }
  .ib-brand small {
    display: none;
  }
  .ib-start {
    padding: 24px 16px 40px;
  }
}
@media (max-width: 520px) {
  .ib-kinds {
    grid-template-columns: 1fr;
  }
  .ib-nav .ib-link {
    padding: 6px 8px;
    font-size: .85rem;
  }
}
