/* Mobile layer — loaded with media="(max-width:767px)". Targets 360 / 390 / 430. */

:root {
	--m-gutter: 1rem;
	--m-section-y: 3rem;
	--m-r-lg: 20px;
}

html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { font-size: 1rem; line-height: 1.75; }
img, video, iframe, svg, table { max-width: 100%; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }
p { text-wrap: pretty; }

/* Fluid headings */
h1, .m-hero__title { font-size: clamp(1.85rem, 1.2rem + 3.6vw, 2.3rem); line-height: 1.3; }
h2, .m-section-title { font-size: clamp(1.45rem, 1.1rem + 2vw, 1.8rem); line-height: 1.35; }
h3 { font-size: 1.12rem; }

/* Touch targets ≥ 44px */
a.m-btn, button, .m-btn, input[type="submit"], .m-tab, .m-faq__q, .m-footer__toggle { min-height: 44px; }
.m-btn { padding-block: .8rem; font-size: 1rem; }
input, select, textarea { font-size: 16px; } /* prevents iOS zoom on focus */

/* Header + safe areas (notch) */
.m-header { padding-top: env(safe-area-inset-top); }
.m-header__inner { padding-inline: max(var(--m-gutter), env(safe-area-inset-right)) max(var(--m-gutter), env(safe-area-inset-left)); }
.m-menu-btn, .m-header__search { width: 44px; height: 44px; }
.m-header__account { min-width: 48px; height: 48px; padding: .2rem .35rem; font-size: .7rem; }
.m-drawer__panel { width: min(88vw, 360px); padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
.m-drawer__link, .m-drawer__panel a { min-height: 48px; display: flex; align-items: center; }

/* Hero */
.m-hero { padding-top: 1.25rem; }
.m-hero__lead { font-size: 1rem; }
.m-hero__actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
.m-hero__actions .m-btn { width: 100%; justify-content: center; }
.m-hero__frame { aspect-ratio: 4 / 3; }

/* Section heads */
.m-section-head { flex-direction: column; align-items: flex-start; gap: .75rem; }
.m-section-head__aside { width: 100%; }

/* Carousels: 1.15 cards peeking */
.m-carousel__track, .m-carousel[data-per="4"] .m-carousel__track { --per: 1.15; scroll-padding-inline: var(--m-gutter); }
.m-carousel__btn { display: none; }
.m-course-card, .m-product-card { border-radius: var(--m-r-lg); }

/* Tabs scroll instead of wrapping */
.m-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab { flex: 0 0 auto; white-space: nowrap; }

/* Panels */
.m-consult__panel, .m-final__panel { padding: 1.5rem 1.25rem; border-radius: var(--m-r-lg); }
.m-final__actions { display: grid; gap: .6rem; }
.m-newsletter__form, .m-footer__news form { display: grid; gap: .6rem; }
.m-newsletter__form .m-btn, .m-footer__news .m-btn { width: 100%; }

/* FAQ */
.m-faq__q { padding-block: 1rem; font-size: 1rem; text-align: start; }

/* Posts */
.m-posts__grid, .m-blog__grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }

/* Footer */
.m-footer__logo .m-logo-img img { height: 76px; }
.m-footer__end { width: 100%; justify-content: space-between; }
.m-to-top { padding-inline: .9rem; }
.m-footer { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }

/* Tables, embeds */
.entry-content table { display: block; overflow-x: auto; }
.wp-block-embed__wrapper, .entry-content iframe { aspect-ratio: 16 / 9; width: 100%; height: auto; }

/* WooCommerce */
.woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: minmax(0, 1fr) !important; }
.woocommerce table.shop_table_responsive tr td { text-align: start !important; }
.woocommerce .cart .button, .woocommerce .checkout-button, .woocommerce #place_order { width: 100%; min-height: 48px; }
.woocommerce form .form-row-first, .woocommerce form .form-row-last { width: 100%; float: none; }

/* LearnDash */
.learndash-wrapper .ld-course-list-items { grid-template-columns: minmax(0, 1fr); }
.learndash-wrapper .ld-item-list-item .ld-item-details { flex-wrap: wrap; }

/* Small phones */
@media (max-width: 380px) {
	:root { --m-gutter: .85rem; }
	.m-cats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
	.m-cat__title { font-size: .9rem; }
	.m-logo-img img, .m-header.is-scrolled .m-logo-img img { height: 46px; }
}

/* Landscape phones: keep hero short */
@media (orientation: landscape) and (max-height: 500px) {
	.m-hero__media { max-width: 360px; }
	.m-header { position: sticky; }
}
