:root {
	--czhcs-navy: #0f2b5c;
	--czhcs-blue: #1d4ed8;
	--czhcs-blue-light: #3b82f6;
	--czhcs-orange: #ea580c;
	--czhcs-text: #1e293b;
	--czhcs-muted: #64748b;
	--czhcs-border: #e2e8f0;
	--czhcs-bg: #f8fafc;
	--czhcs-white: #ffffff;
	--czhcs-radius: 18px;
	--czhcs-gap: 1.5rem;
}

/* ------------------------------------------------------------- Grade --- */
/* Com 8 cards e 3 colunas, o grid resolve 3 + 3 + 2 sozinho.              */

.czhcs-grid {
	display: grid;
	gap: var(--czhcs-gap);
	grid-template-columns: repeat(var(--czhcs-columns, 3), minmax(0, 1fr));
	align-items: stretch;
}

@media (max-width: 1024px) {
	.czhcs-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.czhcs-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* -------------------------------------------------------------- Seção --- */

.czhcs-section {
	margin: 0 0 3rem;
}

.czhcs-section__header {
	margin-bottom: 1.5rem;
}

.czhcs-section__title {
	margin: 0 0 0.5rem;
	color: var(--czhcs-navy);
	font-size: clamp(1.375rem, 2.5vw, 1.75rem);
	font-weight: 700;
	line-height: 1.2;
}

.czhcs-section__subtitle {
	margin: 0;
	max-width: 46rem;
	color: var(--czhcs-muted);
	line-height: 1.6;
}

/* --------------------------------------------------------------- Card --- */

.czhcs-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--czhcs-white);
	border: 1px solid var(--czhcs-border);
	border-radius: var(--czhcs-radius);
	box-shadow: 0 1px 2px rgba(15, 43, 92, 0.04), 0 8px 24px rgba(15, 43, 92, 0.06);
	color: var(--czhcs-text);
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.czhcs-card:hover {
	transform: translateY(-4px);
	border-color: #cbd5e1;
	box-shadow: 0 2px 4px rgba(15, 43, 92, 0.06), 0 16px 32px rgba(15, 43, 92, 0.12);
	text-decoration: none;
}

.czhcs-card:focus-visible {
	outline: 3px solid var(--czhcs-blue);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.czhcs-card,
	.czhcs-card__media img {
		transition: none;
	}
	.czhcs-card:hover {
		transform: none;
	}
	.czhcs-card:hover .czhcs-card__media img {
		transform: none;
	}
}

/* -------------------------------------------------------------- Mídia --- */

.czhcs-card__media {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: var(--czhcs-bg);
}

.czhcs-card__media--4x3 {
	aspect-ratio: 4 / 3;
}

.czhcs-card__media--1x1 {
	aspect-ratio: 1 / 1;
}

.czhcs-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.28s ease;
}

.czhcs-card:hover .czhcs-card__media img {
	transform: scale(1.03);
}

.czhcs-card__media--fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: linear-gradient(135deg, #e8effb 0%, #dbe6fa 100%);
}

.czhcs-card__fallback-text {
	color: var(--czhcs-navy);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
}

/* -------------------------------------------------------------- Corpo --- */

.czhcs-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem;
}

.czhcs-card__title {
	margin: 0;
	color: var(--czhcs-navy);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
}

