/* ==========================================================================
   AhojNet Share
   --------------------------------------------------------------------------
   Pravidlá:
   - Elementor ovládače nastavujú iba CSS premenné; tu sa čítajú cez
     var(--x, predvolená) → žiadne súboje špecificity s post-CSS Elementora.
   - Reset tlačidiel má špecificitu (0,2,0)+, aby prebil štýly tém
     (napr. Hello Elementor [type=button]).
   - Typografia je v :where() (nízka špecificita), aby ju Elementor
     Typography ovládače vždy prepísali.
   ========================================================================== */

/* ---------- Wrapper ---------- */
.ahn-share {
	display: flex;
	align-items: center;
}

/* ---------- Spoločný reset tlačidiel v rámci widgetu ---------- */
.ahn-share .ahn-share__trigger,
.ahn-share .ahn-share__btn,
.ahn-share .ahn-share__round,
.ahn-share .ahn-share__net-link {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	border: 0;
	background: none;
	box-shadow: none;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.ahn-share .ahn-share__svg {
	display: block;
	width: 1em;
	height: 1em;
	flex: none;
}

/* ---------- Hlavná ikona (trigger) ---------- */
.ahn-share .ahn-share__trigger {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	min-width: 44px;               /* dotykový cieľ */
	min-height: 44px;
	justify-content: center;
	padding: var(--ahn-trigger-pad, 10px);
	border-radius: var(--ahn-trigger-radius, 999px);
	color: var(--ahn-trigger-color, currentColor);
	background-color: var(--ahn-trigger-bg, transparent);
	transition: background-color .15s ease, color .15s ease;
}

.ahn-share .ahn-share__trigger:hover,
.ahn-share .ahn-share__trigger:focus-visible {
	color: var(--ahn-trigger-color-hover, var(--ahn-trigger-color, currentColor));
	background-color: var(--ahn-trigger-bg-hover, rgba(60, 64, 67, .08));
}

.ahn-share .ahn-share__trigger-icon {
	display: inline-flex;
	font-size: var(--ahn-trigger-icon, 22px);
	line-height: 1;
}

/* Elementor ikony (FA font aj SVG) v rovnakej veľkosti */
.ahn-share .ahn-share__trigger-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

:where(.ahn-share) .ahn-share__trigger-label {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
}

/* ---------- Fokus (klávesnica) ---------- */
.ahn-share :focus-visible {
	outline: 2px solid var(--ahn-accent, #0b57d0);
	outline-offset: 2px;
}

/* ==========================================================================
   Dialog
   ========================================================================== */
.ahn-share .ahn-share__dialog {
	box-sizing: border-box;
	width: min(var(--ahn-dialog-w, 560px), calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: var(--ahn-dialog-radius, 28px);
	color: var(--ahn-text, #1f1f1f);
	background: var(--ahn-surface, #f8f9fa);
	overflow: auto;
	overscroll-behavior: contain;
}

:where(.ahn-share) .ahn-share__dialog {
	box-shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 8px 24px rgba(60, 64, 67, .18);
}

:where(.ahn-share) .ahn-share__dialog::backdrop {
	background-color: rgba(32, 33, 36, .45);
}

/* Otvorenie – odpoveď na akciu používateľa */
.ahn-share .ahn-share__dialog[open] {
	animation: ahn-share-in .18s cubic-bezier(.2, 0, 0, 1);
}

@keyframes ahn-share-in {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to   { opacity: 1; transform: none; }
}

.ahn-share .ahn-share__panel {
	box-sizing: border-box;
	padding: var(--ahn-panel-pad, 20px 24px 24px);
}

/* ---------- Hlavička ---------- */
.ahn-share .ahn-share__head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
}

:where(.ahn-share) .ahn-share__title {
	flex: 1;
	margin: 0;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.25;
	color: inherit;
}

.ahn-share .ahn-share__round {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 50%;
	font-size: 20px;
	color: var(--ahn-text, #1f1f1f);
	flex: none;
}

.ahn-share .ahn-share__round:hover {
	background-color: rgba(60, 64, 67, .08);
	color: var(--ahn-text, #1f1f1f);
}

/* [hidden] musí vyhrať nad display:inline-flex */
.ahn-share [hidden] {
	display: none !important;
}

/* ---------- Riadok s URL ---------- */
.ahn-share .ahn-share__row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ahn-share .ahn-share__url {
	display: flex;
	align-items: center;
	flex: 1;
	min-width: 0;
	gap: 8px;
	padding: 6px 6px 6px 18px;
	border: 1px solid var(--ahn-line, #dadce0);
	border-radius: 999px;
	background-color: var(--ahn-field, #fff);
}

.ahn-share .ahn-share__input {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: var(--ahn-muted, #444746);
	text-overflow: ellipsis;
	outline: none;
}

.ahn-share .ahn-share__input:focus {
	outline: none;
	box-shadow: none;
}

.ahn-share .ahn-share__url:focus-within {
	border-color: var(--ahn-accent, #0b57d0);
}

.ahn-share .ahn-share__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: none;
	min-height: 40px;
	padding: 8px 16px 8px 12px;
	border-radius: 999px;
	color: var(--ahn-btn-text, #1f1f1f);
	background-color: var(--ahn-chip, #e3e5e8);
	transition: background-color .15s ease;
}

.ahn-share .ahn-share__btn:hover {
	color: var(--ahn-btn-text, #1f1f1f);
	background-color: color-mix(in srgb, var(--ahn-chip, #e3e5e8), #000 7%);
}

.ahn-share .ahn-share__btn--icon {
	width: 52px;
	height: 52px;
	padding: 0;
	justify-content: center;
	font-size: 20px;
}

.ahn-share .ahn-share__btn-icon {
	display: inline-flex;
	font-size: 18px;
}

:where(.ahn-share) .ahn-share__btn,
:where(.ahn-share) .ahn-share__input {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	font-family: inherit;
}

:where(.ahn-share) .ahn-share__input {
	font-weight: 400;
}

/* Potvrdenie skopírovania */
.ahn-share .ahn-share__btn.is-copied {
	color: #fff;
	background-color: var(--ahn-accent, #0b57d0);
}

/* ---------- Siete ---------- */
.ahn-share .ahn-share__nets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
	gap: 16px 4px;
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
}

.ahn-share .ahn-share__net {
	display: flex;
	justify-content: center;
	margin: 0;
	padding: 0;
}

.ahn-share .ahn-share__net::before,
.ahn-share .ahn-share__net::marker {
	content: none;
}

.ahn-share .ahn-share__net-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 4px;
	border-radius: 12px;
	color: var(--ahn-net-label, #1f1f1f);
}

.ahn-share .ahn-share__net-link:hover {
	color: var(--ahn-net-label, #1f1f1f);
}

.ahn-share .ahn-share__net-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--ahn-net-size, 56px);
	height: var(--ahn-net-size, 56px);
	border-radius: 50%;
	font-size: var(--ahn-net-icon, 26px);
	color: var(--ahn-net-color, #1f1f1f);
	background-color: var(--ahn-net-bg, #e3e5e8);
	transition: background-color .15s ease;
}

.ahn-share .ahn-share__net-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.ahn-share .ahn-share__net-link:hover .ahn-share__net-icon {
	background-color: color-mix(in srgb, var(--ahn-net-bg, #e3e5e8), #000 7%);
}

/* Farby značiek – logo vo farbe značky na neutrálnom kruhu */
.ahn-share--brand .ahn-share__net[style] .ahn-share__net-icon {
	color: var(--ahn-brand);
}

:where(.ahn-share) .ahn-share__net-label {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
}

.ahn-share--no-labels .ahn-share__net-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- QR pohľad ---------- */
.ahn-share .ahn-share__view--qr {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.ahn-share .ahn-share__qr {
	width: var(--ahn-qr-size, 224px);
	max-width: 100%;
	aspect-ratio: 1;
	padding: 12px;
	box-sizing: border-box;
	border-radius: 16px;
	background: #fff;
}

.ahn-share .ahn-share__qr svg {
	display: block;
	width: 100%;
	height: 100%;
}

:where(.ahn-share) .ahn-share__hint {
	max-width: 36ch;
	margin: 20px 0 6px;
	font-size: 15px;
	line-height: 1.45;
}

:where(.ahn-share) .ahn-share__qr-url {
	max-width: 100%;
	margin: 0;
	overflow: hidden;
	font-size: 13px;
	color: var(--ahn-muted, #444746);
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Chybový stav QR */
.ahn-share .ahn-share__qr.is-error {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	color: #b3261e;
}

/* ---------- Čítačky obrazovky ---------- */
.ahn-share .ahn-share__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ==========================================================================
   Mobil – spodný panel (bottom sheet)
   ========================================================================== */
@media (max-width: 600px) {
	.ahn-share .ahn-share__dialog {
		width: 100%;
		max-height: 90dvh;
		margin: auto 0 0;
		border-radius: var(--ahn-dialog-radius, 28px) var(--ahn-dialog-radius, 28px) 0 0;
	}

	.ahn-share .ahn-share__dialog[open] {
		animation-name: ahn-share-up;
	}

	.ahn-share .ahn-share__panel {
		padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	}

	/* Text „Kopírovať odkaz“ sa na úzkych displejoch skryje, ostane ikona */
	.ahn-share .ahn-share__url .ahn-share__btn-text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.ahn-share .ahn-share__url .ahn-share__btn {
		width: 40px;
		padding: 0;
		justify-content: center;
	}

	.ahn-share .ahn-share__btn--icon {
		width: 46px;
		height: 46px;
	}

	.ahn-share .ahn-share__nets {
		grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
	}
}

/* Menší nadpis na mobile (mimo :where by prebil Elementor Typography) */
@media (max-width: 600px) {
	:where(.ahn-share) .ahn-share__title {
		font-size: 20px;
	}
}

@keyframes ahn-share-up {
	from { transform: translateY(100%); }
	to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ahn-share .ahn-share__dialog[open] {
		animation: none;
	}
	.ahn-share .ahn-share__trigger,
	.ahn-share .ahn-share__btn,
	.ahn-share .ahn-share__net-icon {
		transition: none;
	}
}
