/* IDE Multimedia — frontend styles. Self-contained; Avada CSS variables are
   used only as optional fallbacks, never as a hard dependency.

   The default "sidebar" layout's proportions/spacing/typography follow the
   Company → Organization page of the IDE site (department list next to a
   grid of team cards) as closely as reasonably possible without depending
   on that module: content ~75%, nav ~25%, #f2f2f2 divider, "Categories"
   heading, and a nav where only font-weight (not colour) marks the active
   item — all measured from the live page, not guessed. */

.ide-mm-wrapper {
	--ide-mm-accent: var(--awb-color2, #0073aa);
	--ide-mm-text: var(--awb-text-color, #283253); /* rgb(40, 50, 83) — IDE/Organization text colour */
	--ide-mm-muted: #666;
	--ide-mm-card-bg: var(--awb-color7, #f2f2f2);
	--ide-mm-border: #f2f2f2;
	font-family: var(--ide-mm-font, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------- Sidebar layout (default) ----------
   Content ~75%, category navigation ~25%, subtle vertical divider — the
   nav stays first in the markup (so the mobile <select> still appears
   above the content when the two-column grid collapses) and is only moved
   visually via `order`. Not sticky. */

.ide-mm-layout {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(200px, 1fr);
	gap: 3rem;
	align-items: start;
}

.ide-mm-content {
	order: 1;
	min-width: 0;
}

.ide-mm-sidebar {
	order: 2;
	/* Deliberately not sticky. */
	position: static;
}

/* Sits above the divider/list, flush left — not indented, no border. */
.ide-mm-sidebar-heading {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--ide-mm-text);
}

.ide-mm-mobile-select-wrap {
	display: none;
	margin-bottom: 1.5rem;
}

.ide-mm-category-select {
	width: 100%;
	padding: 10px 12px;
	font-size: 15px;
	color: var(--ide-mm-text);
	background: #fff;
	border: 1px solid #d3d6db;
	border-radius: 6px;
}

/* The vertical divider belongs to the list, not the heading above it. */
.ide-mm-sidebar-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 1.5rem;
	border-left: 1px solid var(--ide-mm-border);
	padding-left: 1.875rem;
}

/* Only font-weight marks the active item — same colour throughout, no
   border/pill, hover underlines. Matches Organization's department nav. */
.ide-mm-sidebar-link {
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	padding: 0;
	color: var(--ide-mm-text);
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	cursor: pointer;
	transition: font-weight .2s ease;
}

.ide-mm-sidebar-link:hover {
	text-decoration: underline;
}

.ide-mm-sidebar-link.is-active {
	font-weight: 700;
}

.ide-mm-sidebar-link:focus-visible {
	outline: 2px solid var(--ide-mm-accent);
	outline-offset: 2px;
}

.ide-mm-layout .ide-mm-category {
	margin-bottom: 0;
}

@media (max-width: 782px) {
	.ide-mm-layout {
		display: block;
	}

	.ide-mm-sidebar-heading,
	.ide-mm-sidebar-list {
		display: none;
	}

	.ide-mm-mobile-select-wrap {
		display: block;
	}
}

/* ---------- Legacy navigation (navigation="anchors" | "filter") ---------- */

.ide-mm-nav {
	margin-bottom: 2rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-bottom: 1px solid #e2e2e2;
}

.ide-mm-nav-list {
	display: flex;
	flex-wrap: nowrap;
	gap: 1.75rem;
	margin: 0;
	padding: 0 0 0.75rem;
	list-style: none;
	white-space: nowrap;
}

.ide-mm-nav-link {
	display: inline-block;
	color: var(--ide-mm-text);
	font-weight: 500;
	font-size: 15px;
	text-decoration: none;
	padding-bottom: 4px;
	border-bottom: 2px solid transparent;
	transition: color .2s ease, border-color .2s ease;
}

.ide-mm-nav-link:hover {
	color: var(--ide-mm-accent);
}

.ide-mm-nav-link.is-active {
	color: var(--ide-mm-accent);
	font-weight: 700;
	border-bottom-color: var(--ide-mm-accent);
}

/* ---------- Sections & grid ---------- */

.ide-mm-category {
	margin-bottom: 3.5rem;
	scroll-margin-top: 20px;
}

.ide-mm-category[hidden] {
	display: none;
}

.ide-mm-category-title {
	color: var(--ide-mm-text);
	font-size: 36px;
	font-weight: 800;
	line-height: 1.3;
	margin: 0 0 8px;
	letter-spacing: normal;
}

/*
 * `columns` is a maximum, not a fixed count: each track's minimum width is
 * "what 1/N of the available space would be" (clamped to a 200px floor for
 * readability). At that minimum, exactly N columns fit — never more, since
 * a further column would have to be narrower than the minimum. When the
 * container is too narrow for N columns of >=200px, the column count steps
 * down on its own, continuously, with no fixed breakpoint. This works
 * identically for the sidebar layout's narrower content column and for the
 * legacy full-width layouts, so no separate media/container query is
 * needed to react to `columns` — the attribute drives the grid directly
 * via --ide-mm-cols (set inline per grid).
 *
 * auto-fill (not auto-fit): with fewer items than columns, auto-fit would
 * collapse the empty tracks and stretch the remaining item(s) to fill the
 * row — a single video would blow up to full width. auto-fill keeps the
 * empty tracks reserved instead, so 1 item stays one column wide, 2 items
 * stay two columns wide, etc.
 */
.ide-mm-grid {
	--ide-mm-gap: 2rem;
	display: grid;
	align-items: start; /* rows don't stretch every card to the tallest one's height */
	gap: var(--ide-mm-gap);
	grid-template-columns: repeat(
		auto-fill,
		minmax(max(200px, (100% - (var(--ide-mm-cols, 3) - 1) * var(--ide-mm-gap)) / var(--ide-mm-cols, 3)), 1fr)
	);
}

/* ---------- Card ---------- */

/* Flat fill, square corners, no border — matches team-card exactly (same
   #f2f2f2 background token as the sidebar divider, no rounding, no border,
   no shadow). The card "reads" as part of the layout, not a boxed widget. */
.ide-mm-card {
	background: var(--ide-mm-card-bg);
	display: flex;
	flex-direction: column;
	text-align: left;
}

.ide-mm-media {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ide-mm-poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ide-mm-media video {
	width: 100%;
	height: 100%;
	display: block;
	background: #000;
}

.ide-mm-play {
	position: relative;
	z-index: 1;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .2s ease, background .2s ease;
}

.ide-mm-play:hover {
	transform: scale(1.08);
	background: #fff;
}

.ide-mm-play-icon {
	display: block;
	width: 0;
	height: 0;
	margin-left: 4px;
	border-top: 12px solid transparent;
	border-bottom: 12px solid transparent;
	border-left: 20px solid var(--ide-mm-accent);
}

.ide-mm-card.is-loading .ide-mm-play {
	opacity: .6;
	pointer-events: none;
}

/* Discreet caption, not a heading — sits directly on the card's own
   background (no separate box). Tight vertical padding on purpose: this is
   a one-line label, not a text block, so it shouldn't leave dead space
   below it. */
.ide-mm-card-title {
	margin: 0;
	padding: 8px 12px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--ide-mm-text);
}

/* ---------- Modal ---------- */

.ide-mm-modal {
	/* Always rendered as a direct child of <body> by JS, specifically so
	   this position:fixed + inset:0 is relative to the real viewport and
	   not to some ancestor with a transform/filter/perspective (which
	   would otherwise become its containing block). isolation:isolate plus
	   a maximum z-index keep it above header/footer/sticky/Avada Live. */
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	isolation: isolate;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, .8);
}

.ide-mm-modal[hidden] {
	display: none;
}

.ide-mm-modal-dialog {
	position: relative;
	width: min(960px, 100%);
	background: #000;
	border-radius: 12px;
	overflow: hidden;
}

.ide-mm-modal-video-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}

.ide-mm-modal-video-wrap video {
	width: 100%;
	height: 100%;
	display: block;
}

.ide-mm-modal-loading,
.ide-mm-modal-error {
	color: #fff;
	text-align: center;
	padding: 2rem 1rem;
	margin: 0;
}

.ide-mm-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 1;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ide-mm-modal-close:hover {
	background: rgba(0, 0, 0, .75);
}

body.ide-mm-modal-open {
	overflow: hidden;
}

.ide-mm-card-title {
	margin-bottom:5px!important;
}