/* =========================================================================
   GK Policies Manager — Front-end styles
   As cores/tipografia usam variaveis CSS para herdar o tema ativo do site.
   Ajuste os valores de fallback (depois da virgula) para bater 100% com o
   visual do site assim que tivermos os hex/fonte exatos do tema.
   ========================================================================= */

.gkpm-wrapper {
	--gkpm-font: var(--e-global-typography-primary-font-family, var(--wp--preset--font-family--body, inherit));
	--gkpm-text-color: var(--e-global-color-text, var(--wp--preset--color--foreground, #2b2b2b));
	--gkpm-heading-color: var(--e-global-color-primary, var(--wp--preset--color--primary, #1a1a1a));
	--gkpm-accent: var(--e-global-color-accent, var(--wp--preset--color--accent, #c99a4b));
	--gkpm-border-color: var(--e-global-color-secondary, #e2ded6);
	--gkpm-bg: #ffffff;
	--gkpm-muted-bg: #f7f5f1;

	font-family: var(--gkpm-font);
	color: var(--gkpm-text-color);
	max-width: 1100px;
	margin: 0 auto;
}

/* -------------------------------------------------------------------------
   Abas de idioma (PT / ENG) - construidas com radio + label, sem JS
   ---------------------------------------------------------------------- */
.gkpm-tab-radio {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.gkpm-tabs {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	background: var(--gkpm-muted-bg);
	border-radius: 999px;
	margin-bottom: 32px;
}

.gkpm-tab {
	cursor: pointer;
	padding: 9px 22px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--gkpm-text-color);
	opacity: 0.6;
	border-radius: 999px;
	transition: background 0.2s ease, opacity 0.2s ease, color 0.2s ease;
	user-select: none;
}

.gkpm-tab:hover {
	opacity: 0.85;
}

/* Ativa o estilo da aba correspondente ao radio marcado (1o radio = PT, 2o = ENG) */
.gkpm-wrapper input.gkpm-tab-radio:nth-of-type(1):checked ~ .gkpm-tabs .gkpm-tab-pt,
.gkpm-wrapper input.gkpm-tab-radio:nth-of-type(2):checked ~ .gkpm-tabs .gkpm-tab-eng {
	background: var(--gkpm-bg);
	color: var(--gkpm-heading-color);
	opacity: 1;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Mostra/esconde os paineis de acordo com a aba ativa */
.gkpm-panel {
	display: none;
}

.gkpm-wrapper input.gkpm-tab-radio:nth-of-type(1):checked ~ .gkpm-panel-pt,
.gkpm-wrapper input.gkpm-tab-radio:nth-of-type(2):checked ~ .gkpm-panel-eng {
	display: block;
	animation: gkpm-fade-in 0.25s ease;
}

@keyframes gkpm-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Versoes antigas (shortcodes _pt / _en isolados, sem abas) */
.gkpm-single-lang .gkpm-panel {
	display: block;
}

/* -------------------------------------------------------------------------
   Listagem de documentos
   ---------------------------------------------------------------------- */
.gkpm-empty {
	padding: 24px;
	text-align: center;
	color: var(--gkpm-text-color);
	opacity: 0.7;
}

.gkpm-category-block {
	margin-bottom: 36px;
}

.gkpm-category-block:last-child {
	margin-bottom: 0;
}

.gkpm-category-title {
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--gkpm-heading-color);
	margin: 0 0 16px 0;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--gkpm-text-color);
}

.gkpm-doc-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.gkpm-doc-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	background: var(--gkpm-bg);
	border: 1px solid var(--gkpm-border-color);
	border-radius: 8px;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.gkpm-doc-item:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
	border-color: var(--gkpm-accent);
}

.gkpm-doc-icon {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: var(--gkpm-muted-bg);
	color: var(--gkpm-accent);
}

.gkpm-doc-icon svg {
	width: 19px;
	height: 19px;
}

.gkpm-doc-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.gkpm-doc-title {
	font-weight: 600;
	font-size: 1rem;
	color: var(--gkpm-heading-color);
	overflow-wrap: anywhere;
}

.gkpm-doc-meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.gkpm-doc-ext {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--gkpm-accent);
	text-transform: uppercase;
	background: var(--gkpm-muted-bg);
	padding: 2px 7px;
	border-radius: 4px;
	letter-spacing: 0.03em;
}

.gkpm-doc-meta {
	font-size: 0.82rem;
	opacity: 0.6;
}

.gkpm-doc-download {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	background: var(--gkpm-accent);
	color: #fff;
	font-weight: 600;
	font-size: 0.88rem;
	text-decoration: none;
	border-radius: 6px;
	white-space: nowrap;
	transition: opacity 0.2s ease, transform 0.15s ease;
}

.gkpm-doc-download:hover {
	opacity: 0.88;
	color: #fff;
	transform: translateY(-1px);
}

.gkpm-icon-download {
	width: 16px;
	height: 16px;
}

/* Responsivo - empilha em telas pequenas */
@media (max-width: 600px) {
	.gkpm-doc-item {
		flex-wrap: wrap;
	}
	.gkpm-doc-info {
		order: 2;
		width: 100%;
	}
	.gkpm-doc-download {
		order: 3;
		width: 100%;
		justify-content: center;
	}
	.gkpm-tabs {
		width: 100%;
	}
	.gkpm-tab {
		flex: 1;
		text-align: center;
	}
}
