/**
 * Zimrre Catalan Translator - Frontend Styles (v1.3.0)
 *
 * Filosofía: ligero, sin overlays, sin loaders. Solo:
 *   1. Reset agresivo de toda la UI residual del motor de Google Translate
 *   2. Estilos del switcher (3 variantes)
 */

/* ==========================================================================
   1. Reset / supresión del motor de Google Translate
   ========================================================================== */

/* Banner superior amarillo */
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	max-height: 0 !important;
	pointer-events: none !important;
}

/* El motor empuja el body hacia abajo: lo evitamos */
body {
	top: 0 !important;
}

/* Tooltip "Texto original / Valora esta traducción"
   y todos sus contenedores */
#goog-gt-tt,
#goog-gt-tt *,
.goog-tooltip,
.goog-tooltip:hover,
.goog-tooltip-popup,
.goog-te-balloon-frame {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

/* Highlight amarillo al pasar por encima de texto traducido */
.goog-text-highlight {
	background-color: transparent !important;
	box-shadow: none !important;
	box-sizing: border-box !important;
}

/* Selector inline + cualquier rastro del gadget */
#google_translate_element,
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-gadget-icon,
.goog-te-menu-value,
.goog-te-menu-frame,
.skiptranslate iframe,
.skiptranslate > iframe {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	width: 0 !important;
	opacity: 0 !important;
	position: absolute !important;
	left: -9999px !important;
	pointer-events: none !important;
}

.goog-logo-link,
.goog-te-gadget span,
.goog-te-gadget div {
	display: none !important;
}

/* Los <font> wrappers del motor no deben alterar layout/line-height */
font[style*="vertical-align"] {
	vertical-align: inherit !important;
}

/* ==========================================================================
   2. Switcher: estilos base
   ========================================================================== */

.zct-switcher {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: inherit;
	line-height: 1;
	max-width: 100%;
	box-sizing: border-box;
	flex-wrap: wrap;
}

.zct-switcher *,
.zct-switcher *::before,
.zct-switcher *::after {
	box-sizing: border-box;
}

.zct-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	border: 0;
	background: transparent;
	font: inherit;
	color: inherit;
	padding: 6px 12px;
	border-radius: 999px;
	transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.zct-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.zct-flag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 12px;
	overflow: hidden;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
	flex-shrink: 0;
}

.zct-flag svg {
	width: 100%;
	height: 100%;
	display: block;
}

.zct-label {
	font-size: 0.875em;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

/* ---------- Variante: PILL ---------- */

.zct-switcher--pill {
	background: rgba(0, 0, 0, 0.06);
	border-radius: 999px;
	padding: 3px;
	flex-wrap: nowrap;
}

.zct-switcher--pill .zct-btn {
	padding: 6px 12px;
	color: inherit;
	opacity: 0.65;
}

.zct-switcher--pill .zct-btn:hover {
	opacity: 1;
}

.zct-switcher--pill .zct-btn.is-active {
	background: #fff;
	color: #111;
	opacity: 1;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---------- Variante: MINIMAL ---------- */

.zct-switcher--minimal {
	gap: 0;
	background: transparent;
	padding: 0;
}

.zct-switcher--minimal .zct-btn {
	padding: 4px 8px;
	border-radius: 0;
	opacity: 0.6;
	font-weight: 500;
}

.zct-switcher--minimal .zct-btn:hover {
	opacity: 1;
}

.zct-switcher--minimal .zct-btn.is-active {
	opacity: 1;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.zct-switcher--minimal .zct-btn + .zct-btn {
	border-left: 1px solid currentColor;
}

/* ---------- Variante: BLOCK ---------- */

.zct-switcher--block {
	flex-direction: row;
	gap: 8px;
}

.zct-switcher--block .zct-btn {
	padding: 10px 16px;
	border-radius: 6px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: #fff;
	color: #111;
	font-weight: 600;
}

.zct-switcher--block .zct-btn:hover {
	border-color: rgba(0, 0, 0, 0.3);
}

.zct-switcher--block .zct-btn.is-active {
	background: #111;
	color: #fff;
	border-color: #111;
}

/* ---------- Variante: LINKS (ES / CA / EN) ---------- */

.zct-switcher--links {
	gap: 0;
	background: transparent;
	padding: 0;
	flex-wrap: nowrap;
	align-items: baseline;
}

.zct-switcher--links .zct-btn {
	padding: 2px 6px;
	border-radius: 0;
	background: transparent;
	color: inherit;
	opacity: 0.55;
	font-weight: 500;
	letter-spacing: 0.05em;
	font-size: 0.875em;
	text-transform: uppercase;
	transition: opacity 0.15s ease;
}

.zct-switcher--links .zct-btn:hover {
	opacity: 1;
}

.zct-switcher--links .zct-btn.is-active {
	opacity: 1;
	font-weight: 700;
}

.zct-switcher--links .zct-sep {
	display: inline-block;
	padding: 0 4px;
	opacity: 0.4;
	user-select: none;
	font-size: 0.875em;
}

/* Color forzado vía atributo (shortcode color="...").
   Sobrescribe el modo oscuro y cualquier herencia. */
.zct-switcher[style*="--zct-color"] .zct-btn,
.zct-switcher[style*="--zct-color"] .zct-sep {
	color: var(--zct-color) !important;
}

/* ---------- Modo "solo banderas" (labels="0" + flag="1") ---------- */

.zct-switcher--no-labels .zct-btn {
	padding: 4px 6px;
	gap: 0;
}

.zct-switcher--no-labels .zct-flag {
	width: 24px;
	height: 16px;
	border-radius: 2px;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.zct-switcher--no-labels .zct-btn {
	opacity: 0.55;
}

.zct-switcher--no-labels .zct-btn:hover {
	opacity: 1;
}

.zct-switcher--no-labels .zct-btn:hover .zct-flag {
	transform: scale(1.08);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.zct-switcher--no-labels .zct-btn.is-active {
	opacity: 1;
}

.zct-switcher--no-labels .zct-btn.is-active .zct-flag {
	box-shadow: 0 0 0 2px currentColor;
}

/* En modo links + sin labels, el separador queda alineado al medio de la bandera */
.zct-switcher--links.zct-switcher--no-labels {
	align-items: center;
}

.zct-switcher--links.zct-switcher--no-labels .zct-sep {
	font-size: 1em;
	padding: 0 6px;
}

/* En modo pill + sin labels, las banderas necesitan menos padding */
.zct-switcher--pill.zct-switcher--no-labels .zct-btn {
	padding: 5px 8px;
}

/* ---------- Inyección automática ---------- */

.zct-auto-inject--header {
	display: flex;
	justify-content: flex-end;
	padding: 8px 16px;
	background: rgba(0, 0, 0, 0.02);
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.zct-auto-inject--footer {
	display: flex;
	justify-content: center;
	padding: 16px;
}

.zct-menu-item {
	display: flex !important;
	align-items: center;
	padding: 8px 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	.zct-switcher--block {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.zct-switcher--block .zct-btn {
		justify-content: center;
		width: 100%;
	}
}

/* ---------- Modo oscuro ---------- */

@media (prefers-color-scheme: dark) {
	.zct-switcher--pill {
		background: rgba(255, 255, 255, 0.1);
	}

	.zct-switcher--pill .zct-btn.is-active {
		background: #fff;
		color: #111;
	}

	.zct-switcher--block .zct-btn {
		background: #1a1a1a;
		color: #fff;
		border-color: rgba(255, 255, 255, 0.2);
	}

	.zct-switcher--block .zct-btn.is-active {
		background: #fff;
		color: #111;
		border-color: #fff;
	}
}