.czhcs-card__desc {
	margin: 0;
	color: var(--czhcs-muted);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.czhcs-card__meta {
	margin: 0.25rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.8125rem;
	color: var(--czhcs-muted);
}

.czhcs-card__meta li {
	margin: 0 0 0.15rem;
}

.czhcs-card__meta-label {
	font-weight: 600;
	color: #475569;
}

.czhcs-card__count {
	margin-top: auto;
	padding-top: 0.5rem;
	color: #94a3b8;
	font-size: 0.8125rem;
	font-weight: 500;
}

.czhcs-card__cta {
	margin-top: auto;
	padding-top: 0.75rem;
	color: var(--czhcs-blue);
	font-size: 0.875rem;
	font-weight: 600;
}

.czhcs-card:hover .czhcs-card__cta {
	color: var(--czhcs-navy);
}

/* ------------------------------------------------------------ Botões --- */

.czhcs-btn {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	border: 2px solid transparent;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.czhcs-btn:focus-visible {
	outline: 3px solid var(--czhcs-orange);
	outline-offset: 2px;
}

.czhcs-btn--primary {
	background: var(--czhcs-blue);
	color: #fff;
}

.czhcs-btn--primary:hover {
	background: var(--czhcs-navy);
	color: #fff;
}

.czhcs-btn--secondary {
	border-color: var(--czhcs-blue);
	background: transparent;
	color: var(--czhcs-blue);
}

.czhcs-btn--secondary:hover {
	background: var(--czhcs-blue);
	color: #fff;
}

/* --------------------------------------------------------------- Hero --- */

.czhcs-hero {
	display: grid;
	gap: 2rem;
	padding: clamp(2rem, 5vw, 4rem);
	border: 1px solid var(--czhcs-border);
	border-radius: var(--czhcs-radius);
	background: var(--czhcs-white);
}

.czhcs-hero--bg-light {
	background: var(--czhcs-bg);
}

.czhcs-hero--bg-navy,
.czhcs-hero--bg-blue {
	border-color: transparent;
	color: #fff;
}

.czhcs-hero--bg-navy {
	background: var(--czhcs-navy);
}

.czhcs-hero--bg-blue {
	background: var(--czhcs-blue);
}

.czhcs-hero--bg-navy .czhcs-hero__title,
.czhcs-hero--bg-blue .czhcs-hero__title,
.czhcs-hero--bg-navy .czhcs-hero__subtitle,
.czhcs-hero--bg-blue .czhcs-hero__subtitle {
	color: #fff;
}

.czhcs-hero--bg-navy .czhcs-btn--secondary,
.czhcs-hero--bg-blue .czhcs-btn--secondary {
	border-color: #fff;
	color: #fff;
}

.czhcs-hero--bg-navy .czhcs-btn--secondary:hover,
.czhcs-hero--bg-blue .czhcs-btn--secondary:hover {
	background: #fff;
	color: var(--czhcs-navy);
}

.czhcs-hero--align-center {
	text-align: center;
}

.czhcs-hero--align-center .czhcs-hero__subtitle {
	margin-left: auto;
	margin-right: auto;
}

.czhcs-hero--narrow .czhcs-hero__content {
	max-width: 42rem;
	margin: 0 auto;
}

.czhcs-hero__title {
	margin: 0 0 1rem;
	color: var(--czhcs-navy);
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	font-weight: 800;
	line-height: 1.15;
}

.czhcs-hero__subtitle {
	margin: 0;
	max-width: 46rem;
	color: var(--czhcs-muted);
	font-size: 1.0625rem;
	line-height: 1.6;
}

.czhcs-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.75rem;
}

.czhcs-hero--align-center .czhcs-hero__actions {
	justify-content: center;
}

.czhcs-hero__media img {
	width: 100%;
	height: auto;
	border-radius: 12px;
}

/* -------------------------------------------------------------- Busca --- */

.czhcs-search {
	margin: 0 0 2rem;
}

.czhcs-search__main {
	display: flex;
	gap: 0.5rem;
	padding: 0.5rem;
	background: var(--czhcs-white);
	border: 1px solid var(--czhcs-border);
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(15, 43, 92, 0.06);
}

.czhcs-search__field {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.625rem 1rem;
	border: 0;
	background: transparent;
	font-size: 1rem;
	color: var(--czhcs-text);
}

.czhcs-search__field:focus {
	outline: none;
}

.czhcs-search__main:focus-within {
	border-color: var(--czhcs-blue);
	box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.czhcs-search__submit {
	flex: 0 0 auto;
	padding: 0.625rem 1.5rem;
	border: 0;
	border-radius: 999px;
	background: var(--czhcs-blue);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.czhcs-search__submit:hover {
	background: var(--czhcs-navy);
}

.czhcs-search__submit:focus-visible {
	outline: 3px solid var(--czhcs-orange);
	outline-offset: 2px;
}

.czhcs-search__help {
	margin: 0.75rem 0 0;
	color: var(--czhcs-muted);
	font-size: 0.875rem;
}

.czhcs-search__filters {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	margin-top: 1.25rem;
}

.czhcs-search__filter label {
	display: block;
	margin-bottom: 0.25rem;
	color: var(--czhcs-text);
	font-size: 0.8125rem;
	font-weight: 600;
}

.czhcs-search__filter select {
	width: 100%;
	padding: 0.5rem;
	border: 1px solid var(--czhcs-border);
	border-radius: 10px;
	background: var(--czhcs-white);
	color: var(--czhcs-text);
}

/* ---------------------------------------------------------- Resultados --- */

.czhcs-results__summary {
	margin-bottom: 1.5rem;
}

.czhcs-results__total {
	margin: 0 0 0.75rem;
	color: var(--czhcs-navy);
	font-weight: 700;
}

.czhcs-results__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
}

.czhcs-chip {
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--czhcs-border);
	border-radius: 999px;
	background: var(--czhcs-bg);
	color: var(--czhcs-muted);
	font-size: 0.8125rem;
}

.czhcs-results__clear {
	color: var(--czhcs-orange);
	font-size: 0.875rem;
	font-weight: 600;
}

.czhcs-orderby {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	font-size: 0.875rem;
}

.czhcs-orderby select {
	padding: 0.4rem 0.5rem;
	border: 1px solid var(--czhcs-border);
	border-radius: 8px;
}

/* --------------------------------------------------------- Vazio / pg --- */

.czhcs-empty {
	margin: 0;
	padding: 1.5rem;
	border: 1px dashed var(--czhcs-border);
	border-radius: var(--czhcs-radius);
	color: var(--czhcs-muted);
	text-align: center;
}

.czhcs-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 2rem;
}

