/* =========================================================
   hica for Kids — mdBook theme matching the main GH Pages site
   ========================================================= */

/* --- Fonts (same as main site) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&family=Fira+Code:wght@400;500;700&display=swap');

/* --- Force light theme only: hide the theme toggle button --- */
#theme-toggle,
#theme-list,
#mdbook-theme-toggle,
#mdbook-theme-list {
    display: none !important;
}

/* --- Override mdBook light theme CSS variables --- */
.light {
    --bg: #fcfcfc;
    --fg: #334155;
    --sidebar-bg: #f8f9fa;
    --sidebar-fg: #1e293b;
    --sidebar-active: #4f46e5;
    --links: #4f46e5;
    --inline-code-color: #4f46e5;
    --scrollbar: #e2e8f0;
    --table-border-color: #e2e8f0;
    --table-header-bg: #f1f5f9;
    --quote-bg: rgba(79, 70, 229, 0.04);
    --quote-border: #4f46e5;
    --theme-hover: rgba(79, 70, 229, 0.08);
    --icons: #64748b;
    --icons-hover: #1e293b;
}

/* --- Body font --- */
body,
.content main {
    font-family: 'Inter', sans-serif;
}

/* --- Code font --- */
code, pre, tt {
    font-family: 'Fira Code', monospace;
    font-variant-ligatures: none;
}

/* --- Inline code --- */
:not(pre) > code {
    background-color: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.88em;
}

/* --- Code blocks --- */
.light pre {
    background-color: #f6f8fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* --- Sidebar active link --- */
.light .chapter li a.active {
    background-color: #4f46e5;
    color: #ffffff;
}

.light .chapter li a:hover {
    background-color: rgba(79, 70, 229, 0.08);
}

.light .sidebar {
    background-color: #f8f9fa;
    border-right: 1px solid #e2e8f0;
}

/* --- Links --- */
a { color: #4f46e5; }

/* --- Headings --- */
h1, h2, h3, h4, h5, h6 { color: #1e293b; }

h2 {
    padding-bottom: 0.3em;
    border-bottom: 1px solid #e2e8f0;
}

/* --- Blockquotes --- */
.light blockquote {
    border-left: 4px solid #4f46e5;
    background-color: rgba(79, 70, 229, 0.04);
    color: #64748b;
}

/* --- Tables --- */
.light table th {
    background-color: #f1f5f9;
    color: #1e293b;
}

.light table tr:nth-child(even) { background-color: #f8fafc; }

.light table td,
.light table th { border-color: #e2e8f0; }

/* =========================================================
   Kid-friendly sizing
   ========================================================= */

:root {
    --content-max-width: 820px;
}

.content main {
    font-size: 1.4rem;
    line-height: 1.9;
}

/* Make code blocks stand out */
pre {
    border-radius: 8px;
    margin-bottom: 36px;
}

/* Move mdBook's copy-to-clipboard button below the snippet, left side */
pre .clip-button {
    position: absolute;
    top: auto;
    bottom: -32px;
    left: 0;
    right: auto;
    font-size: 0.7rem;
    opacity: 0.5;
    padding: 2px 8px;
}
pre .clip-button:hover {
    opacity: 1;
}

/* "Run" button on code blocks */
.playground-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.75rem;
    padding: 3px 10px;
    border: none;
    border-radius: 4px;
    background: #4f46e5;
    color: #fff !important;
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.15s;
    cursor: pointer;
    z-index: 1;
    font-family: inherit;
}
.playground-btn:hover,
.playground-btn.active {
    opacity: 1;
    text-decoration: none;
}

/* Embedded playground iframe */
.playground-embed {
    margin: 8px 0 16px;
    border: 2px solid #4f46e5;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.playground-iframe {
    width: 100%;
    height: 420px;
    border: none;
    display: block;
}
.playground-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    font-size: 0.7rem;
    padding: 2px 8px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.playground-close:hover {
    opacity: 1;
}

/* --- Syntax highlighting: functions in blue --- */
.hljs-function,
.hljs-title.function,
.hljs-title.function\.invoke {
    color: #2563eb;
}

/* --- Mascot images --- */
.content img.mascot,
.content video.mascot,
.mascot {
    display: block;
    margin: 1.5rem auto 2rem;
    width: 300px !important;
    max-width: 100% !important;
}
