/**
 * Starterkit — what theme.json can't express.
 * Colors, fonts, sizes and spacing come from theme.json presets (--wp--preset--*);
 * change those there, not here.
 */

/* ---------- Base ---------- */

h1, h2, h3, h4 {
	text-wrap: balance;
}

:where(.wp-site-blocks) > * {
	margin-block-start: 0;
}

.wp-element-button,
.wp-block-button__link,
a {
	transition: color var(--wp--custom--transition), background-color var(--wp--custom--transition), border-color var(--wp--custom--transition);
}

.screen-reader-text:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Buttons on brand backgrounds (CTA, USP band, ...) invert automatically. */
.has-primary-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	background-color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--primary);
}

.has-primary-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--border);
	border-color: var(--wp--preset--color--border);
}

.has-primary-background-color .wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-cover .wp-block-button.is-style-outline .wp-block-button__link {
	background-color: transparent; /* a site may give outline buttons a fill (Styles); on colour it must stay see-through */
	border-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--base);
}

.has-primary-background-color .wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--contrast);
}

.wp-block-cover .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.has-primary-background-color a:not(.wp-element-button) {
	color: inherit;
	text-decoration: underline;
}

/* SVGs from wp_get_icon() carry no fill of their own. */
.sk-filter svg,
.sk-testimonial svg,
.wp-block-query-pagination svg {
	fill: currentColor;
}

/* ---------- Header / navigation ---------- */

.wp-block-navigation [aria-current="page"],
.wp-block-navigation .current-menu-item > a,
.wp-block-navigation .current-menu-ancestor > a {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 8px;
}

.wp-block-navigation__responsive-container-open {
	width: 44px;
	height: 44px;
	justify-content: center;
	align-items: center;
	border-radius: 50%;
	box-shadow: var(--wp--preset--shadow--soft);
	color: var(--wp--preset--color--primary);
}

/* ---------- Block styles (inc/block-styles.php) ---------- */

/* Group: card with shadow (post / product cards) */
.wp-block-group.is-style-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--md);
	background: var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--card);
}

.is-style-card > .wp-block-post-featured-image {
	position: relative;
	margin: 0;
}

.is-style-card > .wp-block-post-featured-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: transparent;
	transition: background-color var(--wp--custom--transition);
	pointer-events: none;
}

.is-style-card:hover > .wp-block-post-featured-image::after {
	background: rgb(0 0 0 / 32%);
}

.is-style-card:hover .wp-block-post-title a {
	color: var(--wp--preset--color--primary);
}

.is-style-card .sk-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
}

.is-style-card .sk-card__body > * {
	margin: 0;
}

.is-style-card .wp-block-read-more {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--20);
}

.wp-block-read-more::after {
	content: " \203A";
}

/* "→" in a button / read more link is swapped for this icon (inc/icons.php). */
.sk-arrow {
	display: inline-block;
	width: 1.15em;
	height: 1.15em;
	margin-left: 0.4em;
	vertical-align: -0.2em;
	fill: currentColor;
	flex-shrink: 0;
}

.wp-block-read-more:has(.sk-arrow)::after {
	content: none;
}

/* Group: bordered card (services) */
.wp-block-group.is-style-bordered {
	height: 100%;
	border: 1px solid var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--md);
}

/* Columns: thin dividers between columns (USP band) */
.wp-block-columns.is-style-dividers {
	--sk-divider: color-mix(in srgb, currentColor 40%, transparent);
}

@media (min-width: 782px) {
	.wp-block-columns.is-style-dividers > .wp-block-column + .wp-block-column {
		border-left: 1px solid var(--sk-divider);
		padding-left: var(--wp--style--columns-gap, 2em);
	}
}

@media (max-width: 781px) {
	.wp-block-columns.is-style-dividers > .wp-block-column + .wp-block-column {
		border-top: 1px solid var(--sk-divider);
		padding-top: var(--wp--preset--spacing--40);
	}
}

/* Image */
.wp-block-image.is-style-rounded img {
	border-radius: var(--wp--custom--radius--md);
}

.wp-block-image.is-style-fill {
	height: 100%;
	margin: 0;
}

.wp-block-image.is-style-fill img {
	width: 100%;
	height: 100%;
	min-height: 320px;
	object-fit: cover;
}

/* Embed (video) */
.wp-block-embed.is-style-rounded iframe {
	border-radius: var(--wp--custom--radius--sm);
}

/* Icon */
.wp-block-icon svg {
	width: 1.75rem;
	height: auto;
	aspect-ratio: 1;
	color: var(--wp--preset--color--primary);
}

