/*
 * Significo base styles.
 * Colors and fonts read Elementor's global kit variables first, so Site Settings drive the fallbacks too.
 * They are declared on body as well, because Elementor defines its kit variables on body.elementor-kit-N.
 * Theme options print their own --sg-* values after this file (inc/options.php); the kit's global colors
 * and fonts (with the kit's values as fallback, for pages where Elementor doesn't load its kit CSS),
 * container width and button colors arrive as --sg-color-*, --sg-font-*, --sg-container and
 * --sg-button-* (inc/services.php).
 */

:root,
body {
	--sg-color-primary: var(--e-global-color-primary, #1f3a5f);
	--sg-color-accent: var(--e-global-color-accent, #a85a14);
	--sg-color-text: var(--e-global-color-text, #2b2f36);
	--sg-color-heading: var(--e-global-color-secondary, #12161c);
	--sg-color-muted: #6b7280;
	--sg-color-line: #e5e7eb;
	--sg-color-surface: #f6f7f9;
	--sg-color-bg: #fff;
	--sg-font-body: var(--e-global-typography-text-font-family, "Inter"), system-ui, -apple-system, "Segoe UI", sans-serif;
	--sg-font-heading: var(--e-global-typography-primary-font-family, "Inter"), system-ui, -apple-system, "Segoe UI", sans-serif;
	--sg-font-accent: var(--e-global-typography-accent-font-family, "Inter"), system-ui, -apple-system, "Segoe UI", sans-serif;
	--sg-font-heading-weight: var(--e-global-typography-primary-font-weight, 700);
	--sg-font-body-weight: var(--e-global-typography-text-font-weight, 400);
	--sg-container: 1240px;
	--sg-container-narrow: 760px;
	--sg-gutter: 24px;
	--sg-radius: 8px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--sg-color-bg);
	color: var(--sg-color-text);
	font-family: var(--sg-font-body);
	font-size: var(--sg-font-size, 17px);
	line-height: var(--sg-line-height, 1.65);
	-webkit-font-smoothing: antialiased;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--sg-color-link, var(--sg-color-primary));
	text-underline-offset: 0.15em;
}

a:hover,
a:focus {
	color: var(--sg-color-link-hover, var(--sg-color-accent));
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	color: var(--sg-color-heading);
	font-family: var(--sg-font-heading);
	line-height: 1.2;
}

/* Fonts → weights: the theme's own header, title bar, content and footer. Elementor content keeps the
   weights it was designed with (its widgets and Site Settings set their own). */
:is(.sg-site-header, .sg-title-bar, .sg-site-footer, .sg-main:not(:has(.elementor))) {
	font-weight: var(--sg-font-body-weight);
}

:is(h1, h2, h3, h4, h5, h6):not(.elementor *) {
	font-weight: var(--sg-font-heading-weight);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.4rem; }

/* Heading sizes from Fonts → Sizes: theme templates only, never inside Elementor content. */
:is(.sg-title-bar, .sg-page-header, .sg-entry__header, .sg-entry__content, .entry-content, .sg-comments, .sg-not-found) :is(h1, h2, h3, h4):not(.elementor *) {
	letter-spacing: var(--sg-heading-tracking, normal);
}

:is(.sg-page-header, .sg-entry__header, .sg-entry__content, .entry-content, .sg-comments, .sg-not-found) h1:not(.elementor *) {
	font-size: clamp(calc(var(--sg-h1, 48px) * 0.67), 4vw, var(--sg-h1, 48px));
}

:is(.sg-entry__content, .entry-content, .sg-comments) h2:not(.elementor *) {
	font-size: clamp(calc(var(--sg-h2, 36px) * 0.72), 3vw, var(--sg-h2, 36px));
}

:is(.sg-entry__content, .entry-content, .sg-comments) h3:not(.elementor *) {
	font-size: clamp(calc(var(--sg-h3, 28px) * 0.8), 2.2vw, var(--sg-h3, 28px));
}

:is(.sg-entry__content, .entry-content, .sg-comments) h4:not(.elementor *) {
	font-size: clamp(calc(var(--sg-h4, 22px) * 0.85), 1.6vw, var(--sg-h4, 22px));
}

p,
ul,
ol,
figure {
	margin: 0 0 1.2em;
}

button,
input,
select,
textarea {
	font: inherit;
}

/* Fonts → Labels and buttons: theme buttons, post details and badges (not inside Elementor content). */
:is(.button, button[type="submit"], input[type="submit"], .wp-block-button__link, .sg-entry-meta, .sg-tags a, .page-numbers):not(.elementor *),
.bypostauthor > .comment-body .fn::after {
	font-family: var(--sg-font-accent);
}

/* Form fields: theme, WooCommerce and Contact Form 7 (Colors → Buttons & forms). */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"],
textarea,
select,
.woocommerce form .form-row :is(.input-text, select),
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.wpcf7-form-control:is(.wpcf7-text, .wpcf7-email, .wpcf7-url, .wpcf7-tel, .wpcf7-number, .wpcf7-date, .wpcf7-textarea, .wpcf7-select) {
	width: 100%;
	padding: 0.65em 0.85em;
	border: 1px solid var(--sg-input-border, #8a919c);
	border-radius: var(--sg-radius);
	background: var(--sg-input-bg, #fff);
	color: inherit;
}

.select2-container--default .select2-selection--single {
	height: auto;
	padding: 0.4em 0.5em;
}

/* Theme buttons follow Elementor's Site Settings → Buttons when set there. */
:where(button, .button, input[type="submit"]) {
	display: inline-block;
	padding: 0.75em 1.5em;
	border: 0;
	border-radius: var(--sg-button-radius, var(--sg-radius));
	background: var(--sg-button-bg, var(--sg-color-primary));
	color: var(--sg-button-text, #fff);
	cursor: pointer;
	text-decoration: none;
}

:where(button, .button, input[type="submit"]):hover {
	background: var(--sg-button-bg-hover, var(--sg-color-accent));
	color: var(--sg-button-text-hover, var(--sg-button-text, #fff));
}

/* The Search block's button: theme button colors instead of WordPress's grey. */
.wp-block-search__button.wp-element-button {
	border: 0;
	border-radius: var(--sg-button-radius, var(--sg-radius));
	background: var(--sg-button-bg, var(--sg-color-primary));
	color: var(--sg-button-text, #fff);
}

.wp-block-search__button.wp-element-button:hover {
	background: var(--sg-button-bg-hover, var(--sg-color-accent));
	color: var(--sg-button-text-hover, var(--sg-button-text, #fff));
}

/* Block buttons are pills by default (WordPress 9999px); they follow Corner radius like the rest. */
.wp-block-button__link {
	border-radius: calc(9999px * var(--sg-radius-scale, 1));
}

/* Links styled as buttons keep the button text color over the general link colors, Elementor's kit
   link color (.elementor-kit-N a) included; "body" outranks it without beating WooCommerce's button rules. */
body a.button,
body a.button:focus {
	color: var(--sg-button-text, #fff);
}

body a.button:hover {
	color: var(--sg-button-text-hover, var(--sg-button-text, #fff));
}

:focus-visible {
	outline: 2px solid var(--sg-color-accent);
	outline-offset: 2px;
}

/* Accessibility → Keyboard focus outline: high visibility (dark ring with a light halo, any background). */
.sg-focus--strong :focus-visible {
	outline: 3px solid #0b0d10 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 5px #fff !important;
}

/* Accessibility → Underline links in text (not menus or buttons). */
.sg-underline-links :is(.sg-entry__content, .entry-content, .comment-content, .textwidget, .widget_text, .elementor-widget-text-editor, .woocommerce-product-details__short-description) a:not(.button, .wp-block-button__link, .elementor-button, [role="button"]) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
}

body:not(.sg-underline-links) :is(.sg-entry__content, .entry-content, .comment-content, .textwidget, .widget_text) a:not(:hover, :focus-visible) {
	text-decoration: none;
}

/* Animations: the visitor's reduced-motion setting, or always reduced (Accessibility → Animations). */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

.sg-motion--reduce *,
.sg-motion--reduce *::before,
.sg-motion--reduce *::after {
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	scroll-behavior: auto !important;
	transition-duration: 0.01ms !important;
}

html:has(> .sg-motion--reduce) {
	scroll-behavior: auto !important;
}

/* Elementor entrance animations: show the element in place instead of animating it in. */
.sg-motion--reduce .elementor-invisible {
	visibility: visible !important;
}

.sg-motion--reduce .elementor-element.animated {
	animation: none !important;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link:focus {
	z-index: 100000;
	top: 8px;
	left: 8px;
	width: auto;
	height: auto;
	padding: 12px 16px;
	clip: auto;
	background: #fff;
	color: var(--sg-color-heading);
}

/* Layout */

.sg-container {
	width: 100%;
	max-width: calc(var(--sg-container) + var(--sg-gutter) * 2);
	margin-inline: auto;
	padding-inline: min(var(--sg-gutter), 6vw); /* Never more than 6% of a small screen. */
}

.sg-container--narrow {
	max-width: calc(var(--sg-container-narrow) + var(--sg-gutter) * 2);
}

/* Short pages: the main area grows so the footer sits at the bottom of the screen. */
.sg-site {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.sg-site > * {
	flex-shrink: 0;
}

.sg-main {
	display: block;
	flex-grow: 1;
	padding-block: 48px 72px;
}

.sg-elementor-page .sg-main,
.sg-main--full {
	padding-block: 0;
}

.sg-content-area {
	display: grid;
	gap: 48px;
}

.sg-has-sidebar .sg-content-area {
	grid-template-columns: minmax(0, 1fr) 300px;
}

/* Blog */

.sg-page-header {
	padding-block: 56px 8px;
}

.sg-posts {
	display: grid;
	gap: 40px;
}

.sg-card {
	display: grid;
	gap: 16px;
}

.sg-card__media img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: var(--sg-radius);
	object-fit: cover;
}

.sg-card__title {
	margin-bottom: 6px;
	font-size: 1.5rem;
}

.sg-card__title a {
	color: inherit;
	text-decoration: none;
}

.sg-entry-meta {
	margin-bottom: 12px;
	color: var(--sg-color-muted);
	font-size: 0.9rem;
}

.sg-entry__header {
	margin-bottom: 32px;
}

.sg-entry__media img {
	display: block;
	width: 100%;
	border-radius: var(--sg-radius);
}

.sg-entry__content > * + * {
	margin-top: 0;
}

.sg-tags a {
	display: inline-block;
	margin: 0 8px 8px 0;
	padding: 4px 12px;
	border-radius: calc(999px * var(--sg-radius-scale, 1));
	background: var(--sg-color-surface);
	font-size: 0.85rem;
	text-decoration: none;
}

.sg-comments {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--sg-color-line);
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.page-numbers {
	padding: 6px 14px;
	border: 1px solid var(--sg-color-line);
	border-radius: var(--sg-radius);
	text-decoration: none;
}

.page-numbers.current {
	border-color: var(--sg-color-primary);
	background: var(--sg-color-primary);
	color: #fff;
}

.widget {
	margin-bottom: 32px;
}

.widget-title {
	font-size: 1.05rem;
}

.sg-not-found {
	padding-block: 64px;
	text-align: center;
}

.sg-not-found__code {
	margin: 0;
	color: var(--sg-color-line);
	font-size: clamp(5rem, 14vw, 9rem);
	font-weight: 800;
	line-height: 1;
}

.sg-not-found .search-form {
	display: flex;
	max-width: 480px;
	gap: 8px;
	margin: 24px auto 0;
}

/* WordPress core */

.alignwide {
	max-width: var(--sg-container);
}

.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
}

.wp-caption-text,
figcaption {
	color: var(--sg-color-muted);
	font-size: 0.9rem;
}

/* WordPress core classes */

.alignleft {
	float: left;
	margin: 0.4em 1.6em 1em 0;
}

.alignright {
	float: right;
	margin: 0.4em 0 1em 1.6em;
}

.aligncenter {
	display: block;
	margin-right: auto;
	margin-left: auto;
}

.gallery-caption {
	display: block;
	padding-top: 6px;
	color: var(--sg-color-muted);
	font-size: 0.85rem;
}

.sticky .sg-card__title::before {
	content: "★ ";
	color: var(--sg-color-accent);
}

.bypostauthor > .comment-body .fn::after {
	margin-left: 6px;
	padding: 1px 8px;
	border-radius: calc(999px * var(--sg-radius-scale, 1));
	background: var(--sg-color-surface);
	color: var(--sg-color-muted);
	content: "Author";
	font-size: 0.75rem;
}
