/*
 * Shared public control language for Starachowicka.pl.
 *
 * This sheet deliberately targets actionable components rather than every
 * `button`: map zoom, the PDF reader and other specialist controls retain
 * their own geometry, while all portal CTAs share accessible states.
 */
:root {
	--star-button-primary: #007a39;
	--star-button-primary-hover: #005f2c;
	--star-button-primary-active: #004622;
	--star-button-on-primary: #ffffff;
	--star-button-secondary-bg: #ffffff;
	--star-button-secondary-ink: #075f2d;
	--star-button-secondary-hover: #e6f3eb;
	--star-button-line: #0a7a3b;
	--star-button-focus: #155dc1;
	--star-button-disabled-bg: #e8eeea;
	--star-button-disabled-ink: #5a6860;
	--star-button-radius: 12px;
	--star-button-shadow: 0 8px 20px rgba(6, 74, 35, .14);
	--star-button-shadow-hover: 0 12px 26px rgba(6, 74, 35, .20);
}

/* Keyboard focus is consistent across the public portal, including controls
 * whose visual treatment intentionally remains component-specific. */
body.star-portal-navigation :where(a[href], button, input[type="submit"], input[type="button"], input[type="reset"], [role="button"]):focus-visible {
	outline: 3px solid var(--star-button-focus) !important;
	outline-offset: 3px;
}

/* Common CTA baseline. The selectors are intentionally explicit so ordinary
 * in-content links and specialist reader/map buttons are not restyled. */
body.star-portal-navigation :is(
	.star-blocks-page-hero__button,
	.star-advertising-button,
	.star-advertising-service > a,
	.star-directory-button,
	.star-directory-plan > a,
	.star-page-button,
	.star-company-home__button,
	.star-company-history__button,
	.star-company-news__button,
	.star-professional-profile__button,
	.star-service-parameters__button,
	.star-directory-onboarding__submit,
	.wp-block-button__link,
	.wp-element-button,
	.ast-button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce a.added_to_cart,
	.wc-block-components-button,
	.wpforms-submit,
	.forminator-button-submit,
	.gform_button,
	.wpcf7-submit
) {
	box-sizing: border-box;
	display: inline-flex;
	min-height: 44px;
	padding: 10px 18px;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 2px solid var(--star-button-line);
	border-radius: var(--star-button-radius);
	background: var(--star-button-primary);
	box-shadow: var(--star-button-shadow);
	color: var(--star-button-on-primary) !important;
	font-family: inherit;
	font-size: max(1rem, 16px);
	font-weight: 750;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	text-decoration-thickness: .08em;
	text-underline-offset: .16em;
	transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

/* Secondary controls stay recognisably secondary in every state. */
body.star-portal-navigation :is(
	.star-blocks-page-hero__button--secondary,
	.star-advertising-button--secondary,
	.star-directory-button--secondary,
	.star-page-button--secondary,
	.star-company-home__button--secondary,
	.star-company-history__button--secondary,
	.star-company-news__button--secondary,
	.star-professional-profile__button--secondary,
	.star-service-parameters__button--secondary
) {
	background: var(--star-button-secondary-bg);
	box-shadow: none;
	color: var(--star-button-secondary-ink) !important;
}

/* Ghost treatment is kept deliberately quiet while still giving a visible
 * hover affordance and a full-size hit area. */
body.star-portal-navigation :is(
	.star-blocks-page-hero__button--tertiary,
	.star-company-home__button--ghost
) {
	border-color: currentColor;
	background: transparent;
	box-shadow: none;
	color: inherit !important;
}

@media (hover: hover) and (pointer: fine) {
	body.star-portal-navigation :is(
		.star-blocks-page-hero__button,
		.star-advertising-button,
		.star-advertising-service > a,
		.star-directory-button,
		.star-directory-plan > a,
		.star-page-button,
		.star-company-home__button,
		.star-company-history__button,
		.star-company-news__button,
		.star-professional-profile__button,
		.star-service-parameters__button,
		.star-directory-onboarding__submit,
		.wp-block-button__link,
		.wp-element-button,
		.ast-button,
		.woocommerce a.button,
		.woocommerce button.button,
		.woocommerce input.button,
		.woocommerce a.added_to_cart,
		.wc-block-components-button,
		.wpforms-submit,
		.forminator-button-submit,
		.gform_button,
		.wpcf7-submit
	):not(:disabled):not([aria-disabled="true"]):hover {
		border-color: var(--star-button-primary-hover);
		background: var(--star-button-primary-hover);
		box-shadow: var(--star-button-shadow-hover);
		color: var(--star-button-on-primary) !important;
		transform: translateY(-1px);
	}

	body.star-portal-navigation :is(
		.star-blocks-page-hero__button--secondary,
		.star-advertising-button--secondary,
		.star-directory-button--secondary,
		.star-page-button--secondary,
		.star-company-home__button--secondary,
		.star-company-history__button--secondary,
		.star-company-news__button--secondary,
		.star-professional-profile__button--secondary,
		.star-service-parameters__button--secondary
	):not(:disabled):not([aria-disabled="true"]):hover {
		border-color: var(--star-button-secondary-ink);
		background: var(--star-button-secondary-hover);
		box-shadow: 0 8px 20px rgba(6, 74, 35, .10);
		color: var(--star-button-secondary-ink) !important;
	}

	body.star-portal-navigation :is(
		.star-blocks-page-hero__button--tertiary,
		.star-company-home__button--ghost
	):not(:disabled):not([aria-disabled="true"]):hover {
		background: rgba(255, 255, 255, .16);
		box-shadow: none;
		color: inherit !important;
	}
}

body.star-portal-navigation :is(
	.star-blocks-page-hero__button,
	.star-advertising-button,
	.star-advertising-service > a,
	.star-directory-button,
	.star-directory-plan > a,
	.star-page-button,
	.star-company-home__button,
	.star-company-history__button,
	.star-company-news__button,
	.star-professional-profile__button,
	.star-service-parameters__button,
	.star-directory-onboarding__submit,
	.wp-block-button__link,
	.wp-element-button,
	.ast-button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce a.added_to_cart,
	.wc-block-components-button,
	.wpforms-submit,
	.forminator-button-submit,
	.gform_button,
	.wpcf7-submit
):not(:disabled):not([aria-disabled="true"]):active {
	border-color: var(--star-button-primary-active);
	background: var(--star-button-primary-active);
	box-shadow: 0 4px 10px rgba(6, 74, 35, .16);
	transform: translateY(0);
}

body.star-portal-navigation :is(
	.star-blocks-page-hero__button--secondary,
	.star-advertising-button--secondary,
	.star-directory-button--secondary,
	.star-page-button--secondary,
	.star-company-home__button--secondary,
	.star-company-history__button--secondary,
	.star-company-news__button--secondary,
	.star-professional-profile__button--secondary,
	.star-service-parameters__button--secondary
):not(:disabled):not([aria-disabled="true"]):active {
	background: #d7eadf;
	color: var(--star-button-secondary-ink) !important;
}

body.star-portal-navigation :is(
	.star-blocks-page-hero__button,
	.star-advertising-button,
	.star-directory-button,
	.star-page-button,
	.star-company-home__button,
	.star-company-history__button,
	.star-company-news__button,
	.star-professional-profile__button,
	.star-service-parameters__button,
	.star-directory-onboarding__submit,
	.wp-block-button__link,
	.wp-element-button,
	.ast-button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.wc-block-components-button,
	.wpforms-submit,
	.forminator-button-submit,
	.gform_button,
	.wpcf7-submit
):is(:disabled, [aria-disabled="true"]) {
	border-color: var(--star-button-disabled-bg);
	background: var(--star-button-disabled-bg);
	box-shadow: none;
	color: var(--star-button-disabled-ink) !important;
	cursor: not-allowed;
	opacity: 1;
	pointer-events: none;
}

/* Astra's special classifieds menu item uses a theme button rule. Force every
 * interactive state to retain dark-green ink on its light surface. */
body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428) > .menu-link,
body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428):hover > .menu-link,
body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428):focus-within > .menu-link,
body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428) > .menu-link[aria-expanded="true"] {
	border: 1px solid var(--star-button-line) !important;
	border-radius: 12px;
	background: #ffffff !important;
	box-shadow: none;
	color: var(--star-button-secondary-ink) !important;
}

