/**
* Kozaru Honbu - Shared Obi Styles
*
* File: assets/css/obi.css
*
* Reusable belt/obi preview visuals used by admin and frontend displays.
* Keep builder page layout in admin.css and portal layout in frontend.css.
*/

/* =========================================================
Kozaru Honbu - Shared Obi / Belt Display
========================================================= */

.kozaru-obi-preview {
	--kozaru-obi-s1: #f8f8f8;
	--kozaru-obi-s2: #f8f8f8;
	--kozaru-obi-s3: #f8f8f8;
	--kozaru-obi-stripe: #111111;

	display: inline-grid;
	grid-template-columns: 28px 24px 122px;
	grid-template-rows: 12px 12px;
	gap: 0;
	align-items: center;
	margin: 2px 0 10px;
	min-height: 32px;
}

.kozaru-obi-preview-body,
.kozaru-obi-preview-knot,
.kozaru-obi-preview-tail {
	border: 1px solid rgba(0, 0, 0, 0.45);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.kozaru-obi-preview-body {
	position: relative;
	grid-column: 2 / 4;
	grid-row: 1 / 3;
	height: 22px;
	border-radius: 6px;
	background: var(--kozaru-obi-s1);
	overflow: visible;
}

.kozaru-obi-preview-knot {
	grid-column: 2 / 3;
	grid-row: 1 / 3;
	justify-self: center;
	width: 24px;
	height: 28px;
	border-radius: 6px;
	background: var(--kozaru-obi-s1);
	z-index: 2;
}

.kozaru-obi-preview-tail {
	grid-column: 1 / 2;
	width: 30px;
	height: 10px;
	border-radius: 4px;
	background: var(--kozaru-obi-s1);
	transform-origin: right center;
}

.kozaru-obi-preview-tail-one {
	grid-row: 1 / 2;
	transform: rotate(-18deg);
}

.kozaru-obi-preview-tail-two {
	grid-row: 2 / 3;
	transform: rotate(18deg);
}

.kozaru-obi-preview-halves .kozaru-obi-preview-body,
.kozaru-obi-preview-halves .kozaru-obi-preview-knot,
.kozaru-obi-preview-halves .kozaru-obi-preview-tail {
	background: linear-gradient(
	to bottom,
	var(--kozaru-obi-s1) 0%,
	var(--kozaru-obi-s1) 50%,
	var(--kozaru-obi-s2) 50%,
	var(--kozaru-obi-s2) 100%
	);
}

.kozaru-obi-preview-thirds .kozaru-obi-preview-body,
.kozaru-obi-preview-thirds .kozaru-obi-preview-knot,
.kozaru-obi-preview-thirds .kozaru-obi-preview-tail {
	background: linear-gradient(
	to bottom,
	var(--kozaru-obi-s1) 0%,
	var(--kozaru-obi-s1) 33.333%,
	var(--kozaru-obi-s2) 33.333%,
	var(--kozaru-obi-s2) 66.666%,
	var(--kozaru-obi-s3) 66.666%,
	var(--kozaru-obi-s3) 100%
	);
}

.kozaru-obi-preview-stripes {
	position: absolute;
	top: 0;
	right: 10px;
	bottom: 0;
	display: inline-flex;
	align-items: stretch;
	gap: 3px;
	pointer-events: none;
}

.kozaru-obi-preview-stripes span {
	display: block;
	width: 5px;
	background: var(--kozaru-obi-stripe);
	border-left: 1px solid rgba(255, 255, 255, 0.28);
	border-right: 1px solid rgba(0, 0, 0, 0.18);
}

.kozaru-obi-preview-stripes-0 .kozaru-obi-preview-stripes,
.kozaru-obi-preview-stripes-1 .kozaru-obi-preview-stripes span:nth-child(n+2),
.kozaru-obi-preview-stripes-2 .kozaru-obi-preview-stripes span:nth-child(n+3),
.kozaru-obi-preview-stripes-3 .kozaru-obi-preview-stripes span:nth-child(n+4) {
	display: none;
}

/* v0.4.0.1 - Learn/Core readiness marker overlay.
   This is separate from normal Obi Builder stripe slots. */
.kozaru-obi-preview-markers {
	position: absolute;
	top: 0;
	right: 44px;
	bottom: 0;
	display: inline-flex;
	align-items: stretch;
	gap: 3px;
	pointer-events: none;
}

.kozaru-obi-preview-marker {
	display: block;
	width: 5px;
	background: #111111;
	border-left: 1px solid rgba(255, 255, 255, 0.28);
	border-right: 1px solid rgba(0, 0, 0, 0.18);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.kozaru-obi-preview-marker-grading_readiness {
	border-radius: 1px;
}


/* v0.4.2.2 - readiness marker note. */
.kozaru-student-obi-marker-note {
	display: block;
	max-width: 16rem;
	color: #64748b;
	font-size: .72rem;
	line-height: 1.35;
	margin-top: -0.35rem;
}

/* v0.4.3.6 - Learn master-category instructor-controlled stripes.
   These are capped by the renderer at five, sit on the long horizontal body,
   and build out from centre: centre, right, left, far right, far left. */
.kozaru-obi-preview-master-markers {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 4;
	pointer-events: auto;
}

.kozaru-obi-preview-master-stripe {
	--kozaru-marker-colour: #111111;
	position: absolute;
	top: 0;
	bottom: 0;
	width: 5px;
	border-radius: 2px;
	background: var(--kozaru-marker-colour);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), inset 1px 0 0 rgba(255, 255, 255, 0.22), inset -1px 0 0 rgba(0, 0, 0, 0.28);
	transform: translateX(-50%);
	cursor: help;
}

.kozaru-obi-preview-master-stripe-slot-1 { left: 50%; }
.kozaru-obi-preview-master-stripe-slot-2 { left: calc(50% + 8px); }
.kozaru-obi-preview-master-stripe-slot-3 { left: calc(50% - 8px); }
.kozaru-obi-preview-master-stripe-slot-4 { left: calc(50% + 16px); }
.kozaru-obi-preview-master-stripe-slot-5 { left: calc(50% - 16px); }

.kozaru-obi-preview-master-stripe:hover::after,
.kozaru-obi-preview-master-stripe:focus-visible::after {
	content: attr(data-kozaru-tooltip);
	position: absolute;
	left: 50%;
	bottom: calc(100% + 7px);
	width: max-content;
	max-width: 220px;
	padding: 6px 8px;
	border-radius: 8px;
	background: rgba(15, 23, 42, 0.96);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.25;
	white-space: normal;
	text-align: left;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
	transform: translateX(-50%);
	transform-origin: center bottom;
	z-index: 50;
}

.kozaru-obi-preview-marker-master_category_signoff,
.kozaru-obi-preview-marker-master_category_stripe {
	border-radius: 2px;
}

.kozaru-obi-preview-status-markers {
	position: absolute;
	left: 34px;
	top: 50%;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	transform: translateY(-50%);
	pointer-events: none;
}

.kozaru-obi-preview-status-marker {
	display: block;
	width: 7px;
	height: 7px;
	border-radius: 999px;
	background: #111111;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 0 2px rgba(0, 0, 0, 0.18);
}

/* v0.4.3.6 — master-category stripe tooltip/accessibility tightening */
.kozaru-obi-preview-master-stripe:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .95);
    outline-offset: 3px;
}

