/* RAG Tutorial styles. Scoped to the tutorial's own classes so it can sit inside the main site layout. */
:root {
  --rag-text: #1f2937;
  --rag-muted: #5b6472;
  --rag-border: #e2e6ec;
  --rag-bg: #ffffff;
  --rag-soft: #f5f7fa;
  --rag-accent: #1d5fbf;
  --rag-accent-soft: #e8f0fb;
  --rag-code-bg: #1e2430;
  --rag-note: #1d5fbf;
  --rag-tip: #16794a;
  --rag-warn: #b45309;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--rag-text);
  background: var(--rag-bg);
}
a { color: var(--rag-accent); }
a:hover { text-decoration: none; }

.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; }
.skip-link:focus { left: 8px; z-index: 10; }

/* Sample site header / footer */
.site-header { border-bottom: 1px solid var(--rag-border); background: #fff; }
.site-header-inner { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 24px; align-items: center; }
.site-logo { font-weight: 700; font-size: 20px; color: #b3261e; text-decoration: none; }
.site-nav a { margin-right: 16px; color: var(--rag-text); text-decoration: none; }
.site-footer { border-top: 1px solid var(--rag-border); margin-top: 48px; padding: 24px; text-align: center; color: var(--rag-muted); font-size: 14px; }

/* Layout */
.rag-layout { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; }
.rag-sidebar { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 24px 0; font-size: 15px; }
.sidebar-title { font-weight: 700; margin: 0 0 8px; color: var(--rag-muted); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; }
.rag-sidebar ol { list-style: none; padding: 0; margin: 0; }
.rag-sidebar li a { display: flex; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--rag-text); text-decoration: none; line-height: 1.35; }
.rag-sidebar li a:hover { background: var(--rag-soft); }
.rag-sidebar li a.active { background: var(--rag-accent-soft); color: var(--rag-accent); font-weight: 600; }
.rag-sidebar .num { flex: 0 0 22px; color: var(--rag-muted); font-variant-numeric: tabular-nums; }
.rag-content { min-width: 0; padding: 24px 0 40px; max-width: 860px; }

/* Lesson typography */
.breadcrumb { font-size: 14px; color: var(--rag-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--rag-muted); }
.breadcrumb span { margin: 0 4px; }
.lesson-meta { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--rag-accent); margin: 0 0 4px; }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 25px; line-height: 1.3; margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--rag-border); }
h3 { font-size: 20px; margin: 28px 0 8px; }
.lesson-lead { font-size: 19px; color: var(--rag-muted); margin: 0 0 24px; }
p, ul, ol { margin: 0 0 16px; }
li { margin-bottom: 6px; }
strong { font-weight: 650; }

