/*
 * Cards and blocks of the page sections.
 * Padding and gaps live in the block attributes.
 */
.cecyber-card {
	border: 1px solid var(--wp--preset--color--bg-soft);
	border-radius: 1rem;
	background: var(--wp--preset--color--white);

	strong {
		color: var(--wp--preset--color--text-main);
	}
}

.cecyber-card :where(ul.wp-block-list) {
	padding-left: 1.5em;
}

.cecyber-icon-box {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin: 0;
	border-radius: 0.5rem;
	background: rgb(29 134 148 / 10%);
	color: var(--wp--preset--color--primary);

	.cecyber-icon {
		width: 1.5rem;
		height: 1.5rem;
	}
}

.cecyber-icon-box--white {
	background: var(--wp--preset--color--white);
}

.cecyber-icon-box--small {
	width: 2.5rem;
	height: 2.5rem;

	.cecyber-icon {
		width: 1.25rem;
		height: 1.25rem;
	}
}

.cecyber-check-list {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	padding: 0;
	list-style: none;

	/* Not flex: a leading <strong> would become a column of its own. */
	li {
		position: relative;
		padding-left: 1.75rem;
	}

	li::before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		width: 1.125rem;
		height: 1lh;
		background: var(--wp--preset--color--primary);
		mask: url(../icons/check-circle.svg) no-repeat center / 1.125rem;
	}
}

.cecyber-tag.has-background {
	width: fit-content;
	padding: 0.375rem var(--wp--preset--spacing--30);
	border-radius: 9999px;
	text-transform: uppercase;
}

.cecyber-uppercase {
	text-transform: uppercase;
}

.wp-block-separator.cecyber-divider {
	width: 100%;
	height: 1px;
	margin-block: 0;
	border: 0;
	opacity: 1;
}

/* Arrow icon of the Figma buttons, as a mask so it takes the text color. */
.cecyber-button-arrow .wp-block-button__link {
	display: inline-flex;
	gap: var(--wp--preset--spacing--20);
	align-items: center;
	justify-content: center;

	&::after {
		content: "";
		flex: none;
		width: 1.5rem;
		height: 1.5rem;
		background: currentcolor;
		mask: url(../icons/arrow-up-right.svg) no-repeat center / contain;
	}
}

/*
 * "Vamos conversar" (CTA-contact in the Figma): lime button with a translucent
 * ring and the comments-check icon. Use with the Lima button style.
 */
.wp-block-button.cecyber-button-contact {
	padding: var(--wp--preset--spacing--10);
	border: 1px solid rgb(255 255 255 / 19%);
	border-radius: 9999px;
	background: rgb(255 255 255 / 32%);

	.wp-block-button__link {
		display: flex;
		gap: var(--wp--preset--spacing--20);
		align-items: center;
		justify-content: center;
		width: 100%;

		&::before {
			content: "";
			flex: none;
			width: 1.5rem;
			height: 1.5rem;
			background: currentcolor;
			mask: url(../icons/comments-check.svg) no-repeat center / contain;
		}
	}
}

@media (max-width: 47.9375em) {

	.cecyber-buttons-mobile-full,
	.cecyber-buttons-mobile-full .wp-block-button {
		width: 100%;
	}
}

/* card-team */
.cecyber-card-team__photo {
	overflow: hidden;
	margin: 0;
	border-radius: 0.5rem;
	background: var(--wp--preset--color--bg-surface);

	img {
		display: block;
		width: 100%;
		height: 25rem;
		object-fit: cover;
	}
}

/* card-video */
.cecyber-card-video {
	width: 100%;
	max-width: 37rem;
}

.cecyber-card-video__player {
	overflow: hidden;
	margin: 0;
	border-radius: 0.5rem;
	background: var(--wp--preset--color--bg-soft);
}

/* card-*-featured: media beside the text; stacked on small screens. */
.wp-block-group.cecyber-card-featured > .cecyber-card-featured__media {
	flex: 0 0 min(37rem, 50%);
	margin: 0;
}

