/*
Theme Name: impulseK
Author: impulseK
Description: Tema de blocos acessível da plataforma de cursos impulseK. Cores, fontes, logo e rodapé se ajustam à identidade de cada instituição.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: impulsek-theme
Tags: block-patterns, full-site-editing, accessibility-ready, education, wide-blocks
*/

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	background: var(--wp--preset--color--canvas);
	color: var(--wp--preset--color--body);
	line-height: 1.25;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizelegibility;
}

/* Body text is 18px at every width (theme.json would make it fluid). */
html body {
	font-size: 18px;
}

a {
	color: var(--wp--preset--color--action);
	text-underline-offset: 0.18em;
	transition:
		color 180ms ease,
		background-color 180ms ease,
		border-color 180ms ease;
}

a:hover {
	color: var(--wp--preset--color--action-hover);
	text-decoration-thickness: 0.14em;
}

/*
 * Every button animates its hover. :where() keeps this at zero specificity,
 * so components with their own transition keep it.
 */
:where(button, input[type="submit"], input[type="button"], .wp-element-button, .wp-block-button__link) {
	transition:
		color 180ms ease,
		background-color 180ms ease,
		border-color 180ms ease,
		box-shadow 180ms ease,
		transform 180ms ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--wp--preset--color--heading);
	font-family: var(--wp--custom--font--heading);
}

h3 {
	margin-block-start: 4px !important;
	font-size: 28px;
}

.wp-block-buttons {
	gap: 1rem;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--custom--color--focus);
	outline-offset: 3px;
}

.wp-site-blocks {
	min-height: 100vh;
}

:where(.wp-site-blocks) > * {
	margin-block-start: 0;
}

.wp-block-site-title a {
	font-family: var(--wp--custom--font--heading);
	font-weight: 600;
	text-decoration: none;
}

/*
 * Header and footer colors are defaults with no specificity (:where), so the
 * colors chosen in the block's Styles panel (background, text, link, link on
 * hover) always win.
 */
:where(.ikt-header, .ikt-footer) {
	color: var(--wp--custom--chrome--text);
	background-color: var(--wp--custom--chrome--background);
}

:where(.ikt-header, .ikt-footer) :where(a, .wp-block-navigation-item__content) {
	color: inherit;
}

:where(.ikt-header a:hover, .ikt-header a:focus-visible, .ikt-footer a:hover, .ikt-footer a:focus-visible) {
	color: var(--wp--custom--chrome--hover);
}

.wp-block-navigation a {
	font-family: var(--wp--custom--font--body);
	font-size: 16px;
	font-weight: 500;
	padding: 5px 10px;
	text-transform: uppercase;
}

.wp-block-navigation a:hover,
.wp-block-navigation a:focus-visible {
	color: var(--wp--preset--color--action-hover);
}

.wp-block-navigation .wp-block-page-list {
	gap: 0 !important;
}

.has-surface-muted-background-color {
	box-shadow: none !important;
}

.wp-block-button__link.has-brand-background-color {
	background-color: var(--wp--preset--color--action) !important;
	border-color: var(--wp--preset--color--action) !important;
	color: var(--wp--custom--color--on-dark) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background-color: var(--wp--preset--color--surface) !important;
	border: 2px solid var(--wp--preset--color--action) !important;
	color: var(--wp--preset--color--action) !important;
}

.wp-block-button__link.has-brand-background-color:hover,
.wp-block-button__link.has-brand-background-color:focus-visible,
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus-visible {
	background-color: var(--wp--custom--color--button-hover) !important;
	border-color: var(--wp--custom--color--button-hover) !important;
	color: var(--wp--custom--color--on-dark) !important;
}

.wp-block-button__link,
button {
	transition:
		color 300ms ease,
		background-color 300ms ease,
		border-color 300ms ease;
}

.wp-block-button__link {
	color: var(--wp--custom--color--on-dark) !important;
	font-size: 12px;
	text-transform: uppercase;
}

