/*
Theme Name: Blocks2
Description: Minimal hybrid classic theme spike — daisyUI-inspired design tokens in theme.json and vanilla CSS, with a PHP-only hero block using the WordPress 7.0 autoRegister Block API. WCAG 2.1/2.2 AA conformant.
Author: Jonathan Hatch
Version: 0.1.0
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blocks2
*/

/*
 * Design language: daisyUI/Tailwind aesthetics in vanilla CSS.
 * Color roles, spacing scale, radii, shadows and Inter all come from
 * theme.json presets; this file only covers what theme.json cannot
 * express — classic-theme content layout, accessibility affordances and
 * a few component touches. Loaded on the front end AND in the editor
 * (add_editor_style) so the canvas matches the site.
 */

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Screen-reader-only utility + skip link (WCAG 2.4.1 bypass blocks). */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	top: var(--wp--preset--spacing--2, 0.5rem);
	left: var(--wp--preset--spacing--2, 0.5rem);
	z-index: 100;
	width: auto;
	height: auto;
	margin: 0;
	clip-path: none;
	padding: var(--wp--preset--spacing--3, 0.75rem) var(--wp--preset--spacing--6, 1.5rem);
	background-color: var(--wp--preset--color--primary, #4f46e5);
	color: var(--wp--preset--color--primary-content, #eef2ff);
	border-radius: var(--wp--custom--radius--field, 0.5rem);
	box-shadow: var(--wp--preset--shadow--lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
	text-decoration: none;
	font-weight: 600;
}

/*
 * Classic-theme content column: constrain root blocks, let wide/full
 * escape, and keep a gutter on small screens so text never touches the
 * viewport edge.
 */
.entry-content > * {
	max-width: min(var(--wp--style--global--content-size, 42rem), calc(100% - 3rem));
	margin-left: auto;
	margin-right: auto;
}

.entry-content > .alignwide {
	max-width: min(var(--wp--style--global--wide-size, 72rem), calc(100% - 3rem));
}

.entry-content > .alignfull {
	max-width: none;
}

/* Site chrome */
.blocks2-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: var(--wp--preset--shadow--sm, 0 1px 2px 0 rgb(0 0 0 / 0.05));
}

.blocks2-site-header .wp-block-site-title a {
	text-decoration: none;
	font-weight: 700;
	letter-spacing: -0.025em;
}

.blocks2-site-footer a {
	color: inherit;
}

/*
 * Visible focus states (WCAG 2.4.7 / 2.4.13). The brand ring passes 3:1
 * against the light base surfaces; on dark surfaces (footer, hero image)
 * it would drop to ~1.8:1, so those contexts switch to a light ring.
 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.wp-element-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #4f46e5);
	outline-offset: 2px;
	border-radius: var(--wp--custom--radius--field, 0.5rem);
}

.blocks2-site-footer a:focus-visible,
.blocks2-site-footer button:focus-visible,
.blocks2-hero--has-image a:focus-visible {
	outline-color: var(--wp--preset--color--base-100, #ffffff);
}

/* Buttons: motion polish on top of theme.json element styles, only for
 * users who have not asked for reduced motion (WCAG 2.3.3). */
@media (prefers-reduced-motion: no-preference) {
	.wp-element-button,
	.wp-block-button__link {
		transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
	}

	.wp-element-button:hover,
	.wp-block-button__link:hover {
		transform: translateY(-1px);
	}

	.wp-element-button:active,
	.wp-block-button__link:active {
		transform: translateY(0);
	}

	html {
		scroll-behavior: smooth;
	}
}

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