/* DobieCore Learn — course styles. Tokens mirror bluedobiedev.com (design-tokens.css). */

@font-face { font-family: "Instrument Serif"; src: url("../fonts/InstrumentSerif-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-VariableFont.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --navy: #042d4d;
  --navy-hover: #06396b;
  --cream: #fff6ec;
  --ink: #0e1726;
  --white: #fff;
  --gray-50: #f8f9fa;
  --gray-100: #f5f5f5;
  --gray-200: #e0e0e0;
  --gray-500: #999;
  --gray-700: #555;
  --green: #1f7a4d;
  --green-bg: #e8f5ee;
  --red: #b3261e;
  --red-bg: #fdecea;
  --tip-bg: #eef4fa;
  --font-heading: "Instrument Serif", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(14, 23, 38, .06), 0 4px 16px rgba(14, 23, 38, .06);
  --sidebar-w: 300px;
  --content-w: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.65; color: var(--ink); background: var(--white); }
img { max-width: 100%; height: auto; }
a { color: var(--navy); }
a:hover { color: var(--navy-hover); }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); font-family: var(--font-body); font-weight: 600; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: .35em; }
blockquote { margin: 1em 0; padding: .75em 1.1em; border-left: 3px solid var(--gray-200); background: var(--gray-50); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95em; }
th, td { border: 1px solid var(--gray-200); padding: .55em .75em; text-align: left; vertical-align: top; }
th { background: var(--gray-50); font-weight: 600; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: var(--gray-700); margin-bottom: .5em; }
.eyebrow a { color: inherit; text-decoration: none; }
.lede { font-size: 1.2rem; color: var(--gray-700); max-width: 62ch; }
.container { width: min(100% - 2rem, 1100px); margin-inline: auto; }

/* Buttons */
.btn { display: inline-block; padding: .7em 1.3em; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background .15s, color .15s, border-color .15s; font-family: inherit; }
.btn--primary { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn--primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); color: var(--white); }
.btn--secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--secondary:hover { background: var(--navy); color: var(--white); }
.btn.is-done, .btn.is-done:hover { background: var(--green); border-color: var(--green); color: var(--white); }
.btn[hidden] { display: none; }

/* Header / footer */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--white); border-bottom: 1px solid var(--gray-200); }
.site-header__inner { width: min(100% - 2rem, 1240px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); white-space: nowrap; padding: .6rem 0; }
.brand img { border-radius: 50%; }
.brand__name { font-family: var(--font-heading); font-size: 1.35rem; }
.brand__name em { font-style: italic; color: var(--navy); }
.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.site-nav a { padding: .45em .8em; border-radius: 999px; text-decoration: none; font-size: .92rem; font-weight: 500; color: var(--gray-700); }
.site-nav a:hover { background: var(--gray-100); color: var(--ink); }
.site-nav a[aria-current] { background: var(--cream); color: var(--navy); }
.site-nav__account { margin-left: .5rem; border: 1px solid var(--gray-200); }
@media (max-width: 700px) {
  .site-header__inner { min-height: 0; }
  .site-nav { flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .6rem; margin-top: -.3rem; }
  .site-nav a { white-space: nowrap; }
  .site-nav__account { margin-left: auto; }
}
.site-footer { margin-top: 4rem; padding: 2rem 1rem; border-top: 1px solid var(--gray-200); text-align: center; font-size: .9rem; color: var(--gray-700); }
.site-footer__fine { font-size: .8rem; color: var(--gray-500); max-width: 70ch; margin-inline: auto; }
.crumbs { font-size: .85rem; color: var(--gray-500); margin: 1.25rem 0; }
.crumbs a { color: var(--gray-700); text-decoration: none; }

/* Progress */
.progress { display: grid; gap: .4rem; margin: 1rem 0; }
.progress__bar { height: 10px; background: var(--gray-200); border-radius: 999px; overflow: hidden; }
.progress__fill { display: block; height: 100%; width: 0; background: var(--navy); border-radius: 999px; transition: width .4s ease; }
.progress.is-complete .progress__fill { background: var(--green); }
.progress__label { font-size: .85rem; color: var(--gray-700); }

/* Dashboard */
.course-hero { padding: 3rem 0 1.5rem; max-width: 760px; }
.module-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin: 1.5rem 0 3rem; }
.module-card { display: block; padding: 1.5rem; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--white); text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.module-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(14, 23, 38, .1); color: inherit; }
.module-card h2 { color: var(--navy); }
.module-card__meta { font-size: .85rem; color: var(--gray-500); }
.module-card.is-locked { opacity: .6; }

/* Module page */
.module-hero { padding: 1rem 0 1.5rem; max-width: 760px; border-bottom: 1px solid var(--gray-200); }
.module-body { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); padding: 2rem 0; }
@media (max-width: 820px) { .module-body { grid-template-columns: 1fr; } }

/* Lesson list */
.lesson-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.lesson-list__item a { display: grid; grid-template-columns: 22px auto 1fr; gap: .6rem; align-items: baseline; padding: .6rem .75rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.lesson-list__item a:hover { background: var(--gray-100); }
.lesson-list__item.is-current a { background: var(--cream); color: var(--navy); font-weight: 600; }
.lesson-list__check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--gray-200); display: inline-block; position: relative; top: 3px; }
.lesson-list__item.is-complete .lesson-list__check { border-color: var(--green); background: var(--green); }
.lesson-list__item.is-complete .lesson-list__check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lesson-list__num { font-variant-numeric: tabular-nums; color: var(--gray-500); font-size: .85em; }
.lesson-list__item.is-current .lesson-list__num { color: var(--navy); }

