/* Mahbod Academy — base theme styles.
   Brand tokens follow the Mahbod Style Academy design system; the design-system
   snippet can override any of these custom properties. */

:root {
	--ma-red: #DA5A53;
	--ma-red-600: #C8453F;
	--ma-ink: #1F1B18;
	--ma-ink-2: #5B534D;
	--ma-line: #EAE5E0;
	--ma-bg: #FBFAF8;
	--ma-card: #FFFFFF;
	--ma-green: #2E9E6A;
	--ma-radius: 16px;
	--ma-container: 1200px;
	--ma-font: "Ravi", "Vazirmatn", Tahoma, sans-serif;
}

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

body {
	margin: 0;
	background: var(--ma-bg);
	color: var(--ma-ink);
	font-family: var(--ma-font);
	font-size: 16px;
	line-height: 1.85;
	direction: rtl;
	text-align: right;
	-webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--ma-red-600); text-decoration: none; }
a:hover { color: var(--ma-red); }

h1, h2, h3, h4, h5, h6 { line-height: 1.5; margin: 0 0 .6em; color: var(--ma-ink); }

.container {
	width: 100%;
	max-width: var(--ma-container);
	margin-inline: auto;
	padding-inline: 16px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: 8px; right: 8px; z-index: 100000;
	background: #fff; padding: 8px 14px; border-radius: 8px;
}

.site-content { min-height: 50vh; }
.ma-page, .ma-entry, .ma-archive, .ma-404 { padding-block: 40px; }
.entry-content > * + * { margin-top: 1em; }

.ma-btn,
.single_add_to_cart_button,
.woocommerce a.button,
.woocommerce button.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 24px;
	border: 0;
	border-radius: 12px;
	background: var(--ma-red);
	color: #fff !important;
	font-family: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s;
}
.ma-btn:hover,
.single_add_to_cart_button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover { background: var(--ma-red-600); }

