/* ============================================================
   The Local SEO Operator Course - stylesheet
   Clean, friendly, readable. Designed for a beginner reading
   daily in a browser. Works from file:// (double-click).
   ============================================================ */

:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #1f2733;
  --ink-soft: #4a5666;
  --ink-faint: #8a95a3;
  --line: #e6e9ef;
  --brand: #2f6df6;
  --brand-dark: #1f4fc4;
  --brand-wash: #eef3ff;
  --sidebar: #131a26;
  --sidebar-ink: #c4ccd8;
  --sidebar-ink-soft: #7e8a9c;
  --sidebar-active: #2f6df6;

  --concept: #2f6df6;
  --concept-wash: #eef3ff;
  --howwe: #7a4ddb;
  --howwe-wash: #f2edfd;
  --tip: #14a06a;
  --tip-wash: #e8f7f0;
  --warn: #d98a00;
  --warn-wash: #fdf4e3;
  --danger: #d6453d;
  --danger-wash: #fdecea;
  --task: #0e7c86;
  --task-wash: #e6f6f7;

  --radius: 12px;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 6px 24px rgba(16,24,40,.05);
  --maxread: 820px;
  --sidebar-w: 312px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  color: var(--sidebar-ink);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 0 60px;
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  padding: 44px 40px 120px;
}

.reading { width: 100%; max-width: var(--maxread); }

/* ---------- Sidebar ---------- */
.sb-brand {
  padding: 4px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 12px;
}
.sb-brand a { text-decoration: none; color: #fff; }
.sb-brand .logo {
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); font-weight: 700;
}
.sb-brand .title { font-size: 18px; font-weight: 700; color: #fff; line-height: 1.3; margin-top: 3px; }
.sb-progress-wrap { padding: 0 22px 16px; }
.sb-progress-label { font-size: 12px; color: var(--sidebar-ink-soft); display:flex; justify-content:space-between; margin-bottom:6px; }
.sb-bar { height: 7px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; }
.sb-bar > span { display:block; height:100%; background: var(--brand); width:0; transition: width .4s ease; }

.sb-nav { list-style: none; margin: 0; padding: 0; }
.sb-mod { margin: 2px 0; }
.sb-mod > a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 22px; color: var(--sidebar-ink);
  text-decoration: none; font-size: 14.5px; font-weight: 600;
  border-left: 3px solid transparent;
}
.sb-mod > a:hover { background: rgba(255,255,255,.04); color: #fff; }
.sb-mod > a.active { background: rgba(47,109,246,.14); color: #fff; border-left-color: var(--sidebar-active); }
.sb-mod .num {
  flex: 0 0 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.07); color: var(--sidebar-ink);
}
.sb-mod > a.active .num { background: var(--brand); color: #fff; }
.sb-mod .check { margin-left: auto; color: var(--tip); font-size: 14px; opacity: 0; }
.sb-mod.done .check { opacity: 1; }
.sb-mod.done .num { background: rgba(20,160,106,.2); color: #4fd39a; }

.sb-section-label {
  padding: 16px 22px 6px; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sidebar-ink-soft); font-weight: 700;
}

/* ---------- Mobile nav ---------- */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 30;
  background: var(--sidebar); color: #fff;
  padding: 12px 16px; align-items: center; gap: 12px;
}
.topbar button {
  background: rgba(255,255,255,.1); color: #fff; border: 0;
  font-size: 20px; width: 40px; height: 40px; border-radius: 8px; cursor: pointer;
}
.topbar .t-title { font-weight: 700; font-size: 15px; }

/* ---------- Typography ---------- */
.reading h1 { font-size: 33px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.01em; }
.reading h2 { font-size: 24px; margin: 42px 0 12px; padding-top: 8px; letter-spacing: -.01em; }
.reading h3 { font-size: 19px; margin: 30px 0 8px; }
.reading p { margin: 0 0 16px; color: var(--ink); }
.reading ul, .reading ol { margin: 0 0 18px; padding-left: 24px; }
.reading li { margin: 7px 0; }
.reading a { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.reading strong { color: #10182a; }
.lead { font-size: 19px; color: var(--ink-soft); margin: 8px 0 26px; }
.kicker { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); font-weight: 700; }
.eyebrow-row { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom: 6px; }
.minutes { font-size: 13px; color: var(--ink-faint); background: var(--panel); border:1px solid var(--line); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }

hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

code, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: .9em; background: #eef1f6; padding: 1px 6px; border-radius: 5px; color: #344; }

/* ---------- Callout boxes ---------- */
.box {
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-faint);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 22px 0;
  box-shadow: var(--shadow);
}
.box .box-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  margin-bottom: 7px;
}
.box p:last-child, .box ul:last-child, .box ol:last-child { margin-bottom: 0; }
.box .ico { font-size: 15px; }