/* Lesson shell */
.lesson-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 0; min-height: 70vh; }
.lesson-sidebar { border-right: 1px solid var(--gray-200); padding: 1.5rem 1rem 2rem 1.25rem; position: sticky; top: 60px; max-height: calc(100vh - 60px); overflow-y: auto; background: var(--gray-50); }
.lesson-sidebar__head { padding: 0 .75rem .75rem; }
.lesson-sidebar__head h2 { font-size: 1.5rem; }
.sidebar-toggle { display: none; }
.lesson { width: min(100% - 2rem, var(--content-w)); margin-inline: auto; padding-bottom: 3rem; }
.lesson__head { margin: 0 0 1.5rem; }
.lesson__status { color: var(--green); font-weight: 600; margin: 0; }
.lesson-video { margin: 0 0 2rem; background: var(--ink); border-radius: var(--radius); overflow: hidden; }
.lesson-video iframe, .lesson-video video { width: 100%; border: 0; display: block; }
.lesson-video:not(.is-portrait) { aspect-ratio: 16 / 9; }
.lesson-video:not(.is-portrait) iframe, .lesson-video:not(.is-portrait) video { height: 100%; }
.lesson-video.is-portrait { max-width: 360px; }
.lesson-video.is-portrait video { aspect-ratio: 9 / 16; }
.lesson-video figcaption { padding: .6rem 1rem; background: var(--gray-50); color: var(--gray-700); font-size: .85rem; }
.course-hero .lesson-video { margin: 1.5rem 0 0; }

@media (max-width: 960px) {
  .lesson-shell { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--gray-200); display: none; }
  .lesson-sidebar.is-open { display: block; }
  .sidebar-toggle { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .8rem 1rem; border: 0; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; text-align: left; }
  .sidebar-toggle span { width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
}

/* Lesson sections — classes come from the section header (ls-purpose, ls-dobie-tip, …) */
.ls { margin: 0 0 2rem; }
.ls h2 { font-size: 1.55rem; margin-bottom: .6rem; padding-top: .5rem; }
.ls-purpose, .ls-why-this-matters { }
.ls-use-this-when, .ls-before-you-start { }

.ls-conversation-prompt { position: relative; background: var(--cream); border: 1px solid #f3dfc7; border-radius: var(--radius); padding: 1.25rem 1.5rem 1.5rem; }
.ls-conversation-prompt h2::before { content: "💬 "; }
.ls-conversation-prompt .prompt-copy { position: absolute; top: 1.1rem; right: 1.1rem; }
.ls-conversation-prompt .prompt-copy.is-copied { background: var(--green); border-color: var(--green); color: #fff; }
@media (max-width: 600px) { .ls-conversation-prompt .prompt-copy { position: static; margin-bottom: 1rem; } }

.ls-dobie-tip { background: var(--tip-bg); border-left: 4px solid var(--navy); border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.5rem 1.25rem; }
.ls-dobie-tip h2::before { content: "🐾 "; }
.ls-dobie-tip h3 { margin-top: 1.25rem; }

.ls-follow-up-questions li { font-style: italic; }

.ls-expected-result ul, .ls-every-lesson-includes ul { list-style: none; padding-left: 0; }
.ls-expected-result li, .ls-every-lesson-includes li { padding-left: 1.6em; text-indent: -1.6em; }

.ls-save-this { border: 2px solid var(--red); border-radius: var(--radius); padding: 1.25rem 1.5rem 1.5rem; background: #fff; }
.ls-save-this h2::before { content: "🛑 "; }
.ls-save-this h3 { margin-top: .25rem; color: var(--navy); font-family: var(--font-heading); font-weight: 400; font-size: 1.4rem; }
.ls-save-this .assignment-note { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px dashed var(--gray-200); font-size: .9rem; color: var(--gray-700); }

.ls-common-mistakes ul { list-style: none; padding-left: 0; }
.ls-common-mistakes li { padding-left: 1.6em; text-indent: -1.6em; }

.ls-coming-up-next { border-top: 1px solid var(--gray-200); padding-top: 1.25rem; color: var(--gray-700); }
.ls-coming-up-next h2 { font-size: 1.2rem; font-family: var(--font-body); font-weight: 600; }

/* Quiz */
.ls-quiz { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.quiz__q { border: 0; padding: 0; margin: 0 0 1.25rem; }
.quiz__q legend { font-weight: 600; margin-bottom: .5rem; }
.quiz__q label { display: block; padding: .35rem .5rem; border-radius: 6px; cursor: pointer; }
.quiz__q label:hover { background: var(--gray-50); }
.quiz__q.is-correct { background: var(--green-bg); border-radius: 8px; padding: .5rem; }
.quiz__q.is-wrong { background: var(--red-bg); border-radius: 8px; padding: .5rem; }
.quiz__feedback { font-size: .9rem; margin: .5rem 0 0; }

/* Lesson footer */
.lesson__foot { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); display: grid; gap: 1.5rem; }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lesson-nav a { display: block; padding: .9rem 1rem; border: 1px solid var(--gray-200); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 500; }
.lesson-nav a:hover { border-color: var(--navy); }
.lesson-nav a small { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gray-500); margin-bottom: .2rem; }
.lesson-nav__next { text-align: right; }
@media (max-width: 600px) { .lesson-nav { grid-template-columns: 1fr; } .lesson-nav__next { text-align: left; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
