/**
 * RWD Starter frontend styles.
 *
 * Keep this layer intentionally small.
 * Prefer theme.json and WordPress block supports whenever possible.
 *
 * @package RWD_Starter
 */

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

.wp-element-button,
.wp-block-button__link {
	transition:
		background-color 160ms ease,
		border-color 160ms ease,
		color 160ms ease,
		box-shadow 160ms ease,
		transform 160ms ease;
}

.wp-element-button:hover,
.wp-block-button__link:hover {
	text-decoration: none;
}

.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

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

.wp-element-button:disabled,
.wp-block-button__link:disabled,
.wp-element-button[aria-disabled="true"],
.wp-block-button__link[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
	.wp-element-button,
	.wp-block-button__link {
		transition: none;
	}
}

/* --------------------------------------------------------------------------
 * Forms
 * -------------------------------------------------------------------------- */

:where(input, select, textarea, button) {
	font: inherit;
}

:where(
	input[type="text"],
	input[type="email"],
	input[type="url"],
	input[type="tel"],
	input[type="search"],
	input[type="password"],
	input[type="number"],
	input[type="date"],
	input[type="time"],
	select,
	textarea
) {
	box-sizing: border-box;
	max-width: 100%;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0.5rem;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

:where(
	input[type="text"],
	input[type="email"],
	input[type="url"],
	input[type="tel"],
	input[type="search"],
	input[type="password"],
	input[type="number"],
	input[type="date"],
	input[type="time"],
	select
) {
	min-height: 2.75rem;
	padding: 0.625rem 0.75rem;
}

textarea {
	padding: 0.75rem;
	resize: vertical;
}

::placeholder {
	color: var(--wp--preset--color--muted);
	opacity: 0.75;
}

:where(input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--primary);
}

:where(input, select, textarea):disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

:where(input[type="checkbox"], input[type="radio"]) {
	accent-color: var(--wp--preset--color--primary);
}

button {
	cursor: pointer;
}

button:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

@media (prefers-reduced-motion: no-preference) {
	:where(input, select, textarea) {
		transition:
			border-color 160ms ease,
			box-shadow 160ms ease;
	}
}

select {
	height: 2.75rem;
}

/*
 * Site flow
 *
 * Sections and template parts own their vertical spacing.
 * Keep the global block gap available for inner block composition.
 */
.wp-site-blocks > * {
	margin-block-start: 0;
}

/* --------------------------------------------------------------------------
 * RWD component foundation
 *
 * Reusable visual primitives for Starter Kits and site composition.
 * Keep these classes presentation-focused and independent from Kit identity.
 * -------------------------------------------------------------------------- */

/*
 * Section
 */
.rwd-section {
        padding-block: var(--wp--preset--spacing--xl);
        padding-inline: var(--wp--preset--spacing--md);
}

.rwd-section--large {
        padding-block: var(--wp--preset--spacing--xxl);
}

.rwd-section--surface {
        background-color: var(--wp--preset--color--surface);
}

.rwd-section--surface-alt {
        background-color: var(--wp--preset--color--surface-alt);
}

/*
 * Surface / Card
 */
.rwd-surface,
.rwd-card {
        border: 1px solid var(--wp--preset--color--border);
        border-radius: var(--wp--custom--rwd--radius--lg);
        background-color: var(--wp--preset--color--base);
}

.rwd-card {
        padding: var(--wp--preset--spacing--lg);
        box-shadow: var(--wp--custom--rwd--shadow--sm);
}

.rwd-card--elevated {
        box-shadow: var(--wp--custom--rwd--shadow--md);
}

/*
 * Eyebrow / section label
 */
.rwd-eyebrow {
        margin-block-end: var(--wp--preset--spacing--sm);
        color: var(--wp--preset--color--primary);
        font-size: var(--wp--preset--font-size--sm);
        font-weight: 700;
        line-height: 1.4;
        letter-spacing: 0.08em;
        text-transform: uppercase;
}

/*
 * Content measures
 */
.rwd-content--narrow {
        max-width: var(--wp--custom--rwd--content--narrow);
}

.rwd-content--normal {
        max-width: var(--wp--custom--rwd--content--normal);
}

.rwd-content--wide {
        max-width: var(--wp--custom--rwd--content--wide);
}

/*
 * Buttons
 */
.wp-block-button__link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2.75rem;
        font-weight: 600;
        line-height: 1.2;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
        border: 1px solid currentColor;
        background: transparent;
}

/*
 * Navigation
 */
.wp-block-navigation-item__content {
        text-underline-offset: 0.2em;
}

.wp-block-navigation-item__content:hover {
        text-decoration-thickness: 2px;
}

/*
 * Media
 */
.rwd-card img,
.rwd-media {
        border-radius: var(--wp--custom--rwd--radius--md);
}

/*
 * Accessibility
 */
:where(a, button, input, select, textarea):focus-visible {
        outline: 2px solid var(--wp--preset--color--primary);
        outline-offset: 3px;
}

/* --------------------------------------------------------------------------
 * Responsive component foundation
 * -------------------------------------------------------------------------- */

.rwd-card {
        min-width: 0;
}

.rwd-card > :first-child {
        margin-block-start: 0;
}

.rwd-card > :last-child {
        margin-block-end: 0;
}

.rwd-content--narrow,
.rwd-content--normal,
.rwd-content--wide {
        width: 100%;
}

@media (max-width: 781px) {
        .rwd-section {
                padding-block: var(--wp--preset--spacing--lg);
                padding-inline: var(--wp--preset--spacing--md);
        }

        .rwd-section--large {
                padding-block: var(--wp--preset--spacing--xl);
        }

        .rwd-card {
                padding: var(--wp--preset--spacing--md);
        }

        .wp-block-buttons {
                gap: var(--wp--preset--spacing--sm);
        }
}

@media (max-width: 480px) {
        .rwd-section {
                padding-inline: var(--wp--preset--spacing--sm);
        }

        .wp-block-buttons > .wp-block-button {
                width: 100%;
        }

        .wp-block-buttons > .wp-block-button > .wp-block-button__link {
                width: 100%;
        }

        .rwd-eyebrow {
                letter-spacing: 0.06em;
        }
}
