/**
 * M3BS - Estilos de Jurisprudência, Precedentes e Temas
 * Cores da Marca: #790E17 (Principal), #961420 (Hover), #540a10 (Dark)
 */

:root {
	--m3bs-accent: #790E17;
	--m3bs-accent-light: #961420;
	--m3bs-accent-dark: #540a10;
	--m3bs-accent-subtle: rgba(121, 14, 23, 0.08);
	--m3bs-accent-subtle-hover: rgba(121, 14, 23, 0.14);
	--m3bs-border-color: #e2e8f0;
	--m3bs-card-bg: #ffffff;
}

/* ─── Hero / Intro da Página ───────────────────────────────── */
.m3bs-juris-intro-card {
	background: #ffffff;
	border: 1px solid var(--m3bs-border-color);
	border-radius: 16px;
	padding: 32px 36px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
	position: relative;
	overflow: hidden;
}

.m3bs-juris-intro-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 5px;
	height: 100%;
	background: linear-gradient(180deg, var(--m3bs-accent) 0%, var(--m3bs-accent-light) 100%);
}

.m3bs-juris-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--m3bs-accent);
	background: var(--m3bs-accent-subtle);
	padding: 5px 12px;
	border-radius: 20px;
	margin-bottom: 12px;
}

.m3bs-juris-intro-card h1,
.m3bs-juris-intro-card .m3bs-page-h1 {
	font-size: 1.85rem;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.3;
	margin-bottom: 12px;
}

.m3bs-juris-intro-card .lead {
	font-size: 1.05rem;
	color: #475569;
	line-height: 1.6;
	margin-bottom: 0;
	max-width: 900px;
}

/* ─── Sidebar de Filtros ───────────────────────────────────── */
.m3bs-juris-sidebar {
	position: sticky;
	top: 100px;
}

.m3bs-filter-card {
	background: #ffffff;
	border: 1px solid var(--m3bs-border-color);
	border-radius: 16px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
	overflow: hidden;
}

