/*
 * GW Members: cursos no site. Usa a fonte e as cores do tema; destaque em
 * --gwm-accent e concluída em --gwm-done (o tema ou as configurações trocam).
 * Tudo dentro das classes do plugin, para não mexer no resto do tema.
 */
:root {
	--gwm-done: #2ecc71;
	--gwm-done-text: #fff;
	--gwm-line: color-mix(in srgb, currentColor 14%, transparent);
	--gwm-tint: color-mix(in srgb, currentColor 5%, transparent);
	--gwm-tint-2: color-mix(in srgb, currentColor 9%, transparent);
	--gwm-muted: color-mix(in srgb, currentColor 62%, transparent);
	--gwm-r: 12px;
}

.gwm-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* O círculo de progresso (lista do curso, menus) ------------------------ */

.gwm-check {
	display: inline-block;
	flex: none;
	box-sizing: border-box;
	width: 1.1em;
	height: 1.1em;
	border: 2px solid var(--gwm-line);
	border-radius: 50%;
	vertical-align: -.15em;
	position: relative;
	transition: background-color .15s, border-color .15s;
}
.is-done > a > .gwm-check,
.is-done > .gwm-check,
.gwm-menu-lesson.is-done .gwm-check {
	background: var(--gwm-done);
	border-color: var(--gwm-done);
}
.is-done > a > .gwm-check::after,
.is-done > .gwm-check::after,
.gwm-menu-lesson.is-done .gwm-check::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--gwm-done-text);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 78% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 78% no-repeat;
}
.gwm-lesson:not(.is-done) .gwm-sr--done,
.gwm-menu-lesson:not(.is-done) .gwm-sr--done { display: none !important; }

/* Menus do tema (o tema decide o display do link; o espaço vem da margem) */
.gwm-menu-lesson .gwm-check { width: 1em; height: 1em; margin-right: .5em; vertical-align: -.12em; }

/* Botão "concluir" -------------------------------------------------------- */