.cecyber-card-featured__content {
	flex: 1;
}

@media (max-width: 47.9375em) {

	.wp-block-group.cecyber-card-featured {
		flex-direction: column;
		gap: 0;
		align-items: stretch;
	}

	.wp-block-group.cecyber-card-featured > .cecyber-card-featured__media {
		flex: none;
	}

	.cecyber-card-featured__content {
		padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
	}
}

@media (min-width: 48em) {

	.cecyber-card-featured__content {
		padding-right: var(--wp--preset--spacing--70);
	}
}

/* card-article and card-article-featured */
.cecyber-card-article__image {
	overflow: hidden;
	border-radius: 0.5rem;
	background: var(--wp--preset--color--bg-soft);

	img {
		display: block;
		width: 100%;
		height: 15rem;
		object-fit: cover;
	}
}

.cecyber-card-featured__media img {
	height: auto;
	aspect-ratio: 16 / 9;
}

/* Pills of card-course (area and type). */
.cecyber-pill {
	width: fit-content;
	padding: 0.25rem var(--wp--preset--spacing--30);
	border-radius: 9999px;
}

.cecyber-pill--outline {
	border: 1px solid var(--wp--preset--color--border-sub);
}

/* Text with an icon before it (level, reading time). */
.cecyber-meta {
	display: flex;
	gap: 0.375rem;
	align-items: center;

	&::before {
		content: "";
		flex: none;
		width: 1em;
		height: 1em;
		background: var(--wp--preset--color--primary);
		mask: no-repeat center / contain;
	}
}

.cecyber-meta--level::before {
	mask-image: url(../icons/chart.svg);
}

.cecyber-meta--time::before {
	background: currentcolor;
	mask-image: url(../icons/clock.svg);
}

.cecyber-meta--date::before {
	width: 0.875rem;
	height: 0.875rem;
	background: currentcolor;
	mask-image: url(../icons/calendar.svg);
}

/* card-course: footer at the bottom when cards in a row differ in height. */
.wp-block-group.cecyber-card-course {
	height: 100%;
}

.cecyber-card-course > .cecyber-card-course__footer {
	margin-top: auto;
}

/* card-program */
.wp-block-group.cecyber-card-program {
	height: 100%;
}

.cecyber-card-program__eyebrow {
	color: rgb(255 255 255 / 60%);
}

.cecyber-card-program__muted {
	color: rgb(255 255 255 / 80%);

	strong {
		color: var(--wp--preset--color--white);
	}
}

.cecyber-card-program__installments {
	font-size: 0.625rem;
}

.cecyber-card-program > .cecyber-card-program__footer {
	margin-top: auto;
}

/* card-client */
.cecyber-card-client__logo {
	height: 2.5rem;

	img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: contain;
		object-position: left center;
	}
}

/* card-expert: cut-out photo, tinted background, gradient under the text. */
.wp-block-cover.cecyber-card-expert {
	overflow: hidden;
	border-radius: 1rem;
	background-color: var(--wp--preset--color--primary-lighter);
}

.cecyber-card-expert__role {
	color: rgb(255 255 255 / 80%);
}

/* card-partner */

/* The Figma header is 48px tall with the logo centered in it. */
.cecyber-card-partner__logo {
	overflow: hidden;
	width: 10rem;
	height: 2.5rem;
	border-radius: 0.25rem;

	img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: contain;
		object-position: left center;
	}
}

/* Flex keeps the logo margins from collapsing with the description margin. */
.cecyber-card:has(> .cecyber-card-partner__logo) {
	display: flex;
	flex-direction: column;
}

.cecyber-card > figure.cecyber-card-partner__logo {
	margin-block: 0.25rem;
}

.cecyber-card-partner__logo--square {
	flex: none;
	width: 2.75rem;
	height: 2.75rem;
	margin-block: 0.125rem;
}

/* Pillars and contact info: icon box + text in a row. */
.cecyber-icon-row {
	flex-wrap: nowrap !important;

	> p {
		flex: 1;
	}
}

