/*
 * Dulcamare Theme — Frontend stylesheet
 *
 * Filosofia: il 90% degli stili visivi è gestito da theme.json (design
 * tokens, supports, elements styles). Questo file copre solo:
 *
 *  - skip-link
 *  - micro-correzioni per blocchi core specifici di questo brand
 *  - eventuali hot-fix CSS che NON è naturale esprimere in theme.json
 *
 * Niente reset CSS, niente normalize: WP+Gutenberg ne ha già uno suo
 * in wp-block-styles.
 */

/* =============================
   ACCESSIBILITÀ — skip link
   ============================= */
.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 100000;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	padding: 0.75rem 1rem;
	text-decoration: none;
	border-radius: 0 0 4px 0;
}

.skip-link:focus {
	left: 0;
	top: 0;
}

/* =============================
   FOCUS VISIBLE — ringa accent
   Garantisce WCAG 2.4.11 (focus appearance) anche dove
   l'autorità di style.elements.button non basta.
   ============================= */
:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* =============================
   REDUCED MOTION — disabilita animazioni
   ============================= */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/* =============================
   FONT SMOOTHING (macOS/iOS readability)
   ============================= */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* =============================
   CATEGORY CARD — hover lift
   Riusato dal pattern dulcamare-theme/categories-grid. Niente !important,
   niente colori hardcoded: tutto via design tokens di theme.json.
   ============================= */
.dulcamare-category-card {
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		border-color 0.2s ease;
}

.dulcamare-category-card:hover {
	transform: translateY(-3px);
	border-color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--md);
}

.dulcamare-category-card:has(:focus-visible) {
	border-color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--md);
}

.dulcamare-category-card a {
	color: inherit;
	text-decoration: none;
	display: block;
}

.dulcamare-category-card a:hover {
	color: var(--wp--preset--color--primary);
}

/* =============================
   PRODUCT CARD (WC product-collection) — uniform polish
   Allinea le card prodotto della Product Collection nativa WC al look del theme.
   ============================= */
.wp-block-woocommerce-product-template .wc-block-product {
	padding: 1rem;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.wp-block-woocommerce-product-template .wc-block-product:hover {
	box-shadow: var(--wp--preset--shadow--md);
	transform: translateY(-2px);
}