.czhcs-pagination .page-numbers {
	padding: 0.5rem 0.875rem;
	border: 1px solid var(--czhcs-border);
	border-radius: 10px;
	color: var(--czhcs-text);
	text-decoration: none;
}

.czhcs-pagination .page-numbers:hover {
	border-color: var(--czhcs-blue);
}

.czhcs-pagination .page-numbers.current {
	background: var(--czhcs-blue);
	border-color: var(--czhcs-blue);
	color: #fff;
}

.czhcs-pagination--preview {
	display: block;
	color: var(--czhcs-muted);
	font-size: 0.875rem;
	text-align: center;
}

/* ---------------------------------------------------------- Carrossel --- */

.czhcs-carousel {
	position: relative;
}

.czhcs-carousel__viewport {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 3 * var(--czhcs-gap)) / 4);
	gap: var(--czhcs-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: 0.25rem 0.25rem 1rem;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.czhcs-carousel__viewport:focus-visible {
	outline: 3px solid var(--czhcs-blue);
	outline-offset: 4px;
}

.czhcs-carousel__viewport > .czhcs-card {
	scroll-snap-align: start;
}

@media (max-width: 1024px) {
	.czhcs-carousel__viewport {
		grid-auto-columns: calc((100% - var(--czhcs-gap)) / 2);
	}
}

@media (max-width: 640px) {
	.czhcs-carousel__viewport {
		grid-auto-columns: 100%;
	}
}

.czhcs-carousel__arrow {
	position: absolute;
	top: 40%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--czhcs-border);
	border-radius: 50%;
	background: var(--czhcs-white);
	box-shadow: 0 4px 12px rgba(15, 43, 92, 0.12);
	color: var(--czhcs-navy);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.czhcs-carousel__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.czhcs-carousel__arrow:focus-visible {
	outline: 3px solid var(--czhcs-orange);
	outline-offset: 2px;
}

.czhcs-carousel__arrow--prev {
	left: -18px;
}

.czhcs-carousel__arrow--next {
	right: -18px;
}

@media (max-width: 768px) {
	.czhcs-carousel__arrow {
		display: none;
	}
}

.czhcs-carousel__dots {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 0.5rem;
}

.czhcs-carousel__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #cbd5e1;
	cursor: pointer;
}

