/**
 * Partage d'annonces — bouton + popover.
 * Scopé sur .tfd-share, hérite de la typo du thème (DM Sans).
 *
 * @package tfd-core
 */

.tfd-share {
	position: relative;
	display: inline-block;
	margin-right: 1.25rem; /* Espace avant le toggle Favoris. */
}

/* Bouton déclencheur : même rendu que le lien Favoris voisin. */
.tfd-share__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	line-height: inherit;
	cursor: pointer;
}

.tfd-share__toggle:hover,
.tfd-share__toggle[aria-expanded="true"] {
	color: var(--primary, #F15A29); /* Orange charte, défini dans listinghive-child/style.css. */
}

.tfd-share__toggle:focus-visible,
.tfd-share__item:focus-visible,
.tfd-share__close:focus-visible {
	outline: 2px solid var(--primary, #F15A29);
	outline-offset: 2px;
}

/* Popover */
.tfd-share__popover {
	position: absolute;
	top: calc(100% + 0.5rem);
	right: 0;
	z-index: 100;
	width: 15rem;
	max-width: calc(100vw - 2rem);
	padding: 0.5rem 0;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 0.75rem;
	box-shadow: 0 0.75rem 2rem rgba(20, 20, 20, 0.12);
	text-align: left;
}

.tfd-share__popover[hidden] {
	display: none;
}

.tfd-share__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.25rem 1rem 0.5rem;
	font-weight: 700;
	color: #202A35;
}

.tfd-share__close {
	padding: 0 0.25rem;
	border: 0;
	background: none;
	font-size: 1.5rem;
	line-height: 1;
	color: #5F6670;
	cursor: pointer;
}

.tfd-share__close:hover {
	color: #202A35;
}

.tfd-share__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tfd-share__list li {
	margin: 0;
	padding: 0;
}

.tfd-share .tfd-share__popover button.tfd-share__item,
.tfd-share .tfd-share__popover a.tfd-share__item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	margin: 0;
	padding: 0.6rem 1rem;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	/* Spécificité (0,3,1) : ListingHive (CSS inline hivetheme) écrase font-family
	   et font-weight des <button> via des sélecteurs composés en (0,2,1). */
	font-family: inherit;
	font-size: 1rem;
	/* !important nécessaire : listinghive-child/style.css (~l.1009) applique
	   "button { font-weight: 600 !important }" sans scope. À retirer ici
	   le jour où cette règle du child theme est scopée. */
	font-weight: 400 !important;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	color: #202A35;
	text-decoration: none;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.12s ease;
}

.tfd-share__item:hover {
	background: #F8F9FA;
	color: #202A35;
}

.tfd-share__item i {
	width: 1.25rem;
	text-align: center;
	color: #5F6670;
}

.tfd-share__icon {
	flex: 0 0 1.25rem;
	width: 1.25rem;
	height: 1.1rem;
	fill: currentColor;
	color: #5F6670;
}

.tfd-share__item.is-copied,
.tfd-share__item.is-copied i,
.tfd-share__item.is-copied .tfd-share__icon {
	color: var(--primary, #F15A29);
}

/* Canaux natifs mobile : masqués sur desktop où ils ne fonctionnent pas. */
@media (hover: hover) and (pointer: fine) {
	.tfd-share__item[data-share="sms"] {
		display: none;
	}
}

/* Mobile : le popover s'ancre à gauche pour ne pas sortir de l'écran. */
@media only screen and (max-width: 47.99em) {
	.tfd-share__popover {
		right: auto;
		left: 0;
	}
}
