/*
Theme Name: The Mohur
Description: Contemporary Indian gifting block theme with a reusable editorial design system for WordPress and WooCommerce.
Author: The Mohur
 Version: 1.8.0
 Requires at least: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-mohur
*/

/*
 * Global design tokens are declared here as stable aliases for the presets in
 * theme.json. Component and WooCommerce styling lives in assets/css/.
 */
:root {
	--tm-color-primary: var(--wp--preset--color--primary);
	--tm-color-primary-dark: var(--wp--preset--color--deep-maroon);
	--tm-color-background: var(--wp--preset--color--background);
	--tm-color-surface: var(--wp--preset--color--cream);
	--tm-color-accent: var(--wp--preset--color--gold);
	--tm-color-muted: #6b5f55;
	--tm-color-text: var(--wp--preset--color--text);
	--tm-color-border: var(--wp--preset--color--border);
	--tm-color-white: var(--wp--preset--color--white);

	--tm-space-2xs: var(--wp--preset--spacing--2xs);
	--tm-space-xs: var(--wp--preset--spacing--xs);
	--tm-space-s: var(--wp--preset--spacing--s);
	--tm-space-m: var(--wp--preset--spacing--m);
	--tm-space-l: var(--wp--preset--spacing--l);
	--tm-space-xl: var(--wp--preset--spacing--xl);
	--tm-space-2xl: var(--wp--preset--spacing--2xl);
	--tm-space-3xl: var(--wp--preset--spacing--3xl);
	--tm-space-section-s: var(--wp--preset--spacing--section-s);
	--tm-space-section-m: var(--wp--preset--spacing--section-m);
	--tm-space-section-l: var(--wp--preset--spacing--section-l);

	--tm-radius-none: 0;
	--tm-radius-subtle: 2px;
	--tm-radius-small: 4px;
	--tm-radius-medium: 6px;
	--tm-shadow-quiet: var(--wp--preset--shadow--quiet);
	--tm-duration-fast: 160ms;
	--tm-duration-standard: 240ms;
	--tm-duration-slow: 420ms;
	--tm-ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
	--tm-content-width: var(--wp--style--global--content-size);
	--tm-wide-width: var(--wp--style--global--wide-size);
	--tm-font-display: var(--wp--preset--font-family--display);
	--tm-font-body: var(--wp--preset--font-family--body);
}

*, *::before, *::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	min-width: 320px;
	margin: 0;
	background: var(--tm-color-background);
	background-image:
		radial-gradient(circle at 12% 18%, rgba(179, 154, 103, 0.025), transparent 28rem),
		radial-gradient(circle at 88% 72%, rgba(90, 35, 49, 0.018), transparent 32rem);
	color: var(--tm-color-text);
	font-family: var(--tm-font-body);
	font-size: 1rem;
	line-height: 1.6;
}

