/* Neutrals here are the brand's warm ramp (cms/static/cms/design/tokens/colors.css),
   read with fallbacks so the file still renders if the token link is ever dropped.
   The cool Tailwind greys this file was written in sat inside a warm brand. */

/* HTMX indicators */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }

/* Content body styles (rich HTML from editor) */
.content-body h1 { font-size: 1.75em; font-weight: 700; margin: 0.5em 0; }
.content-body h2 { font-size: 1.4em; font-weight: 700; margin: 0.6em 0; border-bottom: 1px solid var(--greige-400, #e3ddd2); padding-bottom: 0.3em; }
.content-body h3 { font-size: 1.2em; font-weight: 600; margin: 0.6em 0; }
.content-body h4 { font-size: 1.05em; font-weight: 600; margin: 0.6em 0; }
.content-body p { margin: 0.6em 0; line-height: 1.7; }
/* c-700 is the guide's link orange (5.33:1); c-600 is 4.0:1 on cream. */
.content-body a { color: var(--c-700); text-decoration: underline; }
.content-body a:hover { color: var(--c-800); }
.content-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 0.75em 0; }
.content-body ul, .content-body ol { padding-left: 1.25em; margin: 0.6em 0; }
.content-body li { margin: 0.2em 0; line-height: 1.6; }

/* Responsive tables */
.content-body table { border-collapse: collapse; width: 100%; margin: 0.75em 0; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.content-body td, .content-body th { border: 1px solid var(--greige-600, #c4b9b2); padding: 6px 10px; text-align: left; white-space: nowrap; }
.content-body th { background-color: var(--greige-300, #efe9e0); font-weight: 600; }

.content-body blockquote { border-left: 4px solid var(--c-500); padding-left: 1em; margin: 0.75em 0; color: var(--brown-600, #5f4742); font-style: italic; }

/* Responsive code blocks — off-white on the ink, 12.66:1 */
.content-body pre { background: var(--brown-900, #391e1a); color: var(--greige-300, #efe9e0); padding: 0.75em; border-radius: 8px; overflow-x: auto; margin: 0.75em 0; font-size: 0.85em; -webkit-overflow-scrolling: touch; }
.content-body code { background: var(--greige-300, #efe9e0); padding: 2px 5px; border-radius: 4px; font-size: 0.85em; word-break: break-word; }
.content-body pre code { background: none; padding: 0; word-break: normal; }
.content-body hr { border: none; border-top: 2px solid var(--greige-400, #e3ddd2); margin: 1.5em 0; }
.content-body figure { margin: 0.75em 0; text-align: center; }
.content-body figcaption { font-size: 0.875em; color: var(--brown-500, #755f59); margin-top: 0.5em; }

/* Responsive videos and iframes */
.content-body video, .content-body iframe { max-width: 100%; height: auto; margin: 0.75em 0; border-radius: 8px; }
.content-body video { width: 100%; }

.content-body-mini p { margin: 0.25em 0; line-height: 1.5; }

/* Mobile font adjustments */
@media (max-width: 640px) {
    .content-body h1 { font-size: 1.5em; }
    .content-body h2 { font-size: 1.25em; }
    .content-body h3 { font-size: 1.1em; }
    .content-body p, .content-body li { font-size: 0.95em; }
    .content-body td, .content-body th { padding: 4px 8px; font-size: 0.85em; }
    .content-body pre { font-size: 0.8em; padding: 0.6em; }
}

/* Player sidebar */
.player-sidebar { transition: width 0.2s ease, opacity 0.2s ease; }
.player-sidebar.collapsed { width: 0; opacity: 0; overflow: hidden; padding: 0; }

/* Accordion arrow rotation */
details[open] > summary .accordion-arrow { transform: rotate(180deg); }
.accordion-arrow { transition: transform 0.2s ease; }

/* Course card hover — the shadow is tinted with the ink, not black */
.course-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(57,30,26,0.12); }

/* Progress bar animation */
.progress-fill { transition: width 0.5s ease; }

/* Theme swatch selector */
.theme-swatch { width: 2.5rem; height: 2.5rem; border-radius: 9999px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; border: 3px solid transparent; }
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active { border-color: var(--brown-900, #391e1a); box-shadow: 0 0 0 2px white, 0 0 0 4px var(--brown-900, #391e1a); }

/* AI chat message formatting */
.ai-msg strong { font-weight: 600; color: var(--brown-900, #391e1a); }
.ai-msg em { font-style: italic; }
.ai-msg a { color: var(--c-700); text-decoration: underline; }
.ai-msg a:hover { color: var(--c-800); }
.ai-msg code { font-size: 0.85em; background: var(--greige-300, #efe9e0); padding: 1px 4px; border-radius: 3px; }
.ai-msg ul, .ai-msg ol { margin-top: 6px; }
.ai-msg li { margin-bottom: 3px; }
.ai-msg p + p { margin-top: 8px; }