.wp-block-icon.is-style-boxed svg,
.wp-block-icon.is-style-boxed-lg svg {
	box-sizing: border-box;
	width: 3rem;
	padding: 0.625rem;
	border-radius: var(--wp--custom--radius--sm);
	background: var(--wp--preset--color--surface);
}

.wp-block-icon.is-style-boxed-lg svg {
	width: 4rem;
	padding: 1.125rem;
}

.has-primary-background-color .wp-block-icon.is-style-boxed svg,
.has-primary-background-color .wp-block-icon.is-style-boxed-lg svg {
	background: var(--wp--preset--color--base);
}

/* Categories / post terms: pills */
.wp-block-categories.is-style-pills {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	padding: 0;
	list-style: none;
}

.wp-block-categories.is-style-pills a {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2rem;
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}

.wp-block-categories.is-style-pills .current-cat > a,
.wp-block-categories.is-style-pills a:hover {
	border-color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.wp-block-post-terms.is-style-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-block: 0.5rem;
}

.wp-block-post-terms.is-style-pills .wp-block-post-terms__separator {
	display: none;
}

.wp-block-post-terms.is-style-pills a {
	padding: 0.25rem 0.75rem;
	border-radius: var(--wp--custom--radius--full);
	background: var(--wp--preset--color--border);
	color: var(--wp--preset--color--contrast);
}

/* Social links: white circles with a soft shadow */
.wp-block-social-links.is-style-soft .wp-block-social-link.wp-social-link {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--soft);
}

.wp-block-social-links.is-style-soft .wp-social-link a {
	padding: 0.625rem;
}

/* ---------- Accordion (FAQ) ---------- */

.wp-block-accordion-item {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.wp-block-accordion-item:first-child {
	border-top: 1px solid var(--wp--preset--color--border);
}

.wp-block-accordion-heading {
	margin: 0;
}

.wp-block-accordion-heading__toggle {
	padding-block: var(--wp--preset--spacing--30);
}

.wp-block-accordion-panel {
	padding-bottom: var(--wp--preset--spacing--30);
}

.wp-block-accordion-panel > :first-child {
	margin-top: 0;
}

/* ---------- Pagination ---------- */

.wp-block-query-pagination {
	gap: 0.5rem;
	justify-content: center;
}

.wp-block-query-pagination-numbers {
	display: flex;
	gap: 0.5rem;
}

.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	height: 2rem;
	margin: 0;
	border: 1px solid var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--full);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
	padding-inline: 0.75rem;
}

.wp-block-query-pagination .page-numbers.current {
	border-color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

.wp-block-query-pagination .page-numbers.dots {
	border: 0;
}

/* ---------- Carousel (assets/js/carousel.js) ---------- */

.is-style-carousel {
	--sk-carousel-gap: var(--wp--preset--spacing--40);
	--sk-carousel-per-view: 1.15;
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: var(--sk-carousel-gap) !important;
	margin: 0;
	padding: 1rem 0.25rem 2rem;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	list-style: none;
}

.is-style-carousel::-webkit-scrollbar {
	display: none;
}

.is-style-carousel > * {
	flex: 0 0 calc((100% - (var(--sk-carousel-per-view) - 1) * var(--sk-carousel-gap)) / var(--sk-carousel-per-view));
	min-width: 0;
	margin: 0 !important;
	scroll-snap-align: start;
}

@media (min-width: 600px) {
	.is-style-carousel { --sk-carousel-per-view: 2; }
}

@media (min-width: 1024px) {
	.is-style-carousel { --sk-carousel-per-view: 3; }
}

.sk-carousel {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.sk-carousel__button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--base);
	box-shadow: 0 6px 15px 0 rgb(0 0 0 / 8%);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	transition: background-color var(--wp--custom--transition), opacity var(--wp--custom--transition);
}

.sk-carousel__button:hover {
	background: rgb(0 0 0 / 32%);
}

.sk-carousel__button[disabled] {
	opacity: 0.35;
	cursor: default;
}

/* Everything fits: no arrows, and the cards line up with the content around them. */
.sk-carousel.is-static {
	grid-template-columns: minmax(0, 1fr);
}

.sk-carousel.is-static .sk-carousel__button {
	display: none;
}

/* Dots are built by carousel.js but off by default; enable per project. */
.sk-carousel__dots {
	display: none;
}