.ikt-header {
	padding-block: 0;
	border-bottom: 1px solid var(--wp--custom--chrome--border);

	/*
	 * Closed dropdowns are only hidden, so they still count for the page
	 * width. Clipping the x axis keeps them from adding a horizontal
	 * scrollbar; open dropdowns are moved inside the viewport by view.js.
	 */
	overflow-x: clip;
}

.ikt-footer {
	border-top: 1px solid var(--wp--custom--chrome--border);
}

/* The header and footer define their own focus color. */
.ikt-header,
.ikt-footer {
	--wp--custom--color--focus: var(--wp--custom--chrome--focus);
}

.ikt-header__inner {
	position: relative;
	align-items: center;
	padding-block: 1.1rem;
}

.ikt-header__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	align-items: center;
	justify-content: flex-end;
}

.ikt-header__inner,
.ikt-footer__inner {
	padding-inline: var(--wp--custom--gutter);
}

.ikt-footer__aside {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: flex-end;
	text-align: right;
}

/* Footer menus side by side, right-aligned like the rest of the aside. */
.ikt-footer__menus {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem 3rem;
	justify-content: flex-end;
}

.ikt-footer__menus > * {
	margin-block: 0;
}

/* Phones: menus stacked and left-aligned, like the rest of the footer. */
@media (max-width: 600px) {

	.ikt-footer__aside {
		align-items: flex-start;
		text-align: left;
	}

	.ikt-footer__menus {
		flex-direction: column;
		justify-content: flex-start;
	}

	.ikt-footer__aside .ikt-footer-social {
		align-items: flex-start;
	}

	.ikt-footer__aside .ikt-footer-social__list {
		justify-content: flex-start;
	}
}

/*
 * Pages with the title band: the content starts at the same edge as the
 * title text (content width plus the gutter used by the band).
 */
main:has(.ikt-page-title) > .wp-block-post-content {
	box-sizing: border-box;
	max-width: var(--wp--style--global--content-size);
	padding-inline: var(--wp--custom--gutter);
}

main:has(.ikt-page-title) > .wp-block-post-content > * {
	max-width: none;
}

/* Default pages: an intro paragraph and sections with room between them. */
.ikt-lead {
	font-size: 1.25rem;
	line-height: 1.5;
}

.wp-block-post-content > .ikt-page-section {
	margin-top: var(--wp--preset--spacing--80);
}

.ikt-page-section > .wp-block-heading:first-child {
	margin-top: 0;
}

.ikt-page-section li + li {
	margin-top: 0.6rem;
}

/* FAQ: purple section headings with an icon, questions as cards. */
.ikt-faq-section > .wp-block-heading {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	margin-bottom: var(--wp--preset--spacing--50);
	color: var(--wp--custom--color--data);
	font-weight: 500;
}

.ikt-faq-section > .wp-block-heading i {
	--fa-primary-color: var(--wp--custom--color--data);
	--fa-secondary-color: var(--wp--custom--color--data-tint);
	font-size: 0.85em;
}