@media (hover: hover) and (pointer: fine) {
	body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428):hover > .menu-link {
		border-color: var(--star-button-secondary-ink) !important;
		background: var(--star-button-secondary-hover) !important;
		color: var(--star-button-secondary-ink) !important;
	}
}

/* Astra styles visited/current custom menu links after the normal menu
 * palette. Treat the three navigation states as first-class states: the
 * catalogue link stays legible after a visit and the active destination is
 * visible without relying on hover. */
body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428) > .menu-link:visited,
body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428) > .menu-link:focus,
body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428) > .menu-link:focus-visible {
	color: var(--star-button-secondary-ink) !important;
	-webkit-text-fill-color: var(--star-button-secondary-ink) !important;
	text-shadow: none !important;
}

body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428):is(.current-menu-item, .current-menu-ancestor) > .menu-link,
body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428):is(.current-menu-item, .current-menu-ancestor) > .menu-link:visited,
body.star-portal-navigation #ast-desktop-header .main-header-menu > :is(.star-menu-item--classifieds, .menu-item-904428):is(.current-menu-item, .current-menu-ancestor):hover > .menu-link {
	border-color: var(--star-button-primary) !important;
	background: var(--star-button-primary) !important;
	color: var(--star-button-on-primary) !important;
	-webkit-text-fill-color: var(--star-button-on-primary) !important;
	text-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
	body.star-portal-navigation :where(a[href], button, input[type="submit"], input[type="button"], input[type="reset"], [role="button"]) {
		transition-duration: .01ms !important;
	}
}
