/**
 * Shared components: buttons, language switcher, service card, contact form.
 */

/* Buttons ------------------------------------------------------------ */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	padding: var(--space-4) var(--space-6);
	border-radius: var(--radius-pill);
	font-family: var(--font-heading);
	font-weight: var(--weight-medium);
	font-size: var(--text-body);
	white-space: nowrap;
	border: 1px solid transparent;
}

.btn--dark {
	background: var(--color-gray-800);
	color: var(--color-white);
}

.btn--dark:hover {
	opacity: 0.85;
}

.btn--outline {
	background: transparent;
	border-color: var(--color-black);
	color: var(--color-black);
	padding: var(--space-3) var(--space-5);
}

.btn--outline:hover {
	background: var(--color-black);
	color: var(--color-white);
}

/* White CTA — solid button on a colored background (e.g. the purple CTA card). */
.btn--white {
	background: var(--color-white);
	color: var(--color-black);
}

.btn--white:hover {
	opacity: 0.9;
}

/* Plain text link, no background/border — sits inline next to a solid
   .btn--dark button (e.g. the 404 page's "Kontaktirajte nas" link). */
.btn--text {
	background: transparent;
	color: var(--color-gray-800);
}

.btn--text:hover {
	opacity: 0.7;
}

/* Language switcher ---------------------------------------------------- */

.lang-switcher {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-family: var(--font-heading);
	font-size: var(--text-caption);
}

.lang-switcher__link {
	opacity: 0.55;
}

.lang-switcher__link.is-current {
	opacity: 1;
}

.lang-switcher__sep {
	opacity: 0.4;
}

/* Service card (shared: homepage grid + archive) ------------------------ */

.services__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--space-5);
}

.service-card {
	display: flex;
	flex-direction: column;
	background: var(--color-gray-100);
	border-radius: var(--radius-lg);
	overflow: hidden;
	min-height: 420px;
}