.m3bs-filter-card-header {
	padding: 18px 22px;
	background: #ffffff;
	border-bottom: 1px solid var(--m3bs-border-color);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.m3bs-filter-card-header h2,
.m3bs-filter-card-header .m3bs-filter-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: #1e293b;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.m3bs-filter-card-header h2 i,
.m3bs-filter-card-header .m3bs-filter-title i {
	color: var(--m3bs-accent);
}

.m3bs-filter-card-body {
	padding: 22px;
}

/* ─── Search & Filter Pro Estilos do Formulário ────────────── */
.searchandfilter {
	margin: 0;
	padding: 0;
}

.searchandfilter > ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.searchandfilter > ul > li {
	margin-bottom: 22px;
}

.searchandfilter > ul > li:last-child {
	margin-bottom: 0;
}

/* Campo de Pesquisa */
.searchandfilter li.sf-field-search {
	position: relative;
}

.searchandfilter li.sf-field-search label {
	width: 100%;
	position: relative;
	margin: 0;
	display: block;
}

.searchandfilter li.sf-field-search label::before {
	content: "\f002";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	font-size: 0.95rem;
	pointer-events: none;
	z-index: 2;
}

.searchandfilter li.sf-field-search input.sf-input-text {
	width: 100% !important;
	height: 44px;
	padding: 8px 14px 8px 38px !important;
	font-size: 0.92rem;
	border: 1.5px solid var(--m3bs-border-color);
	border-radius: 10px;
	background-color: #f8fafc;
	color: #1e293b;
	transition: all 0.2s ease;
	outline: none;
	box-shadow: none;
}

.searchandfilter li.sf-field-search input.sf-input-text:focus {
	background-color: #ffffff;
	border-color: var(--m3bs-accent);
	box-shadow: 0 0 0 3px rgba(121, 14, 23, 0.12);
}

/* Lista de Taxonomias (Matérias / Assuntos) */
.searchandfilter li[data-sf-field-type="taxonomy"] > h4,
.searchandfilter li.sf-field-taxonomy-materias_jurisprudencia > label:first-child {
	display: block;
	font-size: 0.88rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #475569;
	margin-bottom: 12px;
}

.searchandfilter li[data-sf-field-type="taxonomy"] > ul {
	list-style: none;
	padding: 4px;
	margin: 0;
	max-height: 400px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 #f8fafc;
}

/* Custom Scrollbar */
.searchandfilter li[data-sf-field-type="taxonomy"] > ul::-webkit-scrollbar {
	width: 6px;
}

.searchandfilter li[data-sf-field-type="taxonomy"] > ul::-webkit-scrollbar-track {
	background: #f8fafc;
	border-radius: 10px;
}

.searchandfilter li[data-sf-field-type="taxonomy"] > ul::-webkit-scrollbar-thumb {
	background-color: #cbd5e1;
	border-radius: 10px;
}

.searchandfilter li[data-sf-field-type="taxonomy"] > ul::-webkit-scrollbar-thumb:hover {
	background-color: var(--m3bs-accent);
}

.searchandfilter li[data-sf-field-type="taxonomy"] > ul > li {
	display: flex;
	align-items: flex-start;
	padding: 7px 10px;
	border-radius: 8px;
	margin-bottom: 3px;
	transition: background-color 0.15s ease;
	cursor: pointer;
}

.searchandfilter li[data-sf-field-type="taxonomy"] > ul > li:hover {
	background-color: #f1f5f9;
}

.searchandfilter li[data-sf-field-type="taxonomy"] input[type="checkbox"] {
	appearance: auto;
	-webkit-appearance: auto;
	accent-color: var(--m3bs-accent);
	width: 17px;
	height: 17px;
	margin-top: 3px;
	margin-right: 10px;
	cursor: pointer;
	flex-shrink: 0;
}

.searchandfilter li[data-sf-field-type="taxonomy"] label.sf-label-checkbox {
	font-size: 0.88rem;
	line-height: 1.4;
	color: #334155;
	cursor: pointer;
	margin: 0;
	flex-grow: 1;
	font-weight: 500;
	transition: color 0.15s ease;
}

.searchandfilter li[data-sf-field-type="taxonomy"] li:has(input:checked) {
	background-color: var(--m3bs-accent-subtle);
}

.searchandfilter li[data-sf-field-type="taxonomy"] li:has(input:checked) label.sf-label-checkbox {
	font-weight: 700;
	color: var(--m3bs-accent);
}

/* Botão Limpar Filtros */
.m3bs-filter-actions {
	padding-top: 14px;
	margin-top: 16px;
	border-top: 1px solid var(--m3bs-border-color);
}

.m3bs-btn-reset-filters {
	width: 100%;
	height: 38px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #64748b;
	background: #f8fafc;
	border: 1px solid var(--m3bs-border-color);
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: all 0.2s ease;
}

.m3bs-btn-reset-filters:hover {
	color: var(--m3bs-accent);
	background: var(--m3bs-accent-subtle);
	border-color: var(--m3bs-accent);
}

/* ─── Resultados / Accordion de Julgados ────────────────────── */
.m3bs-juris-results-top {
	border-bottom: 1px solid var(--m3bs-border-color) !important;
}

.m3bs-results-number {
	font-size: 1.15rem;
	color: var(--m3bs-accent) !important;
}

.m3bs-btn-expand-all,
.m3bs-btn-collapse-all {
	font-size: 0.8rem;
	font-weight: 600;
	border-color: var(--m3bs-border-color);
	color: #475569;
	background: #ffffff;
	border-radius: 6px;
	padding: 4px 10px;
	transition: all 0.2s ease;
}

.m3bs-btn-expand-all:hover,
.m3bs-btn-collapse-all:hover {
	border-color: var(--m3bs-accent);
	color: var(--m3bs-accent);
	background: var(--m3bs-accent-subtle);
}

/* Card do Julgado */
.m3bs-juris-card {
	background: #ffffff;
	border: 1.5px solid var(--m3bs-border-color);
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
	overflow: hidden;
	transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.m3bs-juris-card:hover {
	border-color: #cbd5e1;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
	transform: translateY(-1px);
}

.m3bs-juris-card.is-open {
	border-color: var(--m3bs-accent);
	box-shadow: 0 8px 24px rgba(121, 14, 23, 0.08);
}

.m3bs-juris-card-header {
	padding: 0;
	background: #ffffff;
	border: none;
}

.m3bs-juris-toggle {
	width: 100%;
	background: transparent;
	border: none;
	padding: 20px 24px;
	text-align: left;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.m3bs-juris-card.is-open .m3bs-juris-toggle {
	background-color: rgba(121, 14, 23, 0.02);
	border-bottom: 1px solid var(--m3bs-border-color);
}

.m3bs-juris-toggle-meta {
	flex-grow: 1;
}

.m3bs-juris-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.m3bs-badge-materia {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--m3bs-accent);
	background: var(--m3bs-accent-subtle);
	padding: 3px 8px;
	border-radius: 4px;
}

.m3bs-juris-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.45;
	margin: 0;
	transition: color 0.2s ease;
}

.m3bs-juris-card.is-open .m3bs-juris-title,
.m3bs-juris-card:hover .m3bs-juris-title {
	color: var(--m3bs-accent);
}

.m3bs-juris-toggle-indicator {
	flex-shrink: 0;
}

.m3bs-chevron-icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #f1f5f9;
	color: #64748b;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, color 0.2s ease;
}

