/*
Theme Name: AcuCreative 2026
Theme URI: https://acucreative.co.uk
Author: AcuCreative
Description: Editorial block theme for AcuCreative. Cinematic dark hero and work sections, light editorial body, oversized display typography. Built on native WordPress blocks with no page-builder plugins, no jQuery and no icon-font libraries. Includes ready-made page patterns for Home, Services, Portfolio, About and Contact.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: acucreative-2026
Tags: block-patterns, full-site-editing, portfolio, business, one-column, custom-colors, custom-logo, custom-menu, editor-style, featured-images, translation-ready, accessibility-ready
*/

/* -------------------------------------------------------------------------
   Block themes are styled through theme.json. Only genuine additions live
   here: overflow guards, motion, the marquee, and interaction states.
   ------------------------------------------------------------------------- */

/* Nothing may exceed the viewport. The previous site scrolled sideways by 20px. */
html,
body {
	max-width: 100%;
	overflow-x: hidden;
}

img,
video,
iframe {
	max-width: 100%;
	height: auto;
}

/* Wide content scrolls inside its own box rather than pushing the page. */
.wp-block-table,
.wp-block-code,
figure.wp-block-table {
	overflow-x: auto;
	max-width: 100%;
}

/* --- Keyboard focus -------------------------------------------------- */

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 2px;
}

/* On dark sections the focus ring switches to the bright accent. */
.acu-dark :where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline-color: var(--wp--preset--color--accent-bright);
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999999;
	padding: 14px 22px;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--text-on-dark);
	font-weight: 600;
	text-decoration: none;
}

.skip-link:focus {
	left: 8px;
	top: 8px;
}

/* --- Touch targets ---------------------------------------------------- */

.wp-block-navigation .wp-block-navigation-item__content,
.wp-block-button__link,
.wp-block-social-link-anchor {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* --- Dark sections ---------------------------------------------------- */

/* Applied by the patterns. Keeps links, rules and buttons legible on ink. */
.acu-dark {
	color: var(--wp--preset--color--text-on-dark);
}

.acu-dark :is(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--text-on-dark);
}

.acu-dark a:not(.wp-block-button__link):not(.wp-block-social-link-anchor) {
	color: var(--wp--preset--color--accent-bright);
}

.acu-dark a:not(.wp-block-button__link):not(.wp-block-social-link-anchor):hover {
	color: var(--wp--preset--color--text-on-dark);
}

.acu-dark .wp-block-separator {
	color: var(--wp--preset--color--line-dark);
	border-color: var(--wp--preset--color--line-dark);
}

.acu-dark .wp-block-button__link {
	background-color: var(--wp--preset--color--accent-bright);
	color: var(--wp--preset--color--ink);
}

.acu-dark .wp-block-button.is-style-outline .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--text-on-dark);
	border: 1px solid var(--wp--preset--color--line-dark);
}

.acu-dark .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--text-on-dark);
	color: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--text-on-dark);
}

/* --- Buttons ---------------------------------------------------------- */

.wp-block-button__link {
	transition: background-color 200ms ease-out, color 200ms ease-out,
		border-color 200ms ease-out;
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--text-on-dark);
}

/* Outline buttons must not inherit the solid button's white text, or they
   render white-on-paper in light sections. The .acu-dark rule above flips
   this back for dark sections. */
.wp-block-button.is-style-outline .wp-block-button__link {
	border: 1px solid currentColor;
	background-color: transparent;
	color: var(--wp--preset--color--text);
}

/* --- Eyebrow label ---------------------------------------------------- */

/* Small uppercase label above a section heading. Add "acu-eyebrow" as an
   Additional CSS class on any paragraph to use it. */
.acu-eyebrow {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}

.acu-dark .acu-eyebrow {
	color: var(--wp--preset--color--accent-bright);
}

/* --- Work / service cards --------------------------------------------- */

.acu-card {
	transition: transform 250ms ease-out, box-shadow 250ms ease-out;
	height: 100%;
}

.acu-card:hover {
	transform: translateY(-6px);
}

/* Work tiles: image sits muted until hovered, the way the reference sites do it. */
.acu-work-tile img {
	transition: transform 500ms ease-out, filter 400ms ease-out;
	filter: grayscale(0.4) contrast(1.02);
	will-change: transform;
}

.acu-work-tile:hover img,
.acu-work-tile:focus-within img {
	transform: scale(1.04);
	filter: grayscale(0) contrast(1);
}

.acu-work-tile figure,
.acu-work-tile .wp-block-image {
	overflow: hidden;
	border-radius: 10px;
}

/* --- Marquee ---------------------------------------------------------- */

/* Wrap two identical .acu-marquee__row lists so the loop is seamless. */
.acu-marquee {
	overflow: hidden;
	width: 100%;
	display: flex;
	gap: 0;
	user-select: none;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.acu-marquee__row {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 3rem;
	padding-right: 3rem;
	margin: 0;
	list-style: none;
	white-space: nowrap;
	animation: acu-marquee-scroll 32s linear infinite;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	font-size: clamp(1.5rem, 4vw, 3rem);
	letter-spacing: -0.02em;
}

.acu-marquee:hover .acu-marquee__row {
	animation-play-state: paused;
}

.acu-marquee__row li::after {
	content: "";
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin-left: 3rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-bright);
	vertical-align: middle;
}

@keyframes acu-marquee-scroll {
	from { transform: translateX(0); }
	to   { transform: translateX(-100%); }
}

/* --- Scroll reveal ---------------------------------------------------- */

/* The hidden starting state is scoped to .acu-js, a class added to <html> by
   an inline script only when JavaScript is running. If the script is blocked
   or fails, the class is never added and the content simply stays visible —
   nothing is ever trapped behind an animation that did not fire. */
.acu-js .acu-reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.acu-js .acu-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* --- Navigation current page ------------------------------------------ */

.wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-underline-offset: 7px;
	text-decoration-thickness: 2px;
}

/* --- Reduced motion --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.acu-marquee__row {
		animation: none;
	}

	.acu-card:hover,
	.acu-work-tile:hover img {
		transform: none;
	}

	.acu-js .acu-reveal {
		opacity: 1;
		transform: none;
	}
}
