/* Accessible, high-contrast, readable blog styling scoped under .post-readable */
.post-readable {
  --pr-bg: #0f1115;
  --pr-surface: #141821;
  --pr-card: #171c26;
  --pr-text: #e6e8ee;
  --pr-muted: #aab0bf;
  --pr-accent: #7bdcff;
  --pr-accent-2: #9ef0a3;
  --pr-code-bg: #0b0d12;
  --pr-border: #2a3242;
}

.post-readable.theme-light {
  --pr-bg: #f7f9fc;
  --pr-surface: #141821;
  --pr-card: #ffffff;
  --pr-text: #1a2233;
  --pr-muted: #5b667a;
  --pr-accent: #0d6efd;
  --pr-accent-2: #0b5ed7;
  --pr-code-bg: #f3f5f8;
  --pr-border: #dbe2ea;
}

/* Page-level background for this post only (stylesheet is only loaded on this page).
   Use the same element that defines the CSS variables to ensure they resolve. */
.post-readable#pagecontainer { background: var(--pr-bg); }

.post-readable__header {
  background: linear-gradient(180deg, #10141d 0%, #0f1115 100%);
  border-bottom: 1px solid var(--pr-border);
  padding: 72px 0 24px;
}
.post-readable.theme-light .post-readable__header {
  background: linear-gradient(180deg, #fdfefe 0%, #f7f9fc 100%);
}

/* Anchor for absolute-positioned theme toggle inside header container */
.post-readable__header .container { position: relative; padding-right: 80px; }

/* Theme toggle: pill button, top-right of header */
.post-readable__theme-toggle {
  position: absolute;
  top: 12px;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 28px;
  padding: 0;
  background: var(--pr-card);
  color: var(--pr-text);
  border: 1px solid var(--pr-border);
  border-radius: 9999px;
  box-shadow: none; /* flat */
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.post-readable__theme-toggle:hover {
  border-color: var(--pr-accent);
  color: var(--pr-accent);
  transform: none; /* keep flat */
}
.post-readable__theme-toggle:active {
  transform: none;
}
.post-readable__theme-toggle:focus-visible {
  outline: 2px solid var(--pr-accent);
  outline-offset: 2px;
}
.post-readable__theme-toggle .theme-toggle__label { display: none !important; }

/* Knob that slides left/right and shows sun/moon */
.post-readable__theme-toggle .theme-toggle__icon {
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: var(--pr-text);
  color: var(--pr-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  font-size: 0; /* hide original text */
}
.post-readable.theme-dark .post-readable__theme-toggle .theme-toggle__icon::before { content: "☾"; font-size: 14px; line-height: 1; }
.post-readable.theme-light .post-readable__theme-toggle .theme-toggle__icon::before { content: "☀︎"; font-size: 14px; line-height: 1; }
.post-readable.theme-light .post-readable__theme-toggle .theme-toggle__icon { left: calc(100% - 3px - 22px); }

/* Light theme: subtle surface */
.post-readable.theme-light .post-readable__theme-toggle {
  background: var(--pr-card);
  border-color: var(--pr-border);
}

/* Mobile: keep icon only to save space */
@media (max-width: 576px) {
  .post-readable__header .container { padding-right: 80px; }
  .post-readable__theme-toggle { padding: 8px; top: 8px; right: 8px; }
  .post-readable__theme-toggle .theme-toggle__label { display: none; }
}

.post-readable__title {
  color: var(--pr-text);
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.15;
  font-size: 44px;
  margin: 0 0 8px 0;
}

.post-readable__subtitle {
  color: var(--pr-text);
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.15;
  font-size: 24px;
  margin: 0 0 8px 0;
}


.post-readable__meta {
  color: var(--pr-muted);
  margin: 0 0 8px 0;
}

.post-readable__content {
  background: var(--pr-bg);
}

.post-readable__article {
  color: var(--pr-text);
  font-size: 18px;
  line-height: 1.75;
  padding: 24px 0 80px;
  max-width: 820px;
  margin: 0 auto;
}

.post-readable__article p { color: var(--pr-text); }
.post-readable__article h1,
.post-readable__article h2,
.post-readable__article h3,
.post-readable__article h4 {
  color: var(--pr-text);
  margin-top: 28px;
  margin-bottom: 12px;
}

.post-readable__article h1 { font-size: 34px; }
.post-readable__article h2 { font-size: 28px; border-bottom: 1px solid var(--pr-border); padding-bottom: 6px; }
.post-readable__article h3 { font-size: 22px; color: var(--pr-accent); }
.post-readable__article h4 { font-size: 18px; color: var(--pr-accent); }

.post-readable__article a { color: var(--pr-accent); text-decoration: underline; text-underline-offset: 2px; }
.post-readable__article a:hover { color: var(--pr-accent-2); }

.post-readable__article img {
  border: 1px solid var(--pr-border);
  background: var(--pr-card);
  border-radius: 8px;
  padding: 8px;
  max-width: 100%;
}

/* Team logos strip: single row, equal size and spacing */
.post-readable #team-block {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  margin: 8px 0 24px;
  background: var(--pr-card);
  border: 1px solid var(--pr-border);
  border-radius: 10px;
  overflow: hidden;
}

.post-readable #team-block img {
  width: 100%;
  height: 56px;
  object-fit: contain;
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 6px;
}

.post-readable__article blockquote {
  background: var(--pr-card);
  border-left: 4px solid var(--pr-accent);
  color: var(--pr-text);
  margin: 16px 0;
  padding: 12px 16px;
}

/* Distinct callout styling for explicit lesson callouts */
.post-readable__article blockquote.callout-lesson {
  position: relative;
  border-left-color: var(--pr-accent-2);
  background: var(--pr-card);
  box-shadow: inset 0 0 0 1px var(--pr-border);
  padding-left: 44px; /* room for icon */
}

.post-readable__article blockquote.callout-lesson::before {
  content: "💡";
  position: absolute;
  left: 14px;
  top: 12px;
  font-size: 18px;
  line-height: 1;
  opacity: 0.9;
}

.post-readable__article blockquote.callout-lesson > p > strong:first-child {
  display: inline-block;
  background: transparent;
  color: var(--pr-accent-2);
  border: 1px solid var(--pr-accent-2);
  border-radius: 9999px;
  padding: 1px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 8px;
  vertical-align: middle;
}

/* Light theme: improve contrast; avoid saturated blue backgrounds */
.post-readable.theme-light .post-readable__article blockquote.callout-lesson {
  border-left-color: var(--pr-border);
  background: var(--pr-card);
}

.post-readable.theme-light .post-readable__article blockquote.callout-lesson > p > strong:first-child {
  color: var(--pr-text);
  border-color: var(--pr-border);
}

.post-readable__article code,
.post-readable__article pre {
  background: var(--pr-code-bg);
  color: #e8f0ff;
  border: 1px solid var(--pr-border);
  border-radius: 6px;
}

.post-readable__article code { padding: 2px 6px; }
.post-readable__article pre { padding: 12px 16px; overflow-x: auto; }

/* Inline code: more subtle so blocks stand out */
.post-readable__article :not(pre) > code {
  background: #131621;
  border-color: #1f2633;
  border-radius: 4px;
  padding: 0 6px;
}

/* Code blocks: centered, distinct styling */
.post-readable .highlight,
.post-readable__article pre {
  max-width: 820px;
  margin: 20px auto;
  display: block;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.02);
}

.post-readable .highlight pre,
.post-readable__article pre,
.post-readable__article pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Light theme overrides for code readability */
.post-readable.theme-light .post-readable__article code,
.post-readable.theme-light .post-readable__article pre {
  background: var(--pr-code-bg);
  color: #0f172a; /* dark slate */
  border-color: var(--pr-border);
}

.post-readable.theme-light .post-readable__article :not(pre) > code {
  background: var(--pr-code-bg);
  border-color: var(--pr-border);
  color: #0f172a;
}

.post-readable__article ul,
.post-readable__article ol { padding-left: 24px; }

.post-readable__article hr { border-top: 1px solid var(--pr-border); margin: 28px 0; }

/* Tables */
.post-readable__article table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.post-readable__article th,
.post-readable__article td { border: 1px solid var(--pr-border); padding: 8px 12px; }
.post-readable__article th { background: var(--pr-card); color: var(--pr-text); }

/* Utility: center images within paragraphs */
.post-readable__article p[align="center"] { text-align: center; }

/* Make the fixed dark navbar readable on dark page */
body#page-top .navbar.navbar-dark { background-color: var(--pr-surface) !important; }
/* Prevent white flash during shrink/expand on desktop */
@media (min-width: 992px) {
  #mainNav { background-color: var(--pr-surface) !important; transition: padding-top 0.3s, padding-bottom 0.3s !important; }
  #mainNav.navbar-shrink { background-color: var(--pr-surface) !important; }
}
body#page-top .navbar .nav-link { color: var(--pr-muted); }
body#page-top .navbar .nav-link:hover { color: var(--pr-accent); }
.post-readable.theme-light body#page-top .navbar.navbar-dark { background-color: var(--pr-surface) !important; }

/* Footer theming on this page only (override inline white bg) */
footer.footer { background-color: var(--pr-surface) !important; border-top: 1px solid var(--pr-border); }
footer.footer, footer.footer a, footer.footer .copyright { color: var(--pr-muted); }
footer.footer .social-buttons i { color: var(--pr-muted); }

@media (max-width: 576px) {
  .post-readable__title { font-size: 32px; }
  .post-readable__subtitle { font-size: 16px; }
  .post-readable__article { font-size: 17px; }
}

/* Light mode variant (auto) */
@media (prefers-color-scheme: light) {
  .post-readable {
    --pr-bg: #f7f9fc;
    --pr-surface: #ffffff;
    --pr-card: #ffffff;
    --pr-text: #1a2233;
    --pr-muted: #5b667a;
    --pr-accent: #0d6efd;
    --pr-accent-2: #0b5ed7;
    --pr-code-bg: #f3f5f8;
    --pr-border: #dbe2ea;
  }

  .post-readable__article h3,
  .post-readable__article h4 { color: var(--pr-accent); }

  body#page-top .navbar.navbar-dark { background-color: #ffffff !important; }
  body#page-top .navbar .nav-link { color: var(--pr-muted); }
  body#page-top .navbar .nav-link:hover { color: var(--pr-accent); }
}