/* Code */
:not(pre) > code { font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: .9em; background: var(--rag-soft); border: 1px solid var(--rag-border); border-radius: 4px; padding: 1px 5px; }
pre { position: relative; margin: 0 0 20px; border-radius: 8px; font-size: 14.5px; line-height: 1.55; }
pre[class*="language-"], pre { background: var(--rag-code-bg) !important; overflow-x: auto; padding: 16px 18px; }
pre code { font-family: Consolas, "Cascadia Mono", Menlo, monospace; color: #e6e9ef; }
.filename { font-family: Consolas, Menlo, monospace; font-size: 13px; background: #2b3343; color: #cfd6e4; padding: 6px 14px; border-radius: 8px 8px 0 0; margin-top: 8px; }
.filename + pre { border-top-left-radius: 0; border-top-right-radius: 0; }
.copy-btn { position: absolute; top: 8px; right: 8px; font-size: 12px; padding: 3px 10px; border: 1px solid #4b5568; border-radius: 4px; background: #2b3343; color: #cfd6e4; cursor: pointer; opacity: .8; }
.copy-btn:hover, .copy-btn:focus { opacity: 1; }
/* Output blocks: light box with dark text. Prism adds a language-* class to the <pre> when the page loads,
   so these selectors must be more specific than pre[class*="language-"] above. */
pre.output, pre.output[class*="language-"] { background: var(--rag-soft) !important; border: 1px solid var(--rag-border); }
pre.output code, pre.output code[class*="language-"], pre.output code .token { color: var(--rag-text) !important; background: none !important; text-shadow: none !important; }

/* Figures */
figure { margin: 24px 0 28px; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--rag-border); border-radius: 8px; background: #fff; }
figcaption { font-size: 14px; color: var(--rag-muted); margin-top: 8px; text-align: center; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { border: 1px solid var(--rag-border); padding: 8px 12px; text-align: left; vertical-align: top; }
th { background: var(--rag-soft); font-weight: 650; }

/* Callouts */
.callout { border-left: 4px solid var(--rag-note); background: var(--rag-accent-soft); padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 0 0 20px; }
.callout > :last-child { margin-bottom: 0; }
.callout.tip { border-color: var(--rag-tip); background: #e9f6ef; }
.callout.warning { border-color: var(--rag-warn); background: #fdf3e5; }
.callout-title { font-weight: 700; display: block; margin-bottom: 4px; }

.takeaways { background: var(--rag-soft); border: 1px solid var(--rag-border); border-radius: 8px; padding: 16px 20px; margin: 32px 0 0; }
.takeaways h2 { border: 0; margin-top: 0; padding-top: 0; font-size: 20px; }
.takeaways ul { margin-bottom: 0; }

/* Glossary */
.glossary dt { font-weight: 700; margin-top: 14px; }
.glossary dd { margin: 2px 0 0; color: var(--rag-text); }

/* Pager and module list */
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 40px 0 24px; }
.pager a { flex: 1 1 0; border: 1px solid var(--rag-border); border-radius: 8px; padding: 12px 16px; text-decoration: none; color: var(--rag-text); line-height: 1.35; }
.pager a:hover { border-color: var(--rag-accent); }
.pager a small { display: block; color: var(--rag-muted); font-size: 13px; margin-bottom: 2px; }
.pager .next { text-align: right; margin-left: auto; }
.in-module { border-top: 1px solid var(--rag-border); padding-top: 16px; font-size: 15px; }
.in-module h2 { font-size: 17px; border: 0; margin: 0 0 8px; padding: 0; }
.in-module ol { list-style: none; counter-reset: lesson; margin: 0; padding: 0; max-width: 640px; }
.in-module li { counter-increment: lesson; margin: 0; }
.in-module li a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--rag-text); text-decoration: none; line-height: 1.35; }
.in-module li a::before { content: counter(lesson); flex: 0 0 20px; color: var(--rag-muted); font-variant-numeric: tabular-nums; }
.in-module li a:hover { background: var(--rag-soft); color: var(--rag-accent); }
.in-module li.current a { background: var(--rag-accent-soft); color: var(--rag-accent); font-weight: 600; }
.in-module li.current a::before { color: var(--rag-accent); }

.lesson-list { list-style: none; padding: 0; }
.lesson-list a { display: grid; grid-template-columns: 36px 1fr; column-gap: 8px; padding: 14px 16px; border: 1px solid var(--rag-border); border-radius: 8px; margin-bottom: 10px; text-decoration: none; color: var(--rag-text); }
.lesson-list a:hover { border-color: var(--rag-accent); }
.lesson-list .num { grid-row: span 2; font-weight: 700; color: var(--rag-accent); font-size: 20px; }
.lesson-list .t { font-weight: 650; }
.lesson-list .d { color: var(--rag-muted); font-size: 15px; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.module-card { border: 1px solid var(--rag-border); border-radius: 10px; padding: 16px 18px; }
.module-card h2 { border: 0; margin: 0 0 6px; padding: 0; font-size: 20px; }
.module-card h2 a { color: var(--rag-text); text-decoration: none; }
.module-card p { color: var(--rag-muted); font-size: 15px; }
.module-card ul { font-size: 15px; padding-left: 18px; margin: 0; }

@media (max-width: 900px) {
  .rag-layout { grid-template-columns: 1fr; gap: 0; }
  .rag-sidebar { position: static; max-height: none; border-bottom: 1px solid var(--rag-border); }
  .rag-sidebar ol { columns: 2; }
  h1 { font-size: 28px; }
  .pager { flex-direction: column; }
  .pager .next { text-align: left; margin-left: 0; }
}

/* ---- Home page: hero ---- */
.home-hero { margin: 0 0 8px; }
.home-hero h1 { margin-top: 4px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 24px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; background: var(--rag-accent); color: #fff; font-weight: 600; text-decoration: none; border: 1px solid var(--rag-accent); }
.btn:hover { background: #174e9e; }
.btn-secondary { background: #fff; color: var(--rag-accent); }
.btn-secondary:hover { background: var(--rag-accent-soft); }
.hero-image { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--rag-border); box-shadow: 0 6px 24px rgba(30, 58, 138, .08); }

/* ---- Home page: latest tutorials ---- */
.tut-list { display: flex; flex-direction: column; }
.tut-card { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--rag-border); }
.tut-card:last-child { border-bottom: 0; }
.tut-thumb img { display: block; width: 150px; height: auto; border-radius: 6px; border: 1px solid var(--rag-border); background: #fff; }
.tut-body h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.35; font-style: italic; font-weight: 500; }
.tut-body h3 a { color: var(--rag-text); text-decoration: none; }
.tut-body h3 a:hover { color: var(--rag-accent); text-decoration: underline; }
.tut-body p { margin: 0 0 10px; color: #374151; font-size: 16px; }
.tut-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 !important; }
.tut-module { font-size: 13px; color: var(--rag-muted); }
.updated { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border: 1px solid #c7d7f2; border-radius: 999px; color: var(--rag-accent); font-size: 14px; font-weight: 600; font-style: italic; background: #fff; }
.updated em { font-style: italic; }
.updated .cal { flex: 0 0 auto; }

@media (max-width: 640px) {
  .tut-card { grid-template-columns: 96px 1fr; gap: 14px; }
  .tut-thumb img { width: 96px; }
  .tut-body h3 { font-size: 18px; }
  .tut-body p { font-size: 15px; }
}

/* ---- Home page: learning paths ---- */
.path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 16px 0; }
.path-card { display: flex; flex-direction: column; border: 1px solid var(--rag-border); border-top: 5px solid var(--rag-accent); border-radius: 10px; padding: 18px 20px; background: #fff; }
.path-card.path-beginner { border-top-color: var(--rag-tip); }
.path-card.path-intermediate { border-top-color: var(--rag-accent); }
.path-card.path-advanced { border-top-color: #6d28d9; }
.path-level { margin: 0 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rag-muted); }
.path-card h3 { margin: 0 0 8px; font-size: 20px; }
.path-card > p { color: #374151; font-size: 15px; margin: 0 0 10px; }
.path-card ol { margin: 0 0 12px; padding-left: 22px; font-size: 15px; }
.path-card li { margin: 3px 0; }
.path-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--rag-soft); color: var(--rag-muted); font-size: 12px; text-align: center; }
.path-card .path-outcome { background: var(--rag-soft); border-radius: 6px; padding: 8px 10px; font-size: 14px; }
.path-card .btn { margin-top: auto; align-self: flex-start; padding: 8px 16px; font-size: 15px; }
.path-reference { color: var(--rag-muted); font-size: 15px; }

/* ---- Lesson pages: enhanced top section (lessons with a hero image) ---- */
.lesson-top { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: center; margin: 0 0 20px; }
.lesson-thumb { display: block; width: 150px; height: auto; border-radius: 6px; border: 1px solid var(--rag-border); background: #fff; }
.lesson-top h1 { font-style: italic; font-weight: 500; margin: 2px 0 8px; }
.lesson-top .lesson-lead { margin: 0 0 12px; color: #374151; font-size: 18px; }
.lesson-hero { margin: 0 0 28px; }
.lesson-hero img { border-radius: 14px; box-shadow: 0 6px 24px rgba(30, 58, 138, .08); }
@media (max-width: 640px) {
  .lesson-top { grid-template-columns: 1fr; gap: 12px; }
  .lesson-thumb { width: 120px; }
}

/* ---- Authors ---- */
.byline { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--rag-muted); }
.byline img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.byline a { font-weight: 600; color: var(--rag-text); text-decoration: none; }
.byline a:hover { color: var(--rag-accent); text-decoration: underline; }
.author-box { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: start; margin: 40px 0 8px; padding: 20px 22px; border: 1px solid var(--rag-border); border-radius: 12px; background: var(--rag-soft); }
.author-box img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; }
.author-box p { margin: 0 0 8px; font-size: 15px; color: #374151; }
.author-label { font-size: 12px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--rag-muted) !important; margin-bottom: 2px !important; }
.author-name { font-size: 20px !important; font-weight: 700; margin-bottom: 0 !important; }
.author-name a { color: var(--rag-text); text-decoration: none; }
.author-name a:hover { color: var(--rag-accent); }
.author-role { color: var(--rag-muted) !important; font-size: 14px !important; }
.author-link { font-weight: 600; font-size: 15px; text-decoration: none; }
.author-link:hover { text-decoration: underline; }
.author-header { display: flex; align-items: center; gap: 24px; margin: 0 0 20px; }
.author-header img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.author-header h1 { margin: 2px 0 4px; }
@media (max-width: 640px) {
  .author-box { grid-template-columns: 64px 1fr; gap: 14px; }
  .author-box img { width: 64px; height: 64px; }
  .author-header { flex-direction: column; align-items: flex-start; }
}

/* ---- Provider tabs (OpenAI | Anthropic | Ollama) ---- */
.provider-tabs { border: 1px solid var(--rag-border); border-radius: 10px; margin: 0 0 22px; background: #fff; }
.provider-tab { padding: 4px 16px 2px; }
.provider-tab > :last-child { margin-bottom: 14px; }
/* Without JavaScript every panel is shown with its label as a heading. */
.provider-tab::before { content: attr(data-label); display: block; margin: 10px 0 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rag-accent); }
.provider-tabs.tabs-ready .provider-tab::before { content: none; }
.provider-tablist { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--rag-border); background: var(--rag-soft); border-radius: 10px 10px 0 0; }
.provider-tablist button { font: inherit; font-size: 14px; font-weight: 600; padding: 7px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--rag-muted); cursor: pointer; margin-bottom: -1px; }
.provider-tablist button:hover { color: var(--rag-accent); }
.provider-tablist button[aria-selected="true"] { background: #fff; color: var(--rag-accent); border-color: var(--rag-border); }
.provider-tablist button:focus-visible { outline: 2px solid var(--rag-accent); outline-offset: 1px; }
.provider-tab[hidden] { display: none; }

/* ---- "Written for" version note ---- */
.version-note { font-size: 14px; color: var(--rag-muted); background: var(--rag-soft); border: 1px solid var(--rag-border); border-radius: 8px; padding: 8px 12px; margin: 0 0 24px; }
.version-note strong { color: var(--rag-text); }

/* ---- Learning path colour for professional level ---- */
.path-card.path-professional { border-top-color: #b45309; }

/* ---- "Try it yourself" box ---- */
.try-it { border: 1px solid #c6e6d4; background: #f3faf6; border-radius: 10px; padding: 14px 18px; margin: 24px 0; }
.try-it h2, .try-it h3 { border: 0; margin-top: 0; padding-top: 0; font-size: 19px; color: var(--rag-tip); }
