/*
Theme Name: CN Tech
Description: قالب بلوکی اختصاصی سی ان تک. منطق در افزونه cntech-core است.
Version: 1.0.2
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cntech
*/

/* ==========================================================================
   پایه
   همه مقدارها از theme.json می آید (--wp--preset--* و --wp--custom--*).
   اینجا فقط چیزهایی است که theme.json جایی برایشان ندارد.
   نقطه شکست lg = 64em (1024px). در media query متغیر کار نمی کند.
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: var(--wp--preset--spacing--3);
}

body {
	overflow-wrap: break-word;
}

/* فاصله کناری صفحه: custom.gutter.base (10px) در موبایل، custom.gutter.lg (24px) از lg به بالا.
   سربرگ، پابرگ و همه بخش ها از همین متغیر می خوانند (.container و padding ریشه). */
@media (min-width: 64em) {
	body {
		--wp--style--root--padding-left: var(--wp--custom--gutter--lg);
		--wp--style--root--padding-right: var(--wp--custom--gutter--lg);
	}
}

ul,
ol {
	padding-inline-start: var(--wp--preset--spacing--3);
}

ol {
	list-style-type: persian;
}

address {
	font-style: normal;
}

/* خط زیر لینک نازک و کمی پایین تر، مثل base.css دمو */
a {
	text-decoration-thickness: var(--wp--custom--border-width);
	text-underline-offset: 0.3em;
}

/* ---------- Focus (کیبورد) ---------- */
:focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--custom--color--focus);
	outline-offset: var(--wp--custom--focus--offset);
}

:focus:not(:focus-visible) {
	outline: none;
}

/* اسکرول نرم فقط وقتی کاربر کاهش حرکت نخواسته */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

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

[hidden] {
	display: none !important;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

button {
	cursor: pointer;
}

/* سربرگ، محتوا و پابرگ بدون فاصله blockGap بین خودشان، مثل دمو */
.wp-site-blocks > * {
	margin-block: 0;
}

/* جا برای نوار ثابت پایین در موبایل، برابر ارتفاع نوار (quick-bar.css) */
body {
	padding-block-end: calc(var(--wp--custom--size--quick-bar) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 64em) {
	body {
		padding-block-end: 0;
	}
}

/* ==========================================================================
   کمکی ها و اجزای مشترک (از base.css و components.css دمو)
   ========================================================================== */
.container {
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	padding-inline: var(--wp--style--root--padding-left);
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.nowrap {
	white-space: nowrap;
}

.icon {
	width: var(--wp--custom--size--icon);
	height: var(--wp--custom--size--icon);
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--1);
	min-height: var(--wp--custom--size--control);
	padding: 0 var(--wp--preset--spacing--3);
	border: var(--wp--custom--border-width-thick) solid transparent;
	border-radius: var(--wp--preset--border-radius--default);
	font-size: var(--wp--preset--font-size--base);
	font-weight: var(--wp--custom--font-weight--bold);
	line-height: var(--wp--custom--line-height--control);
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color var(--wp--custom--duration), color var(--wp--custom--duration), border-color var(--wp--custom--duration);
}

.btn--outline {
	background: var(--wp--custom--color--surface);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.btn--outline:hover {
	background: var(--wp--preset--color--primary-soft);
	color: var(--wp--preset--color--primary-strong);
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--size--tap);
	height: var(--wp--custom--size--tap);
	padding: 0;
	border: 0;
	border-radius: var(--wp--preset--border-radius--default);
	background: transparent;
	color: var(--wp--custom--color--text);
}

.icon-btn:hover {
	background: var(--wp--custom--color--surface-muted);
}

.icon-btn .icon {
	width: var(--wp--custom--size--icon-lg);
	height: var(--wp--custom--size--icon-lg);
}

/* فلش کوچک برای دکمه های باز و بسته (فقط با border، بدون تصویر) */
.chevron::after {
	content: "";
	display: block;
	width: var(--wp--custom--size--chevron);
	height: var(--wp--custom--size--chevron);
	border-right: var(--wp--custom--border-width-thick) solid currentColor;
	border-bottom: var(--wp--custom--border-width-thick) solid currentColor;
	transform: translateY(-25%) rotate(45deg);
	transition: transform var(--wp--custom--duration);
}

.chevron[aria-expanded="true"]::after {
	transform: translateY(25%) rotate(-135deg);
}
