/* PowerPoint Boy — e-book shop (โทนเดียวกับ slides.powerpointboy.com) */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --line: #e7e6e0;
  --text: #1c1c1a;
  --muted: #6b6a65;
  --accent: #111111;
  --good: #1f7a4d;
  --good-bg: #e7f4ec;
  --bad: #b3261e;
  --bad-bg: #fbeaea;
  --highlight: #ffd84d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Thai", "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.01em; }
h2 { font-size: clamp(22px, 3.2vw, 30px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
code, .mono { font-family: "Inter", ui-monospace, monospace; font-size: .92em; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.eyebrow { font-family: "Inter", sans-serif; font-size: 12.5px; font-weight: 600; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(250,249,246,.88); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-family: "Inter", sans-serif; font-weight: 700; text-decoration: none; letter-spacing: -.01em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 10px; padding: 11px 20px; font: inherit; font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }
.btn.sm { padding: 7px 14px; font-size: 14px; }
.btn.lg { padding: 15px 30px; font-size: 17px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.invert { background: #fff; color: var(--accent); border-color: #fff; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.lead { font-size: 19px; color: #3b3a36; max-width: 34em; }
.price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 24px 0 20px; }
.price-row.center { justify-content: center; }
.price { font-family: "Inter", sans-serif; font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.price small { font-family: "IBM Plex Sans Thai", sans-serif; font-size: 18px; font-weight: 600; }
.compare { color: var(--muted); text-decoration: line-through; font-size: 18px; }
.save { background: var(--highlight); font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.cta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pay-badges { list-style: none; padding: 0; margin: 22px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pay-badges li { font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); padding: 4px 10px; border-radius: 6px; color: #3b3a36; }

.hero-cover { display: flex; justify-content: center; }
.cover-img { width: 100%; max-width: 380px; border-radius: 10px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.05); transform: rotate(-2deg); }
.cover-mock {
  width: 100%; max-width: 360px; aspect-ratio: 3 / 4; border-radius: 10px; padding: 32px 28px;
  background: linear-gradient(155deg, #161616 0%, #2a2a2a 60%, #3a3326 100%); color: #fff;
  display: flex; flex-direction: column; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); transform: rotate(-2deg);
}
.cm-top { font-family: "Inter", sans-serif; font-size: 13px; letter-spacing: .1em; opacity: .7; text-transform: uppercase; }
.cm-title { font-family: "Inter", "IBM Plex Sans Thai", sans-serif; font-size: 32px; font-weight: 800; line-height: 1.15; margin-top: 18px; }
.cm-bars { margin-top: auto; display: flex; align-items: flex-end; gap: 10px; height: 110px; }
.cm-bars i { flex: 1; background: var(--highlight); border-radius: 3px 3px 0 0; }
.cm-bars i:nth-child(1) { height: 35%; opacity: .5; }
.cm-bars i:nth-child(2) { height: 55%; opacity: .65; }
.cm-bars i:nth-child(3) { height: 45%; opacity: .8; }
.cm-bars i:nth-child(4) { height: 75%; opacity: .9; }
.cm-bars i:nth-child(5) { height: 100%; }
.cm-foot { margin-top: 18px; font-family: "Inter", sans-serif; font-size: 12px; letter-spacing: .14em; opacity: .7; }

/* ---------- sections ---------- */
.section { padding-top: 56px; padding-bottom: 56px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 24px; }
.feature h3 { margin-top: 10px; }
.feature p { margin: 0; font-size: 15px; }
.f-icon { font-size: 26px; }

.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.previews img { width: 100%; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.checklist { list-style: none; padding: 0; margin: 16px 0 0; }
.checklist li { position: relative; padding: 8px 0 8px 32px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; display: grid; place-items: center; }
.steps ol { margin: 0; padding-left: 22px; }
.steps li { padding: 6px 0; }

.faq { margin-top: 20px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 32px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 22px; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: #3b3a36; padding-right: 32px; }

.final { padding-top: 24px; padding-bottom: 24px; scroll-margin-top: 80px; }
.final-in { background: var(--accent); color: #fff; border-radius: 22px; padding: 56px 24px; text-align: center; }
.final-in .compare { color: rgba(255,255,255,.6); }
.final-in .small { opacity: .7; margin: 16px 0 0; }

.policy p { font-size: 14.5px; color: #3b3a36; }
.footer { border-top: 1px solid var(--line); margin-top: 24px; padding: 28px 0; }
.footer-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 4px 0 0; }

.alert { background: #fff7d6; border: 1px solid #f0e2a4; padding: 12px 16px; border-radius: 10px; margin: 16px 0; }

/* ---------- buy dialog ---------- */
.buy-dialog { border: 0; border-radius: 18px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.buy-dialog::backdrop { background: rgba(20,20,18,.55); backdrop-filter: blur(3px); }
.buy-dialog form { padding: 30px 26px 24px; position: relative; }
.buy-dialog h2 { font-size: 22px; margin-bottom: 0; }
.dialog-price { font-family: "Inter", sans-serif; font-weight: 800; font-size: 26px; margin: 0; }
.close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack .eyebrow { margin: 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input:not([type]) {
  font: inherit; font-weight: 400; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- secondary pages ---------- */
body.plain main { padding-top: 56px; padding-bottom: 56px; }
.card.center { text-align: center; padding: 44px 28px; }
.card.center form { margin: 24px 0 18px; }
.icon-circle { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 700; background: #f0efe9; }
.icon-circle.ok { background: var(--good-bg); color: var(--good); }
.icon-circle.warn { background: #fff3d6; color: #9a6b00; }
.spinner { width: 48px; height: 48px; margin: 0 auto 22px; border-radius: 50%; border: 4px solid #e7e6e0; border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* admin */
.admin-head { display: flex; justify-content: space-between; align-items: baseline; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.stats .card { display: flex; flex-direction: column; }
.stats b { font-family: "Inter", sans-serif; font-size: 26px; }
section.card + section.card { margin-top: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #f0efe9; }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
details summary { cursor: pointer; font-size: 13px; }
td details form { margin-top: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 180px; padding: 7px 10px; font-size: 14px; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.checks li.good b { color: var(--good); }
.checks li.bad b { color: var(--bad); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; padding-bottom: 40px; }
  .hero-cover { order: -1; }
  .cover-img, .cover-mock { max-width: 260px; }
  .cm-title { font-size: 24px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .grid-3 { grid-template-columns: 1fr; }
  .price { font-size: 34px; }
  .lead { font-size: 17px; }
  .section { padding-top: 40px; padding-bottom: 40px; }
  .final-in { padding: 40px 18px; }
  .stats b { font-size: 20px; }
}
.card.center h1, body.plain h1 { font-size: clamp(24px, 4vw, 30px); }

/* ---------- v2: ปกแนวนอน + ส่วนใหม่ ---------- */
.hero { grid-template-columns: 1fr 1.1fr; gap: 48px; }
.cover-img { max-width: 100%; height: auto; border-radius: 12px; transform: rotate(-1.5deg); }
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stats-strip div { padding: 22px 20px; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.stats-strip div:first-child { border-left: 0; }
.stats-strip b { font-family: "Inter", sans-serif; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stats-strip span { color: var(--muted); font-size: 14px; }
.brands { margin: 18px 0 0; font-weight: 600; font-size: 15px; line-height: 1.9; color: #3b3a36; }
.brands > .small:first-child { display: block; font-weight: 500; }
.quote blockquote { margin: 0 0 16px; padding: 0 0 0 20px; border-left: 4px solid var(--highlight); }
.quote blockquote p { font-size: clamp(20px, 2.6vw, 26px); font-weight: 600; line-height: 1.5; margin: 0; }
.previews { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; margin-top: 16px; }
.previews figure { margin: 0; }
.previews figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.pv { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.pv img { height: auto; transition: transform .2s, box-shadow .2s; }
.pv:hover img { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.toc { list-style: none; counter-reset: toc; padding: 0; margin: 16px 0 0; }
.toc li { counter-increment: toc; position: relative; padding: 10px 0 10px 46px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.toc li::before { content: counter(toc, decimal-leading-zero); position: absolute; left: 0; top: 10px; font-family: "Inter", sans-serif; font-weight: 800; color: #e8590c; }
.toc li span { font-size: 14.5px; }
.author h3 { margin-bottom: 6px; }
.author p:last-child { margin: 0; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1200px, 94vw); width: 100%; overflow: visible; }
.lightbox::backdrop { background: rgba(10,10,10,.82); }
.lightbox img { width: 100%; border-radius: 10px; cursor: zoom-out; }
.lightbox .lb-cap { color: #fff; text-align: center; margin: 10px 0 0; }
.lightbox .close { top: -40px; right: 0; color: #fff; font-size: 32px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .cover-img { max-width: 100%; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stats-strip div:nth-child(3) { border-left: 0; }
  .stats-strip div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .previews { grid-template-columns: 1fr; }
  .stats-strip b { font-size: 28px; }
}
