/**
 * Google Follow Buttons TE — Frontend Styles
 *
 * Buttons are injected server-side into the Newsfy/Rivax theme's .meta-3 flex
 * slot inside .single-hero-meta. On desktop they sit to the right of the author
 * name and date; on mobile they wrap to a new row below.
 *
 * @package Google_Follow_Buttons_TE
 * @since   1.0.0
 * @updated 1.0.4 — Rewritten for .meta-3 placement.
 */

/* ── Custom property (overridden via inline style from settings) ───────────── */
:root {
	--gfbte-button-height: 40px;
	--gfbte-gap:           8px;
}

/* ── .meta-3 host container ───────────────────────────────────────────────── */
/*
 * The Newsfy theme makes .single-hero-meta a flex row:
 *   .meta-1 (avatar) | .meta-2 (name/date) | .meta-3 (right slot)
 * We push .meta-3 to the far right with margin-left: auto and ensure it
 * can shrink on narrow viewports without overflowing.
 */
.single-hero-meta .meta-3 {
	display:        flex;
	align-items:    center;
	margin-left:    auto;  /* Push to right edge of the flex row */
	flex-shrink:    1;
	min-width:      0;
}

/* ── Buttons wrapper ──────────────────────────────────────────────────────── */
.gfbte-buttons-wrapper {
	display:     flex;
	align-items: center;
	flex-wrap:   wrap;
	gap:         var(--gfbte-gap);
	min-width:   0;
}

/* ── Fallback wrapper (used when .meta-3 is not found) ────────────────────── */
.gfbte-below-meta {
	display:       flex;
	align-items:   center;
	flex-wrap:     wrap;
	gap:           var(--gfbte-gap);
	margin-top:    12px;
	margin-bottom: 4px;
}

/* ── Individual button link ───────────────────────────────────────────────── */
.gfbte-button {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	flex-shrink:     0;
	text-decoration: none;
	border:          none;
	background:      none;
	padding:         0;
	margin:          0;
	line-height:     1;
	border-radius:   4px;
	transition:      opacity 0.15s ease, box-shadow 0.15s ease;
}

.gfbte-button:hover,
.gfbte-button:focus-visible {
	opacity: 0.85;
}

.gfbte-button:focus-visible {
	outline:    2px solid transparent;
	box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.45);
}

/* ── Button image ─────────────────────────────────────────────────────────── */
.gfbte-button-img {
	display:          block;
	height:           var(--gfbte-button-height);
	width:            auto;
	max-width:        none;  /* Override any theme max-width on images */
	border:           none;
	box-shadow:       none;
	margin:           0;
	padding:          0;
	vertical-align:   middle;
}

/*
 * Hard override for theme rules that commonly break image proportions.
 * Scoped tightly to our wrapper to avoid collateral effects.
 */
.gfbte-buttons-wrapper img,
.gfbte-below-meta img {
	display:    block !important;
	height:     var(--gfbte-button-height) !important;
	width:      auto !important;
	max-width:  none !important;
	border:     none !important;
	box-shadow: none !important;
	margin:     0 !important;
	padding:    0 !important;
	float:      none !important;
}

/* ── Mobile / tablet — single row, slightly smaller ───────────────────────── */
@media ( max-width: 767px ) {

	/*
	 * Push .meta-3 onto its own full-width row below the author name and date.
	 */
	.single-hero-meta .meta-3 {
		flex:        0 0 100%;
		margin-left: 0;
		margin-top:  10px;
	}

	/*
	 * Keep both buttons on ONE line — no wrapping.
	 * Reduce the gap slightly to recover a few pixels.
	 */
	.gfbte-buttons-wrapper {
		flex-wrap:       nowrap;
		justify-content: flex-start;
		gap:             6px;
	}

	/*
	 * Scale each button down to ~78 % of the configured desktop height so both
	 * fit comfortably side by side on narrow screens.
	 * flex-shrink allows further compression on very small viewports.
	 */
	.gfbte-button {
		flex-shrink: 1;
		min-width:   0;
	}

	.gfbte-button-img,
	.gfbte-buttons-wrapper img {
		height: calc( var( --gfbte-button-height ) * 0.78 ) !important;
		width:  auto !important;
	}
}