.box.concept { border-left-color: var(--concept); background: var(--concept-wash); }
.box.concept .box-label { color: var(--concept); }
.box.howwe { border-left-color: var(--howwe); background: var(--howwe-wash); }
.box.howwe .box-label { color: var(--howwe); }
.box.tip { border-left-color: var(--tip); background: var(--tip-wash); }
.box.tip .box-label { color: var(--tip); }
.box.warn { border-left-color: var(--warn); background: var(--warn-wash); }
.box.warn .box-label { color: #9a6400; }
.box.danger { border-left-color: var(--danger); background: var(--danger-wash); }
.box.danger .box-label { color: var(--danger); }
.box.task { border-left-color: var(--task); background: var(--task-wash); }
.box.task .box-label { color: var(--task); }

/* example / definition */
.example { background:#fbfcfe; border:1px solid var(--line); border-radius: var(--radius); padding: 4px 18px; margin: 20px 0; }
.example .ex-tag { font-size:12px; font-weight:700; color: var(--ink-faint); text-transform:uppercase; letter-spacing:.08em; margin-top:14px; }

/* good / bad columns */
.gb { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
.gb .col { border-radius: var(--radius); padding: 14px 16px; border:1px solid var(--line); }
.gb .col h4 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing:.05em; }
.gb .good { background: var(--tip-wash); border-color: #bfe6d4; }
.gb .good h4 { color: var(--tip); }
.gb .bad { background: var(--danger-wash); border-color: #f3c8c4; }
.gb .bad h4 { color: var(--danger); }
.gb .col ul { padding-left: 18px; margin: 0; }
@media (max-width: 640px){ .gb { grid-template-columns: 1fr; } }

/* tables */
.tbl { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15.5px; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl th, .tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: #f0f3f8; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.tbl tr:last-child td { border-bottom: 0; }

/* key terms */
.term { font-weight: 700; color: var(--brand-dark); border-bottom: 1px dotted var(--brand); cursor: help; }

/* ---------- Quiz ---------- */
.quiz { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 24px; margin: 30px 0; box-shadow: var(--shadow); }
.quiz h3 { margin: 0 0 4px; display:flex; align-items:center; gap:8px; }
.quiz .quiz-sub { color: var(--ink-faint); font-size:14px; margin: 0 0 18px; }
.q { margin: 0 0 18px; padding: 0 0 16px; border-bottom: 1px dashed var(--line); }
.q:last-of-type { border-bottom: 0; }
.q .q-text { font-weight: 600; margin-bottom: 10px; }
.q .opt {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: #fcfdff; border-radius: 9px;
  padding: 10px 14px; margin: 7px 0; font: inherit; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.q .opt:hover { border-color: var(--brand); }
.q .opt.sel { border-color: var(--brand); background: var(--brand-wash); }
.q .opt.correct { border-color: var(--tip); background: var(--tip-wash); }
.q .opt.wrong { border-color: var(--danger); background: var(--danger-wash); }
.q .opt .mk { float: right; font-weight: 800; }
.q .explain { display:none; margin-top: 8px; font-size: 14.5px; color: var(--ink-soft); background: #f5f7fb; border-radius: 8px; padding: 9px 12px; border-left: 3px solid var(--brand); }
.q.answered .explain { display: block; }
.quiz-actions { display:flex; align-items:center; gap:14px; margin-top: 6px; }
.quiz-score { font-weight: 700; }

/* ---------- Buttons ---------- */
.btn { display:inline-flex; align-items:center; gap:8px; cursor:pointer; border:0; border-radius: 9px; font: inherit; font-weight: 600; padding: 11px 18px; text-decoration: none; }
.btn.primary { background: var(--brand); color:#fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: var(--panel); color: var(--ink); border:1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn.done-btn.is-done { background: var(--tip); color:#fff; }

/* ---------- Pager ---------- */
.pager { display:flex; justify-content: space-between; gap: 16px; margin-top: 50px; padding-top: 26px; border-top: 1px solid var(--line); }
.pager a { flex: 1; text-decoration:none; border:1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: var(--panel); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.pager a:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.pager a.next { text-align: right; }
.pager .dir { font-size:12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing:.08em; }
.pager .lbl { font-weight: 700; color: var(--brand-dark); }
.pager a.disabled { opacity: .4; pointer-events: none; }

.mark-done-row { display:flex; align-items:center; gap:14px; margin: 40px 0 0; padding: 18px; background: var(--brand-wash); border:1px solid #d6e2ff; border-radius: var(--radius); }
.mark-done-row .md-text { font-size: 14.5px; color: var(--ink-soft); }

/* ---------- Dashboard (index) ---------- */
.hero { background: linear-gradient(135deg, #1b2536, #243756); color:#fff; border-radius: 18px; padding: 40px 40px 38px; margin-bottom: 30px; }
.hero .logo { color: #7fa6ff; font-weight:700; letter-spacing:.14em; text-transform:uppercase; font-size:13px; }
.hero h1 { font-size: 38px; margin: 8px 0 10px; color:#fff; line-height:1.15; }
.hero p { color: #c8d3e6; font-size: 18px; max-width: 640px; margin: 0 0 22px; }
.hero .hero-stats { display:flex; gap: 28px; flex-wrap: wrap; margin-top: 8px; }
.hero .hero-stats .s { }
.hero .hero-stats .n { font-size: 26px; font-weight: 800; color:#fff; }
.hero .hero-stats .l { font-size: 13px; color:#9fb2d0; text-transform:uppercase; letter-spacing:.06em; }

.dash-progress { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 30px; box-shadow: var(--shadow); }
.dash-progress .dp-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.dash-progress .dp-pct { font-size: 22px; font-weight: 800; color: var(--brand-dark); }
.dash-bar { height: 10px; background: #eef1f6; border-radius: 99px; overflow:hidden; }
.dash-bar > span { display:block; height:100%; background: linear-gradient(90deg,var(--brand),#5b8bff); width:0; transition: width .5s; }

.mod-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.mod-card { display:block; text-decoration:none; color: var(--ink); background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow); transition: transform .12s, border-color .15s; position: relative; }
.mod-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.mod-card .mc-num { font-size: 12px; font-weight: 800; color: var(--brand); letter-spacing:.08em; }
.mod-card h3 { margin: 4px 0 6px; font-size: 18px; }
.mod-card p { margin:0; font-size: 14.5px; color: var(--ink-soft); }
.mod-card .mc-check { position:absolute; top:14px; right:14px; color: var(--tip); opacity:0; font-weight:800; }
.mod-card.done .mc-check { opacity:1; }
.mod-card.done { border-color: #bfe6d4; }

.callout-row { display:grid; grid-template-columns: 1fr 1fr; gap:16px; margin: 26px 0; }
@media (max-width: 680px){ .callout-row { grid-template-columns: 1fr; } }

/* glossary */
.gloss { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 22px; }
.gloss dt { font-weight: 700; color: var(--brand-dark); margin-top: 18px; }
.gloss dd { margin: 4px 0 0; color: var(--ink-soft); }
.gloss-jump { display:flex; flex-wrap:wrap; gap:6px; margin: 16px 0 26px; }
.gloss-jump a { text-decoration:none; width:30px; height:30px; display:grid; place-items:center; border:1px solid var(--line); border-radius:7px; font-weight:700; color:var(--brand-dark); background:var(--panel); }
.gloss-jump a:hover { background: var(--brand); color:#fff; }

/* checklist (printable) */
.checklist { list-style:none; padding-left:0; }
.checklist li { padding: 8px 0 8px 30px; position: relative; border-bottom:1px dashed var(--line); }
.checklist li:before { content:"☐"; position:absolute; left:0; top:7px; font-size:18px; color: var(--brand); }

.pill { display:inline-block; font-size:12px; font-weight:700; padding:3px 9px; border-radius:99px; background: var(--brand-wash); color: var(--brand-dark); margin-right:6px; }
.pill.gray { background:#eef1f6; color: var(--ink-soft); }

@media print {
  .sidebar, .topbar, .pager, .mark-done-row, .quiz-actions { display:none !important; }
  .content { padding: 0; }
  .q.answered .explain { display:block; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 40;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display:block; }
  .scrim { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:35; }
  .topbar { display:flex; }
  .content { padding: 24px 18px 100px; }
  .reading h1 { font-size: 27px; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 28px; }
}