.m3bs-juris-card.is-open .m3bs-chevron-icon {
	transform: rotate(180deg);
	background-color: var(--m3bs-accent);
	color: #ffffff;
}

/* Corpo do Julgado / Ementa */
.m3bs-juris-card-body {
	padding: 24px;
	background: #ffffff;
}

.m3bs-juris-content {
	font-size: 0.95rem;
	line-height: 1.8;
	color: #334155;
}

.m3bs-juris-content p {
	margin-bottom: 14px;
}

.m3bs-juris-content p:last-child {
	margin-bottom: 0;
}

.m3bs-juris-content strong {
	color: #0f172a;
}

/* Destaque para dados do Tribunal / Processo */
.m3bs-juris-content p strong:only-child,
.m3bs-juris-content > p:last-child {
	background: #f8fafc;
	padding: 12px 18px;
	border-left: 4px solid var(--m3bs-accent);
	border-radius: 0 8px 8px 0;
	margin-top: 16px;
	font-size: 0.9rem;
	color: #1e293b;
	display: block;
}

/* Botão Copiar Ementa */
.btn-copy-ementa {
	border-color: var(--m3bs-accent);
	color: var(--m3bs-accent);
	font-size: 0.82rem;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 6px;
	transition: all 0.2s ease;
	background: #ffffff;
}

.btn-copy-ementa:hover {
	background-color: var(--m3bs-accent);
	border-color: var(--m3bs-accent);
	color: #ffffff;
}

.btn-copy-ementa.copied {
	background-color: #15803d !important;
	border-color: #15803d !important;
	color: #ffffff !important;
}

/* ─── Modal de Bloqueio / Conteúdo Restrito ─────────────────── */
.m3bs-gate-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 99999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

body.m3bs-modal-locked #cmplz-cookiebanner {
	opacity: 0.2;
	pointer-events: none;
}

.m3bs-gate-modal-backdrop.active {
	opacity: 1;
	pointer-events: auto;
}

.m3bs-gate-modal-dialog {
	background: #ffffff;
	width: 100%;
	max-width: 580px;
	border-radius: 20px;
	box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
	position: relative;
	overflow: hidden;
	border-top: 6px solid var(--m3bs-accent);
	transform: translateY(20px) scale(0.97);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	max-height: 92vh;
	overflow-y: auto;
}

.m3bs-gate-modal-backdrop.active .m3bs-gate-modal-dialog {
	transform: translateY(0) scale(1);
}

.m3bs-gate-modal-header {
	padding: 32px 32px 16px;
	text-align: center;
}

.m3bs-gate-modal-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--m3bs-accent-subtle);
	color: var(--m3bs-accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	margin-bottom: 16px;
}

.m3bs-gate-modal-header h3 {
	font-size: 1.45rem;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 8px;
}

.m3bs-gate-modal-header p {
	font-size: 0.92rem;
	color: #64748b;
	line-height: 1.5;
	margin-bottom: 0;
}

.m3bs-gate-modal-body {
	padding: 8px 32px 32px;
}

/* Estilos dos inputs do CF7 no Modal */
.m3bs-gate-modal-body .wpcf7 form {
	position: relative;
}

.m3bs-gate-modal-body .wpcf7 form br {
	display: none;
}

.m3bs-gate-modal-body .wpcf7 form p {
	margin: 0;
	padding: 0;
}

.m3bs-gate-modal-body .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
	margin-bottom: 14px;
}

