/* eHowMe LMS — frontend. Override the variables in your theme / Elementor custom CSS. */
:root {
	--ehl-accent: #2563eb;
	--ehl-accent-text: #fff;
	--ehl-done: #16a34a;
	--ehl-fail: #dc2626;
	--ehl-muted: #6b7280;
	--ehl-line: #e5e7eb;
	--ehl-surface: #f9fafb;
	--ehl-radius: 10px;
}
.ehl > * + * { margin-top: 1.25rem; }
.ehl-muted { color: var(--ehl-muted); }
.ehl-notice { padding: .75rem 1rem; border-radius: var(--ehl-radius); background: var(--ehl-surface); border-left: 4px solid var(--ehl-accent); }
.ehl-breadcrumb { font-size: .9em; margin: 0; }
.ehl-breadcrumb a { color: var(--ehl-muted); text-decoration: none; }

/* Buttons */
.ehl-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .7em 1.4em; border: 0; border-radius: var(--ehl-radius);
	background: var(--ehl-accent); color: var(--ehl-accent-text); font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; transition: filter .15s; }
.ehl-btn:hover, .ehl-btn:focus-visible { filter: brightness(1.08); color: var(--ehl-accent-text); }
.ehl-btn--ghost { background: transparent; color: var(--ehl-accent); box-shadow: inset 0 0 0 2px currentColor; }
.ehl-btn--ghost:hover { color: var(--ehl-accent); }
.ehl-btn--cert { background: var(--ehl-done); }
.ehl-enroll { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.ehl-course__actions { display: grid; gap: 1rem; }

/* Progress */
.ehl-progress__head { display: flex; justify-content: space-between; font-size: .95em; margin-bottom: .4rem; }
.ehl-progress__value { font-weight: 600; }
.ehl-progress__value small { font-weight: 400; color: var(--ehl-muted); margin-left: .25em; }
.ehl-progress__track { height: 8px; border-radius: 99px; background: var(--ehl-line); overflow: hidden; }
.ehl-progress__bar { height: 100%; background: var(--ehl-done); border-radius: inherit; transition: width .4s; }

/* Outline */
.ehl-outline__heading { margin: 0 0 .75rem; }
.ehl-outline ul { list-style: none; margin: 0; padding: 0; }
.ehl-outline__list > li { border: 1px solid var(--ehl-line); border-radius: var(--ehl-radius); margin-bottom: .5rem; overflow: hidden; }
.ehl-outline__list > li > .ehl-outline__row { font-weight: 600; background: var(--ehl-surface); }
.ehl-outline__row { display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem; }
.ehl-outline__sub .ehl-outline__row { padding-left: 2rem; border-top: 1px solid var(--ehl-line); }
.ehl-outline__sub .ehl-outline__sub .ehl-outline__row { padding-left: 3.25rem; }
.ehl-outline__title { flex: 1; color: inherit; text-decoration: none; }
a.ehl-outline__title:hover { color: var(--ehl-accent); }
.ehl-outline__meta { font-size: .85em; color: var(--ehl-muted); font-weight: 400; }
.ehl-outline__icon { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ehl-line); position: relative; }
.ehl-outline__item--done > .ehl-outline__row .ehl-outline__icon { background: var(--ehl-done); border-color: var(--ehl-done); }
.ehl-outline__item--done > .ehl-outline__row .ehl-outline__icon::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ehl-outline__item--locked > .ehl-outline__row { color: var(--ehl-muted); }
.ehl-outline__item--locked > .ehl-outline__row .ehl-outline__icon { border-radius: 4px; border-style: dashed; }
.ehl-type--quiz > .ehl-outline__row .ehl-outline__title::before { content: "✎ "; color: var(--ehl-muted); }
.ehl-outline__item.is-current > .ehl-outline__row { box-shadow: inset 3px 0 0 var(--ehl-accent); }
.ehl-step__outline summary { cursor: pointer; font-weight: 600; padding: .5rem 0; }

/* Complete + nav */
.ehl-complete { margin-top: 2rem; }
.ehl-complete__done { color: var(--ehl-done); font-weight: 600; }
.ehl-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding-top: 1.25rem; border-top: 1px solid var(--ehl-line); }
.ehl-nav a { text-decoration: none; }
.ehl-nav__course { color: var(--ehl-muted); font-size: .9em; }
.ehl-nav__next { justify-self: end; }

/* Quiz */
.ehl-quiz__list, .ehl-quiz__review { padding-left: 1.25rem; }
.ehl-quiz__q { margin-bottom: 1.5rem; }
.ehl-quiz__q fieldset { border: 0; padding: 0; margin: 0; }
.ehl-quiz__qtext { font-weight: 600; margin-bottom: .6rem; padding: 0; }
.ehl-quiz__qtext p { margin: 0; }
.ehl-quiz__option { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .8rem; margin-bottom: .4rem; border: 1px solid var(--ehl-line); border-radius: var(--ehl-radius); cursor: pointer; }
.ehl-quiz__option:has(input:checked) { border-color: var(--ehl-accent); background: var(--ehl-surface); }
.ehl-quiz__option input { margin-top: .3em; accent-color: var(--ehl-accent); }
.ehl-quiz__result { padding: 1rem 1.25rem; border-radius: var(--ehl-radius); background: var(--ehl-surface); border-left: 4px solid var(--ehl-done); }
.ehl-quiz__result.is-fail { border-left-color: var(--ehl-fail); }
.ehl-quiz__result p { margin: 0; }
.ehl-quiz__verdict { font-size: 1.25em; font-weight: 700; }
.ehl-quiz__answers { list-style: none; padding: 0; }
.ehl-quiz__answers li { padding: .35rem .6rem; border-radius: 6px; }
.ehl-quiz__answers li.is-answer { background: color-mix(in srgb, var(--ehl-done) 14%, transparent); }
.ehl-quiz__answers li.is-chosen:not(.is-answer) { background: color-mix(in srgb, var(--ehl-fail) 14%, transparent); text-decoration: line-through; }
.ehl-quiz__answers li.is-chosen::after { content: " ← คำตอบของคุณ"; font-size: .85em; color: var(--ehl-muted); }
.ehl-quiz__explain { font-size: .92em; color: var(--ehl-muted); padding-left: .6rem; border-left: 2px solid var(--ehl-line); }

/* My courses */
.ehl-my-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.ehl-card { border: 1px solid var(--ehl-line); border-radius: var(--ehl-radius); overflow: hidden; display: flex; flex-direction: column; }
.ehl-card__thumb img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.ehl-card__body { padding: 1rem; display: grid; gap: .9rem; }
.ehl-card__title { margin: 0; font-size: 1.1em; }
.ehl-card__title a { color: inherit; text-decoration: none; }

@media (max-width: 600px) {
	.ehl-nav { grid-template-columns: 1fr 1fr; }
	.ehl-nav__course { grid-column: 1 / -1; order: 3; text-align: center; }
}
