/* CreatorTools - Blog stylesheet
   Self-contained (no CDN JS) for fast LCP and stable Core Web Vitals. */

:root {
  --bg: #ffffff;
  --bg-soft: #f9f9f9;
  --card: #f1f1f1;
  --border: #e5e5e5;
  --text: #0f0f0f;
  --text-soft: #606060;
  --text-mute: #909090;
  --red: #cc0000;
  --link: #065fd4;
  --radius: 12px;
  --maxw: 760px;
}

html.dark {
  --bg: #0f0f0f;
  --bg-soft: #181818;
  --card: #282828;
  --border: #303030;
  --text: #f1f1f1;
  --text-soft: #aaaaaa;
  --text-mute: #717171;
  --red: #ff0000;
  --link: #3ea6ff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; fill: var(--red); }
.header-nav { display: flex; align-items: center; gap: 18px; }
.header-nav a { color: var(--text-soft); font-size: 14px; font-weight: 500; }
.header-nav a:hover { color: var(--text); text-decoration: none; }
.theme-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; width: 34px; height: 34px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1;
}
.theme-btn:hover { background: var(--border); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.crumbs { font-size: 13px; color: var(--text-mute); margin: 24px 0 8px; }
.crumbs a { color: var(--text-mute); }
.crumbs span { margin: 0 6px; }

/* ---------- Article ---------- */
.post-head { padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.eyebrow {
  display: inline-block; background: var(--card); color: var(--text-soft);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
h1 { font-size: 2.05rem; line-height: 1.22; letter-spacing: -0.025em; margin: 0 0 14px; font-weight: 800; }
.post-meta { font-size: 14px; color: var(--text-mute); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.standfirst { font-size: 1.08rem; color: var(--text-soft); margin: 16px 0 0; }

article h2 { font-size: 1.45rem; line-height: 1.3; letter-spacing: -0.02em; margin: 2.2em 0 .6em; font-weight: 700; scroll-margin-top: 76px; }
article h3 { font-size: 1.12rem; margin: 1.7em 0 .5em; font-weight: 700; }
article p { margin: 0 0 1.15em; }
article ul, article ol { margin: 0 0 1.2em; padding-left: 1.35em; }
article li { margin-bottom: .5em; }
article strong { color: var(--text); font-weight: 600; }

.toc { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 28px 0; }
.toc p { font-weight: 700; margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute); }
.toc ol { margin: 0; padding-left: 1.2em; font-size: 15px; }
.toc li { margin-bottom: .3em; }

.callout {
  border-left: 3px solid var(--red); background: var(--bg-soft);
  padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.8em 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout .callout-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); display: block; margin-bottom: 6px; }

.table-scroll { overflow-x: auto; margin: 1.6em 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { background: var(--bg-soft); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }

/* ---------- Video / resource embed ---------- */
.watch {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-soft); padding: 18px 20px; margin: 1.8em 0;
  display: flex; gap: 14px; align-items: flex-start;
}
.watch .play {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 999px; background: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.watch .play svg { width: 18px; height: 18px; fill: #fff; margin-left: 2px; }
.watch-body { min-width: 0; }
.watch-body p { margin: 0; font-size: 15px; color: var(--text-soft); }
.watch-body .watch-title { font-weight: 700; color: var(--text); margin-bottom: 3px; font-size: 15px; }

.video-frame { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; margin: 1.8em 0; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- FAQ ---------- */
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px; background: var(--bg-soft);
}
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--text-mute); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 12px 0 0; color: var(--text-soft); font-size: 16px; }

/* ---------- Keywords + sources ---------- */
.endmatter { margin-top: 3rem; padding-top: 1.8rem; border-top: 1px solid var(--border); }
.endmatter h2 { font-size: 1.15rem; margin-top: 1.6em; }
.endmatter h2:first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 .5em; padding: 0; list-style: none; }
.chips li { background: var(--card); color: var(--text-soft); font-size: 13px; padding: 5px 11px; border-radius: 999px; }
.sources { font-size: 15px; padding-left: 1.3em; }
.sources li { margin-bottom: .55em; color: var(--text-soft); }
.sources a { word-break: break-word; }

/* ---------- Ads ---------- */
.ad-slot { margin: 2.4em 0; text-align: center; min-height: 100px; }
.ad-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 6px; }

/* ---------- Related ---------- */
.related { margin-top: 3rem; padding-top: 1.8rem; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); list-style: none; padding: 0; margin: 0; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  background: var(--bg-soft); transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--text-mute); }
.card .cat { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--red); }
.card h3 { margin: 7px 0 6px; font-size: 15.5px; line-height: 1.35; }
.card h3 a { color: var(--text); }
.card h3 a:hover { text-decoration: none; color: var(--link); }
.card p { margin: 0; font-size: 13.5px; color: var(--text-mute); line-height: 1.5; }

/* ---------- Index page ---------- */
.index-hero { padding: 48px 0 8px; text-align: center; }
.index-hero h1 { font-size: 2.3rem; }
.index-hero p { color: var(--text-soft); max-width: 620px; margin: 0 auto; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 26px 0 8px; padding: 0; list-style: none; }
.filters button {
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  background: var(--card); color: var(--text); border: 1px solid transparent;
  padding: 6px 14px; border-radius: 999px;
}
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.post-list { list-style: none; padding: 0; margin: 28px 0 0; }
.post-list li { padding: 22px 0; border-bottom: 1px solid var(--border); display: flex; gap: 20px; align-items: flex-start; }
.post-list .thumb { flex: 0 0 200px; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); line-height: 0; }
.post-list .thumb img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.post-list-body { min-width: 0; }
.post-list .cat { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--red); }
.post-list h2 { font-size: 1.2rem; margin: 6px 0; line-height: 1.35; }
.post-list h2 a { color: var(--text); }
.post-list p { margin: 0 0 6px; color: var(--text-soft); font-size: 15px; }
.post-list .meta { font-size: 13px; color: var(--text-mute); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 28px 0 44px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-mute); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-nav a { color: var(--text-mute); }
.disclosure { font-size: 12.5px; color: var(--text-mute); margin-top: 14px; line-height: 1.6; }

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  h1 { font-size: 1.72rem; }
  article h2 { font-size: 1.28rem; }
  .header-nav a { display: none; }
  .index-hero { padding: 34px 0 4px; }
  .index-hero h1 { font-size: 1.85rem; }
}

@media print { .ad-slot, .site-header, .related, .filters { display: none; } }

/* ---------- Hero image (blog_src/build_images.py) ---------- */
.post-hero { margin: 26px 0 30px; }
.post-hero img {
  width: 100%; height: auto; display: block;
  aspect-ratio: 1200 / 630;          /* reserves space, so no layout shift */
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

@media (max-width: 640px) {
  .post-list li { flex-direction: column; gap: 12px; }
  .post-list .thumb { flex: none; width: 100%; }
  .post-hero { margin: 20px 0 24px; }
}
