/**
 * Kozaru Honbu - Public Frontend Page Shell
 *
 * Version: 1.0.0
 *
 * Public-facing Kozaru pages are not dashboard cockpits. This module keeps
 * Class Schedule, Trial Booking, and Instructors centred and full-width inside
 * arbitrary WordPress themes without inheriting staff/student right-nav layout.
 */

body.kozaru-frontend-public-page {
	--kozaru-public-max: 1180px;
	--kozaru-public-wide: 1320px;
	--kozaru-public-gutter: clamp(0.75rem, 2.25vw, 2rem);
	--kozaru-public-ink: var(--kozaru-ink, #111111);
	--kozaru-public-bone: var(--kozaru-bone, #f7f6f2);
	--kozaru-public-paper: var(--kozaru-paper, #ffffff);
	--kozaru-public-crimson: var(--kozaru-crimson, #c62828);
}

/*
 * Public pages still need theme chrome neutralised, but they should not be
 * stretched into cockpit grids. Make the host page area reliable first.
 */
body.kozaru-frontend-public-page .site-content,
body.kozaru-frontend-public-page .content-area,
body.kozaru-frontend-public-page .site-main,
body.kozaru-frontend-public-page #primary,
body.kozaru-frontend-public-page #main,
body.kozaru-frontend-public-page main,
body.kozaru-frontend-public-page .wp-site-blocks > main,
body.kozaru-frontend-public-page .site-main > .container,
body.kozaru-frontend-public-page .site-main > .wrap,
body.kozaru-frontend-public-page .content-area > .container,
body.kozaru-frontend-public-page .content-area > .wrap,
body.kozaru-frontend-public-page .page-content,
body.kozaru-frontend-public-page .page .entry-content,
body.kozaru-frontend-public-page .entry-content,
body.kozaru-frontend-public-page .wp-block-post-content,
body.kozaru-frontend-public-page .is-layout-flow,
body.kozaru-frontend-public-page .is-layout-constrained,
body.kozaru-frontend-public-page .kozaru-section,
body.kozaru-frontend-public-page .kozaru-content-wrap,
body.kozaru-frontend-public-page .kozaru-container,
body.kozaru-frontend-public-page .kozaru-container--wide {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	left: auto !important;
	right: auto !important;
	transform: none !important;
}

body.kozaru-frontend-public-page .kozaru-section {
	padding-top: clamp(0.5rem, 1.2vw, 1rem) !important;
	padding-bottom: clamp(1.75rem, 4vw, 3.5rem) !important;
}

/*
 * Centre the actual public Kozaru components. These are the public equivalents
 * of an app shell, not dashboard pages with a right-side cockpit rail.
 */
body.kozaru-frontend-public-page .entry-content > .kozaru-calendar-shortcode,
body.kozaru-frontend-public-page .wp-block-post-content > .kozaru-calendar-shortcode,
body.kozaru-frontend-public-page .kozaru-calendar-shortcode,
body.kozaru-frontend-public-page .entry-content > .kozaru-registration-box,
body.kozaru-frontend-public-page .wp-block-post-content > .kozaru-registration-box,
body.kozaru-frontend-public-page .kozaru-registration-box,
body.kozaru-frontend-public-page .entry-content > .kozaru-frontend-wrap.kozaru-instructor-directory,
body.kozaru-frontend-public-page .wp-block-post-content > .kozaru-frontend-wrap.kozaru-instructor-directory,
body.kozaru-frontend-public-page .kozaru-frontend-wrap.kozaru-instructor-directory {
	box-sizing: border-box !important;
	position: static !important;
	float: none !important;
	clear: both !important;
	display: block !important;
	left: auto !important;
	right: auto !important;
	transform: none !important;
	width: min(calc(100vw - var(--kozaru-public-gutter) - var(--kozaru-public-gutter)), var(--kozaru-public-max)) !important;
	max-width: min(calc(100vw - var(--kozaru-public-gutter) - var(--kozaru-public-gutter)), var(--kozaru-public-max)) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	margin-top: clamp(0.75rem, 2vw, 1.5rem) !important;
	margin-bottom: clamp(2rem, 4vw, 4rem) !important;
}

body.kozaru-frontend-public-page .entry-content > .kozaru-calendar-shortcode:first-child,
body.kozaru-frontend-public-page .wp-block-post-content > .kozaru-calendar-shortcode:first-child,
body.kozaru-frontend-public-page .entry-content > .kozaru-registration-box:first-child,
body.kozaru-frontend-public-page .wp-block-post-content > .kozaru-registration-box:first-child,
body.kozaru-frontend-public-page .entry-content > .kozaru-frontend-wrap.kozaru-instructor-directory:first-child,
body.kozaru-frontend-public-page .wp-block-post-content > .kozaru-frontend-wrap.kozaru-instructor-directory:first-child {
	margin-top: clamp(0.5rem, 1.2vw, 1rem) !important;
}

/* Calendar and instructor pages can use a slightly wider, brand-board style canvas. */
body.kozaru-public-page-calendar .kozaru-calendar-shortcode,
body.kozaru-public-page-instructors .kozaru-frontend-wrap.kozaru-instructor-directory {
	width: min(calc(100vw - var(--kozaru-public-gutter) - var(--kozaru-public-gutter)), var(--kozaru-public-wide)) !important;
	max-width: min(calc(100vw - var(--kozaru-public-gutter) - var(--kozaru-public-gutter)), var(--kozaru-public-wide)) !important;
}

/* Trial booking reads better slightly narrower; the form is the product here. */
body.kozaru-public-page-trial-registration .kozaru-registration-box,
body.kozaru-frontend-registration-app-page .kozaru-registration-box.kozaru-trial-booking-box {
	width: min(calc(100vw - var(--kozaru-public-gutter) - var(--kozaru-public-gutter)), 1080px) !important;
	max-width: min(calc(100vw - var(--kozaru-public-gutter) - var(--kozaru-public-gutter)), 1080px) !important;
}

/* Remove accidental dashboard/cockpit behaviours from public front pages. */
body.kozaru-frontend-public-page .kozaru-staff-interface,
body.kozaru-frontend-public-page .kozaru-student-interface,
body.kozaru-frontend-public-page .kozaru-staff-right-nav,
body.kozaru-frontend-public-page .kozaru-student-right-nav,
body.kozaru-frontend-public-page .kozaru-dashboard-sidebar {
	position: static !important;
	left: auto !important;
	right: auto !important;
	transform: none !important;
}

body.kozaru-frontend-public-page .kozaru-instructor-directory-hero,
body.kozaru-frontend-public-page .kozaru-calendar-shortcode > h2,
body.kozaru-frontend-public-page .kozaru-trial-booking-hero {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

@media (max-width: 782px) {
	body.kozaru-frontend-public-page {
		--kozaru-public-gutter: 0.75rem;
	}

	body.kozaru-frontend-public-page .entry-content > .kozaru-calendar-shortcode,
	body.kozaru-frontend-public-page .wp-block-post-content > .kozaru-calendar-shortcode,
	body.kozaru-frontend-public-page .kozaru-calendar-shortcode,
	body.kozaru-frontend-public-page .entry-content > .kozaru-registration-box,
	body.kozaru-frontend-public-page .wp-block-post-content > .kozaru-registration-box,
	body.kozaru-frontend-public-page .kozaru-registration-box,
	body.kozaru-frontend-public-page .entry-content > .kozaru-frontend-wrap.kozaru-instructor-directory,
	body.kozaru-frontend-public-page .wp-block-post-content > .kozaru-frontend-wrap.kozaru-instructor-directory,
	body.kozaru-frontend-public-page .kozaru-frontend-wrap.kozaru-instructor-directory {
		width: calc(100vw - var(--kozaru-public-gutter) - var(--kozaru-public-gutter)) !important;
		max-width: calc(100vw - var(--kozaru-public-gutter) - var(--kozaru-public-gutter)) !important;
	}
}
