/*
Theme Name: Petcrafting Workshop
Theme URI: https://www.petcrafting.com
Author: Petcrafting
Description: A modern, warm "workbench" block theme for Petcrafting.com – kraft-paper tones, stitched edges, punched-hole dividers and handwritten notes. Built for tutorials and a WooCommerce shop.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: petcrafting-workshop
Tags: block-theme, full-site-editing, blog, e-commerce, custom-colors, editor-style, wide-blocks
WC requires at least: 9.0
*/

/* ---------- Base ---------- */

body {
	/* faint paper grain */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--wp--preset--color--sunny);
	color: var(--wp--preset--color--ink);
}

:where(a) {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1.5px;
}

:where(.wp-site-blocks) :focus-visible {
	outline: 2px solid var(--wp--preset--color--coral);
	outline-offset: 3px;
	border-radius: 4px;
}

img {
	height: auto;
}

/* ---------- Header ---------- */

.pc-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--paper) 92%, transparent);
	backdrop-filter: saturate(1.2) blur(8px);
	-webkit-backdrop-filter: saturate(1.2) blur(8px);
	border-bottom: var(--wp--custom--stitch);
}

.admin-bar .pc-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .pc-header {
		top: 0;
		position: relative;
	}
}

.pc-header .wp-block-site-logo img {
	max-height: 44px;
	width: auto;
}

.pc-header .wp-block-navigation-item__content {
	padding: 0.35em 0.15em;
	position: relative;
}

.pc-header .wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: repeating-linear-gradient(90deg, var(--wp--preset--color--coral) 0 6px, transparent 6px 10px);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}

.pc-header .wp-block-navigation .wp-block-navigation-item__content:hover::after,
.pc-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

/* cart / account icons sit nicely */
.pc-header .wc-block-mini-cart__button,
.pc-header .wc-block-customer-account a {
	color: var(--wp--preset--color--ink);
}

.pc-header .wc-block-mini-cart__badge {
	background: var(--wp--preset--color--coral);
	color: #fff;
	border-color: var(--wp--preset--color--paper);
}

/* ---------- Block styles (registered in functions.php) ---------- */

/* Stitched card: dashed "stitching" inset from the edge */
.is-style-stitched {
	position: relative;
	background-color: var(--wp--preset--color--card);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--preset--shadow--card);
}

.is-style-stitched::before {
	content: "";
	position: absolute;
	inset: 8px;
	border: 1.5px dashed var(--wp--preset--color--line);
	border-radius: calc(var(--wp--custom--radius--medium) - 6px);
	pointer-events: none;
}

.is-style-stitched.has-background::before {
	border-color: color-mix(in srgb, currentColor 35%, transparent);
}

/* Taped image: a strip of washi tape on top */
.wp-block-image.is-style-taped,
.wp-block-post-featured-image.is-style-taped {
	position: relative;
	overflow: visible;
}

.wp-block-image.is-style-taped::before,
.wp-block-post-featured-image.is-style-taped::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 50%;
	width: 110px;
	height: 26px;
	transform: translateX(-50%) rotate(-3deg);
	background: color-mix(in srgb, var(--wp--preset--color--sunny) 70%, transparent);
	background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 4px, transparent 4px 8px);
	box-shadow: 0 1px 2px rgba(0,0,0,.08);
	z-index: 2;
	clip-path: polygon(2% 0, 98% 4%, 100% 50%, 97% 100%, 3% 96%, 0 50%);
}

.wp-block-image.is-style-taped img,
.wp-block-post-featured-image.is-style-taped img {
	box-shadow: var(--wp--preset--shadow--card);
	background: #fff;
	padding: 8px;
}

/* Punched-hole divider – like a leash with holes every 20 mm */
hr.wp-block-separator.is-style-punched {
	border: 0 !important;
	height: 16px;
	width: min(100%, 320px) !important;
	max-width: 100%;
	background:
		radial-gradient(circle at center, var(--wp--preset--color--paper) 0 4px, var(--wp--preset--color--ink) 4.5px 5.5px, transparent 6px) center / 40px 16px repeat-x,
		linear-gradient(var(--wp--preset--color--teal), var(--wp--preset--color--teal)) center / 100% 16px no-repeat;
	border-radius: 8px;
	opacity: 1;
}

hr.wp-block-separator.is-style-punched.alignwide,
hr.wp-block-separator.is-style-punched.alignfull {
	width: 100% !important;
}

hr.wp-block-separator.is-style-punched.has-background {
	background:
		radial-gradient(circle at center, var(--wp--preset--color--paper) 0 4px, transparent 4.5px) center / 40px 16px repeat-x,
		currentColor;
}

/* Handwritten heading */
.is-style-hand,
.pc-hand {
	font-family: var(--wp--preset--font-family--hand) !important;
	font-weight: 700 !important;
	letter-spacing: 0 !important;
	line-height: 1.1 !important;
}

