/**
 * Index Sticky Button - Base Styles
 * @package IndexStickyButton
 */

/* Container */
#isb-sticky-button {
	position: fixed;
	right: 1rem;        /* 16px */
	bottom: 1rem;       /* 16px */
	z-index: 999999;
}

/* Inline-Button (Shortcode [isb_button]) */
.isb-inline-button {
	display: inline-block;
}

/* Button-Link – geteilt zwischen Sticky und Inline */
#isb-sticky-button .isb-button-link,
.isb-inline-button .isb-button-link {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	position: relative;
	padding: 1rem;
	font-family: Arial, Helvetica, sans-serif !important;
	border-radius: 999px;           /* Pille – bleibt px (bewusst großer Wert) */
	text-decoration: none !important;
	background: var(--isb-btn-bg, #2271b1);
	color: var(--isb-btn-color, #fff);
	font-weight: 600;
	box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.5);  /* 0 2px 8px */
	transition: all 0.3s ease;
	cursor: pointer;
}

/* Kalender-Icon (::before)
   mask-image + background-color:currentColor statt background-image,
   damit das Icon die konfigurierte Textfarbe (--isb-btn-color) übernimmt */
#isb-sticky-button .isb-button-link::before,
.isb-inline-button .isb-button-link::before {
	display: inline-block !important;
	vertical-align: middle !important;
	content: "";
	flex-shrink: 0;
	width: 1.1rem;
	height: 1.3rem;
	margin-top: -0.3125rem !important;  /* -5px */
	color: var(--isb-btn-color, #fff) !important;
	background-color: var(--isb-btn-color, #fff) !important;
	-webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 14"><path fill="black" fill-rule="evenodd" d="M2.6,1.3v0.8H1.3C0.6,2.1,0,2.7,0,3.4v1.2h12V3.4c0-0.7-0.6-1.2-1.3-1.2H9.4V1.3c0-0.4-0.4-0.8-0.8-0.8c-0.5,0-0.9,0.4-0.9,0.8v0.8H4.3V1.3c0-0.4-0.4-0.8-0.9-0.8S2.6,0.9,2.6,1.3z M12,5.4H0v7c0,0.7,0.6,1.2,1.3,1.2h9.4c0.7,0,1.3-0.5,1.3-1.2V5.4z M5.4,7.5H6.6V8.9H8V10.1H6.6V11.5H5.4V10.1H4V8.9H5.4Z"/></svg>');
	mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 14"><path fill="black" fill-rule="evenodd" d="M2.6,1.3v0.8H1.3C0.6,2.1,0,2.7,0,3.4v1.2h12V3.4c0-0.7-0.6-1.2-1.3-1.2H9.4V1.3c0-0.4-0.4-0.8-0.8-0.8c-0.5,0-0.9,0.4-0.9,0.8v0.8H4.3V1.3c0-0.4-0.4-0.8-0.9-0.8S2.6,0.9,2.6,1.3z M12,5.4H0v7c0,0.7,0.6,1.2,1.3,1.2h9.4c0.7,0,1.3-0.5,1.3-1.2V5.4z M5.4,7.5H6.6V8.9H8V10.1H6.6V11.5H5.4V10.1H4V8.9H5.4Z"/></svg>');
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-position: center;
	mask-position: center;
}

/* -----------------------------------------------
   Pulsierender Glow
   --isb-glow-color wird per PHP-Inline-Style gesetzt
   (Buttonfarbe als rgba mit reduzierter Deckkraft).
   ----------------------------------------------- */
@keyframes isb-pulse {
	/*  0 % + 20 % halten den „aus"-Zustand → kurzes Aufleuchten bei 50 %
	    Blur und Spread sind in transparentem und gefärbtem Zustand gleich,
	    sodass nur die Farbe animiert wird → weiches, gleichmäßiges Fade.  */
	0%, 20%, 100% {
		box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.5),
		            0 0 0.5rem 0.5rem transparent;
	}
	50% {
		box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.5),
		            0 0 1.3rem 1.3rem var(--isb-glow-color, transparent);
	}
}

.isb-btn--glow {
	animation: isb-pulse 3s infinite;
}

/* Hover: Animation pausieren, damit scale-Effekt sauber greift */
.isb-btn--glow:hover {
	animation-play-state: paused;
}

/* Hover-Effekt */
#isb-sticky-button .isb-button-link:hover,
.isb-inline-button .isb-button-link:hover {
	transform: scale(1.08);
}

/* Focus für Barrierefreiheit */
#isb-sticky-button .isb-button-link:focus,
.isb-inline-button .isb-button-link:focus {
	outline: 2px solid var(--isb-btn-bg, #2271b1);     /* Outline bleibt px – Pixel-genaue Fokusanzeige */
	outline-offset: 2px;
}

/* Button-Text */
#isb-sticky-button .isb-button-text,
.isb-inline-button .isb-button-text {
	font-size: clamp(1rem, 0.125vw + 0.975rem, 1.125rem);    /* 16px */
	line-height: 1.2;
}

/* Responsive: Mobile
   – Button-Text visuell ausblenden (bleibt für Screenreader lesbar),
     nur noch Icon sichtbar → Button wird zum kompakten Kreis */
@media (max-width: 48rem) {     /* 768px */
	#isb-sticky-button {
		right: 0.75rem;     /* 12px */
		bottom: 0.75rem;    /* 12px */
	}

	#isb-sticky-button .isb-button-link {
		padding: 1rem 0.95rem;  /* 10px */
	}

	#isb-sticky-button .isb-button-text {
		/* Visuell versteckt, aber für assistive Technologien lesbar
		   (Entspricht der gängigen .sr-only / .visually-hidden Technik)
		   1px-Werte sind hier bewusst – rem würde die Technik destabilisieren */
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}
}
