/*
 * RocketCite Global Styles
 *
 * Base styles that complement theme.json design tokens.
 * Do NOT hardcode colors, fonts, or spacing here.
 * Use CSS custom properties from theme.json presets.
 */

/* Smooth scrolling */
html {
	scroll-behavior: smooth;
}

/* Offset anchor targets below the sticky navbar (80px + 16px breathing room) */
[id] {
	scroll-margin-top: var(--wp--preset--spacing--96);
}

/* When the WP admin bar is visible, add its height to the scroll offset */
body.admin-bar [id] {
	scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--preset--spacing--96));
}

/* Push footer to bottom on short-content pages */
body > .wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

body > .wp-site-blocks > main {
	flex: 1;
}

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

/* Remove default block-gap margins between header, main, and footer.
   WordPress applies margin-top via --wp--style--block-gap to flow-layout
   children, but our flex layout handles spacing via the blocks themselves. */
body > .wp-site-blocks > * {
	margin-block-start: 0;
}

/* Improve media defaults */
img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

/* Remove default margins */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
	margin: 0;
}

/* ---------- Typography ---------- */

/* Font smoothing */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Headings: tracking-tight equivalent */
h1,
h2,
h3,
h4,
h5,
h6 {
	letter-spacing: -0.025em;
}

/* ---------- Links ---------- */

a {
	text-decoration: none;
}

@media (hover: hover) {

	a:hover {
		text-decoration: underline;
	}
}

/* ---------- Blockquote ---------- */

blockquote {
	border-left: 4px solid var(--wp--preset--color--accent);
	background-color: var(--wp--preset--color--gray-50);
	border-radius: 0 var(--wp--custom--border-radius--2-xl) var(--wp--custom--border-radius--2-xl) 0;
	padding: var(--wp--preset--spacing--16) var(--wp--preset--spacing--24);
}

/* ---------- Code ---------- */

/* Inline code */
code {
	background-color: var(--wp--preset--color--gray-100);
	color: var(--wp--preset--color--primary);
	border-radius: var(--wp--custom--border-radius--sm);
	padding: 0.15em 0.4em;
	font-size: 0.875em;
}

/* Code blocks */
pre code {
	display: block;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--gray-100);
	border-radius: var(--wp--custom--border-radius--md);
	padding: var(--wp--preset--spacing--16) var(--wp--preset--spacing--24);
	overflow-x: auto;
}

/* ---------- Accessibility utilities ---------- */

/* Visually hide elements while keeping them available to screen readers. */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	position: absolute;
	word-wrap: normal;
}

/* ---------- Buttons ---------- */

a.wp-block-button__link,
.wp-element-button {
	border-radius: var(--wp--custom--border-radius--lg);
	font-weight: 600;
	box-shadow: var(--wp--custom--shadow--accent-sm);
	transition: box-shadow 0.2s ease;
}

@media (hover: hover) {

	a.wp-block-button__link:hover,
	.wp-element-button:hover {
		box-shadow: var(--wp--custom--shadow--accent-lg);
		text-decoration: none;
	}
}

a.wp-block-button__link:focus-visible,
.wp-element-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}

	a.wp-block-button__link,
	.wp-element-button {
		transition: none;
	}
}
