/*
 * Compartidor2026.css - Botonera de compartir articles (Interempresas)
 * Va amb Compartidor2026.js. Tots els selectors van prefixats amb ".compartidor .cmp" perquè
 * guanyin a les regles antigues (.P14 .noticia-detall-autor-social-links a {...}) si el
 * compartidor queda dins d'aquell contenidor.
 *
 * Punts de tall:  >= 992px escriptori amb etiquetes
 *                 768-991px escriptori compacte (només icones)
 *                 <= 767px mòbil (botons grans, compartició nativa)
 */

.compartidor {
	--cmp-text: #1f2937;
	--cmp-suau: #5b6776;
	--cmp-vora: #cfd6df;
	--cmp-fons-suau: #eef1f5;
	--cmp-lectures: #39597e;
	--cmp-email: #0a88ff;
	--cmp-linkedin: #0a66c2;
	--cmp-whatsapp: #25a244;
	--cmp-facebook: #1877f2;
	--cmp-x: #000000;
	--cmp-teams: #5b5fc7;
	--cmp-telegram: #229ed9;
	--cmp-nadiu: #0a88ff;
	--cmp-ok: #1e8e4a;
	--cmp-focus: #e60000;
	--cmp-radi: 6px;
	--cmp-alt: 38px;
}

/* Encaix amb la maqueta actual: el compartidor viu dins
   .P14 > ... > .noticia-detall-autor-social-links (float:right), al costat de la data/autor */
.noticia-detall-autor-social-links:has(> .compartidor) { max-width: 100%; }
.P14 .noticia-detall-autor-social-links .compartidor { margin: 0; }
/* Aire entre la línia de sota el títol (.P11) i la fila data/autor + botonera */
.P14:has(.compartidor) { padding-top: 10px; }

.compartidor .cmp {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: center;
	gap: 6px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;		/* .noticia-detall-autor-info posa vermell i negreta: no ho heretem */
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	color: var(--cmp-text);
	-webkit-tap-highlight-color: transparent;
}

.compartidor .cmp *,
.compartidor .cmp *::before,
.compartidor .cmp *::after { box-sizing: border-box; }

.compartidor .cmp .cmp-botons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

/* ---------- Lectures (bloc diferenciat, no és un botó) ---------- */
.compartidor .cmp .cmp-lectures {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: var(--cmp-alt);
	padding: 0 13px;
	border-radius: 999px;
	background: var(--cmp-fons-suau);
	color: var(--cmp-lectures);
	white-space: nowrap;
	cursor: default;
}
.compartidor .cmp .cmp-lectures svg { width: 17px; height: 17px; flex: none; }
.compartidor .cmp .cmp-lectures b { font-weight: 700; color: var(--cmp-text); }
.compartidor .cmp .cmp-lectures .cmp-txt { color: var(--cmp-suau); }

.compartidor .cmp .cmp-sep {
	width: 1px;
	height: 24px;
	margin: 0 4px;
	background: var(--cmp-vora);
}

/* ---------- Botons ---------- */
.compartidor .cmp .cmp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: auto;
	min-width: var(--cmp-alt);
	height: var(--cmp-alt);
	margin: 0 !important;	/* #pgArticle .noticia-detall-autor-social-links a {margin-bottom:5px} (CanalCSS) */
	padding: 0 11px;
	border: 1px solid transparent;
	border-radius: var(--cmp-radi);
	background: var(--cmp-text);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.compartidor .cmp .cmp-btn svg { width: 18px; height: 18px; flex: none; }
.compartidor .cmp .cmp-btn:hover { text-decoration: none; filter: brightness(.92); }
.compartidor .cmp .cmp-btn:active { transform: translateY(1px); }
.compartidor .cmp .cmp-btn:focus { outline: none; }
.compartidor .cmp .cmp-btn:focus-visible,
.compartidor .cmp .cmp-item:focus-visible {
	outline: 2px solid var(--cmp-focus);
	outline-offset: 2px;
}

.compartidor .cmp .cmp-btn--email    { background: var(--cmp-email); }
.compartidor .cmp .cmp-btn--linkedin { background: var(--cmp-linkedin); padding: 0 14px; }
.compartidor .cmp .cmp-btn--whatsapp { background: var(--cmp-whatsapp); }
.compartidor .cmp .cmp-btn--whatsapp svg { width: 20px; height: 20px; }
.compartidor .cmp .cmp-btn--nadiu    { background: var(--cmp-nadiu); display: none; }

/* Botons secundaris: blancs amb vora */
.compartidor .cmp .cmp-btn--copiar,
.compartidor .cmp .cmp-btn--mes {
	background: #fff;
	color: var(--cmp-text);
	border-color: var(--cmp-vora);
}
.compartidor .cmp .cmp-btn--copiar:hover,
.compartidor .cmp .cmp-btn--mes:hover,
.compartidor .cmp .cmp-btn--mes[aria-expanded="true"] {
	filter: none;
	background: #f5f7fa;
	border-color: #9aa5b3;
}
.compartidor .cmp .cmp-btn--copiar svg { width: 17px; height: 17px; color: var(--cmp-suau); }

/* Estat "Copiat!" */
.compartidor .cmp .cmp-btn--copiar.cmp-btn--fet,
.compartidor .cmp .cmp-btn--copiar.cmp-btn--fet:hover {
	background: #e9f7ef;
	border-color: var(--cmp-ok);
	color: var(--cmp-ok);
}
.compartidor .cmp .cmp-btn--fet svg { color: var(--cmp-ok); }

