/**
 * Miglior CRM - base element styles.
 *
 * Loaded after Kadence's global CSS and its inline Customizer output, so
 * same-specificity rules here win. Keep selectors low-specificity.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--mc-header-h) + var(--mc-space-4));
}

body {
	background: var(--mc-white);
	color: var(--mc-text);
	font-family: var(--mc-font-body);
	font-size: var(--mc-fs-body);
	font-weight: 500;
	line-height: var(--mc-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Headings: Plus Jakarta Sans, bold, sentence case (professional tone) */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
	margin: 0 0 var(--mc-space-3);
	color: inherit;
	font-family: var(--mc-font-display);
	font-weight: 800;
	font-style: normal;
	line-height: var(--mc-lh-heading);
	letter-spacing: var(--mc-ls-display);
	text-transform: none;
	text-wrap: balance;
}

h1, .h1 { font-size: var(--mc-fs-h1); line-height: 1.12; }
h2, .h2 { font-size: var(--mc-fs-h2); line-height: 1.15; }
h3, .h3 { font-size: var(--mc-fs-h3); }
h4, .h4 { font-size: var(--mc-fs-h4); letter-spacing: -0.02em; }
h5, .h5 { font-size: var(--mc-fs-h5); letter-spacing: -0.01em; }
h6, .h6 { font-size: var(--mc-fs-h6); letter-spacing: 0; }

p {
	margin: 0 0 var(--mc-space-4);
}

a {
	color: var(--mc-brand-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color var(--mc-dur) var(--mc-ease), background-color var(--mc-dur) var(--mc-ease), border-color var(--mc-dur) var(--mc-ease);
}

a:hover,
a:focus-visible {
	color: var(--mc-brand);
}

strong, b {
	font-weight: 700;
}

small {
	font-size: var(--mc-fs-xs);
}

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

hr {
	height: 1px;
	margin: var(--mc-space-8) 0;
	border: 0;
	background: var(--mc-border);
}

::selection {
	background: rgba(var(--mc-brand-rgb), 0.28);
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--mc-brand);
	outline-offset: 2px;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
	width: 100%;
	min-height: 46px;
	padding: 0.625rem 0.875rem;
	border: 1px solid var(--mc-border);
	border-radius: var(--mc-radius-sm);
	background-color: var(--mc-white);
	color: var(--mc-text);
	font-family: var(--mc-font-body);
	font-size: var(--mc-fs-body); /* >= 16px avoids iOS zoom on focus */
	font-weight: 500;
	box-shadow: none;
	transition: border-color var(--mc-dur) var(--mc-ease), box-shadow var(--mc-dur) var(--mc-ease);
}

input:hover,
select:hover,
textarea:hover {
	border-color: var(--mc-text-disabled);
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--mc-ink);
	outline: 0;
	box-shadow: 0 0 0 3px rgba(var(--mc-brand-rgb), 0.18);
	color: var(--mc-text);
}

textarea {
	min-height: 140px;
	resize: vertical;
}

::placeholder {
	color: var(--mc-text-subtle);
	opacity: 1;
}

label {
	font-size: var(--mc-fs-sm);
	font-weight: 700;
}

/* Native WP / Kadence buttons follow the primary button style */
button,
.button,
.wp-block-button__link,
.wp-element-button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
	border-radius: var(--mc-radius-sm);
	font-family: var(--mc-font-display);
	font-weight: 800;
	letter-spacing: 0;
	text-transform: none;
}

/* Tables (generic) */
table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--mc-fs-sm);
}

th {
	font-family: var(--mc-font-display);
	font-size: var(--mc-fs-3xs);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-align: left;
	text-transform: uppercase;
}

/* Accessibility helpers */
.mc-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mc-skip-link:focus {
	position: fixed;
	top: var(--mc-space-2);
	left: var(--mc-space-2);
	z-index: calc(var(--mc-z-overlay) + 1);
	width: auto;
	height: auto;
	padding: var(--mc-space-3) var(--mc-space-4);
	clip: auto;
	background: var(--mc-ink);
	color: var(--mc-white);
}

@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;
	}
}