.pc-note {
	display: inline-block;
	font-family: var(--wp--preset--font-family--hand);
	font-size: var(--wp--preset--font-size--hand);
	color: var(--wp--preset--color--coral);
	transform: rotate(-3deg);
	line-height: 1.1;
}

/* Pill-shaped "label" paragraph, e.g. "Tutorial" kicker */
.is-style-label {
	display: inline-block;
	padding: 0.3em 0.9em;
	border-radius: 999px;
	background: var(--wp--preset--color--sunny);
	color: var(--wp--preset--color--ink);
	font-size: 0.8rem !important;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	line-height: 1.4;
}

/* Outline button variant */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--ink);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--card);
}

.wp-block-button__link {
	transition: transform 0.15s ease, background-color 0.2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
}

/* ---------- Hero ---------- */

.pc-hero {
	position: relative;
	overflow: hidden;
}

.pc-hero .pc-hero__photos {
	position: relative;
	min-height: 420px;
}

.pc-hero .pc-hero__photos .wp-block-image {
	position: absolute;
	margin: 0;
	width: 58%;
}

.pc-hero .pc-hero__photos .wp-block-image:nth-child(1) { top: 0; left: 0; transform: rotate(-4deg); z-index: 1; }
.pc-hero .pc-hero__photos .wp-block-image:nth-child(2) { top: 18%; right: 0; transform: rotate(3deg); z-index: 2; }
.pc-hero .pc-hero__photos .wp-block-image:nth-child(3) { bottom: 0; left: 14%; transform: rotate(-1.5deg); z-index: 3; width: 50%; }

.pc-hero .pc-hero__photos img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
}

@media (max-width: 781px) {
	.pc-hero .pc-hero__photos {
		min-height: 300px;
	}
}

/* ---------- Post cards (query loops) ---------- */

.pc-cards .wp-block-post {
	display: flex;
}

.pc-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: var(--wp--preset--color--card);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--preset--shadow--card);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	position: relative;
}

.pc-card:hover {
	transform: translateY(-3px) rotate(-0.3deg);
	box-shadow: var(--wp--preset--shadow--lift);
}

.pc-card .wp-block-post-featured-image {
	margin: 0;
	border-radius: 0;
}

.pc-card .wp-block-post-featured-image img {
	border-radius: 0;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.pc-card .pc-card__body {
	flex: 1;
}

.pc-card .wp-block-post-title a::after {
	/* whole card clickable */
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.pc-card .wp-block-post-terms a {
	position: relative;
	z-index: 2;
	color: var(--wp--preset--color--coral);
	text-decoration: none;
}

/* Fallback when a post has no featured image */
.pc-card:not(:has(.wp-block-post-featured-image img))::before {
	content: "";
	display: block;
	height: 10px;
	background: repeating-linear-gradient(90deg, var(--wp--preset--color--leaf) 0 25%, var(--wp--preset--color--sunny) 25% 50%, var(--wp--preset--color--rose) 50% 75%, var(--wp--preset--color--sky) 75% 100%);
}

/* ---------- Single posts ---------- */

.pc-article .wp-block-post-content > h2 {
	margin-top: 2.5em;
	padding-top: 0.6em;
	position: relative;
}

.pc-article .wp-block-post-content > h2::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 56px;
	height: 6px;
	border-radius: 3px;
	background: repeating-linear-gradient(90deg, var(--wp--preset--color--coral) 0 10px, transparent 10px 14px);
}

.pc-article .wp-block-post-content img {
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--preset--shadow--card);
}

.pc-article .wp-block-post-content ul li::marker,
.pc-article .wp-block-post-content ol li::marker {
	color: var(--wp--preset--color--coral);
	font-weight: 700;
}

/* Affiliate notice / tips in old posts often live in plain paragraphs –
   give any <p><strong>NOTE:</strong> a callout look */
.pc-article .wp-block-post-content p:has(> strong:first-child) {
	background: var(--wp--preset--color--card);
	border-left: 4px solid var(--wp--preset--color--sunny);
	padding: 0.9rem 1.1rem;
	border-radius: 0 var(--wp--custom--radius--small) var(--wp--custom--radius--small) 0;
}

/* Elementor leftovers inside post content – keep them readable */
.pc-article .elementor-section,
.pc-article .elementor-container,
.pc-article .elementor-column {
	max-width: 100% !important;
	width: 100% !important;
}

/* ---------- Footer ---------- */

.pc-footer {
	position: relative;
}

.pc-footer::before {
	/* scalloped / stitched top edge */
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -14px;
	height: 14px;
	background: radial-gradient(circle at 10px 14px, var(--wp--preset--color--teal-dark) 10px, transparent 10.5px) 0 0 / 20px 14px repeat-x;
}

.pc-footer a {
	color: var(--wp--preset--color--card);
	text-decoration: none;
}

.pc-footer a:hover {
	color: var(--wp--preset--color--sunny);
	text-decoration: underline;
}

.pc-footer .wp-block-navigation {
	font-weight: 500;
}

/* ---------- Trust strip ---------- */