.compartidor .cmp .cmp-txt--curt { display: none; }

/* ---------- Menú "Més" ---------- */
.compartidor .cmp .cmp-mes { position: relative; display: inline-flex; }

.compartidor .cmp .cmp-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 1000;
	display: block;
	min-width: 190px;
	padding: 6px;
	background: #fff;
	border: 1px solid #dfe3e8;
	border-radius: 8px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
	text-align: left;
}
.compartidor .cmp .cmp-menu[hidden] { display: none; }
.compartidor .cmp .cmp-menu--amunt { top: auto; bottom: calc(100% + 6px); }

.compartidor .cmp .cmp-item {
	display: flex;
	align-items: center;
	gap: 11px;
	width: auto;
	height: auto;
	margin: 0 !important;
	padding: 10px 12px;
	border-radius: 6px;
	background: transparent;
	color: var(--cmp-text);
	font-weight: 500;
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
}
.compartidor .cmp .cmp-item:hover,
.compartidor .cmp .cmp-item:focus { background: #f1f4f8; color: var(--cmp-text); text-decoration: none; }
.compartidor .cmp .cmp-item svg { width: 17px; height: 17px; flex: none; }
.compartidor .cmp .cmp-item--email svg    { color: var(--cmp-email); }
.compartidor .cmp .cmp-item--facebook svg { color: var(--cmp-facebook); }
.compartidor .cmp .cmp-item--x svg        { color: var(--cmp-x); }
.compartidor .cmp .cmp-item--teams svg    { color: var(--cmp-teams); width: 19px; }
.compartidor .cmp .cmp-item--telegram svg { color: var(--cmp-telegram); }
.compartidor .cmp .cmp-item--email        { display: none; }	/* a escriptori el correu ja és a primer nivell */

/* Text només per a lectors de pantalla */
.compartidor .cmp .cmp-avis {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Escriptori compacte: només icones ---------- */
@media (min-width: 768px) and (max-width: 991px) {
	.compartidor .cmp .cmp-btn .cmp-txt { display: none; }
	.compartidor .cmp .cmp-btn { padding: 0 10px; }
	.compartidor .cmp .cmp-lectures .cmp-txt { display: none; }
}

/* ---------- Mòbil ---------- */
@media (max-width: 767px) {
	.compartidor { --cmp-alt: 50px; }

	/* Amb autor destacat, el compartidor és dins .noticia-detall-autor-info.grid-100, que en mòbil
	   flota i s'encongeix al contingut (nom + data) i afegeix padding i marge: que ocupi tota l'amplada */
	.P14 .noticia-detall-autor-info:has(.compartidor) {
		float: none;
		width: auto;
		padding-left: 0;
		padding-right: 0;
		margin-right: 0;
	}

	/* En mòbil la botonera ocupa tota l'amplada, sota la data/autor */
	.P14 .noticia-detall-autor-social-links:has(> .compartidor) {
		float: none;
		clear: both;
		width: 100%;
		margin-right: 0;
	}

	.compartidor .cmp {
		flex-wrap: nowrap;
		width: 100%;
		gap: 6px;
		margin: 6px 0;
	}
	.compartidor .cmp .cmp-sep { display: none; }

	.compartidor .cmp .cmp-lectures {
		flex: none;
		flex-direction: column;
		justify-content: center;
		gap: 3px;
		height: var(--cmp-alt);
		padding: 0 9px;
		border-radius: var(--cmp-radi);
		font-size: 12px;
	}
	.compartidor .cmp .cmp-lectures .cmp-txt { display: none; }

	.compartidor .cmp .cmp-botons {
		flex: 1 1 auto;
		flex-wrap: nowrap;
		min-width: 0;
		gap: 6px;
	}
	.compartidor .cmp .cmp-btn,
	.compartidor .cmp .cmp-mes {
		flex: 1 1 0;
		min-width: 0;
	}
	.compartidor .cmp .cmp-btn {
		flex-direction: column;
		gap: 4px;
		padding: 0 4px;
		font-size: 11px;
		font-weight: 600;
		border-radius: 8px;
	}
	.compartidor .cmp .cmp-mes .cmp-btn { width: 100%; }
	.compartidor .cmp .cmp-btn svg,
	.compartidor .cmp .cmp-btn--copiar svg { width: 21px; height: 21px; }
	.compartidor .cmp .cmp-btn--whatsapp svg { width: 23px; height: 23px; }

	.compartidor .cmp .cmp-txt--llarg { display: none; }
	.compartidor .cmp .cmp-txt--curt { display: inline; }

	/* Amb compartició nativa (iOS/Android): botó "Compartir" principal i el correu passa al menú */
	.compartidor .cmp--nadiu .cmp-btn--nadiu { display: inline-flex; flex-grow: 1.4; }
	.compartidor .cmp .cmp-btn--email { display: none; }
	.compartidor .cmp .cmp-item--email { display: flex; }

	.compartidor .cmp .cmp-menu { min-width: 210px; }
	.compartidor .cmp .cmp-item { padding: 14px 14px; font-size: 15px; }
}

/* Mòbils molt estrets: amaguem les etiquetes per no apretar */
@media (max-width: 359px) {
	.compartidor .cmp .cmp-btn .cmp-txt { display: none; }
	.compartidor .cmp .cmp-lectures { padding: 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.compartidor .cmp .cmp-btn { transition: none; }
}

@media print {
	.compartidor { display: none !important; }
}
