/*! NSBM Faculty of Computing - integration with the 2026 theme (eikra-child)
 *
 *  Loaded after foc-home.css / foc-pages.css (copied unchanged from the FOC package by tools/copy-foc-assets.py).
 *  Every selector starts at #nsbm-foc-app, so nothing here reaches the site header, footer or any other page.
 */

/* ---------------------------------------------------------------------------
 * 1. Colours: the FOC palette mapped onto the 2026 design tokens
 *    (design-tokens / nsbm-chrome.css, :root). The FOC values stay as
 *    fallbacks. The accent colours (amber, coral, teal) and the softer grey
 *    text colour (ink3, kept for contrast) are the package's own.
 * ------------------------------------------------------------------------ */
#nsbm-foc-app {
	--nfoc-blue: var(--blue-700, #1b4d9b);
	--nfoc-blue-d: var(--blue-800, #133b7a);
	--nfoc-blue-dd: var(--blue-900, #0d2b5c);
	--nfoc-blue-l: var(--blue-50, #e7eef9);
	--nfoc-green: var(--green-500, #1e9a55);
	--nfoc-green-d: var(--green-600, #147b42);
	--nfoc-green-dd: var(--green-700, #0f5e33);
	--nfoc-green-l: var(--green-50, #e3f4ea);
	--nfoc-ink: var(--neutral-900, #0f1d33);
	--nfoc-ink2: var(--neutral-600, #4b5a70);
	--nfoc-line: var(--neutral-200, #dde4ee);
	--nfoc-bg: var(--neutral-50, #f6f8fc);

	/* --nfoc-hdr: the part of the window the sticky site header covers. Written by foc-nav.js while scrolling;
	   used by the pinned sections, anchor scrolling and the optional sticky Faculty menu. */
	position: relative;
	isolation: isolate; /* Keeps the component's z-indexes below the site header. */
	font-family: var(--font-sans, "Roboto Slab", Georgia, serif);
}

/* ---------------------------------------------------------------------------
 * 2. Full-bleed (nsbm_foc_breakout, on by default): widens the component to
 *    the window from inside a themed container; no effect when already full.
 * ------------------------------------------------------------------------ */
#nsbm-foc-app.nsbm-foc--breakout {
	width: var(--nfoc-vw, 100vw);
	max-width: var(--nfoc-vw, 100vw);
	margin-inline: calc(50% - var(--nfoc-vw, 100vw) / 2);
}

/* ---------------------------------------------------------------------------
 * 3. Faculty menu position: pinned at the top while scrolling (default since
 *    1.3.10; filter nsbm_foc_sticky_nav to turn off).
 * ------------------------------------------------------------------------ */
/* Positioned with its own z-index so the Departments dropdown opens over the page below it (with `static`, the
   next section painted over the open menu: it looked empty). */
#nsbm-foc-app .nsbm-foc-secondary-nav {
	position: relative;
	z-index: 40;
}

/* Sticky (default since 1.3.10): pinned at the top of the window while the page scrolls, as on sliit.lk. The site
   header is not sticky on these pages, so at the top of the page both bars show and further down only this one.
   Logged in: below the WordPress admin bar, which is fixed from 601px up. */
#nsbm-foc-app.nsbm-foc--sticky-nav .nsbm-foc-secondary-nav {
	position: sticky;
	top: var(--nfoc-hdr, 0px);
	z-index: 40;
	box-shadow: 0 6px 18px -14px rgb(0 33 71 / 0.45);
}

@media (min-width: 601px) {
	body.admin-bar #nsbm-foc-app.nsbm-foc--sticky-nav .nsbm-foc-secondary-nav {
		top: calc(var(--nfoc-hdr, 0px) + var(--wp-admin--admin-bar--height, 32px));
	}
}

/* Skip link: hidden until focused, then shown inside the component (the sticky site header cannot cover it). */
#nsbm-foc-app .nfoc-skip {
	position: absolute;
	left: 16px;
	top: 16px;
	z-index: 3;
}

#nsbm-foc-app .nfoc-skip:not(:focus) {
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * 4. Faculty menu on small screens: opens in the page flow (not a full-screen
 *    overlay), so it never sits on top of the site header or its own menu.
 * ------------------------------------------------------------------------ */
#nsbm-foc-app .nfoc-mmenu {
	position: static;
	inset: auto;
	z-index: auto;
	max-height: 0;
	overflow: hidden;
	opacity: 1;
	visibility: visible;
	transform: none;
	padding-block: 0;
	border-bottom: 1px solid transparent;
	transition: max-height 0.42s var(--nfoc-out), padding-block 0.42s var(--nfoc-out), border-color 0.42s;
}

#nsbm-foc-app.nfoc-menu-open .nfoc-mmenu {
	max-height: min(78vh, 820px);
	overflow-y: auto;
	padding-block: 16px 28px;
	border-bottom-color: var(--nfoc-line);
}

#nsbm-foc-app .nfoc-mmenu .nfoc-mh {
	padding-top: 12px;
	font-size: 14px;
	font-weight: 700;
	color: var(--nfoc-ink3);
}

@media (min-width: 1261px) {
	#nsbm-foc-app .nfoc-mmenu {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	#nsbm-foc-app .nfoc-mmenu {
		transition: none;
	}
}

/* ---------------------------------------------------------------------------
 * 5. What used to be inline style in the package markup.
 * ------------------------------------------------------------------------ */
#nsbm-foc-app .nfoc-dhero h1 em {
	font-style: normal;
	color: var(--nfoc-em, #9fd8ff);
}

#nsbm-foc-app .nfoc-dhero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	align-items: center;
	margin-top: 24px;
}

#nsbm-foc-app .nfoc-dhero-actions .nfoc-btn {
	background: #fff;
	color: var(--nfoc-ink);
}