.m3bs-gate-modal-body .wpcf7 input[type="text"],
.m3bs-gate-modal-body .wpcf7 input[type="email"],
.m3bs-gate-modal-body .wpcf7 input[type="tel"] {
	display: block;
	width: 100%;
	height: 48px;
	padding: 0 16px;
	font-size: 0.95rem;
	font-weight: 500;
	color: #1e293b;
	background-color: #f8fafc;
	border: 1.5px solid var(--m3bs-border-color);
	border-radius: 10px;
	outline: none;
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.m3bs-gate-modal-body .wpcf7 input[type="text"]:focus,
.m3bs-gate-modal-body .wpcf7 input[type="email"]:focus,
.m3bs-gate-modal-body .wpcf7 input[type="tel"]:focus {
	background-color: #ffffff;
	border-color: var(--m3bs-accent);
	box-shadow: 0 0 0 3px rgba(121, 14, 23, 0.12);
}

/* Aceite dos Termos / Texto Corrido Natural */
.m3bs-gate-modal-body .wpcf7-form-control-wrap[data-name="aceite"] {
	display: inline;
	width: auto;
	margin: 0;
}

.m3bs-gate-modal-body .wpcf7 label {
	display: block;
	position: relative;
	padding-left: 28px;
	margin: 16px 0 22px;
	font-size: 0.85rem;
	line-height: 1.55;
	color: #475569;
	text-align: left;
	cursor: pointer;
}

.m3bs-gate-modal-body .wpcf7 label .wpcf7-form-control-wrap[data-name="aceite"],
.m3bs-gate-modal-body .wpcf7 label .wpcf7-acceptance,
.m3bs-gate-modal-body .wpcf7 label .wpcf7-list-item {
	position: absolute;
	left: 0;
	top: 3px;
	margin: 0;
	padding: 0;
	display: inline-block;
	line-height: 1;
}

.m3bs-gate-modal-body .wpcf7 label input[type="checkbox"] {
	display: block;
	margin: 0;
	accent-color: var(--m3bs-accent);
	width: 18px;
	height: 18px;
	cursor: pointer;
}

.m3bs-gate-modal-body .wpcf7 label a {
	color: var(--m3bs-accent);
	text-decoration: underline;
	font-weight: 600;
	display: inline;
	transition: color 0.15s ease;
}

.m3bs-gate-modal-body .wpcf7 label a:hover {
	color: var(--m3bs-accent-light);
}

.m3bs-gate-modal-body .wpcf7 input#enviar,
.m3bs-gate-modal-body .wpcf7 input[type="submit"] {
	display: block;
	width: 100%;
	height: 50px;
	background: var(--m3bs-accent);
	color: #ffffff;
	border: none;
	border-radius: 10px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
	margin-top: 8px;
	box-shadow: 0 4px 14px rgba(121, 14, 23, 0.25);
}

.m3bs-gate-modal-body .wpcf7 input#enviar:hover,
.m3bs-gate-modal-body .wpcf7 input[type="submit"]:hover {
	background: var(--m3bs-accent-light);
	box-shadow: 0 6px 18px rgba(121, 14, 23, 0.35);
	transform: translateY(-1px);
}

.m3bs-gate-modal-body .wpcf7 input#enviar:active,
.m3bs-gate-modal-body .wpcf7 input[type="submit"]:active {
	background: var(--m3bs-accent-dark);
	transform: translateY(0);
}

.m3bs-gate-modal-body .wpcf7 .wpcf7-response-output {
	border-radius: 8px;
	padding: 12px 16px;
	font-size: 0.88rem;
	margin: 14px 0 0;
}

.m3bs-gate-modal-body .wpcf7 form.sent .wpcf7-response-output {
	background-color: #f0fdf4;
	border-color: #86efac;
	color: #166534;
}

.m3bs-gate-modal-footer {
	text-align: center;
	padding-top: 14px;
	border-top: 1px solid var(--m3bs-border-color);
	font-size: 0.78rem;
	color: #94a3b8;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

/* Bloqueio da página de fundo quando gated */
body.m3bs-modal-locked {
	overflow: hidden !important;
}

body.m3bs-modal-locked .m3bs-juris-page-content {
	filter: blur(5px);
	pointer-events: none;
	user-select: none;
	transition: filter 0.4s ease;
}

/* ─── Responsividade ───────────────────────────────────────── */
@media (max-width: 991.98px) {
	.m3bs-juris-sidebar {
		position: static;
		margin-bottom: 30px;
	}

	.m3bs-filter-collapse-toggle {
		display: flex !important;
	}

	.m3bs-filter-card-body.collapse:not(.show) {
		display: none;
	}
}

@media (max-width: 575.98px) {
	.m3bs-juris-intro-card {
		padding: 24px 20px;
	}

	.m3bs-juris-intro-card h1 {
		font-size: 1.45rem;
	}

	.m3bs-gate-modal-dialog {
		padding: 20px 16px;
	}

	.m3bs-gate-modal-header {
		padding: 16px 12px 12px;
	}

	.m3bs-gate-modal-body {
		padding: 8px 12px 20px;
	}
}
