/* =========================================================
   CodeRunner — guides, about, contact, privacy, terms
   (loaded after style.css)
   ========================================================= */

.content-page main { padding: 2.2rem 0 4rem; }

.crumbs { display: flex; flex-wrap: wrap; gap: .45rem; font-family: "JetBrains Mono", monospace; font-size: .8rem; color: var(--muted); margin-bottom: 1.4rem; }
.crumbs a:hover { color: var(--accent); }

/* ---------- Page hero (guides index) ---------- */
.page-hero { max-width: 48rem; padding: 1.5rem 0 1.5rem; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.topic-chips { flex-wrap: wrap; margin-top: 1.4rem; }
.start-here {
  padding: 1rem 1.2rem; border-radius: 14px; margin: .5rem 0 2.5rem;
  background: var(--accent-soft); border: 1px solid var(--border-strong);
}
.start-here a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.topic-block { margin-bottom: 3rem; scroll-margin-top: 90px; }
.topic-block h2 { font-size: 1.5rem; font-family: "JetBrains Mono", monospace; }

/* ---------- Guide cards ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.guide-card {
  display: flex; flex-direction: column; padding: 1.4rem; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.guide-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.guide-top { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; font-family: "JetBrains Mono", monospace; font-size: .78rem; color: var(--muted); }
.guide-icon { min-width: 34px; height: 34px; padding: 0 .4rem; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-strong); font-weight: 700; }
.guide-topic { color: var(--orange); }
.guide-time { margin-left: auto; }
.guide-card h3 { font-size: 1.08rem; line-height: 1.35; margin-bottom: .5rem; }
.guide-card p { color: var(--muted); font-size: .92rem; margin: 0 0 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.guide-more { margin-top: auto; font-weight: 600; color: var(--accent); font-size: .9rem; }

/* ---------- Article layout ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 3rem; align-items: start; }
.narrow-page { max-width: 820px; }
.article { min-width: 0; }
.article-head { margin-bottom: 2rem; }
.article-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.12; }
.article-lead { font-size: 1.15rem; color: var(--muted); }
.article-meta { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-family: "JetBrains Mono", monospace; font-size: .8rem; color: var(--muted); }
.article-meta li + li::before { content: "·"; margin-right: 1.2rem; color: var(--border-strong); }
.article-meta a { color: var(--accent); }

.article-side { position: sticky; top: 96px; }
.toc { padding: 1.2rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.toc-title { font-family: "JetBrains Mono", monospace; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--orange); margin-bottom: .7rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.toc a { display: block; padding: .35rem .6rem; border-radius: 8px; font-size: .88rem; color: var(--muted); border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); background: var(--surface-2); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }

/* ---------- Prose ---------- */
.prose { font-size: 1.06rem; line-height: 1.75; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 + *, .prose h3 + * { margin-top: .7rem; }
.prose h2 { font-size: 1.6rem; margin: 2.6rem 0 .2rem; scroll-margin-top: 90px; padding-top: .4rem; }
.prose h3 { font-size: 1.2rem; margin: 1.8rem 0 0; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0; }
.prose li + li { margin-top: .4rem; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); }
.prose :not(pre) > code {
  font-size: .88em; padding: .12em .4em; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--orange);
}
.prose blockquote {
  margin: 1.4rem 0 0; padding: 1rem 1.2rem; border-radius: 14px;
  background: var(--orange-soft); border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent);
  border-left: 4px solid var(--orange);
}
.prose blockquote p { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.prose th, .prose td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* Code blocks (always dark, like a terminal) */
.code-block { border-radius: 14px; overflow: hidden; border: 1px solid rgba(0, 255, 157, .18); background: #0b1118; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: .45rem .5rem .45rem 1rem; background: #0f1821; border-bottom: 1px solid rgba(0, 255, 157, .12); font-family: "JetBrains Mono", monospace; font-size: .72rem; color: #6f8a7e; text-transform: uppercase; letter-spacing: .06em; }
.copy-btn { border: 1px solid rgba(0, 255, 157, .3); background: transparent; color: #00ff9d; border-radius: 7px; padding: .2rem .6rem; font-size: .72rem; font-family: "JetBrains Mono", monospace; text-transform: none; letter-spacing: 0; }
.copy-btn:hover, .copy-btn.ok { background: rgba(0, 255, 157, .12); }
.code-block .highlight { background: transparent !important; margin: 0; }
.code-block pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font-size: .9rem; line-height: 1.65; color: #e6edf3; }
.code-block pre code { font-family: "JetBrains Mono", monospace; }

/* ---------- CTA boxes, pager, related ---------- */
.cta-box { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; margin-top: 2.5rem; padding: 1.3rem 1.4rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border-strong); }
.cta-box + .cta-box { margin-top: 1rem; }
.cta-box p { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; }
.cta-box.pq { border-color: rgba(139, 92, 246, .45); background: radial-gradient(400px 200px at 100% 0%, rgba(139, 92, 246, .18), transparent 70%), var(--surface); }
.cta-box.pq .btn-primary { background: linear-gradient(135deg, #8b5cf6, #14b8a6); color: #fff; box-shadow: 0 10px 30px -10px #8b5cf6; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.pager a { padding: 1rem 1.2rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: border-color .2s; }
.pager a:hover { border-color: var(--accent); }
.pager span { display: block; font-family: "JetBrains Mono", monospace; font-size: .75rem; color: var(--muted); }
.pager strong { display: block; margin-top: .2rem; font-size: .95rem; line-height: 1.35; }
.pager .next { text-align: right; }

.related { margin-top: 4rem; }
.related h2 { font-size: 1.6rem; }

/* Footer with four columns */
.footer-grid-4 { grid-template-columns: 2fr 1fr 1fr 1fr; }

/* Home page "Beginner guides" section */
.guides-home .section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; max-width: none; }
.guides-home .section-head > div { max-width: 40rem; }

@media (max-width: 980px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-side { display: none; }
}
@media (max-width: 900px) {
  .footer-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .prose { font-size: 1rem; }
  .code-block pre { font-size: .82rem; }
  .footer-grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ---------- Video pages ---------- */
.video-embed, .video-frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; border: 1px solid var(--border-strong); background: #000; padding: 0; box-shadow: var(--shadow); }
.video-embed img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s; opacity: .9; }
.video-embed:hover img { transform: scale(1.03); opacity: 1; }
.video-embed .play, .video-thumb .play { position: absolute; inset: 0; margin: auto; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #00ff9d; border: 1px solid rgba(0, 255, 157, .6); transition: transform .25s, background .25s; }
.video-embed:hover .play { transform: scale(1.08); background: #00ff9d; color: #04140d; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-alt { margin: .7rem 0 2rem; font-size: .88rem; }
.video-alt a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.video-card { padding: 0; overflow: hidden; }
.video-card h3, .video-card p, .video-card .guide-more { margin-left: 1.3rem; margin-right: 1.3rem; }
.video-card .guide-more { margin-bottom: 1.3rem; }
.video-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); margin-bottom: 1rem; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .play { width: 52px; height: 52px; }
