<?php
/**
 * Floating Sidebar — Variant 3 (List Style)
 *
 * @package Relatedly
 * @since   2.0.0
 * @var array $data Template variables from AbstractTheme::template_vars().
 */
defined( 'ABSPATH' ) || exit;
?>
<div class="relatedly-floating-item relatedly-floating-v3"
	style="<?php echo esc_attr( $data['css_vars'] ); ?>"
	data-relatedly-source="<?php echo esc_attr( $data['source_post_id'] ); ?>"
	data-relatedly-type="floating">
	<div class="relatedly-floating-row">
		<?php if ( $data['thumbnail_id'] ) : ?>
			<div class="relatedly-floating-thumb-sm">
				<?php echo wp_get_attachment_image( $data['thumbnail_id'], [ 48, 48 ] ); ?>
			</div>
		<?php endif; ?>
		<div class="relatedly-floating-content">
			<span class="relatedly-floating-label"><?php echo esc_html( $data['label'] ); ?></span>
			<a href="<?php echo esc_url( $data['permalink'] ); ?>"
				class="relatedly-floating-title relatedly-tracked-link"
				<?php if ( '_blank' === $data['link_target'] ) : ?>target="_blank" rel="noopener noreferrer"<?php elseif ( $data['link_rel'] ) : ?>rel="<?php echo esc_attr( $data['link_rel'] ); ?>"<?php endif; ?>
				<?php if ( $data['source_post_id'] ) : ?>data-relatedly-source="<?php echo esc_attr( $data['source_post_id'] ); ?>" data-relatedly-clicked="<?php echo esc_attr( $data['tracking_post_id'] ); ?>" data-relatedly-type="<?php echo esc_attr( $data['display_type'] ); ?>"<?php endif; ?>
			><?php echo esc_html( $data['title'] ); ?></a>
		</div>
	</div>
</div>
