/* Arkebuz – Słowniczek */

/* Hasło w tekście: kropkowane podkreślenie w kolorze strony, kursor „pomoc”. */
.ark-term {
	cursor: help;
	text-decoration: underline dotted rgba( 221, 19, 60, 0.75 );
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
	border-radius: 2px;
	transition: background-color 0.15s ease;
}

.ark-term:hover,
.ark-term[aria-describedby] {
	background-color: rgba( 221, 19, 60, 0.08 );
}

.ark-term:focus {
	outline: none;
}

.ark-term:focus-visible {
	outline: 2px solid #dd133c;
	outline-offset: 2px;
}

/* ---------- Dymek ---------- */

.ark-term-tip {
	--ark-tip-arrow: 50%;
	position: fixed;
	z-index: 100000;
	box-sizing: border-box;
	width: max-content;
	max-width: min( 300px, calc( 100vw - 24px ) );
	padding: 14px 16px 15px;
	border: 1px solid #e2e2e2;
	border-top: 3px solid #dd133c;
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 14px 40px rgba( 0, 0, 0, 0.16 );
	color: #404040;
	font-size: 14px;
	line-height: 1.55;
	text-align: left;
	pointer-events: none;
	animation: ark-tip-in 0.15s ease both;
}

.ark-term-tip[hidden] {
	display: none;
}

/* Strzałka wskazująca hasło */
.ark-term-tip::after {
	content: "";
	position: absolute;
	bottom: -7px;
	left: var( --ark-tip-arrow );
	width: 12px;
	height: 12px;
	margin-left: -6px;
	border-right: 1px solid #e2e2e2;
	border-bottom: 1px solid #e2e2e2;
	background: inherit;
	transform: rotate( 45deg );
}

.ark-term-tip.is-below::after {
	top: -9px;
	bottom: auto;
	border: 0;
	border-top: 3px solid #dd133c;
	border-left: 3px solid #dd133c;
	width: 10px;
	height: 10px;
	margin-left: -5px;
}

.ark-term-tip__label {
	display: block;
	margin-bottom: 5px;
	color: #dd133c;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ark-term-tip__desc {
	display: block;
}

@keyframes ark-tip-in {
	from {
		opacity: 0;
		transform: translateY( 4px );
	}
}

/* ---------- Okienko (telefon) ---------- */

.ark-term-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba( 0, 0, 0, 0.55 );
	animation: ark-modal-in 0.15s ease both;
}

.ark-term-modal[hidden] {
	display: none;
}

.ark-term-modal__box {
	box-sizing: border-box;
	width: 100%;
	max-width: 380px;
	padding: 20px 22px 24px;
	border-top: 4px solid #dd133c;
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 24px 60px rgba( 0, 0, 0, 0.35 );
	color: #404040;
}

.ark-term-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.ark-term-modal__label {
	padding-top: 6px;
	color: #dd133c;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Pełny reset – motyw nadaje każdemu <button> czerwone tło i padding. */
html .ark-term-modal .ark-term-modal__close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: -6px -10px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #555555;
	cursor: pointer;
}

html .ark-term-modal .ark-term-modal__close:hover,
html .ark-term-modal .ark-term-modal__close:focus {
	background: rgba( 0, 0, 0, 0.06 );
	color: #191919;
}

.ark-term-modal__close svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.ark-term-modal__desc {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
}

@keyframes ark-modal-in {
	from {
		opacity: 0;
	}
}

/* ---------- Ciemny motyw (wtyczka Arkebuz – Jasny i ciemny motyw) ---------- */

html[data-ark-theme="dark"] .ark-term {
	text-decoration-color: rgba( 255, 143, 166, 0.8 );
}

html[data-ark-theme="dark"] .ark-term:hover,
html[data-ark-theme="dark"] .ark-term[aria-describedby] {
	background-color: rgba( 255, 143, 166, 0.12 );
}

html[data-ark-theme="dark"] .ark-term:focus-visible {
	outline-color: #ff8fa6;
}

html[data-ark-theme="dark"] .ark-term-tip,
html[data-ark-theme="dark"] .ark-term-modal__box {
	border-color: #363636;
	border-top-color: #ff8fa6;
	background: #1c1c1c;
	box-shadow: 0 14px 40px rgba( 0, 0, 0, 0.6 );
	color: #d2d2d2;
}

html[data-ark-theme="dark"] .ark-term-tip::after {
	border-color: #363636;
}

html[data-ark-theme="dark"] .ark-term-tip.is-below::after {
	border-color: #ff8fa6;
}

html[data-ark-theme="dark"] .ark-term-tip__label,
html[data-ark-theme="dark"] .ark-term-modal__label {
	color: #ff8fa6;
}

html[data-ark-theme="dark"] .ark-term-modal .ark-term-modal__close {
	color: #a6a6a6;
}

html[data-ark-theme="dark"] .ark-term-modal .ark-term-modal__close:hover,
html[data-ark-theme="dark"] .ark-term-modal .ark-term-modal__close:focus {
	background: rgba( 255, 255, 255, 0.08 );
	color: #f2f2f2;
}

@media ( prefers-reduced-motion: reduce ) {
	.ark-term-tip,
	.ark-term-modal {
		animation: none;
	}
}