.gwm-complete-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5em .75em; margin: 1.75em 0 1.25em; clear: both; }
.gwm-complete {
	display: inline-flex;
	align-items: center;
	gap: .6em;
	margin: 0;
	padding: .7em 1.25em .7em .9em;
	border: 1.5px solid var(--gwm-line);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.gwm-complete:hover { border-color: var(--gwm-done); background: color-mix(in srgb, var(--gwm-done) 8%, transparent); color: inherit; }
.gwm-complete:active { transform: scale(.98); }
.gwm-complete:focus-visible { outline: 2px solid var(--gwm-accent, #0664b9); outline-offset: 3px; }
.gwm-complete[disabled] { cursor: not-allowed; opacity: .6; }
.gwm-complete__icon {
	flex: none;
	box-sizing: border-box;
	width: 1.25em;
	height: 1.25em;
	border: 2px solid currentColor;
	border-radius: 50%;
	opacity: .55;
	position: relative;
}
.gwm-complete.is-done { background: var(--gwm-done); border-color: var(--gwm-done); color: var(--gwm-done-text); }
.gwm-complete.is-done:hover { filter: brightness(.95); }
.gwm-complete.is-done .gwm-complete__icon { opacity: 1; border-color: currentColor; }
.gwm-complete.is-done .gwm-complete__icon::after {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 80% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.gwm-complete.is-busy { cursor: progress; }
.gwm-complete.is-busy .gwm-complete__icon { border-right-color: transparent; animation: gwm-spin .8s linear infinite; opacity: 1; }
.gwm-complete.is-busy .gwm-complete__icon::after { display: none; }
.gwm-complete--no-icon .gwm-complete__icon { display: none; }
.gwm-complete--no-icon { padding-left: 1.25em; }
.gwm-complete-error { font-size: .875em; color: #c0392b; }
@keyframes gwm-spin { to { transform: rotate(360deg); } }

/* Barra de progresso ------------------------------------------------------ */

.gwm-progress { margin: 1em 0; }
.gwm-progress__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25em 1em; margin-bottom: .45em; font-size: .9em; }
.gwm-progress__label { font-weight: 600; }
.gwm-progress__meta { display: inline-flex; gap: .75em; color: var(--gwm-muted); font-variant-numeric: tabular-nums; }
.gwm-progress__percent { font-weight: 600; color: inherit; }
.gwm-progress__track { height: 8px; border-radius: 99px; background: var(--gwm-tint-2); overflow: hidden; }
.gwm-progress__fill { height: 100%; border-radius: inherit; background: var(--gwm-done); transition: width .3s ease; }
.gwm-progress--compact { margin: .6em 0 0; }
.gwm-progress--compact .gwm-progress__head { margin-bottom: .35em; font-size: .8em; }
.gwm-progress--compact .gwm-progress__track { height: 6px; }

/* Navegação do curso (barra lateral, página do curso) -------------------- */

.gwm-course-nav { font-size: .95em; line-height: 1.4; }
.gwm-course-nav__head { padding: 0 0 .9em; margin-bottom: .5em; border-bottom: 1px solid var(--gwm-line); }
.gwm-course-nav__title { display: block; font-weight: 700; font-size: 1.05em; line-height: 1.3; color: inherit; text-decoration: none; }
.gwm-course-nav__title:hover { color: var(--gwm-accent, #0664b9); }
.gwm-course-nav ol.gwm-lessons,
.gwm-lesson-list ol.gwm-lessons { list-style: none; margin: 0; padding: 0; }
.gwm-course-nav .gwm-lesson,
.gwm-lesson-list .gwm-lesson { margin: 0; padding: 0; list-style: none; }
.gwm-course-nav .gwm-lesson > a,
.gwm-lesson-list .gwm-lesson > a {
	display: flex;
	align-items: flex-start;
	gap: .65em;
	padding: .5em .6em;
	margin: 1px 0;
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	transition: background-color .12s;
}
.gwm-course-nav .gwm-lesson > a:hover,
.gwm-lesson-list .gwm-lesson > a:hover { background: var(--gwm-tint); }
.gwm-course-nav .gwm-lesson > a .gwm-check,
.gwm-lesson-list .gwm-lesson > a .gwm-check { margin-top: .12em; }
.gwm-course-nav .gwm-lesson.is-current > a,
.gwm-lesson-list .gwm-lesson.is-current > a { background: color-mix(in srgb, var(--gwm-accent, #0664b9) 12%, transparent); font-weight: 600; }
.gwm-course-nav .gwm-lesson.is-current:not(.is-done) .gwm-check,
.gwm-lesson-list .gwm-lesson.is-current:not(.is-done) .gwm-check { border-color: var(--gwm-accent, #0664b9); }
.gwm-course-nav .gwm-lesson.is-locked > a,
.gwm-lesson-list .gwm-lesson.is-locked > a { color: var(--gwm-muted); }
.gwm-course-nav .gwm-lesson.is-locked:not(.is-done) .gwm-check,
.gwm-lesson-list .gwm-lesson.is-locked:not(.is-done) .gwm-check { border: 0; background: currentColor; opacity: .7; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='11' width='15' height='10' rx='2'/%3E%3Cpath d='M8 11V7.5a4 4 0 0 1 8 0V11'/%3E%3C/svg%3E") center / 92% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='11' width='15' height='10' rx='2'/%3E%3Cpath d='M8 11V7.5a4 4 0 0 1 8 0V11'/%3E%3C/svg%3E") center / 92% no-repeat; }
.gwm-lesson__title { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.gwm-module { margin: 0; padding: 0; border-bottom: 1px solid var(--gwm-line); }
.gwm-module:last-child { border-bottom: 0; }
.gwm-module__head {
	display: flex;
	align-items: center;
	gap: .75em;
	padding: .8em .3em .8em .6em;
	cursor: pointer;
	list-style: none;
	font-weight: 650;
	user-select: none;
}
.gwm-module__head::-webkit-details-marker { display: none; }
.gwm-module__head::after {
	content: "";
	flex: none;
	width: .55em;
	height: .55em;
	margin-left: .1em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translate(-2px, -2px);
	opacity: .5;
	transition: transform .15s;
}
.gwm-module[open] > .gwm-module__head::after { transform: rotate(-135deg) translate(-2px, -2px); }
.gwm-module__title { flex: 1; min-width: 0; }
.gwm-module__count { flex: none; font-size: .8em; font-weight: 600; color: var(--gwm-muted); font-variant-numeric: tabular-nums; }
.gwm-module.is-complete .gwm-module__count { color: var(--gwm-done); }
.gwm-module > .gwm-lessons { padding-bottom: .6em !important; }

/* Página do curso: o conteúdo inteiro, sem recolher */
.gwm-course-nav--page { border: 1px solid var(--gwm-line); border-radius: var(--gwm-r); padding: .4em 1em; }

/* Anterior / próxima ------------------------------------------------------ */

.gwm-lesson-footer { margin: 2em 0 2.5em; }
.gwm-lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: .75em; margin: 1.25em 0 0; }
.gwm-lesson-nav a {
	display: flex;
	flex-direction: column;
	gap: .2em;
	padding: .85em 1.1em;
	border: 1px solid var(--gwm-line);
	border-radius: var(--gwm-r);
	color: inherit;
	text-decoration: none;
	transition: border-color .15s, background-color .15s;
}
.gwm-lesson-nav a:hover { border-color: var(--gwm-accent, #0664b9); background: var(--gwm-tint); }
.gwm-lesson-nav__next { text-align: right; grid-column: 2; }
.gwm-lesson-nav__dir { font-size: .78em; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gwm-muted); }
.gwm-lesson-nav__title { font-weight: 600; line-height: 1.3; }
@media (max-width: 600px) {
	.gwm-lesson-nav { grid-template-columns: 1fr; }
	.gwm-lesson-nav__next { grid-column: 1; }
	.gwm-lesson-nav > span:empty { display: none; }
}

/* Cartões de cursos ------------------------------------------------------- */

.gwm-courses { display: grid; grid-template-columns: repeat(var(--gwm-columns, 3), minmax(0, 1fr)); gap: 1.5em; margin: 1.5em 0; }
@media (max-width: 960px) { .gwm-courses { grid-template-columns: repeat(min(var(--gwm-columns, 3), 2), minmax(0, 1fr)); } }
@media (max-width: 600px) { .gwm-courses { grid-template-columns: 1fr; } }
.gwm-course-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--gwm-line);
	border-radius: var(--gwm-r);
	overflow: hidden;
	background: var(--gwm-tint);
}
.gwm-course-card__cover { position: relative; display: block; aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--gwm-accent, #0664b9) 18%, transparent); overflow: hidden; }
.gwm-course-card__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gwm-course-card:hover .gwm-course-card__img { transform: scale(1.03); }
.gwm-course-card__placeholder { display: grid; place-items: center; width: 100%; height: 100%; font-size: 2.2em; font-weight: 800; letter-spacing: .02em; color: var(--gwm-accent, #0664b9); }
.gwm-course-card.is-locked .gwm-course-card__img { filter: grayscale(.6); opacity: .75; }
.gwm-course-card__body { display: flex; flex-direction: column; gap: .5em; padding: 1.1em 1.2em 1.25em; flex: 1; }
.gwm-course-card__title { margin: 0; font-size: 1.1em; line-height: 1.3; }
.gwm-course-card__title a { color: inherit; text-decoration: none; }
.gwm-course-card__title a:hover { color: var(--gwm-accent, #0664b9); }
.gwm-course-card__meta { margin: 0; font-size: .85em; color: var(--gwm-muted); }
.gwm-course-card__excerpt { margin: 0; font-size: .92em; opacity: .85; }
.gwm-course-card .gwm-progress { margin-top: .25em; }
.gwm-course-card__cta { margin-top: auto; align-self: flex-start; }
.gwm-course-card .gwm-progress + .gwm-course-card__cta { margin-top: .6em; }
.gwm-course-card__alt { align-self: flex-start; font-size: .88em; color: inherit; opacity: .8; }
.gwm-course-card__alt:hover { opacity: 1; }
.gwm-course-card .gwm-badge { position: absolute; left: .75em; top: .75em; }

.gwm-badge { display: inline-block; padding: .3em .7em; border-radius: 99px; font-size: .78em; font-weight: 700; line-height: 1.2; background: #1f2937; color: #fff; }
.gwm-badge--done { background: var(--gwm-done); color: var(--gwm-done-text); }
.gwm-badge--overdue,
.gwm-badge--pending { background: #b45309; }
.gwm-badge--blocked { background: #b91c1c; }

/* Botão do plugin (o mesmo do gwm.css, para quando a proteção está desligada) */
.gwm-courses .gwm-button,
.gwm-course-hero .gwm-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .65em 1.3em;
	border-radius: 8px;
	border: 1px solid var(--gwm-accent, #0664b9);
	background: var(--gwm-accent, #0664b9);
	color: var(--gwm-accent-text, #fff) !important;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
}
.gwm-courses .gwm-button:hover,
.gwm-course-hero .gwm-button:hover { filter: brightness(1.08); }
.gwm-course-hero .gwm-button--ghost { background: transparent; color: inherit !important; border-color: var(--gwm-line); }

/* Continuar de onde parei */
.gwm-continue {
	display: grid;
	gap: .15em;
	padding: 1em 1.2em;
	margin: 1em 0;
	border: 1px solid var(--gwm-line);
	border-left: 4px solid var(--gwm-accent, #0664b9);
	border-radius: var(--gwm-r);
	color: inherit;
	text-decoration: none;
	background: var(--gwm-tint);
}
.gwm-continue:hover { border-color: var(--gwm-accent, #0664b9); }
.gwm-continue__label { font-size: .78em; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gwm-accent, #0664b9); }
.gwm-continue__lesson { font-weight: 700; font-size: 1.05em; }
.gwm-continue__course { font-size: .85em; color: var(--gwm-muted); }

.gwm-empty { padding: 1.25em; border: 1px dashed var(--gwm-line); border-radius: var(--gwm-r); text-align: center; color: var(--gwm-muted); }

/* Página pronta da aula ---------------------------------------------------- */

.gwm-lesson-layout {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 2.5em;
	align-items: start;
	width: 100%;
	max-width: var(--gwm-layout-width, 1240px);
	margin: 2em auto 3em;
	padding: 0 16px;
}
.gwm-lesson-main { min-width: 0; }
.gwm-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; margin: 0 0 .6em; font-size: .88em; color: var(--gwm-muted); }
.gwm-crumbs a { color: inherit; }
.gwm-crumbs__jump { display: none; margin-left: auto; }
.gwm-lesson-title { margin: 0 0 .8em; line-height: 1.2; }
.gwm-lesson-side { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + 1.5em); max-height: calc(100vh - 3em - var(--wp-admin--admin-bar--height, 0px)); overflow-y: auto; overscroll-behavior: contain; padding: 1.1em 1em; border: 1px solid var(--gwm-line); border-radius: var(--gwm-r); }
@media (max-width: 900px) {
	.gwm-lesson-layout { grid-template-columns: 1fr; gap: 2em; }
	.gwm-lesson-side { position: static; max-height: none; }
	.gwm-crumbs__jump { display: inline; }
}

/* Página do curso ----------------------------------------------------------- */

.gwm-course-layout { box-sizing: border-box; width: 100%; max-width: var(--gwm-layout-width, 1100px); margin: 2em auto 3em; padding: 0 16px; }
.gwm-course-head { display: grid; gap: 2em; align-items: center; margin-bottom: 2em; }
.gwm-course-head.has-cover { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.gwm-course-head__cover img { display: block; width: 100%; height: auto; border-radius: var(--gwm-r); }
.gwm-course-title { margin: 0 0 .4em; line-height: 1.15; }
.gwm-course-hero__excerpt { font-size: 1.1em; margin: 0 0 .75em; opacity: .9; }
.gwm-course-hero__facts { margin: 0 0 1em; color: var(--gwm-muted); font-size: .92em; }
.gwm-course-hero__actions { display: flex; flex-wrap: wrap; gap: .6em; margin: 1.25em 0 0; }
.gwm-course-hero__locked { margin: 1em 0 0; }
.gwm-course-content { margin-bottom: 2.5em; }
.gwm-course-outline h2 { margin: 0 0 .75em; }
@media (max-width: 800px) {
	.gwm-course-head.has-cover { grid-template-columns: 1fr; }
	.gwm-course-head__cover { order: -1; }
}

/* Prévia no editor de blocos */
.gwm-block-placeholder { padding: 1em; border: 1px dashed currentColor; border-radius: 8px; opacity: .7; font-size: 13px; }
