/* ==========================================================================
   JOY Mobile — mobile-first stylesheet
   Palette and type are lifted from the current Astra/Elementor site:
   cream paper #fdfaf1, sage tint #e3e9d8, olive ink #343f1e,
   primary green #5c8607 / #70a309, brand-name lime #99cc00,
   Marcellus headings, Inter body.
   ========================================================================== */

:root {
	--joy-primary: #5c8607;
	--joy-primary-2: #70a309;
	--joy-ink: #343f1e;
	--joy-ink-soft: rgba(52, 63, 30, 0.72);
	--joy-tint: #e3e9d8;
	--joy-paper: #fdfaf1;
	--joy-brand-name: #99cc00;
	--joy-line: rgba(53, 64, 31, 0.16);
	--joy-white: #fff;

	--joy-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--joy-font-head: "Marcellus", Georgia, "Times New Roman", serif;

	--joy-radius: 14px;
	--joy-radius-pill: 100px;
	--joy-shadow: 0 6px 24px rgba(52, 63, 30, 0.10);

	--joy-gutter: 20px;
	--joy-max: 1120px;
	--joy-tap: 48px;

	--joy-header-h: 64px;
	--joy-actionbar-h: 62px;
	--joy-safe-b: env(safe-area-inset-bottom, 0px);
	--joy-safe-t: env(safe-area-inset-top, 0px);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--joy-header-h) + 12px); }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
	margin: 0;
	background: var(--joy-paper);
	color: var(--joy-ink);
	font-family: var(--joy-font-body);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
html.joy-drawer-open, html.joy-drawer-open body { overflow: hidden; }

img, video, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--joy-primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--joy-primary-2); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--joy-primary-2); outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--joy-font-head);
	font-weight: 400;
	line-height: 1.15;
	margin: 0 0 0.5em;
	color: var(--joy-ink);
	text-wrap: balance;
}
h1 { font-size: clamp(2rem, 6.5vw + 0.5rem, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4.5vw + 0.4rem, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.5vw + 0.5rem, 1.75rem); }
p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); margin: -1px; padding: 0; border: 0; word-wrap: normal !important;
}
.skip-link { left: -999px; top: 8px; z-index: 1000; }
.skip-link:focus { left: 8px; width: auto; height: auto; clip: auto; clip-path: none; padding: 10px 14px; background: var(--joy-white); border-radius: 8px; box-shadow: var(--joy-shadow); }

/* ---------- Layout ---------- */
.joy-container { width: 100%; max-width: var(--joy-max); margin-inline: auto; padding-inline: var(--joy-gutter); }
.joy-main { min-height: 50vh; }
body.has-action-bar .joy-main { padding-bottom: 0; }
body.has-action-bar .joy-footer { padding-bottom: calc(var(--joy-actionbar-h) + var(--joy-safe-b) + 16px); }

