/**
 * @name Altuit-TOC-Sketchnote
 * @background #FFFFFF
 * @text #000000
 */

@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&family=Fredoka+One&display=swap');

/* Custom Rapid Leroy font */
@font-face {
  font-family: 'Rapid Leroy';
  src: url('https://www.widgetgadget.com/cw1/ai-stuff/ai-fonts/RapidLeroy-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rapid Leroy';
  src: url('https://www.widgetgadget.com/cw1/ai-stuff/ai-fonts/RapidLeroy-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rapid Leroy';
  src: url('https://www.widgetgadget.com/cw1/ai-stuff/ai-fonts/RapidLeroy-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --accent: #000000;
  --accent-hover: #333333;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(0,0,0,.15);
  --content-w: 920px;
  --sidebar-w: 280px;
}

/* Theme colors - always light */
[data-theme="light"],
[data-theme="dark"],
.theme-altuit-toc-sketchnote {
  --bg: #F0F0F0;
  --elev-1: #FFFFFF;
  --elev-2: #EEEEEE;
  --text: #000000;
  --muted: #444444;
  --border: #CCCCCC;
  --link: #000000;
  --chip: #EEEEEE;
  --code-bg: #EEEEEE;
}


/* ============================================
   Base Typography
   ============================================ */
html {
  height: 100%;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: 'Rapid Leroy', 'Comic Neue', cursive;
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box }
a { color: var(--link); text-decoration: underline }
a:hover { color: var(--accent-hover); text-decoration: underline }
strong, b { font-weight: 700; }
em, i { font-style: italic; }

/* ============================================
   Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--elev-1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--elev-1);
}

/* ============================================
   Headings - Fredoka One rounded style
   ============================================ */
.theme-altuit-toc-sketchnote h1, .theme-altuit-toc-sketchnote h2, .theme-altuit-toc-sketchnote h3,
.theme-altuit-toc-sketchnote h4, .theme-altuit-toc-sketchnote h5, .theme-altuit-toc-sketchnote h6,
h1, h2, h3, h4, h5, h6 {
  font-family: 'Rapid Leroy', 'Fredoka One', cursive;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.1;
  color: var(--accent);
}
.theme-altuit-toc-sketchnote h1, h1 { font-size: 2.5em; border-bottom: 2px dashed var(--border); padding-bottom: 0.3em; }
.theme-altuit-toc-sketchnote h2, h2 { font-size: 2em; border-bottom: 1px dashed var(--border); padding-bottom: 0.3em; }
.theme-altuit-toc-sketchnote h3, h3 { font-size: 1.5em; }
.theme-altuit-toc-sketchnote h4, h4 { font-size: 1.25em; color: var(--text); }
.theme-altuit-toc-sketchnote h5, h5 { font-size: 1.1em; color: var(--text); font-weight: 400; }
.theme-altuit-toc-sketchnote h6, h6 { font-size: 1em; color: var(--muted); font-weight: 400; }

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--elev-2);
  border-bottom: 1px dashed var(--border);
}
.header-inner {
  max-width: calc(var(--content-w) + var(--sidebar-w) + 64px);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.brand {
  font-family: 'Rapid Leroy', 'Comic Neue', cursive;
  font-size: 24px;
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--text);
}
.spacer { flex: 1 }
#themeToggle { display: none; }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
}
.btn:hover {
  background: rgba(0,0,0,.08);
  text-decoration: none;
}

/* ============================================
   Layout - Sidebar + Content
   ============================================ */
