/**
 * CraftsLeather — small additions that theme.json cannot express.
 * Loaded on the front end and in the editor. No JavaScript is used by the theme.
 */

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

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* ---------- Brass stitch (the one signature detail) ---------- */
.wp-block-separator.is-style-stitch {
	border: 0 !important;
	height: 2px !important;
	max-width: 100%;
	background-image: repeating-linear-gradient(
		90deg,
		var(--wp--preset--color--brass) 0 10px,
		transparent 10px 16px
	);
	opacity: 1;
}
.wp-block-separator.is-style-stitch:not(.is-style-wide):not(.alignwide):not(.alignfull) {
	width: 72px;
}

.cl-stitch-under {
	position: relative;
	padding-bottom: 6px;
}
.cl-stitch-under::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	background-image: repeating-linear-gradient(
		90deg,
		var(--wp--preset--color--brass) 0 6px,
		transparent 6px 10px
	);
}

/* ---------- Eyebrow text ---------- */
.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: var(--wp--preset--font-size--x-small) !important;
	font-weight: 600 !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase;
	line-height: 1.4 !important;
	color: var(--wp--preset--color--accent);
}

/* ---------- Buttons ---------- */
.wp-block-button.is-style-arrow .wp-block-button__link::after {
	content: "\2192";
	display: inline-block;
	margin-left: 0.5em;
	transition: transform 0.2s ease;
}
.wp-block-button.is-style-arrow .wp-block-button__link:hover::after,
.wp-block-button.is-style-arrow .wp-block-button__link:focus-visible::after {
	transform: translateX(3px);
}

.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button .wp-block-button__link.is-style-outline {
	border: 1.5px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	padding: calc(0.85rem - 1.5px) calc(1.6rem - 1.5px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--contrast);
}

.wp-block-button.is-style-text-link > .wp-block-button__link {
	background: transparent !important;
	color: inherit !important;
	padding: 0 0 4px !important;
	border-radius: 0 !important;
	border-bottom: 1.5px solid currentColor;
}
.wp-block-button.is-style-text-link > .wp-block-button__link:hover {
	color: var(--wp--preset--color--accent) !important;
}

/* ---------- Cards ---------- */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.wp-block-group.is-style-card:hover {
	box-shadow: var(--wp--preset--shadow--soft);
}

.wp-block-image.is-style-framed img {
	border: 1px solid var(--wp--preset--color--line);
	padding: 6px;
	background: var(--wp--preset--color--base);
}

/* ---------- Lists ---------- */
.is-style-checklist {
	list-style: none;
	padding-left: 0;
}
.is-style-checklist li {
	position: relative;
	padding-left: 1.75em;
	margin-bottom: 0.5em;
}
.is-style-checklist li::before {
	content: "";
	position: absolute;
	left: 0.15em;
	top: 0.45em;
	width: 0.85em;
	height: 0.45em;
	border-left: 2px solid var(--wp--preset--color--accent);
	border-bottom: 2px solid var(--wp--preset--color--accent);
	transform: rotate(-45deg);
}

/* ---------- Header ---------- */
.cl-announcement {
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.02em;
}
.cl-announcement a {
	color: inherit;
}
.cl-site-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.cl-site-header .wp-block-site-title a {
	position: relative;
	padding-bottom: 5px;
}
.cl-site-header .wp-block-site-title a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background-image: repeating-linear-gradient(
		90deg,
		var(--wp--preset--color--brass) 0 6px,
		transparent 6px 10px
	);
}
.cl-header-tools {
	gap: 0.25rem;
}
.cl-header-tools .wp-block-search__input {
	min-width: 0;
}
@media (max-width: 781px) {
	.cl-header-tools .wp-block-search {
		display: none;
	}
}

/* ---------- Hero ---------- */
.cl-hero .wp-block-cover__inner-container > * {
	animation: cl-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.cl-hero .wp-block-cover__inner-container > *:nth-child(2) { animation-delay: 0.06s; }
.cl-hero .wp-block-cover__inner-container > *:nth-child(3) { animation-delay: 0.12s; }
.cl-hero .wp-block-cover__inner-container > *:nth-child(4) { animation-delay: 0.18s; }

@keyframes cl-rise {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

/* ---------- Tiles & product cards ---------- */
.cl-tile .wp-block-image img,
.cl-tile .wp-block-cover__image-background {
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cl-tile:hover .wp-block-image img,
.cl-tile:hover .wp-block-cover__image-background {
	transform: scale(1.03);
}
.cl-tile .wp-block-image {
	overflow: hidden;
	border-radius: 4px;
}

.cl-swatch {
	display: inline-block;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	border: 1px solid rgba(21, 20, 18, 0.15);
	box-shadow: inset 0 0 0 3px var(--wp--preset--color--base);
}

.wc-block-product-template .wc-block-components-product-image img,
.wp-block-woocommerce-product-template .wc-block-components-product-image img {
	background: var(--wp--preset--color--surface);
	border-radius: 4px;
}
.wp-block-woocommerce-product-template .wp-block-post-title {
	font-family: var(--wp--preset--font-family--body);
	letter-spacing: -0.01em;
}

/* ---------- Single product ---------- */
.cl-product-summary .wp-block-post-title {
	margin-top: 0;
}
.cl-trust-list {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

/* ---------- Footer ---------- */
.cl-footer a {
	text-decoration: none;
}
.cl-footer a:hover {
	text-decoration: underline;
}
.cl-footer .wp-block-navigation {
	--navigation-layout-direction: column;
}

/* ---------- Journal ---------- */
.cl-post-card .wp-block-post-featured-image img {
	border-radius: 4px;
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cl-post-card .wp-block-post-featured-image {
	overflow: hidden;
	border-radius: 4px;
}
.cl-post-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

/* ---------- Motion preference ---------- */
@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;
	}
}

/* ---------- Refinements ---------- */
.wp-block-separator.is-style-stitch:not(.has-text-align-center) {
	margin-left: 0 !important;
}
.cl-header-tools .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	padding: 0.5rem;
	border: 0;
}
.cl-header-tools .wp-block-search__button:hover,
.cl-header-tools .wp-block-search__button:focus-visible {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}
.cl-header-tools .wp-block-search__button svg {
	width: 22px;
	height: 22px;
}
.cl-tile .wp-block-image {
	margin-bottom: 0;
}