.czhcs-carousel__dot.is-active {
	background: var(--czhcs-blue);
}

/* -------------------------------------------------------- Breadcrumb --- */

.czhcs-breadcrumb {
	margin: 0 0 1.5rem;
	font-size: 0.875rem;
}

.czhcs-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.czhcs-breadcrumb__item + .czhcs-breadcrumb__item::before {
	content: "\203A";
	margin-right: 0.5rem;
	color: var(--czhcs-muted);
}

.czhcs-breadcrumb a {
	color: var(--czhcs-blue);
	text-decoration: none;
}

.czhcs-breadcrumb a:hover {
	text-decoration: underline;
}

.czhcs-breadcrumb [aria-current="page"] {
	color: var(--czhcs-muted);
}

/* ------------------------------------------------------ Institucional --- */

.czhcs-institutional {
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border: 1px solid var(--czhcs-border);
	border-radius: var(--czhcs-radius);
	background: var(--czhcs-bg);
}

.czhcs-institutional__title {
	margin: 0 0 0.75rem;
	color: var(--czhcs-navy);
	font-size: 1.5rem;
	font-weight: 700;
}

.czhcs-institutional__text {
	margin: 0;
	max-width: 46rem;
	color: var(--czhcs-muted);
	line-height: 1.6;
}

.czhcs-institutional__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

/* --------------------------------------------------- Ficha do material --- */

.czhcs-material-info {
	display: grid;
	grid-template-columns: minmax(120px, auto) 1fr;
	gap: 0.5rem 1rem;
	margin: 0 0 1.5rem;
	padding: 1.25rem;
	border: 1px solid var(--czhcs-border);
	border-radius: 12px;
	background: var(--czhcs-bg);
}

.czhcs-material-info dt {
	color: var(--czhcs-navy);
	font-weight: 600;
}

.czhcs-material-info dd {
	margin: 0;
	color: var(--czhcs-muted);
}

/* Evita overflow horizontal em telas de 320px. */
.czhcs-block img,
.czhcs-section img {
	max-width: 100%;
}

/* -------------------------------------------------- Depuração da busca --- */
/* Renderizado só para administradores, quando a opção estiver ligada.      */

.czhcs-debug {
	margin-top: 2rem;
	padding: 1rem;
	border: 1px dashed var(--czhcs-border);
	border-radius: 12px;
	background: var(--czhcs-bg);
	font-size: 0.8125rem;
}

.czhcs-debug summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--czhcs-navy);
}

.czhcs-debug table {
	width: 100%;
	margin-top: 0.75rem;
	border-collapse: collapse;
}

.czhcs-debug th {
	width: 220px;
	padding: 0.25rem 0.5rem 0.25rem 0;
	text-align: left;
	vertical-align: top;
	color: var(--czhcs-muted);
	font-weight: 600;
}

.czhcs-debug td {
	padding: 0.25rem 0;
	word-break: break-word;
}

.czhcs-debug pre {
	max-height: 260px;
	margin: 0.75rem 0 0;
	padding: 0.75rem;
	overflow: auto;
	background: #fff;
	border: 1px solid var(--czhcs-border);
	border-radius: 8px;
}

.czhcs-debug__errors {
	color: #b91c1c;
}

.czhcs-search__filter--habilidade input {
	width: 100%;
	padding: 0.5rem;
	border: 1px solid var(--czhcs-border);
	border-radius: 10px;
	text-transform: uppercase;
}

.czhcs-search__filter--habilidade small {
	display: block;
	margin-top: 0.25rem;
	color: var(--czhcs-muted);
	font-size: 0.75rem;
	text-transform: none;
}