.kozaru-obi-preview-master-stripe:hover,
.kozaru-obi-preview-master-stripe:focus-visible {
    z-index: 60;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .32), 0 0 0 3px rgba(15, 23, 42, .2), inset 1px 0 0 rgba(255, 255, 255, .22), inset -1px 0 0 rgba(0, 0, 0, .28);
}


/* Student identity blocks pair prominent names with the Kozaru obi visual. */
.kozaru-student-identity {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	max-width: 100%;
}

.kozaru-student-identity-main {
	display: grid;
	gap: 0.15rem;
	min-width: 0;
}

.kozaru-student-identity-name {
	margin: 0;
	font-weight: 800;
	line-height: 1.15;
}

.kozaru-student-identity-name a {
	color: inherit;
	text-decoration: none;
}

.kozaru-student-identity-name a:hover,
.kozaru-student-identity-name a:focus-visible {
	text-decoration: underline;
}

.kozaru-student-identity-rank {
	color: #64748b;
	font-size: 0.78rem;
	font-weight: 700;
}

.kozaru-student-identity .kozaru-student-obi {
	margin: 0;
}

.kozaru-student-identity .kozaru-obi-preview {
	margin: 0;
	transform-origin: left center;
}

.kozaru-student-identity-inline,
.kozaru-student-identity-compact {
	gap: 0.5rem;
}

.kozaru-student-identity-inline .kozaru-obi-preview,
.kozaru-student-identity-compact .kozaru-obi-preview {
	transform: scale(0.72);
}

.kozaru-student-identity-inline .kozaru-student-obi-label,
.kozaru-student-identity-compact .kozaru-student-obi-label {
	font-size: 0.68rem;
}

.kozaru-student-identity-card_header,
.kozaru-student-identity-profile_header,
.kozaru-student-identity-large {
	align-items: flex-start;
	justify-content: space-between;
	width: 100%;
}

.kozaru-student-identity-card_header .kozaru-obi-preview {
	transform: scale(0.86);
}

.kozaru-student-identity-large .kozaru-obi-preview,
.kozaru-student-identity-profile_header .kozaru-obi-preview {
	transform: scale(0.95);
}

.kozaru-student-identity-photo {
	flex: 0 0 auto;
}

@media (max-width: 640px) {
	.kozaru-student-identity-card_header,
	.kozaru-student-identity-profile_header,
	.kozaru-student-identity-large {
		align-items: flex-start;
		flex-direction: column;
	}
}

/* Reusable stacked identity card: profile image, small name, obi, small rank. */
.kozaru-student-identity-identity_card,
.kozaru-student-identity-badge,
.kozaru-student-identity-student_badge {
	align-items: center;
	gap: 1rem;
	width: 100%;
}

.kozaru-student-identity-identity_card .kozaru-student-identity-main,
.kozaru-student-identity-badge .kozaru-student-identity-main,
.kozaru-student-identity-student_badge .kozaru-student-identity-main {
	align-items: flex-start;
	gap: 0.35rem;
}

.kozaru-student-identity-identity_card .kozaru-student-identity-name,
.kozaru-student-identity-badge .kozaru-student-identity-name,
.kozaru-student-identity-student_badge .kozaru-student-identity-name {
	font-size: 0.95rem;
	font-weight: 800;
}

.kozaru-student-identity-identity_card .kozaru-student-identity-rank,
.kozaru-student-identity-badge .kozaru-student-identity-rank,
.kozaru-student-identity-student_badge .kozaru-student-identity-rank {
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.kozaru-student-identity-identity_card .kozaru-obi-preview,
.kozaru-student-identity-badge .kozaru-obi-preview,
.kozaru-student-identity-student_badge .kozaru-obi-preview {
	transform: scale(0.78);
}

.kozaru-student-identity-identity_card .kozaru-student-obi-label,
.kozaru-student-identity-badge .kozaru-student-obi-label,
.kozaru-student-identity-student_badge .kozaru-student-obi-label {
	display: none;
}

@media (max-width: 640px) {
	.kozaru-student-identity-identity_card,
	.kozaru-student-identity-badge,
	.kozaru-student-identity-student_badge {
		align-items: flex-start;
	}
}