/* FAQ: the Details block (faq-item in the Figma). */
.wp-block-details {
	padding: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--bg-soft);
	border-radius: 1rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text-soft);
	font-size: var(--wp--preset--font-size--small);

	summary {
		display: flex;
		gap: var(--wp--preset--spacing--20);
		align-items: center;
		justify-content: space-between;
		color: var(--wp--preset--color--text-main);
		font-family: var(--wp--preset--font-family--montserrat);
		font-size: var(--wp--preset--font-size--large);
		font-weight: 500;
		line-height: 1.3;
		list-style: none;
		cursor: pointer;

		&::-webkit-details-marker {
			display: none;
		}

		&::after {
			content: "";
			flex: none;
			width: 2.5rem;
			height: 2.5rem;
			border: 1px solid var(--wp--preset--color--border-sub);
			border-radius: 9999px;
			background: var(--wp--preset--color--white) url(../icons/plus.svg) no-repeat center / 1.25rem;
		}
	}

	&[open] summary::after {
		background-image: url(../icons/minus.svg);
	}

	> * + * {
		margin-block: 1.5em 0;
	}

	> summary + * {
		margin-top: var(--wp--preset--spacing--20);
	}

	strong {
		color: var(--wp--preset--color--text-main);
	}
}

/* Contact form (visual only until PD-3885). */
.cecyber-form {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--60);
}

.cecyber-form__fields {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--40);
}

.cecyber-form__field {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--text-sub);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	line-height: 1.5;
}

.cecyber-form__input {
	width: 100%;
	height: 3rem;
	padding: 0 var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--border-sub);
	border-radius: 0.5rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text-main);
	font: inherit;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
}

select.cecyber-form__input {
	padding-right: var(--wp--preset--spacing--60);
	background:
		var(--wp--preset--color--white)
		url(../icons/angle-down.svg)
		no-repeat right var(--wp--preset--spacing--40) center / 1.125rem;
	appearance: none;
}

textarea.cecyber-form__input {
	height: 7.5rem;
	padding-block: var(--wp--preset--spacing--30);
	resize: vertical;
}

.cecyber-form__consent {
	display: flex;
	gap: var(--wp--preset--spacing--20);
	align-items: center;
	color: var(--wp--preset--color--text-sub);
	font-size: var(--wp--preset--font-size--x-small);
	line-height: 1.5;

	input {
		width: 1.125rem;
		height: 1.125rem;
		margin: 0;
		accent-color: var(--wp--preset--color--primary);
	}
}

.cecyber-form__actions {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	align-items: stretch;
}

.cecyber-form__submit {
	display: inline-flex;
	gap: var(--wp--preset--spacing--20);
	align-items: center;
	justify-content: center;
	align-self: flex-end;
	cursor: pointer;

	&::after {
		content: "";
		width: 1.5rem;
		height: 1.5rem;
		background: currentcolor;
		mask: url(../icons/arrow-up-right.svg) no-repeat center / contain;
	}
}

.wp-block-social-links.cecyber-social {

	.wp-social-link {
		border: 1px solid var(--wp--preset--color--border-sub);
		background: var(--wp--preset--color--white);
		color: var(--wp--preset--color--primary);
	}

	.wp-block-social-link-anchor {
		padding: 0.625rem;
	}

	svg {
		width: 1.25rem;
		height: 1.25rem;
	}
}

/* Contact channels: text and button in a row, separated by a line. */
.cecyber-channel + .cecyber-channel {
	border-top: 1px solid var(--wp--preset--color--border-sub);
}

.cecyber-channel > .wp-block-buttons {
	flex: none;
}

@media (max-width: 47.9375em) {

	.wp-block-group.cecyber-channel {
		flex-direction: column;
		gap: var(--wp--preset--spacing--40);
		align-items: stretch;
	}
}

/* Site map */
.cecyber-sitemap-list {
	padding: 0;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 500;
	line-height: 2;
	list-style: none;

	ul {
		margin: 0;
		padding-left: 1.125rem;
		list-style: none;
	}

	a {
		text-decoration: none;
	}
}