@media (max-width: 781px) {
	.sk-carousel {
		grid-template-columns: 1fr 1fr;
	}

	.sk-carousel > .is-style-carousel {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	.sk-carousel__button {
		grid-row: 2;
		width: 3rem;
		height: 3rem;
	}

	.sk-carousel__button--prev { justify-self: end; }
}

/* ---------- Logo marquee (assets/js/marquee.js) ---------- */

.wp-block-gallery.is-style-marquee {
	flex-wrap: nowrap !important;
	overflow: hidden;
	mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.wp-block-gallery.is-style-marquee .sk-marquee__track {
	display: flex;
	flex: none;
	align-items: center;
	gap: var(--wp--preset--spacing--70);
	padding-right: var(--wp--preset--spacing--70);
	animation: sk-marquee var(--sk-marquee-duration, 40s) linear infinite;
}

.wp-block-gallery.is-style-marquee:hover .sk-marquee__track {
	animation-play-state: paused;
}

.wp-block-gallery.is-style-marquee figure.wp-block-image {
	flex: none !important;
	width: auto !important;
	margin: 0 !important;
}

.wp-block-gallery.is-style-marquee figure.wp-block-image img {
	width: auto !important;
	height: 2.5rem !important;
	object-fit: contain !important;
}

@keyframes sk-marquee {
	to { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.is-style-marquee {
		flex-wrap: wrap !important;
		justify-content: center;
		mask-image: none;
	}

	.wp-block-gallery.is-style-marquee .sk-marquee__track {
		flex-wrap: wrap;
		justify-content: center;
		animation: none;
	}

	.wp-block-gallery.is-style-marquee .sk-marquee__track[aria-hidden] {
		display: none;
	}
}

/* ---------- Forms (Contact Form 7, newsletter, search) ---------- */

.wpcf7-form label,
.sk-form label {
	display: block;
	font-weight: 600;
}

.wpcf7-form input:not([type="submit"], [type="checkbox"], [type="radio"]),
.wpcf7-form textarea,
.wpcf7-form select,
.sk-form input:not([type="submit"]),
.wp-block-search__input {
	width: 100%;
	margin-top: 0.5rem;
	padding: 0.75rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--sm);
	background: var(--wp--preset--color--base);
	font: inherit;
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.sk-form input:focus {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 0;
}

.wpcf7-form input[type="submit"] {
	width: auto;
	cursor: pointer;
}

/* Two fields per row on wider screens: wrap fields in <div class="sk-form-grid">. */
.sk-form-grid {
	display: grid;
	gap: 0 var(--wp--preset--spacing--40, 1.5rem);
}

@media (min-width: 782px) {
	.sk-form-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.wpcf7-form p {
	margin-block: 0 var(--wp--preset--spacing--30, 1rem);
}

.wpcf7-form input:not([type="submit"], [type="checkbox"], [type="radio"]),
.wpcf7-form textarea,
.wpcf7-form select {
	box-sizing: border-box;
	max-width: 100%;
}

.wpcf7-form textarea {
	min-height: 9rem;
	resize: vertical;
	/* A pill radius on a tall box looks broken; cap it. */
	border-radius: min(var(--wp--custom--radius--sm), 1rem);
}

.wpcf7-form .wpcf7-not-valid {
	border-color: #c62828;
}

.wpcf7-form .wpcf7-not-valid-tip {
	margin-top: 0.35rem;
	color: #c62828;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
}

.wpcf7-form .wpcf7-response-output {
	margin: var(--wp--preset--spacing--30, 1rem) 0 0 !important;
	padding: 0.75rem 1rem !important;
	border-radius: var(--wp--custom--radius--sm);
}

/* Form on a coloured section: a white card keeps the fields readable. */
.sk-form-card {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* ---------- Editor tweaks ---------- */

.editor-styles-wrapper .is-style-carousel {
	overflow-x: auto;
}

/* Single post ------------------------------------------------------------ */

.sk-post-hero .wp-block-post-title {
	max-width: 20ch;
	margin-left: 0 !important;
}

.sk-post-hero .wp-block-post-terms.is-style-pills {
	margin-block: 0;
}

.sk-post-hero .wp-block-post-terms.is-style-pills a {
	background: rgb(255 255 255 / 85%);
}

.sk-post-content {
	padding-top: var(--wp--preset--spacing--70);
}

.sk-post-content > :where(p, ul, ol, blockquote) {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.7;
}

.sk-post-content > :where(h2, h3, h4) {
	margin-top: var(--wp--preset--spacing--60);
}

.sk-post-content > .wp-block-image img {
	border-radius: var(--wp--custom--radius--md);
}

.sk-post-content > .wp-block-quote {
	padding-left: var(--wp--preset--spacing--40);
	border-left: 4px solid var(--wp--preset--color--primary);
}

/* Card image placeholder (post without a featured image) */
.sk-image-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: var(--wp--preset--spacing--40);
	background: linear-gradient(135deg, var(--wp--preset--color--primary), var(--wp--preset--color--contrast));
	color: var(--wp--preset--color--base);
	text-align: center;
}

.sk-image-placeholder a {
	display: contents;
	color: inherit;
	text-decoration: none;
}

.sk-image-placeholder__label {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	opacity: 0.9;
}