.layout {
  max-width: calc(var(--content-w) + var(--sidebar-w) + 64px);
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  gap: 24px;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

/* ============================================
   TOC Sidebar
   ============================================ */
nav.toc {
  position: sticky;
  top: 84px;
  align-self: start;
  padding: 16px;
  background: var(--elev-1);
  border: 1px dashed var(--border);
  border-radius: 16px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.toc h3 {
  font-family: 'Rapid Leroy', 'Comic Neue', cursive;
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border: none;
}
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc > ul > li {
  margin: 4px 0;
}
.toc a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.toc a:hover {
  text-decoration: underline;
  color: var(--link);
}

/* TOC Header with Controls */
.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.toc-header h3 { margin: 0; }
.toc-controls {
  display: flex;
  gap: 4px;
}
.toc-controls button {
  background: none;
  border: 1px dashed var(--border);
  color: var(--muted);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 4px;
  line-height: 1;
  font-family: inherit;
}
.toc-controls button:hover {
  background: var(--border);
  color: var(--text);
}

/* Collapsible TOC Sections */
.toc-section {
  margin: 4px 0;
}
.toc-section-header {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px 0;
}
.toc-section-header:hover {
  color: var(--link);
}
.toc-toggle {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s;
}
.toc-section.collapsed .toc-toggle {
  transform: rotate(-90deg);
}
.toc-section-header a {
  flex: 1;
}
.toc-children {
  margin-left: 20px;
  padding: 4px 0 4px 12px;
  border-left: 1px dashed var(--border);
  overflow: hidden;
}
.toc-section.collapsed .toc-children {
  display: none;
}
.toc-children li {
  margin: 4px 0;
}
.toc-children a {
  font-size: 13px;
  color: var(--muted);
}
.toc-children a:hover {
  color: var(--link);
}

/* H1 level styling - slightly bolder */
.toc-h1 > .toc-section-header a {
  font-weight: 600;
  font-size: 14px;
}
/* H2 level styling */
.toc-h2 > .toc-section-header a {
  font-weight: 400;
  font-size: 13px;
}

/* ============================================
   Content Card
   ============================================ */
.card {
  background: var(--elev-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* Document Content Styling - for browser export (.doc) and in-app preview */
.doc p, .theme-altuit-toc-sketchnote p { margin: 1em 0; font-weight: 400; font-size: 1.25em; line-height: 1.6; }
.doc ul, .theme-altuit-toc-sketchnote ul {
  margin: 1em 0;
  padding-left: 2em;
  list-style: disc outside;
}
.doc ol, .theme-altuit-toc-sketchnote ol {
  margin: 1em 0;
  padding-left: 2em;
  list-style: decimal outside;
}
.doc li, .theme-altuit-toc-sketchnote li {
  margin: 0.5em 0;
  display: list-item;
  font-size: 1.25em;
  line-height: 1.6;
}
.doc li li, .theme-altuit-toc-sketchnote li li {
  font-size: 1em;
}
.doc img, .theme-altuit-toc-sketchnote img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.doc blockquote, .theme-altuit-toc-sketchnote blockquote {
  border-left: 4px dashed var(--accent);
  padding-left: 1em;
  color: var(--muted);
  margin: 1em 0;
  font-style: italic;
}
.doc blockquote > p, .theme-altuit-toc-sketchnote blockquote > p {
  margin: 0;
}
.doc code, .theme-altuit-toc-sketchnote code {
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}
.doc pre, .theme-altuit-toc-sketchnote pre {
  background: var(--code-bg);
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px dashed var(--border);
}
.doc pre code, .theme-altuit-toc-sketchnote pre code {
  background: none;
  padding: 0;
}
.doc hr, .theme-altuit-toc-sketchnote hr {
  border: none;
  border-top: 2px dashed #000000;
  margin: 2em 0;
}
.doc mark, .theme-altuit-toc-sketchnote mark {
  background: rgba(0,0,0,.1);
  color: var(--accent);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* Tables */
.doc table, .theme-altuit-toc-sketchnote table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.9em;
  font-weight: 400;
}
.doc th, .doc td, .theme-altuit-toc-sketchnote th, .theme-altuit-toc-sketchnote td {
  border: 1px dashed var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  color: var(--text);
  font-weight: 400;
}
.doc th, .theme-altuit-toc-sketchnote th {
  background: var(--elev-2);
  font-family: 'Rapid Leroy', 'Fredoka One', cursive;
  font-weight: 400;
  font-size: 1.1em;
}
.doc th img, .doc td img,
.theme-altuit-toc-sketchnote th img, .theme-altuit-toc-sketchnote td img {
  max-width: none;
  width: auto;
  height: auto;
  display: block;
  margin: 12px auto 0 auto;
}

/* YouTube embeds - responsive 16:9 */
.youtube-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1em 0;
  overflow: hidden;
}
.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1px dashed var(--border);
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  nav.toc {
    position: relative;
    top: 0;
    margin-bottom: 16px;
  }
}
@media (max-width: 768px) {
  .brand {
    font-size: 20px;
  }
}
