/*
Theme Name: Carton
Theme URI: https://tenfoldthemes.example/carton
Author: Tenfold Themes
Author URI: https://tenfoldthemes.example
Description: A structural-packaging theme for box makers, print shops and packaging exporters — kraft tones, die-line details and stamp badges, with 18 patterns, four full-page layouts, an Inkwell dark style and locally hosted variable fonts.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: carton
Tags: block-theme, full-site-editing, block-patterns, block-styles, custom-colors, editor-style, featured-images, threaded-comments, translation-ready, wide-blocks, one-column, e-commerce, portfolio
*/

/* ---------------------------------------------------------------------------
 * Focus visibility & motion
 * ------------------------------------------------------------------------- */

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

::selection {
	background: var(--wp--preset--color--primary);
	color: #fff;
}

a,
.wp-block-button__link,
.wp-element-button {
	transition: var(--wp--custom--transition);
}

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

/* ---------------------------------------------------------------------------
 * Block style: Group — Label panel
 * A white shipping-label card on the kraft ground.
 * ------------------------------------------------------------------------- */

.wp-block-group.is-style-label {
	background: var(--wp--custom--label-bg, #ffffff);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--m);
	box-shadow: var(--wp--preset--shadow--card);
	padding: var(--wp--preset--spacing--40);
}

/* Optional tape strip across the label's top edge: add class "carton-tape". */
.wp-block-group.is-style-label.carton-tape {
	position: relative;
	box-shadow: var(--wp--preset--shadow--lift);
}

.wp-block-group.is-style-label.carton-tape::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 50%;
	width: 108px;
	height: 24px;
	background: var(--wp--preset--gradient--brand-2);
	opacity: 0.85;
	border-radius: 2px;
	transform: translateX(-50%) rotate(-2deg);
}

/* ---------------------------------------------------------------------------
 * Block style: Group — Die-line
 * Dashed fold-line border, like a cutting template.
 * ------------------------------------------------------------------------- */

.wp-block-group.is-style-dieline {
	border: 2px dashed var(--wp--preset--color--contrast-2);
	border-radius: var(--wp--custom--radius--m);
	padding: var(--wp--preset--spacing--40);
}

/* ---------------------------------------------------------------------------
 * Block style: Group — Stamp circle
 * Round rubber-stamp badge with a dashed outer ring.
 * ------------------------------------------------------------------------- */

.wp-block-group.is-style-stamp {
	border: 2px solid currentColor;
	border-radius: 999px;
	outline: 1.5px dashed currentColor;
	outline-offset: 5px;
	width: 8.75rem;
	height: 8.75rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1rem;
	margin: 8px;
}

.wp-block-group.is-style-stamp p {
	margin: 0;
	line-height: 1.3;
}

/* ---------------------------------------------------------------------------
 * Block style: Separator — Die-line cut
 * ------------------------------------------------------------------------- */

hr.is-style-dieline-cut {
	border: none;
	border-top: 2px dashed var(--wp--preset--color--border);
	height: 0;
	background: none;
	width: 100%;
}

/* ---------------------------------------------------------------------------
 * Block style: List — Packing ticks
 * Box-checked packing-list markers in stamp green.
 * ------------------------------------------------------------------------- */

ul.is-style-packing-ticks {
	list-style: none;
	padding-left: 0;
}

ul.is-style-packing-ticks > li {
	padding-left: 1.85em;
	position: relative;
	margin-bottom: 0.55em;
}

ul.is-style-packing-ticks > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.18em;
	width: 1.15em;
	height: 1.15em;
	border-radius: 2px;
	background-color: var(--wp--preset--color--primary);
	-webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="3" fill="none" stroke="black" stroke-width="2.5"/><path fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M7 12.5l3.5 3.5L17 8.5"/></svg>') center / 100% no-repeat;
	mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="3" fill="none" stroke="black" stroke-width="2.5"/><path fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M7 12.5l3.5 3.5L17 8.5"/></svg>') center / 100% no-repeat;
}

/* ---------------------------------------------------------------------------
 * Details / FAQ affordance
 * ------------------------------------------------------------------------- */

.wp-block-details summary {
	cursor: pointer;
	list-style: none;
	position: relative;
	padding-right: 2rem;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.35em;
	font-weight: 600;
	line-height: 1;
	color: var(--wp--preset--color--accent);
	transition: transform 0.2s ease;
}

.wp-block-details[open] summary::after {
	content: "−";
}

.wp-block-details > :not(summary) {
	font-weight: 400;
	color: var(--wp--preset--color--contrast-2);
}

/* ---------------------------------------------------------------------------
 * Small refinements
 * ------------------------------------------------------------------------- */

.wp-block-navigation .current-menu-item > a {
	color: var(--wp--preset--color--primary);
}

/* Social icons inherit the surrounding palette color so they remap in style variations. */
.wp-block-social-links.is-style-logos-only .wp-block-social-link a {
	color: currentColor;
}

.wp-block-button.is-style-outline .wp-block-button__link {
	border-width: 1.5px;
}

.wp-block-image img {
	height: auto;
	max-width: 100%;
}
/* ---------------------------------------------------------------------------
 * Palette-slug guard: the standard palette includes a slug named "border".
 * When used as a *text* color, WordPress emits `.has-border-color`, which core
 * pairs with `:where(.has-border-color){border-style:solid}`; with the default
 * medium width that paints a stray ~3px box around the text. Zero the width
 * here — genuine borders set an explicit width (inline or via block-style
 * classes) that overrides this 0-specificity rule.
 * ------------------------------------------------------------------------- */
:where(.has-border-color) {
	border-width: 0;
}