/* ---------- Buttons ---------- */
.joy-btn, .joy-prose .wp-block-button__link, .joy-prose .wp-element-button {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: var(--joy-tap); padding: 12px 24px;
	background: var(--joy-primary); color: var(--joy-paper) !important;
	border: 2px solid var(--joy-primary); border-radius: var(--joy-radius-pill);
	font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.95rem;
	text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s;
	-webkit-tap-highlight-color: transparent;
}
.joy-btn:hover, .joy-btn:focus-visible { background: var(--joy-primary-2); border-color: var(--joy-primary-2); }
.joy-btn:active { transform: translateY(1px); }
.joy-btn--outline { background: transparent; color: var(--joy-primary) !important; }
.joy-btn--outline:hover { background: var(--joy-tint); color: var(--joy-ink) !important; }
.joy-btn--block { width: 100%; }
.joy-btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.joy-header__sentinel { height: 1px; }
.joy-header {
	position: relative; z-index: 60;
	background: var(--joy-paper);
	border-bottom: 1px solid var(--joy-line);
	padding-top: var(--joy-safe-t);
}
body.has-sticky-header .joy-header { position: sticky; top: 0; }
.joy-header.is-stuck { box-shadow: 0 2px 14px rgba(52, 63, 30, 0.10); }
.joy-header__inner {
	max-width: var(--joy-max); margin-inline: auto; padding-inline: var(--joy-gutter);
	min-height: var(--joy-header-h);
	display: flex; align-items: center; gap: 12px;
}
.joy-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; flex: 1; }
.joy-brand__logo img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.joy-brand__text { display: flex; flex-direction: column; min-width: 0; }
.joy-brand__name {
	font-family: Georgia, var(--joy-font-head); font-weight: 700; color: var(--joy-brand-name);
	font-size: 1.1rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.joy-brand__sub { font-size: 0.72rem; font-style: italic; color: var(--joy-ink-soft); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.joy-header__nav { display: none; }
.joy-header__cta { display: none; }
.joy-header__toggle {
	flex: none; width: var(--joy-tap); height: var(--joy-tap);
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--joy-primary); color: var(--joy-paper); border: 0; border-radius: 10px; cursor: pointer;
}
.joy-header__toggle svg { width: 26px; height: 26px; }
.joy-header__toggle:hover { background: var(--joy-primary-2); }

/* ---------- Drawer ---------- */
.joy-drawer { position: fixed; inset: 0; z-index: 100; }
.joy-drawer[hidden] { display: none; }
.joy-drawer__backdrop { position: absolute; inset: 0; background: rgba(52, 63, 30, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 0; padding: 0; cursor: pointer; }
.joy-drawer__panel {
	position: absolute; top: 0; right: 0; bottom: 0; width: 100%;
	background: var(--joy-paper); display: flex; flex-direction: column;
	padding: calc(12px + var(--joy-safe-t)) 0 calc(16px + var(--joy-safe-b));
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18); z-index: 1;
	animation: joy-slide-in 0.22s ease-out;
	overflow-y: auto; overscroll-behavior: contain;
}
@keyframes joy-slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.joy-drawer__top { display: flex; align-items: center; gap: 8px; padding: 0 var(--joy-gutter) 12px; border-bottom: 1px solid var(--joy-line); }
.joy-drawer__close { flex: none; width: var(--joy-tap); height: var(--joy-tap); border: 0; background: var(--joy-tint); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.joy-drawer__close svg { width: 24px; height: 24px; }
.joy-drawer__nav { padding: 8px 0; flex: 1; }
.joy-menu { list-style: none; margin: 0; padding: 0; }
.joy-menu--stack li { position: relative; border-bottom: 1px solid var(--joy-line); }
.joy-menu--stack a {
	display: flex; align-items: center; min-height: 56px; padding: 12px var(--joy-gutter);
	font-family: var(--joy-font-head); font-size: 1.35rem; color: var(--joy-ink); text-decoration: none;
}
.joy-menu--stack .current-menu-item > a, .joy-menu--stack .current_page_item > a { color: var(--joy-primary); }
.joy-menu--stack a:active { background: var(--joy-tint); }
.joy-menu__expander {
	position: absolute; top: 4px; right: 8px; width: var(--joy-tap); height: var(--joy-tap);
	border: 0; background: transparent; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.joy-menu__expander svg { width: 24px; height: 24px; transition: transform 0.15s; }
.joy-menu__expander[aria-expanded="true"] svg { transform: rotate(180deg); }
.joy-menu--stack .sub-menu { list-style: none; margin: 0; padding: 0 0 8px; display: none; background: var(--joy-tint); }
.joy-menu--stack li.is-open > .sub-menu { display: block; }
.joy-menu--stack .sub-menu li { border: 0; }
.joy-menu--stack .sub-menu a { min-height: 48px; font-family: var(--joy-font-body); font-size: 1.05rem; padding-left: calc(var(--joy-gutter) + 16px); }
.joy-drawer__contact { padding: 12px var(--joy-gutter) 0; display: grid; gap: 10px; }
.joy-drawer__link { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--joy-ink); text-decoration: none; font-weight: 500; }
.joy-drawer__link svg { width: 22px; height: 22px; color: var(--joy-primary); flex: none; }

/* ---------- Bottom action bar (phones) ---------- */
.joy-actionbar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
	display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
	background: var(--joy-white);
	border-top: 1px solid var(--joy-line);
	box-shadow: 0 -4px 20px rgba(52, 63, 30, 0.10);
	padding-bottom: var(--joy-safe-b);
}
.joy-actionbar__item {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
	min-height: var(--joy-actionbar-h); padding: 6px 4px;
	background: none; border: 0; color: var(--joy-ink); text-decoration: none;
	font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.joy-actionbar__item svg { width: 24px; height: 24px; color: var(--joy-primary); }
.joy-actionbar__item:active { background: var(--joy-tint); }
.joy-actionbar__item--primary { background: var(--joy-primary); color: var(--joy-paper); }
.joy-actionbar__item--primary svg { color: var(--joy-paper); }
.joy-actionbar__item--primary:active { background: var(--joy-primary-2); }

/* ---------- Title band + prose ---------- */
.joy-titleband { background: var(--joy-tint); padding: 32px 0 28px; margin-bottom: 24px; }
.joy-titleband__title { margin: 0; }
.joy-titleband__meta { margin: 8px 0 0; color: var(--joy-ink-soft); font-size: 0.95rem; }
.joy-page__thumb img { width: 100%; border-radius: var(--joy-radius); margin-bottom: 20px; }
.joy-prose { max-width: 720px; padding-bottom: 40px; }
.joy-prose > :first-child { margin-top: 0; }
.joy-prose img { border-radius: var(--joy-radius); }
.joy-prose ul, .joy-prose ol { padding-left: 1.25em; }
.joy-prose li { margin-bottom: 0.35em; }
.joy-prose blockquote { margin: 1.5em 0; padding: 12px 20px; border-left: 4px solid var(--joy-primary); background: var(--joy-tint); border-radius: 0 var(--joy-radius) var(--joy-radius) 0; }
.joy-prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.joy-prose th, .joy-prose td { padding: 10px; border: 1px solid var(--joy-line); text-align: left; }
.joy-prose iframe { max-width: 100%; }
.joy-pagelinks { margin-top: 24px; }
.joy-prose .wp-block-button__link, .joy-prose .wp-element-button { min-height: var(--joy-tap); }

/* ---------- Cards (archives) — match the home page course cards ---------- */
.joy-cards { display: grid; gap: 24px; padding-bottom: 32px; }
.joy-card { background: var(--joy-paper); border-radius: var(--joy-radius); overflow: hidden; box-shadow: var(--joy-shadow); border: 1px solid var(--joy-line); }
.joy-card__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.joy-card__body { padding: 20px; }
.joy-card__title { font-size: 1.4rem; margin-bottom: 8px; }
.joy-card__title a { color: var(--joy-ink); text-decoration: none; }
.joy-card__excerpt p { margin: 0 0 12px; color: var(--joy-ink-soft); }
.joy-card__more { font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

.pagination, .comments-pagination { display: flex; justify-content: center; gap: 8px; padding-bottom: 32px; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: var(--joy-tap); min-height: var(--joy-tap); padding: 0 12px; border-radius: 10px; background: var(--joy-tint); text-decoration: none; color: var(--joy-ink); }
.pagination .page-numbers.current { background: var(--joy-primary); color: var(--joy-paper); }

.post-navigation { padding: 16px 0 32px; }
.post-navigation .nav-links { display: grid; gap: 12px; }
.post-navigation a { display: block; padding: 14px 16px; border-radius: var(--joy-radius); background: var(--joy-tint); text-decoration: none; color: var(--joy-ink); }
.joy-postnav__label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--joy-ink-soft); }
.joy-postnav__title { font-family: var(--joy-font-head); font-size: 1.1rem; }

/* ---------- Search ---------- */
.joy-search { display: flex; gap: 8px; margin: 16px 0; }
.joy-search__input { flex: 1; min-height: var(--joy-tap); padding: 10px 14px; border: 1px solid var(--joy-line); border-radius: 12px; background: var(--joy-white); font: inherit; font-size: 16px; }

/* ---------- Comments ---------- */
.joy-comments { padding: 16px 0 40px; }
.joy-comments__list { list-style: none; padding: 0; margin: 0 0 24px; }
.joy-comments__list .comment-body { padding: 14px 16px; border-radius: var(--joy-radius); background: var(--joy-tint); margin-bottom: 12px; }
.joy-comments__list .children { list-style: none; padding-left: 20px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; min-height: var(--joy-tap); padding: 10px 14px; border: 1px solid var(--joy-line); border-radius: 12px; font: inherit; font-size: 16px; background: var(--joy-white);
}
.comment-form input[type="submit"] { min-height: var(--joy-tap); padding: 12px 24px; background: var(--joy-primary); color: var(--joy-paper); border: 0; border-radius: var(--joy-radius-pill); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Footer ---------- */
.joy-footer { background: var(--joy-tint); border-top: 1px solid var(--joy-line); margin-top: 32px; }
.joy-footer__widgets { max-width: var(--joy-max); margin-inline: auto; padding: 28px var(--joy-gutter) 0; }
.joy-footer__inner { max-width: var(--joy-max); margin-inline: auto; padding: 32px var(--joy-gutter) 24px; }
.joy-footer__note { font-family: var(--joy-font-head); font-size: 1.35rem; margin-bottom: 16px; }
.joy-brand--footer { margin-bottom: 24px; }
.joy-brand--footer .joy-brand__name { white-space: normal; font-size: 1.15rem; }
.joy-brand--footer .joy-brand__sub { white-space: normal; }
.joy-footer__grid { display: grid; gap: 24px; }
.joy-footer__heading { font-size: 1.1rem; font-family: var(--joy-font-body); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.joy-footer__contact, .joy-footer__links { list-style: none; margin: 0; padding: 0; }
.joy-footer__contact li a { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--joy-ink); text-decoration: none; }
.joy-footer__contact svg { width: 20px; height: 20px; color: var(--joy-primary); flex: none; }
.joy-footer__links li a { display: flex; align-items: center; min-height: 44px; color: var(--joy-ink); text-decoration: none; }
.joy-footer__links li a:hover { color: var(--joy-primary); }
.joy-footer__copy { margin: 24px 0 0; font-size: 0.85rem; color: var(--joy-ink-soft); }
.joy-footer .widget { margin-bottom: 20px; }
.joy-footer .widget-title { font-size: 1.1rem; }

/* ---------- Elementor content: tighten the phone layout ----------
   The home/courses/contact pages are Elementor. Astra's wrappers are gone, so
   give Elementor a clean full-width canvas and sane phone spacing. */
.joy-page--builder { width: 100%; }
.joy-elementor-page .elementor-section.elementor-section-boxed > .elementor-container { max-width: var(--joy-max); }
@media (max-width: 767px) {
	.joy-elementor-page .elementor-section .elementor-container,
	.joy-elementor-page .e-con.e-parent { padding-inline: max(var(--joy-gutter), var(--e-con-padding-left, 0px)); }
	.joy-elementor-page .elementor-widget-heading h1.elementor-heading-title { font-size: clamp(2rem, 8vw, 2.75rem) !important; line-height: 1.15 !important; }
	.joy-elementor-page .elementor-widget-heading h2.elementor-heading-title { font-size: clamp(1.6rem, 6vw, 2.2rem) !important; line-height: 1.2 !important; }
	.joy-elementor-page .elementor-button { min-height: var(--joy-tap); width: 100%; justify-content: center; }
	.joy-elementor-page .elementor-widget-image img { border-radius: var(--joy-radius); }
}

/* ---------- Tablet and up ---------- */
@media (min-width: 640px) {
	:root { --joy-gutter: 28px; }
	.joy-drawer__panel { width: min(60vw, 420px); }
	.joy-cards { grid-template-columns: repeat(2, 1fr); }
	.joy-footer__grid { grid-template-columns: 1fr 1fr; }
	.post-navigation .nav-links { grid-template-columns: 1fr 1fr; }
}

/* ---------- Desktop: inline menu, header CTA, no action bar ---------- */
@media (min-width: 900px) {
	:root { --joy-header-h: 76px; --joy-gutter: 32px; }
	.joy-actionbar { display: none; }
	body.has-action-bar .joy-footer { padding-bottom: 0; }
	.joy-brand { flex: none; }
	.joy-brand__logo img { width: 52px; height: 52px; }
	.joy-brand__name { font-size: 1.35rem; }
	.joy-brand__sub { font-size: 0.8rem; }
	.joy-header__nav { display: block; flex: 1; }
	.joy-menu--inline { display: flex; justify-content: center; gap: 4px; }
	.joy-menu--inline li { position: relative; }
	.joy-menu--inline a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 10px; color: var(--joy-ink); text-decoration: none; font-weight: 500; white-space: nowrap; }
	.joy-header__nav { overflow-x: auto; scrollbar-width: none; }
	.joy-header__cta { flex: none; white-space: nowrap; }
	.joy-menu--inline a:hover, .joy-menu--inline .current-menu-item > a, .joy-menu--inline .current_page_item > a { background: var(--joy-tint); color: var(--joy-primary); }
	.joy-menu--inline .sub-menu {
		list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 0; min-width: 220px;
		background: var(--joy-paper); border: 1px solid var(--joy-line); border-radius: var(--joy-radius); box-shadow: var(--joy-shadow);
		display: none; z-index: 70;
	}
	.joy-menu--inline li:hover > .sub-menu, .joy-menu--inline li:focus-within > .sub-menu { display: block; }
	.joy-menu--inline .sub-menu a { display: flex; width: 100%; }
	.joy-header__cta { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 22px; background: var(--joy-primary); color: var(--joy-paper); border-radius: var(--joy-radius-pill); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.9rem; text-decoration: none; }
	.joy-header__cta:hover { background: var(--joy-primary-2); color: var(--joy-paper); }
	.joy-header__toggle { display: none; }
	.joy-cards { grid-template-columns: repeat(3, 1fr); }
	.joy-titleband { padding: 56px 0 48px; }
}

/* ---------- Print ---------- */
@media print {
	.joy-header, .joy-actionbar, .joy-drawer, .joy-footer { display: none !important; }
}
