/* CraftMyAI blog. Tokens mirror :root in ../index.html: the dark header of the
   main site over a cream "paper" reading surface, which is kinder to long text
   than charcoal. Every article and the blog index share this one file. */
:root {
  --char: #17120c;
  --char-2: #211910;
  --paper: #fbf3e3;
  --paper-2: #f3e7cf;
  --paper-line: #e6d5b4;
  --card: #fffaf0;
  --ink: #241a12;
  --ink-soft: #6d5b46;
  --cream: #f7ecd8;
  --cream-soft: #c3b299;
  --orange: #ff6b35;
  --orange-deep: #c9461a;
  --gold: #ffc947;
  --mint: #1f9e83;
  --display: "Baloo 2", ui-rounded, "Segoe UI Rounded", system-ui, sans-serif;
  --body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.75 var(--body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-deep); }
a:hover { color: var(--ink); }
::selection { background: var(--orange); color: #fff; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 50; }

/* ---- header / footer ---- */
/* Same bar as the landing page (index.html header.nav): 132px tall, see-through
   and blurred, with the logo pinned to the top-left corner at 88px (264 x 88,
   the logo is 3:1) and the links riding the right edge. */
.b-nav {
  position: sticky; top: 0; z-index: 20; color: var(--cream);
  background: var(--char);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.b-nav .wrap { display: flex; align-items: center; justify-content: flex-end; gap: 24px; height: 132px; padding-left: 280px; }
.b-nav .brand { position: absolute; top: 0; left: 0; display: flex; align-items: center; }
.b-nav .brand img { height: 88px; width: auto; }
.b-nav nav { display: flex; align-items: center; gap: 24px; font-weight: 600; font-size: .95rem; }
.b-nav nav a { color: var(--cream-soft); text-decoration: none; }
.b-nav nav a:hover, .b-nav nav a[aria-current] { color: var(--cream); }
.b-nav .cta {
  color: #fff; padding: .6em 1.2em; border-radius: 999px; text-decoration: none;
  background: linear-gradient(135deg, var(--orange), var(--gold)); font-family: var(--display); font-weight: 700;
}
.b-nav .cta:hover { color: #fff; }
@media (max-width: 1024px) {
  .b-nav .wrap { height: 74px; padding-left: 160px; }
  .b-nav .brand img { height: 48px; }
}

.b-foot { background: var(--char); color: var(--cream-soft); padding: 36px 0; margin-top: 64px; font-size: .9rem; }
.b-foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
.b-foot nav { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.b-foot a { color: var(--cream-soft); text-decoration: none; }
.b-foot a:hover { color: var(--cream); }

/* ---- article ---- */
.crumbs { font-size: .85rem; color: var(--ink-soft); margin: 28px 0 10px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--paper-line); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }

.post { max-width: var(--measure); margin: 0 auto; }
.post-head .kicker {
  display: inline-block; font: 700 .78rem/1 var(--display); letter-spacing: .12em; text-transform: uppercase;
  color: var(--orange-deep); margin-bottom: 12px;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 800; margin: 0 0 14px; text-wrap: balance; }
h2 { font-size: clamp(1.45rem, 3.2vw, 1.85rem); font-weight: 800; margin: 48px 0 12px; scroll-margin-top: 150px; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 28px 0 8px; }
.post p { margin: 0 0 18px; }
.post ul, .post ol { padding-left: 1.3em; margin: 0 0 18px; }
.post li { margin-bottom: 8px; }
.lede { font-size: 1.12rem; color: var(--ink-soft); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--ink-soft); margin: 6px 0 26px; }

.hero-img { border-radius: 20px; overflow: hidden; margin: 0 0 28px; box-shadow: 0 18px 40px -22px rgba(60, 40, 20, .45); background: var(--paper-2); }
.hero-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* The direct answer, first thing after the intro: what answer engines quote. */
.answer {
  background: var(--card); border: 1px solid var(--paper-line); border-left: 5px solid var(--orange);
  border-radius: 14px; padding: 18px 20px; margin: 0 0 26px;
}
.answer strong:first-child { display: block; font-family: var(--display); font-size: 1.05rem; margin-bottom: 4px; }
.answer p:last-child { margin-bottom: 0; }

.takeaways { background: var(--paper-2); border-radius: 14px; padding: 18px 22px; margin: 0 0 28px; }
.takeaways h2 { font-size: 1.15rem; margin: 0 0 8px; }
.takeaways ul { margin: 0; }

.toc { border: 1px dashed var(--paper-line); border-radius: 14px; padding: 14px 20px; margin: 0 0 28px; font-size: .95rem; }
.toc strong { font-family: var(--display); }
.toc ol { margin: 6px 0 0; }

figure { margin: 30px 0; }
figure .frame { background: var(--card); border: 1px solid var(--paper-line); border-radius: 16px; padding: 16px; overflow-x: auto; }
figure svg { width: 100%; height: auto; display: block; min-width: 520px; }
figure.photo .frame { padding: 0; overflow: hidden; }
figure.photo svg { min-width: 0; }
figcaption { font-size: .86rem; color: var(--ink-soft); margin-top: 8px; text-align: center; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery img { border-radius: 12px; aspect-ratio: 1; object-fit: cover; background: var(--paper-2); }

.table-wrap { overflow-x: auto; margin: 22px 0 26px; border-radius: 14px; border: 1px solid var(--paper-line); }
table { border-collapse: collapse; width: 100%; min-width: 520px; background: var(--card); font-size: .93rem; }
caption { text-align: left; font-weight: 600; padding: 12px 14px 0; color: var(--ink-soft); font-size: .85rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
thead th { font-family: var(--display); background: var(--paper-2); }
tbody tr:last-child td { border-bottom: 0; }

.callout { background: #fff1e8; border-radius: 14px; padding: 16px 20px; margin: 24px 0; }
.callout p:last-child { margin-bottom: 0; }

.faq details { background: var(--card); border: 1px solid var(--paper-line); border-radius: 12px; padding: 4px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style-position: outside; }
.faq details p { margin: 0 0 14px; }

.cta-box {
  margin: 40px 0 10px; padding: 26px; border-radius: 20px; color: var(--cream); background: var(--char);
  display: grid; gap: 10px;
}
.cta-box h2 { color: var(--cream); margin: 0; font-size: 1.5rem; }
.cta-box p { margin: 0; color: var(--cream-soft); }
.cta-box a.btn {
  justify-self: start; margin-top: 6px; color: #fff; text-decoration: none; padding: .7em 1.3em; border-radius: 999px;
  font-family: var(--display); font-weight: 700; background: linear-gradient(135deg, var(--orange), var(--gold));
}

.author { display: flex; gap: 14px; align-items: center; border-top: 1px solid var(--paper-line); padding-top: 20px; margin-top: 36px; font-size: .92rem; color: var(--ink-soft); }
.author img { width: 48px; height: 48px; border-radius: 12px; }

.related { max-width: var(--measure); margin: 40px auto 0; }
.related h2 { margin-top: 0; }

/* ---- cards (index + related) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--paper-line); border-radius: 18px;
  overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -20px rgba(60, 40, 20, .45); color: var(--ink); }
.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--paper-2); }
.card .body { padding: 16px 18px 20px; }
.card .tag { font: 700 .72rem/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--orange-deep); }
.card h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.card p { margin: 0; font-size: .92rem; color: var(--ink-soft); }

.blog-hero { padding: 40px 0 10px; max-width: 760px; }
.blog-hero h1 { margin-bottom: 10px; }

@media (max-width: 1024px) { h2 { scroll-margin-top: 90px; } }
@media (max-width: 720px) {
  body { font-size: 16px; }
  .b-nav nav a:not(.cta) { display: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
.hero-gallery { margin: 0 0 24px; }
/* Show whole product photos (the tee shots are portrait) rather than cropping them. */
.gallery img { object-fit: contain; }

/* ---- listing pages ---- */
.card .card-title { margin: 8px 0 6px; font-size: 1.15rem; line-height: 1.25; }

/* Pagination: real links, so crawlers can walk every page. */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; margin: 36px 0 8px; }
.pager-nums { display: inline-flex; gap: 6px; }
.pager-num, .pager-step {
  display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 14px; border-radius: 999px;
  font-family: var(--display); font-weight: 700; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--paper-line);
}
.pager a:hover { border-color: var(--orange); color: var(--orange-deep); }
.pager-num[aria-current] { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.card .card-date { display: block; margin-top: 10px; font-size: .8rem; color: var(--ink-soft); }

/* ---- waitlist dialog (../waitlist.js) ---- */
.wl-dialog {
  width: min(460px, calc(100vw - 32px)); border: 0; border-radius: 20px; padding: 26px 24px 24px;
  background: var(--char); color: var(--cream); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6);
}
.wl-dialog::backdrop { background: rgba(23, 18, 12, .55); backdrop-filter: blur(2px); }
.wl-dialog h2 { color: var(--cream); font-size: 1.45rem; margin: 0 0 6px; }
.wl-dialog p { margin: 0 0 16px; color: var(--cream-soft); font-size: .95rem; line-height: 1.55; }
.wl-dialog label { display: block; font-size: .85rem; font-weight: 600; color: var(--cream-soft); margin-bottom: 8px; }
.wl-close {
  position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .08); color: var(--cream); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.wl-close:hover { background: rgba(255, 255, 255, .16); }
.wl-dlg-row { display: flex; gap: 8px; }
.wl-dlg-row input {
  flex: 1; min-width: 0; font: inherit; font-size: .95rem; padding: .75em 1.1em; border-radius: 999px;
  border: 1px solid #3a2d1c; background: rgba(255, 255, 255, .06); color: var(--cream);
}
.wl-dlg-row input::placeholder { color: var(--cream-soft); opacity: .7; }
.wl-dlg-row input:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.wl-dlg-btn, .wl-dlg-ig {
  font-family: var(--display); font-weight: 700; font-size: 1rem; border: 0; border-radius: 999px; cursor: pointer;
  padding: .75em 1.3em; color: #fff; background: linear-gradient(135deg, var(--orange), var(--gold)); white-space: nowrap;
}
.wl-dlg-btn[disabled] { opacity: .6; cursor: progress; }
/* Honeypot field: hidden from people, still filled in by form bots. */
.wl-hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wl-dlg-error { margin: 8px 0 0 !important; color: #ff9b8a !important; font-size: .85rem !important; }
.wl-dlg-ig { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.wl-dlg-ig:hover { color: #fff; }
@media (max-width: 480px) { .wl-dlg-row { flex-direction: column; } }