@media (max-width: 47.9375em) {

	.cecyber-form__submit {
		align-self: stretch;
	}
}

@media (min-width: 48em) {

	.cecyber-form__fields {
		grid-template-columns: 1fr 1fr;
	}

	.cecyber-form__field--wide {
		grid-column: 1 / -1;
	}

	.cecyber-form__actions {
		flex-direction: row;
		align-items: center;
		justify-content: flex-end;
	}
}

/* Text link with an arrow after it ("Saiba mais"). */
.cecyber-link-arrow a {
	display: inline-flex;
	gap: var(--wp--preset--spacing--20);
	align-items: center;
	color: var(--wp--preset--color--primary);
	text-decoration: none;

	&::after {
		content: "";
		width: 1rem;
		height: 1rem;
		background: currentcolor;
		mask: url(../icons/arrow-right.svg) no-repeat center / contain;
	}

	&:hover {
		text-decoration: underline;
	}
}

/*
 * Carousels: `.cecyber-slider` always slides, `.cecyber-slider-mobile` only on
 * small screens. assets/js/slider.js adds the progress bar and arrows
 * (slider-nav-mobile in the Figma) after the cards.
 */
.wp-block-group.cecyber-slider {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;

	> * {
		flex: none;
		width: var(--cecyber-slider-item, 17.5rem);
		scroll-snap-align: start;
	}
}

/* Three cards at a time on larger screens, like a three-column grid. */
.wp-block-group.cecyber-slider--thirds {
	--cecyber-slider-item: calc((100% - 2 * var(--wp--preset--spacing--45)) / 3);
}

.wp-block-group.cecyber-slider--halves {
	--cecyber-slider-item: calc((100% - var(--wp--preset--spacing--50)) / 2);
}

@media (max-width: 47.9375em) {

	:is(.wp-block-group, .wp-block-post-template):is(.cecyber-slider, .cecyber-slider-mobile) {
		display: flex;
		flex-wrap: nowrap;
		margin-inline: calc(var(--wp--style--root--padding-left) * -1) calc(var(--wp--style--root--padding-right) * -1) !important;
		overflow-x: auto;
		padding-inline: var(--wp--style--root--padding-left) var(--wp--style--root--padding-right);
		scroll-padding-inline: var(--wp--style--root--padding-left);
		scroll-snap-type: x mandatory;
		scrollbar-width: none;

		> * {
			flex: none;
			width: 17.5rem;
			scroll-snap-align: start;
		}
	}
}

.cecyber-slider-nav {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);

	&[hidden] {
		display: none;
	}
}

.cecyber-slider-nav__track {
	overflow: hidden;
	height: 0.5rem;
	border-radius: 3rem;
	background: var(--wp--preset--color--bg-soft);
}

.cecyber-slider-nav__progress {
	height: 100%;
	border-radius: 2rem;
	background: var(--wp--preset--color--primary);
	transition: width 0.2s;
}

.cecyber-slider-nav__arrows {
	display: flex;
	gap: var(--wp--preset--spacing--20);
}

.cecyber-slider-nav__button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	padding: 0;
	border: 1px solid var(--wp--preset--color--border-sub);
	border-radius: 9999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text-main);
	cursor: pointer;

	&::before {
		content: "";
		width: 1.25rem;
		height: 1.25rem;
		background: currentcolor;
		mask: url(../icons/arrow-right.svg) no-repeat center / contain;
	}

	&:disabled {
		opacity: 0.4;
		cursor: default;
	}

	&:hover:not(:disabled) {
		border-color: var(--wp--preset--color--primary);
		color: var(--wp--preset--color--primary);
	}
}

.cecyber-slider-nav__button--previous::before {
	transform: scaleX(-1);
}

@media (min-width: 48em) {

	.cecyber-slider-nav {
		flex-direction: row;
		gap: var(--wp--preset--spacing--70);
		align-items: center;
	}

	.cecyber-slider-nav__track {
		flex: 1;
	}
}
