/*
Theme Name: KS Origin
Description: A WordPress block theme for WooCommerce.
Version: 0.1.0
Author: KondaSoft
Text Domain: ks-origin
*/

/* Base page shell styles that theme.json does not cover. */

/* Style WordPress's auto-injected skip link to match KS Origin tokens and clear the admin bar. */
.skip-link.screen-reader-text:focus {
	top: var(--wp--preset--spacing--20);
	left: var(--wp--preset--spacing--20);
	padding: 0.75rem 1.25rem;
	border-radius: 0.375rem;
	background-color: var(--wp--preset--color--background);
	color: var(--wp--preset--color--foreground);
	border: 1px solid currentColor;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	opacity: 1;
	box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
}

body.admin-bar .skip-link.screen-reader-text:focus {
	top: calc(var(--wp-admin--admin-bar--height, 32px) + var(--wp--preset--spacing--20));
}

/* Keep the footer at the bottom of the viewport on short pages (e.g. 404, empty search or cart). */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100svh;
}

body.admin-bar .wp-site-blocks {
	min-height: calc(100svh - var(--wp-admin--admin-bar--height, 32px));
}

.wp-site-blocks > footer {
	margin-top: auto;
}

/* Give main content regions default vertical breathing room across WordPress and WooCommerce templates. */
:where(.wp-site-blocks main) {
	padding-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
}

/*
 * Stretched-link product cards: lets the title link cover the entire card (so product images
 * don't need a redundant link/tab stop) while keeping buttons clickable above the overlay.
 */
.wc-block-product-template .wc-block-product {
	position: relative;
}

.wc-block-product-template .wc-block-product .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 0.375rem;
}

.wc-block-product-template .wc-block-product .wp-block-post-title a:focus-visible {
	outline-color: transparent;
}

.wc-block-product-template .wc-block-product .wp-block-post-title a:focus-visible::after {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.wc-block-product-template .wc-block-product .wp-block-woocommerce-product-button {
	position: relative;
	z-index: 1;
}

/*
 * Stretched-link announcement bar: when a single link is present, stretch its hit target across
 * the full bar (including padding) on the storefront without interfering with Site Editor clicks.
 */
.ks-announcement-bar {
	position: relative;
}

body:not(.editor-styles-wrapper) .ks-announcement-bar a:only-of-type::after {
	content: "";
	position: absolute;
	inset: 0;
}

body:not(.editor-styles-wrapper) .ks-announcement-bar a:only-of-type:focus-visible {
	outline-color: transparent;
}

body:not(.editor-styles-wrapper) .ks-announcement-bar a:only-of-type:focus-visible::after {
	outline: 2px solid currentColor;
	outline-offset: -4px;
}