/* Fallback header/footer (only when no Elementor template applies) */
.ma-header { background: #fff; border-bottom: 1px solid var(--ma-line); }
.ma-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.ma-header__title { font-weight: 800; font-size: 20px; color: var(--ma-ink); }
.ma-header__nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.ma-footer { background: var(--ma-ink); color: #fff; padding: 32px 0; margin-top: 48px; }
.ma-footer a { color: #fff; }
.ma-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; padding: 0; margin: 0 0 12px; }
.ma-footer__copy { margin: 0; opacity: .7; font-size: 14px; }

/* Blog / archive grid */
.ma-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.ma-card { background: var(--ma-card); border: 1px solid var(--ma-line); border-radius: var(--ma-radius); overflow: hidden; }
.ma-card__link { color: inherit; display: block; }
.ma-card__img img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.ma-card__body { padding: 16px 18px 20px; }
.ma-card__title { font-size: 17px; margin: 0 0 8px; }
.ma-card__excerpt { margin: 0; color: var(--ma-ink-2); font-size: 14px; }

/* ---------- Single course ---------- */
.ma-single-course { padding-bottom: 48px; }
.product-single-top-part { padding: 32px 0 24px; }
.product-single-top-part .product_title { font-size: clamp(22px, 3vw, 32px); font-weight: 800; }
.product-short-description { color: var(--ma-ink-2); max-width: 820px; }
.ma-breadcrumbs { font-size: 13px; color: var(--ma-ink-2); margin-bottom: 8px; }

.row.has-sidebar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 28px;
	align-items: start;
}
.product-single-main { min-width: 0; }
.product-single-thumbnail img { display: block; width: 100%; border-radius: 20px; margin-bottom: 24px; }
.product-single-content { background: #fff; border: 1px solid var(--ma-line); border-radius: 24px; padding: 24px; }
.product-reviews { margin-top: 28px; background: #fff; border: 1px solid var(--ma-line); border-radius: 24px; padding: 24px; }

.product-single-aside .theiaStickySidebar { position: sticky; top: 24px; display: grid; gap: 20px; }
.product-info-box { background: #fff; border: 1px solid var(--ma-line); border-radius: 24px; padding: 22px; }
.sell_course .price { font-size: 24px; font-weight: 800; margin-bottom: 14px; color: var(--ma-ink); }
.sell_course .price del { color: var(--ma-ink-2); font-size: 16px; font-weight: 400; margin-inline-end: 8px; }
.sell_course .price ins { text-decoration: none; }
.sell_course form.cart { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.sell_course form.cart .quantity { display: none; }
.sell_course .single_add_to_cart_button { width: 100%; }
.sell_course table.variations { width: 100%; border-collapse: collapse; }
.sell_course table.variations td, .sell_course table.variations th { padding: 4px 0; display: block; text-align: right; }
.sell_course table.variations select { width: 100%; min-height: 44px; border: 1px solid var(--ma-line); border-radius: 10px; padding: 0 10px; font-family: inherit; }
.purchased-info-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; background: #ECF8F2; color: var(--ma-green); font-weight: 700; }
.purchased-info-box__icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ma-green); color: #fff; font-size: 15px; }

.product-meta-info-list { list-style: none; margin: 18px 0 0; padding: 0; }
.meta-info-unit { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #F0ECE7; font-size: 14px; }
.meta-info-unit .title { color: var(--ma-ink-2); }
.meta-info-unit .value { font-weight: 700; text-align: left; }

.course-teacher-details { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--ma-line); border-radius: 24px; padding: 18px; }
.course-teacher-details__img img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: block; }
.course-teacher-details__label { font-size: 12px; color: var(--ma-ink-2); }
.course-teacher-details h4 { margin: 0; font-size: 16px; }
.course-teacher-details p { margin: 4px 0 0; font-size: 13px; color: var(--ma-ink-2); }

@media (max-width: 991px) {
	.row.has-sidebar { grid-template-columns: 1fr; }
	.product-single-aside { order: -1; }
	.product-single-aside .theiaStickySidebar { position: static; }
	.product-single-content, .product-reviews { padding: 16px; border-radius: 18px; }
}

/* ---------- Course builder ("lessons" widget from studiare-core) ---------- */
.elementory-section { margin-bottom: 20px; }
.course-section { background: #fff; border: 1px solid var(--ma-line); border-radius: 20px; overflow: hidden; }
.course-section-title-elementory {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 16px 20px; cursor: pointer; user-select: none;
}
.course-section-title-elementory .gheadlinel span { font-weight: 800; font-size: 17px; }
.course-section-title-elementory .subtitle-lesson { margin: 2px 0 0; font-size: 13px; color: var(--ma-ink-2); }
.course-section-title-elementory > i,
.course-section-title-elementory .ma-chevron { transition: transform .25s; }
.course-section.is-open .course-section-title-elementory > i,
.course-section.is-open .course-section-title-elementory .ma-chevron { transform: rotate(180deg); }
.course-section .panel-group.deactive { display: none; }
.course-section .panel-group { border-top: 1px solid var(--ma-line); }

.course-panel-heading {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 12px 20px; cursor: pointer; border-top: 1px solid #F0ECE7;
}
.course-panel-heading:first-child { border-top: 0; }
.course-panel-heading:hover { background: var(--ma-bg); }
.panel-heading-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.panel-heading-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.course-lesson-icon { color: var(--ma-red); }
.course-panel-heading .title h4 { margin: 0; font-size: 15px; font-weight: 700; }
.course-panel-heading .title .subtitle { margin: 2px 0 0; font-size: 12px; color: var(--ma-ink-2); }
.badge-item { display: inline-block; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #FBEDEC; color: var(--ma-red-600); vertical-align: middle; }
.badge-item.free { background: #ECF8F2; color: var(--ma-green); }
.private-lesson { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ma-ink-2); }
.private-lesson .green-lock { color: var(--ma-green); }
.preview-button { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.preview-button.for-mobile { display: none; }
.download-button { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--ma-bg); color: var(--ma-ink); }
.download-button.gray { opacity: .45; }
/* Closed lessons keep their full width (height 0 instead of display:none) so the
   video player script can size itself correctly when the page loads. */
.panel-content { display: block; height: 0; overflow: hidden; padding: 0 20px; }
.panel-content.is-open, .elementory-section .course-section .panel-group .panel-content.is-open { height: auto; max-height: none; overflow: visible; padding-bottom: 18px; }
.panel-content-inner iframe, .panel-content-inner video { width: 100%; border: 0; border-radius: 14px; aspect-ratio: 16/9; height: auto; }

@media (max-width: 600px) {
	.preview-button:not(.for-mobile) { display: none; }
	.preview-button.for-mobile { display: inline-flex; }
	.course-panel-heading { padding: 12px 14px; }
	.panel-content { padding: 0 14px 14px; }
}

/* Preview modal */
.ma-modal { position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; background: rgba(20, 16, 14, .78); padding: 16px; }
.ma-modal.is-open { display: flex; }
.ma-modal__box { position: relative; width: min(960px, 100%); background: #000; border-radius: 16px; overflow: hidden; }
.ma-modal__box video, .ma-modal__box iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; }
.ma-modal__close { position: absolute; top: 8px; left: 8px; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 20px; line-height: 1; cursor: pointer; }

/* WooCommerce shop grid fallback */
.woocommerce ul.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 0; margin: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; background: #fff; border: 1px solid var(--ma-line); border-radius: var(--ma-radius); padding: 14px; }
.woocommerce ul.products li.product img { border-radius: 12px; }
@media (max-width: 900px) { .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .woocommerce ul.products { grid-template-columns: 1fr; } }