.service-card__text {
	padding: var(--space-4) var(--space-4) 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.service-card__title {
	font-size: var(--text-subtitle);
	line-height: var(--text-subtitle-lh);
	font-weight: var(--weight-medium);
	color: var(--color-gray-900);
}

.service-card__description {
	font-family: var(--font-body);
	font-size: var(--text-paragraph);
	color: var(--color-gray-500);
}

.service-card__image {
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.service-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Contact form ---------------------------------------------------------- */

.contact-form-wrap {
	max-width: 520px;
}

.contact-form__notice {
	padding: var(--space-4);
	border-radius: var(--radius-md);
	margin-bottom: var(--space-5);
	font-family: var(--font-body);
	font-size: var(--text-paragraph);
}

.contact-form__notice--success {
	background: #eafbe7;
	color: #1a5c1a;
}

.contact-form__notice--error {
	background: #fde8e8;
	color: #8a1f1f;
}

.contact-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.contact-form__row {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin-bottom: var(--space-4);
}

.contact-form__row label {
	font-family: var(--font-heading);
	font-size: var(--text-caption);
	color: var(--color-text-muted);
}

.contact-form__row input,
.contact-form__row select,
.contact-form__row textarea {
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	padding: var(--space-3) var(--space-4);
	font-family: var(--font-body);
	font-size: var(--text-body);
	color: var(--color-text);
}

.contact-form__row input:focus,
.contact-form__row select:focus,
.contact-form__row textarea:focus {
	outline: 2px solid var(--color-primary);
	outline-offset: 1px;
}

.contact-form__row-group {
	display: flex;
	gap: var(--space-4);
}

.contact-form__row-group .contact-form__row {
	flex: 1 1 0;
	min-width: 0;
}

.contact-form button[type="submit"] {
	margin-top: var(--space-2);
}

/* CTA section (shared: Pricing, About, and any future page) ------------ */

.cta-section {
	max-width: var(--container-max);
	margin-inline: auto;
	padding: var(--space-6);
}

.cta-section__card {
	background: var(--color-primary);
	border-radius: var(--radius-2xl);
	padding: 216px var(--container-padding) var(--space-13);
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--space-6);
}

.cta-section__text {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
	max-width: 638px;
}

.cta-section__eyebrow {
	font-family: var(--font-heading);
	font-weight: var(--weight-bold);
	font-size: var(--text-tag);
	letter-spacing: var(--text-tag-ls);
	text-transform: uppercase;
	/* Was gray-200/white against a dark indigo card — the new lighter teal
	   background needs dark text instead (white on #58c1c7 is ~2.1:1,
	   well under WCAG AA). */
	color: var(--color-gray-800);
}

.cta-section__heading {
	font-family: var(--font-heading);
	font-weight: var(--weight-light);
	font-size: var(--text-h1);
	line-height: var(--text-h1-lh);
	color: var(--color-gray-900);
}

.cta-section__intro {
	font-family: var(--font-body);
	font-size: var(--text-paragraph);
	line-height: var(--text-paragraph-lh);
	color: var(--color-gray-800);
}

.cta-section .btn {
	flex-shrink: 0;
}

@media (max-width: 900px) {
	.services__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.cta-section__card {
		flex-direction: column;
		align-items: flex-start;
		padding: var(--space-9) var(--space-6);
	}

	.cta-section__heading {
		font-size: var(--text-h2);
		line-height: var(--text-h2-lh);
	}
}

@media (max-width: 560px) {
	/* Figma mobile frame: single-column list of horizontal cards (small
	   square image left, title + description right) instead of the
	   2-column grid of tall vertical cards used above 560px. */
	.services__grid {
		grid-template-columns: 1fr;
		gap: var(--space-4);
	}

	.service-card {
		flex-direction: row;
		align-items: center;
		min-height: 0;
		padding: var(--space-4);
		gap: var(--space-4);
	}

	.service-card__text {
		padding: 0;
	}

	.service-card__image {
		/* Was full-bleed flex:1 filling the tall vertical card; now a fixed
		   inset square, so it needs its own rounding + clip instead of
		   relying on .service-card's overflow:hidden. */
		order: -1;
		flex: 0 0 110px;
		width: 110px;
		height: 110px;
		border-radius: var(--radius-md);
	}

	.cta-section {
		padding: var(--space-4);
	}
}

/**
 * Sidrena tooltip — small accessible hover/focus explainer, currently used
 * on the pricing page (the "SC" header badge + each sidrena price value).
 * Never the only way to see the underlying info — the trigger content
 * itself is always plain visible text; this is a pure enhancement.
 */
.sidrena-tooltip {
	position: relative;
	display: inline-flex;
}

.sidrena-tooltip__trigger {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: help;
	text-decoration: underline dotted;
	text-underline-offset: 3px;
}

.sidrena-tooltip__bubble {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 0;
	z-index: 20;
	width: 240px;
	padding: var(--space-3) var(--space-4);
	background: var(--color-black);
	color: var(--color-white);
	font-family: var(--font-body);
	font-size: var(--text-body-sm);
	line-height: var(--text-body-sm-lh);
	border-radius: var(--radius-md);
	text-align: left;
	white-space: normal;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	pointer-events: none;
}

.sidrena-tooltip:hover .sidrena-tooltip__bubble,
.sidrena-tooltip:focus-within .sidrena-tooltip__bubble {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

@media (max-width: 560px) {
	.sidrena-tooltip__bubble {
		width: 200px;
		right: -8px;
	}
}

/* Video embed facade (Explainers, Razgovori, First Visit Q&A) — click-to-play,
   see bival_video_embed() in inc/template-tags.php and assets/js/video-embed.js. */

.video-embed {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--color-gray-900);
}

.video-embed__trigger {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.video-embed__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.video-embed__play {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--color-white);
	color: var(--color-primary);
	transition: transform 0.15s ease;
}

.video-embed__play svg {
	width: 28px;
	height: 28px;
	margin-left: 3px;
}

.video-embed__trigger:hover .video-embed__play,
.video-embed__trigger:focus-visible .video-embed__play {
	transform: scale(1.08);
}

.video-embed__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