.wp-block-details.ikt-faq {
	margin: 0;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: var(--wp--custom--radius);
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.wp-block-details.ikt-faq + .wp-block-details.ikt-faq {
	margin-top: 0.75rem;
}

.wp-block-details.ikt-faq:hover,
.wp-block-details.ikt-faq[open] {
	border-color: var(--wp--custom--color--data-tint);
	box-shadow: var(--wp--custom--shadow--card);
}

.wp-block-details.ikt-faq > summary {
	padding: 1rem 1.25rem;
	color: var(--wp--preset--color--heading);
	font-weight: 600;
	transition: color 0.2s ease;
}

.wp-block-details.ikt-faq > summary:hover,
.wp-block-details.ikt-faq[open] > summary {
	color: var(--wp--custom--color--data);
}

.wp-block-details.ikt-faq > :not(summary) {
	margin: 0;
	padding: 0 1.25rem 1.1rem;
}

.ikt-footer__aside .wp-block-navigation {
	justify-content: flex-end;
}

.ikt-footer__aside .wp-block-navigation__container,
.ikt-footer__aside .wp-block-page-list {
	align-items: flex-end;
}



.ikt-hero {
	position: relative;
}

.ikt-hero__intro {
	max-width: 64rem;
}

.ikt-hero__intro .wp-block-button__link {
	font-size: 18px;
}

.ikt-card {
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: var(--wp--custom--radius);
	box-shadow: var(--wp--custom--shadow--card);
	height: 100%;
	overflow: hidden;
}

.ikt-card__icon,
.ikt-section-icon {
	align-items: center;
	background: transparent;
	border-radius: 50%;
	color: var(--wp--custom--color--icon);
	display: inline-flex;
	font-size: 3rem;
	height: 3rem;
	justify-content: center;
	margin-bottom: 0.5rem;
	width: 3rem;
}

.ikt-card--business .ikt-card__icon {
	background: transparent;
	color: var(--wp--custom--color--icon);
}

.ikt-card--practice .ikt-card__icon {
	background: transparent;
	color: var(--wp--custom--color--icon);
	font-size: 2.5rem;
}

.ikt-highlight {
	border-left: 0.25rem solid var(--wp--custom--color--data);
}

.ikt-eyebrow {
	font-family: var(--wp--custom--font--body);
	font-size: 1.1rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ikt-prose {
	max-width: 60rem;
}

.ikt-empty-state {
	background: var(--wp--preset--color--surface-muted);
	border: 1px dashed var(--wp--preset--color--divider-strong);
	border-radius: var(--wp--custom--radius);
	padding: var(--wp--preset--spacing--50);
	text-align: center;
}

/* Presentation hooks for plugin-owned components. */
.ikt-dashboard,
.ikt-course-list,
.ikt-progress,
.ikt-lesson,
.ikt-facilitator-panel {
	color: var(--wp--preset--color--body);
	font-family: var(--wp--custom--font--body);
}

.ikt-dashboard,
.ikt-facilitator-panel {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: var(--wp--custom--radius);
	box-shadow: var(--wp--custom--shadow--card);
	padding: clamp(1rem, 3vw, 2rem);
}

.ikt-course-list {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.ikt-course-card,
.ikt-lesson {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: var(--wp--custom--radius);
	padding: var(--wp--preset--spacing--40);
}

.ikt-progress {
	accent-color: var(--wp--preset--color--success);
}

.ikt-progress__track {
	background: var(--wp--preset--color--divider);
	border-radius: 999px;
	height: 0.75rem;
	overflow: hidden;
}

.ikt-progress__bar {
	background: var(--wp--preset--color--success);
	height: 100%;
	min-width: 0.25rem;
}

.ikt-button,
.ikt-dashboard button,
.ikt-facilitator-panel button {
	background: var(--wp--preset--color--action);
	border: 2px solid var(--wp--preset--color--action);
	border-radius: 0.55rem;
	color: var(--wp--custom--color--on-dark);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	justify-content: center;
	padding: 0.75rem 1.1rem;
	text-decoration: none;
	text-transform: uppercase;
	transition:
		color 300ms ease,
		background-color 300ms ease,
		border-color 300ms ease;
}

.ikt-button:hover,
.ikt-dashboard button:hover,
.ikt-facilitator-panel button:hover {
	background: var(--wp--custom--color--button-hover);
	border-color: var(--wp--custom--color--button-hover);
	color: var(--wp--custom--color--on-dark);
}

:where(input[type="checkbox"], input[type="radio"]) {
	margin: 0 0.4rem 0 0;
	vertical-align: middle;
}

.fa-duotone {
	--fa-primary-color: var(--wp--custom--color--icon);
	--fa-secondary-color: var(--wp--custom--color--data-tint);
	--fa-secondary-opacity: 1;
}

.ikt-field label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.35rem;
}

.ikt-field :where(input, select, textarea) {
	background: var(--wp--preset--color--surface);
	border: 2px solid var(--wp--preset--color--divider-strong);
	border-radius: 0.35rem;
	color: var(--wp--preset--color--heading);
	font: inherit;
	max-width: 100%;
	min-height: 2.75rem;
	padding: 0.65rem 0.75rem;
	width: 100%;
}

.ikt-notice {
	border-left: 0.35rem solid var(--wp--preset--color--success);
	padding: 0.85rem 1rem;
}

.ikt-notice--error {
	border-left-color: var(--wp--preset--color--success);
}

/* Mobile bar: one row with the logo, then search, account and the menu button. */
@media (max-width: 1024px) {

	.ikt-header__inner {
		flex-wrap: nowrap;
	}

	.ikt-header__actions {
		flex-wrap: nowrap;
		gap: 0.5rem;
	}
}

@media (max-width: 600px) {

	.ikt-header__inner {
		gap: 0.75rem;
	}

	.ikt-hero .wp-block-buttons,
	.ikt-hero .wp-block-button,
	.ikt-hero .wp-block-button__link {
		width: 100%;
	}
}

/* -------------------------------------------------------------------------
   Page title — marca-texto
   ------------------------------------------------------------------------- */

.ikt-breadcrumb:has(+ main .ikt-page-title) {
	border-bottom: 0;
}

main.wp-block-group:has(.ikt-page-title) {
	padding-top: 0 !important;
}

.ikt-page-title {
	display: flex;
	margin-block: 0 2rem;
	padding-block: clamp(2.5rem, 5vw, 3.75rem) 1.5rem;
	color: var(--wp--custom--title-band--text);
	font-size: clamp(2.2rem, 4.6vw, 3.4rem);
	font-weight: 700;
	line-height: 1.06;
}

/* Aligned with the content column used by the course app. */
.ikt-page-title__banner {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	width: 100%;
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
	padding-inline: var(--wp--custom--gutter);
}

.ikt-page-title__icon {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	color: var(--wp--custom--title-band--icon-color);
	font-size: 1.25rem;
	background: var(--wp--custom--title-band--icon-background);
	border-radius: 50%;
}

.ikt-page-title__text {
	padding-inline: 0.2em;
	background: linear-gradient(
		transparent 58%,
		var(--wp--custom--title-band--highlight) 58%,
		var(--wp--custom--title-band--highlight) 94%,
		transparent 94%
	);
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

/* -------------------------------------------------------------------------
   Search results — aligned with the page title band
   ------------------------------------------------------------------------- */

.ikt-search-page {
	padding-inline: var(--wp--custom--gutter);
}

.ikt-search-page__form {
	margin-bottom: var(--wp--preset--spacing--60);
}

.ikt-search-results__item {
	border-bottom: 1px solid var(--wp--preset--color--divider);
}

.ikt-search-results__item .wp-block-post-title {
	margin-bottom: 0.4rem;
	font-weight: 600;
}

.ikt-search-results__item .wp-block-post-title a {
	text-decoration: none;
}

.ikt-search-results__item .wp-block-post-title a:hover,
.ikt-search-results__item .wp-block-post-title a:focus-visible {
	color: var(--wp--preset--color--brand);
	text-decoration: underline;
}

.ikt-search-results__item .wp-block-post-excerpt {
	margin-top: 0;
}

/* Accordions: a Font Awesome Sharp Light chevron instead of the browser triangle. */
details > summary {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
	list-style: none;
	cursor: pointer;
}

details > summary::-webkit-details-marker {
	display: none;
}

details > summary::after {
	flex-shrink: 0;
	font-family: "Font Awesome 7 Sharp";
	font-size: 1em;
	font-style: normal;
	font-weight: 300;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	content: "\f078";
	transition: transform 0.2s ease;
}

details[open] > summary::after {
	transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {

	details > summary::after {
		transition: none;
	}
}