img,
svg {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

a {
	color: var(--tm-color-primary);
	text-underline-offset: 0.16em;
	transition: color var(--tm-duration-standard) var(--tm-ease-out);
}

a:hover {
	color: var(--tm-color-primary-dark);
}

button,
input,
select,
textarea {
	font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
	width: 1.125rem;
	height: 1.125rem;
	accent-color: var(--tm-color-primary);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled,
[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.55;
}

input:user-invalid,
select:user-invalid,
textarea:user-invalid,
[aria-invalid="true"] {
	border: 2px dashed var(--tm-color-primary);
}

input:user-valid,
select:user-valid,
textarea:user-valid {
	border-style: double;
	border-color: var(--tm-color-accent);
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.wp-element-button {
	cursor: pointer;
}

:focus-visible {
	outline: 2px solid var(--tm-color-primary);
	outline-offset: 3px;
}

::selection {
	background: var(--tm-color-primary);
	color: var(--tm-color-background);
}

/* Keep content from touching the viewport on smaller screens. */
.wp-site-blocks > * {
	margin-inline: auto;
}

.wp-site-blocks {
	overflow: clip;
}

.wp-block-post-content,
.entry-content {
	max-width: var(--tm-content-width);
}

.wp-block-post-content > .alignwide,
.entry-content > .alignwide {
	max-width: var(--tm-wide-width);
}

.the-mohur-skip-link {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 100;
	padding: 0.75rem 1rem;
	background: var(--tm-color-primary-dark);
	color: var(--tm-color-white);
	transform: translateY(-200%);
	transition: transform var(--tm-duration-fast) var(--tm-ease-out);
}

.the-mohur-skip-link:focus {
	transform: translateY(0);
}

.the-mohur-site-header,
.the-mohur-site-footer {
	border-color: var(--tm-color-border);
}

.the-mohur-site-header .wp-block-site-title a,
.the-mohur-site-footer .wp-block-site-title a {
	color: var(--tm-color-primary-dark);
	text-decoration: none;
}

.the-mohur-site-header .wp-block-navigation-item__content,
.the-mohur-site-footer .wp-block-navigation-item__content {
	text-decoration: none;
}

.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--tm-space-l);
	background: var(--tm-color-surface);
}

.wp-block-button__link,
.wp-element-button {
	min-height: 2.75rem;
	border: 1px solid var(--tm-color-primary);
	border-radius: var(--tm-radius-none);
	transition:
		background-color var(--tm-duration-standard) var(--tm-ease-out),
		border-color var(--tm-duration-standard) var(--tm-ease-out),
		color var(--tm-duration-standard) var(--tm-ease-out),
		transform var(--tm-duration-standard) var(--tm-ease-out);
}

.wp-block-button__link:hover,
.wp-element-button:hover {
	border-color: var(--tm-color-primary-dark);
	background: var(--tm-color-primary-dark);
	color: var(--tm-color-white);
	transform: translateY(-2px);
}

.wp-block-button.is-style-outline .wp-block-button__link,
.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--tm-color-primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.is-style-outline > .wp-block-button__link:hover {
	background: var(--tm-color-primary);
	color: var(--tm-color-background);
}

.wp-block-button.is-style-text-link .wp-block-button__link {
	display: inline-flex;
	min-height: 2.75rem;
	align-items: center;
	padding: 0.7rem 0;
	border: 0;
	background: transparent;
	color: var(--tm-color-primary);
}

.wp-block-button.is-style-text-link .wp-block-button__link::after {
	content: "→";
	display: inline-block;
	margin-inline-start: 0.5rem;
	transition: transform var(--tm-duration-standard) var(--tm-ease-out);
}

.wp-block-button.is-style-text-link .wp-block-button__link:hover {
	background: transparent;
	color: var(--tm-color-primary-dark);
	transform: none;
}

.wp-block-button.is-style-text-link .wp-block-button__link:hover::after {
	transform: translateX(3px);
}

/* Generic development and editorial utility classes for patterns and blocks. */
.tm-eyebrow {
	margin-block-end: var(--tm-space-xs);
	color: var(--tm-color-primary);
	font-family: var(--tm-font-body);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.tm-eyebrow::before {
	content: "";
	display: inline-block;
	width: 1.75rem;
	height: 1px;
	margin-inline-end: 0.65rem;
	vertical-align: middle;
	background: var(--tm-color-accent);
}

.tm-display {
	font-family: var(--tm-font-display);
	font-weight: 500;
	letter-spacing: -0.02em;
}

.tm-text-measure {
	max-width: 64ch;
}

.tm-surface-cream {
	background: var(--tm-color-surface);
}

.tm-dark-editorial {
	background: var(--tm-color-primary-dark);
	color: var(--tm-color-background);
}

.tm-dark-editorial h1,
.tm-dark-editorial h2,
.tm-dark-editorial h3,
.tm-dark-editorial h4,
.tm-dark-editorial h5,
.tm-dark-editorial h6 {
	color: var(--tm-color-background);
}

.tm-dark-editorial a {
	color: var(--tm-color-background);
}

.tm-dark-editorial a:hover {
	color: var(--tm-color-accent);
}

.tm-dark-editorial .tm-eyebrow {
	color: var(--tm-color-accent);
}

.tm-divider {
	display: flex;
	align-items: center;
	gap: var(--tm-space-xs);
	color: var(--tm-color-accent);
}

.tm-divider::before,
.tm-divider::after {
	content: "";
	height: 1px;
	flex: 1;
	background: currentColor;
	opacity: 0.7;
}

.tm-divider::after {
	max-width: 0.45rem;
	transform: rotate(45deg);
}

.the-mohur-media-placeholder {
	display: grid;
	min-height: 12rem;
	place-items: center;
	border: 1px solid var(--tm-color-border);
	background:
		linear-gradient(135deg, transparent 49.5%, rgba(179, 154, 103, 0.12) 50%, transparent 50.5%),
		var(--tm-color-surface);
	color: var(--tm-color-muted);
}

.the-mohur-media-placeholder p {
	margin: 0;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tm-media--contain img {
	object-fit: contain;
}

.tm-media--4-5 img,
.tm-media--category img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.tm-media--square img {
	aspect-ratio: 1;
	object-fit: cover;
}

.tm-media--wide img {
	aspect-ratio: 2 / 1;
	object-fit: cover;
}

.tm-media--editorial img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.tm-announcement-bar {
	display: flex;
	min-height: 2rem;
	align-items: center;
	justify-content: center;
	padding: 0.35rem var(--tm-space-m);
	background: var(--tm-color-primary-dark);
	color: var(--tm-color-background);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-align: center;
	text-transform: uppercase;
}

.tm-badge {
	display: inline-flex;
	align-items: center;
	min-height: 1.6rem;
	padding: 0.3rem 0.5rem;
	border: 1px solid currentColor;
	border-radius: var(--tm-radius-none);
	color: var(--tm-color-primary);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1;
	text-transform: uppercase;
}

@media (max-width: 781px) {
	.wp-block-navigation__responsive-container.is-menu-open {
		padding: var(--tm-space-m);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}