.pc-stats .pc-stat-number {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: clamp(2rem, 4vw, 2.8rem);
	line-height: 1;
	margin: 0;
}

.pc-stars {
	color: var(--wp--preset--color--sunny);
	letter-spacing: 0.15em;
}

/* ---------- WooCommerce ---------- */

/* product grid cards */
.wc-block-product-template .wc-block-product,
.wp-block-woocommerce-product-template .wc-block-product,
ul.products li.product {
	background: var(--wp--preset--color--card);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--preset--shadow--card);
	padding: 0 0 1.25rem !important;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	position: relative;
}

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

.wc-block-product-template .wc-block-product > *:not(.wc-block-components-product-image),
.wp-block-woocommerce-product-template .wc-block-product > *:not(.wc-block-components-product-image) {
	padding-left: 1.1rem;
	padding-right: 1.1rem;
}

.wc-block-components-product-image img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 0 !important;
}

.wc-block-components-product-price,
.wp-block-woocommerce-product-price {
	font-weight: 700;
	color: var(--wp--preset--color--teal);
}

.wc-block-components-product-sale-badge,
.wp-block-woocommerce-product-sale-badge span {
	background: var(--wp--preset--color--coral) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 999px !important;
	font-family: var(--wp--preset--font-family--hand);
	font-size: 1.1rem !important;
	transform: rotate(-6deg);
}

/* add to cart buttons follow theme buttons */
.wc-block-components-product-button .wp-block-button__link,
.wp-block-woocommerce-product-button .wp-block-button__link,
.wc-block-components-button:not(.is-link) {
	border-radius: 999px !important;
	font-weight: 700 !important;
}

.wc-block-components-button:not(.is-link) {
	background: var(--wp--preset--color--teal);
	color: var(--wp--preset--color--card);
}

.wc-block-components-button:not(.is-link):hover {
	background: var(--wp--preset--color--teal-dark);
	color: var(--wp--preset--color--card);
}

/* variation selector (sizes) – roomy, never clipped */
.single-product table.variations select,
.single-product .variations select,
.wc-block-add-to-cart-with-options select {
	box-sizing: border-box;
	height: auto !important;
	min-height: 2.9rem;
	min-width: 13rem;
	max-width: 100%;
	padding: 0.6rem 2.4rem 0.6rem 0.9rem !important;
	line-height: 1.4 !important;
	font-family: inherit;
	font-size: 1rem !important;
	color: var(--wp--preset--color--ink);
	background-color: var(--wp--preset--color--card);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232A2622' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.9rem center;
	border: 2px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--small);
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.single-product .variations select:focus,
.wc-block-add-to-cart-with-options select:focus {
	border-color: var(--wp--preset--color--teal);
	outline: none;
}

.single-product table.variations,
.single-product table.variations th,
.single-product table.variations td {
	border: 0;
	padding: 0.25rem 0.75rem 0.25rem 0;
	vertical-align: middle;
}

.single-product table.variations th label {
	font-weight: 700;
}

.single-product .reset_variations {
	font-size: var(--wp--preset--font-size--small);
	margin-left: 0.5rem;
}

/* price of the chosen size */
.single-product .woocommerce-variation-price .price {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--wp--preset--color--teal);
}

/* quantity box */
.single-product .quantity .qty,
.wc-block-add-to-cart-with-options .quantity .qty {
	box-sizing: border-box;
	height: 3rem;
	width: 4.5rem;
	padding: 0 0.5rem;
	text-align: center;
	font: inherit;
	font-size: 1rem;
	border: 2px solid var(--wp--preset--color--line);
	border-radius: 999px;
	background: var(--wp--preset--color--card);
}

.single-product .single_add_to_cart_button {
	min-height: 3rem;
}

.single-product .woocommerce-product-gallery img,
.wp-block-woocommerce-product-image-gallery img {
	border-radius: var(--wp--custom--radius--medium);
}

/* product page "good to know" box */
.pc-product-meta {
	font-size: var(--wp--preset--font-size--small);
}

.pc-product-meta p {
	margin: 0.35rem 0;
}

/* Cart / checkout tidy */
.wc-block-cart,
.wc-block-checkout {
	--pc-panel: var(--wp--preset--color--card);
}

.wc-block-components-sidebar .wc-block-components-panel,
.wc-block-components-totals-wrapper {
	border-color: var(--wp--preset--color--line) !important;
}

.wc-block-components-text-input input,
.wc-block-components-combobox .wc-block-components-combobox-control input,
.wc-block-components-form .wc-block-components-text-input input {
	border-radius: var(--wp--custom--radius--small) !important;
}

/* store notices */
.wc-block-components-notice-banner {
	border-radius: var(--wp--custom--radius--small);
}

/* currency switcher (CURCY / similar) inside header */
.pc-currency select {
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: 999px;
	padding: 0.25rem 0.6rem;
	background: var(--wp--preset--color--card);
	font: inherit;
	font-size: 0.875rem;
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}

.pc-note.has-text-align-center {
	display: block;
}