/* ---------------------------------------------------------------------------
 * 6. Eikra's stylesheet is still loaded on these pages (as on every inner page with the new header); neutralise
 *    the few of its element rules that reach into the component.
 * ------------------------------------------------------------------------ */
#nsbm-foc-app figure {
	margin: 0;
}

#nsbm-foc-app button {
	font-family: inherit;
}

#nsbm-foc-app blockquote {
	border: 0;
	padding: 0;
	margin: 0;
	font-size: inherit;
}

/* ---------------------------------------------------------------------------
 * 7. Page base. Eikra's and Elementor's stylesheets are not loaded on the FOC
 *    pages (assets.php), so the few base rules the page relied on are here.
 * ------------------------------------------------------------------------ */
body.nsbm-foc-page {
	margin: 0;
	background: #fff;
	color: var(--nfoc-ink, #0f1d33);
	font-family: var(--font-sans, "Roboto Slab", Georgia, serif);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body.nsbm-foc-page .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
/* 1.3.54: faculty menu bar. The "Inquire now" button never wraps or shrinks (it broke onto two lines next to a long
   menu), and when the links do not fit beside the faculty name and the button, the bar shows the menu button instead
   (foc-nav.js adds .nfoc-hdr--fit), as it does on smaller screens. */
#nsbm-foc-app .nfoc-hdr .nfoc-in > .nfoc-btn { flex: none; white-space: nowrap; padding: 10px 20px; font-size: 14.5px; line-height: 1.2; }
#nsbm-foc-app .nfoc-hdr .nfoc-in > .nfoc-nav { flex: 0 1 auto; }
#nsbm-foc-app .nfoc-hdr.nfoc-hdr--fit .nfoc-in > .nfoc-nav { display: none; }
#nsbm-foc-app .nfoc-hdr.nfoc-hdr--fit .nfoc-in > .nfoc-burger { display: grid; }
#nsbm-foc-app .nfoc-hdr.nfoc-hdr--fit .nfoc-in > .nfoc-btn { margin-left: auto; }
