/* ===== BASE — mirrors blog/index.html ===== */
:root { color-scheme: light dark; }
* { box-sizing: border-box; }

body {
  box-sizing: content-box;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ===== LIBRARY ===== */
body.lib-view h1 {
  text-align: center;
  margin: 0 0 14px;
  color: #0a66c2;
}
.subtitle {
  text-align: center;
  color: #444;
  font-size: 17px;
  max-width: 700px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

nav.backnav { text-align: center; margin: 0 0 28px; }
nav.backnav a { color: #0a66c2; text-decoration: none; }
nav.backnav a:hover { text-decoration: underline; }

.subscribe-block { text-align: center; margin: 0 auto 36px; max-width: 480px; }
.subscribe-label { font-size: 15px; color: #555; margin: 0 0 12px; }
.subscribe-form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.subscribe-form input[type="email"] {
  flex: 1; min-width: 200px; max-width: 280px;
  padding: 10px 14px; border-radius: 10px; font-size: 14px; font-family: Arial, sans-serif;
  border: 1px solid rgba(0,0,0,.1); background: #fff; color: inherit;
  outline: none;
}
.subscribe-form input[type="email"]:focus { border-color: rgba(0,0,0,.3); }
.subscribe-form button {
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: bold;
  font-family: Arial, sans-serif; cursor: pointer;
  background: #fff; color: #0a66c2; border: 1px solid rgba(0,0,0,.1);
}
.subscribe-form button:hover { background: #f5f8ff; }
.subscribe-sent { font-size: 15px; color: #0a66c2; font-weight: bold; margin: 0; }

.lang-note {
  margin-top: 48px; padding: 14px 18px; border-radius: 12px;
  background: rgba(10,102,194,.03); border: 1px solid rgba(10,102,194,.12);
  font-size: 13px; color: #888; line-height: 1.6;
}
.lang-note p { margin: 0 0 6px; }
.lang-note p:last-child { margin-bottom: 0; }

.lib-footer {
  margin-top: 48px; padding: 24px 0 40px;
  border-top: 1px solid rgba(10,102,194,.12);
  font-size: 14px; color: #666;
}
.lib-footer .copyright { margin-bottom: 8px; }
.lib-footer .footer-links { display: flex; gap: 18px; }
.lib-footer .footer-links a { color: #0a66c2; text-decoration: underline; }
.lib-footer .footer-links a:hover { color: #084e96; }

/* --- Filters — same recipe as .cta-post on main index.html --- */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}
.filter-chip {
  border: 1px solid rgba(10,102,194,.25);
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  font-family: Arial, sans-serif;
  color: #0a66c2;
  background: rgba(10,102,194,.06);
  cursor: pointer;
}
.filter-chip.active { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.filter-chip:hover { background: rgba(10,102,194,.12); }
.filter-chip.active:hover { background: #084e96; }

/* --- Cards — same recipe as .post-card on blog (flat, no hover effects) --- */
.grid { display: grid; gap: 18px; }
.card {
  border: 1px solid rgba(10,102,194,.18);
  border-radius: 14px;
  padding: 16px 18px;
  background: rgba(10,102,194,.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.card .chapter { font-size: 13px; color: #777; }
.card .title { font-size: 20px; font-weight: bold; color: #0a66c2; margin: 0; line-height: 1.3; }
.card .fallback-lang { font-size: 13px; color: #888; font-weight: normal; }
.card .excerpt { font-size: 15px; color: #444; line-height: 1.55; flex-grow: 1; }
.card .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.card .tag { font-size: 12px; color: #777; }
.empty-state { text-align: center; color: #888; padding: 40px 0; font-size: 15px; }

/* ===== CASE PAGE ===== */
body.case-view {
  max-width: 1100px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding-top: 40px;
}

/* --- Mobile top bar (hidden on desktop) --- */
.case-topbar {
  display: none;
}
.case-topbar .hamburger {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border: 1px solid rgba(10,102,194,.25);
  border-radius: 10px;
  background: rgba(10,102,194,.06);
  color: #0a66c2;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: Arial, sans-serif;
}
.case-topbar .topbar-title {
  font-size: 15px;
  font-weight: bold;
  color: #0a66c2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.case-topbar .topbar-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: rgba(10,102,194,.12);
}
.case-topbar .topbar-progress > span {
  display: block; height: 100%;
  width: 0%;
  background: #0a66c2;
  transition: width .25s ease;
}

/* --- Drawer backdrop (mobile only) --- */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 115;
}
.drawer-backdrop.show { display: block; }

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: rgba(10,102,194,.03);
  border: 1px solid rgba(10,102,194,.18);
  border-radius: 14px;
  padding: 16px 18px;
  position: sticky;
  top: 40px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.sidebar .case-label { font-size: 13px; color: #777; margin-bottom: 4px; }
.sidebar h1 { font-size: 20px; margin: 0 0 14px; color: #0a66c2; line-height: 1.3; text-align: left; }

.progress-track { height: 5px; background: rgba(10,102,194,.12); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: #0a66c2; width: 0%; transition: width .25s ease; }
.progress-label { font-size: 13px; color: #0a66c2; margin-bottom: 20px; }

.nav-section-title { font-size: 13px; color: #999; margin: 18px 0 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 8px; cursor: pointer;
  font-size: 15px; color: #555; margin-bottom: 1px;
  user-select: none;
}
.nav-item:hover { background: rgba(10,102,194,.06); }
.nav-item.active { background: rgba(10,102,194,.08); color: #0a66c2; font-weight: bold; }
.nav-item.sub { padding-left: 26px; font-size: 14px; }
.nav-item .check {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #ccd8ea;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent;
}
.nav-item.visited .check { background: #0a66c2; border-color: #0a66c2; color: #fff; }

.sidebar-back { display: block; margin-top: 22px; font-size: 14px; color: #0a66c2; text-decoration: none; }
.sidebar-back:hover { text-decoration: underline; }

.sidebar-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(10,102,194,.12);
  font-size: 13px;
  color: #666;
}
.sidebar-footer .copyright { margin-bottom: 8px; }
.sidebar-footer .footer-links { display: flex; gap: 18px; }
.sidebar-footer .footer-links a { color: #0a66c2; text-decoration: underline; }
.sidebar-footer .footer-links a:hover { color: #084e96; }

/* --- Case content --- */
.content { flex: 1; min-width: 0; padding: 0 0 40px; }
.pane { display: none; }
.pane.active { display: block; }

.eyebrow { font-size: 13px; color: #777; margin-bottom: 8px; }
.content h2 { font-size: 20px; margin: 0 0 20px; color: #0a66c2; }
.content p { line-height: 1.6; font-size: 16px; color: #444; }

.bridge-question {
  margin-top: 24px; padding: 16px 18px;
  background: rgba(10,102,194,.03); border: 1px solid rgba(10,102,194,.18);
  border-radius: 14px; font-weight: bold; color: #0a66c2; font-size: 16px;
}

.actions-list { display: grid; gap: 18px; margin-top: 22px; }
.action-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid rgba(10,102,194,.18); border-radius: 14px;
  padding: 16px 18px; background: rgba(10,102,194,.03);
}
.action-row .label { font-size: 20px; font-weight: bold; color: #0a66c2; line-height: 1.3; margin: 0; }
.action-row .desc { color: #777; font-size: 13px; margin-top: 4px; }
.action-row button {
  background: #fff; color: #0a66c2;
  border: 1px solid rgba(0,0,0,.1); border-radius: 10px;
  min-height: 34px; padding: 0 14px; font-weight: bold; font-size: 14px; cursor: pointer;
  flex-shrink: 0; font-family: Arial, sans-serif;
}
.action-row button:hover { background: #f5f8ff; }

.pull-quote {
  margin: 24px 0; padding: 16px 18px; border-radius: 14px;
  background: rgba(10,102,194,.03); border: 1px solid rgba(10,102,194,.18);
  font-style: italic; color: #444;
}
.pull-quote .source { display: block; margin-top: 8px; font-style: normal; font-size: 14px; color: #777; }

.resource-list { list-style: none; padding: 0; margin: 18px 0; }
.resource-list li { margin-bottom: 8px; }
.resource-list a { color: #0a66c2; text-decoration: none; }
.resource-list a:hover { text-decoration: underline; }

.back-link { display: inline-block; margin-top: 28px; color: #0a66c2; text-decoration: none; font-size: 15px; cursor: pointer; }
.back-link:hover { text-decoration: underline; }

.accreditation-toggle {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 14px;
  font-family: Arial, sans-serif;
  background: rgba(10,102,194,.06);
  color: #0a66c2;
  border: 1px solid rgba(10,102,194,.25);
  cursor: pointer;
  line-height: 1.4;
}
.accreditation-toggle:hover { background: rgba(10,102,194,.12); }
.accreditation-note { font-size: 16px; color: #444; line-height: 1.6; margin-top: 14px; }

.reflection-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #0a66c2; margin: 24px 0 12px; }
.reflection-list { padding-left: 0; list-style: none; counter-reset: q; }
.reflection-list li {
  counter-increment: q; margin-bottom: 16px; padding-left: 36px;
  position: relative; font-size: 16px; line-height: 1.6; color: #444;
}
.reflection-list li::before {
  content: counter(q); position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #0a66c2; color: #fff; font-size: 13px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
}

.share-block {
  margin-top: 36px; padding: 22px; border-radius: 14px;
  background: rgba(10,102,194,.03); border: 1px solid rgba(10,102,194,.18);
}
.share-block .cta {
  display: inline-block; margin-right: 12px; padding: 12px 18px;
  border-radius: 12px; background: rgba(10,102,194,.06); color: #0a66c2;
  border: 1px solid rgba(10,102,194,.25);
  text-decoration: none; font-weight: bold; font-size: 15px;
}
.share-block .cta:hover { background: rgba(10,102,194,.12); }
.share-block .email-text { font-size: 15px; color: #555; }

.coming-soon-pane { text-align: center; padding: 80px 20px; color: #888; }
.coming-soon-pane h2 { color: #0a66c2; margin-bottom: 12px; }

.content-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(10,102,194,.12);
  font-size: 14px;
  color: #666;
}
.content-footer .copyright { margin-bottom: 8px; }
.content-footer .footer-links { display: flex; gap: 18px; }
.content-footer .footer-links a { color: #0a66c2; text-decoration: underline; }
.content-footer .footer-links a:hover { color: #084e96; }

.case-page-footer {
  margin-top: 48px;
  padding: 24px 0 40px;
  border-top: 1px solid rgba(10,102,194,.12);
  font-size: 14px;
  color: #666;
}
.case-page-footer .copyright { margin-bottom: 8px; }
.case-page-footer .footer-links { display: flex; gap: 18px; }
.case-page-footer .footer-links a { color: #0a66c2; text-decoration: underline; }
.case-page-footer .footer-links a:hover { color: #084e96; }

/* ===== MOBILE — navigation drawer pattern ===== */
@media (max-width: 700px) {
  body.case-view {
    display: block;
    padding: 0;
    max-width: 100%;
  }

  .case-topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 120;
    background: #fff;
    border-bottom: 1px solid rgba(10,102,194,.15);
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 120;
    border-radius: 0 14px 14px 0;
    max-height: 100%;
    height: 100%;
    transform: translateX(-100%);
    transition: transform .25s ease;
    margin: 0;
    background: #fff;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .content {
    padding: 20px 16px 40px;
  }

  .action-row {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .action-row {
    flex-direction: column;
  }

  .action-row button {
    align-self: flex-start;
  }
}

/* ===== DARK MODE — mirrors blog + main index.html ===== */
@media (prefers-color-scheme: dark) {
  body { background: #111; color: #ddd; }

  /* Library */
  .subtitle { color: #ccc; }
  nav.backnav a { color: #9ec5ff; }
  .subscribe-label { color: #aaa; }
  .subscribe-form input[type="email"] { background: #0f141a; border-color: rgba(255,255,255,.1); }
  .subscribe-form input[type="email"]:focus { border-color: rgba(255,255,255,.3); }
  .subscribe-form button { background: #0f141a; color: #9ec5ff; border-color: rgba(255,255,255,.1); }
  .subscribe-form button:hover { background: #141a22; }
  .subscribe-sent { color: #9ec5ff; }
  .lang-note { background: rgba(207,224,255,.03); border-color: rgba(207,224,255,.12); color: #777; }
  .i18n-banner { background: rgba(207,224,255,.06); border-color: rgba(207,224,255,.22); color: #cfe0ff; }
  .filter-chip { background: rgba(207,224,255,.06); border-color: rgba(207,224,255,.22); color: #9ec5ff; }
  .filter-chip.active { background: #9ec5ff; color: #111; border-color: #9ec5ff; }
  .filter-chip:hover { background: rgba(207,224,255,.12); }
  .filter-chip.active:hover { background: #cfe0ff; }

  /* Cards — blog dark #141a22 */
  .card { background: #141a22; border-color: rgba(207,224,255,.18); }
  .card .chapter { color: #888; }
  .card .title { color: #cfe0ff; }
  .card .excerpt { color: #aaa; }
  .card .tag { color: #888; }
  .card .langs .lang-pill { color: #9ec5ff; }
  .card .langs .lang-pill.off { color: #555; }
  .empty-state { color: #777; }

  /* Case top bar (mobile) */
  .case-topbar { background: #111; border-bottom-color: rgba(207,224,255,.15); }
  .case-topbar .hamburger { background: rgba(207,224,255,.06); border-color: rgba(207,224,255,.22); color: #9ec5ff; }
  .case-topbar .topbar-title { color: #cfe0ff; }
  .case-topbar .topbar-progress { background: rgba(207,224,255,.12); }
  .case-topbar .topbar-progress > span { background: #9ec5ff; }

  /* Sidebar — blog iconbtn dark #0f141a */
  .sidebar { background: #0f141a; border-color: rgba(207,224,255,.18); }
  .sidebar h1 { color: #9ec5ff; }
  .sidebar .case-label { color: #888; }
  .nav-item { color: #aaa; }
  .nav-item:hover { background: rgba(207,224,255,.06); }
  .nav-item.active { background: rgba(207,224,255,.08); color: #9ec5ff; }
  .nav-item .check { border-color: #2a3a55; }
  .nav-item.visited .check { background: #9ec5ff; border-color: #9ec5ff; color: #111; }
  .nav-section-title { color: #777; }
  .progress-track { background: rgba(207,224,255,.12); }
  .progress-fill { background: #9ec5ff; }
  .progress-label { color: #9ec5ff; }
  .sidebar-back { color: #9ec5ff; }
  .sidebar-footer { border-top-color: rgba(207,224,255,.12); color: #999; }
  .sidebar-footer .footer-links a { color: #9ec5ff; }
  .sidebar-footer .footer-links a:hover { color: #cfe0ff; }

  /* Case content */
  .content h2 { color: #9ec5ff; }
  .content p { color: #bbb; }
  .eyebrow { color: #888; }
  .bridge-question { background: #141a22; border-color: rgba(207,224,255,.18); border-left-color: #9ec5ff; color: #9ec5ff; }
  .action-row { border-color: rgba(207,224,255,.18); background: #141a22; }
  .action-row .label { color: #cfe0ff; }
  .action-row .desc { color: #aaa; }
  .action-row button { background: #0f141a; border-color: rgba(255,255,255,.1); color: #9ec5ff; }
  .action-row button:hover { background: #141a22; }
  .pull-quote { background: #141a22; border-color: rgba(207,224,255,.18); color: #ccc; }
  .pull-quote .source { color: #888; }
  .resource-list a, .back-link { color: #9ec5ff; }
  .accreditation-toggle { background: rgba(207,224,255,.06); color: #cfe0ff; border-color: rgba(207,224,255,.22); }
  .accreditation-toggle:hover { background: rgba(207,224,255,.12); }
  .accreditation-note { color: #bbb; }
  .reflection-list li { color: #bbb; }
  .reflection-list li::before { background: #9ec5ff; color: #111; }
  .share-block { background: #141a22; border-color: rgba(207,224,255,.18); }
  .share-block .cta { background: rgba(207,224,255,.06); border-color: rgba(207,224,255,.22); color: #cfe0ff; }
  .share-block .cta:hover { background: rgba(207,224,255,.12); }
  .share-block .email-text { color: #aaa; }
  .coming-soon-pane h2 { color: #9ec5ff; }
  .content-footer { border-top-color: rgba(207,224,255,.12); color: #999; }
  .content-footer .footer-links a { color: #9ec5ff; }
  .content-footer .footer-links a:hover { color: #cfe0ff; }
  .case-page-footer { border-top-color: rgba(207,224,255,.12); color: #999; }
  .case-page-footer .footer-links a { color: #9ec5ff; }
  .case-page-footer .footer-links a:hover { color: #cfe0ff; }
  .lib-footer { border-top-color: rgba(207,224,255,.12); color: #999; }
  .lib-footer .footer-links a { color: #9ec5ff; }
  .lib-footer .footer-links a:hover { color: #cfe0ff; }
}

@media (max-width: 700px) and (prefers-color-scheme: dark) {
  .sidebar { background: #1a1a1a; }
}
