/* Nimbus: software, online tools and digital services.  Slate blue and a
   fresh lime on bright white, with soft cloud shapes and rounded cards.
   The colours, fonts, shape and dark mode come from theme.json through the
   shared core (themes/_core); this file adds the character, and uses only
   the --mg-* tokens so a site's own palette carries straight through. */

/* Header: a hairline under it, firm menu links with a lime underline on
   the current page, and a frosted look once the page scrolls */
.mg-core .mg-header { border-bottom: 1px solid var(--mg-border); }
.mg-core .mg-header .nav-link { font-weight: 600; position: relative; }
.mg-core .mg-header .navbar-nav > .nav-item > .nav-link.active::after,
.mg-core .mg-header .navbar-nav > .nav-item > .nav-link[aria-current="page"]::after {
	content: ""; position: absolute; left: .5rem; right: .5rem; bottom: .15rem;
	height: 3px; border-radius: 3px; background: var(--mg-accent);
}
.mg-masthead.is-scrolled .mg-header {
	background: rgba(var(--mg-header-bg-rgb), .84);
	-webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
}
.mg-core .dropdown-menu { border: 1px solid var(--mg-border); border-radius: var(--mg-radius-md); box-shadow: 0 18px 40px rgba(var(--mg-dark-rgb), .14); padding: .4rem; }
.mg-core .dropdown-item { border-radius: calc(var(--mg-radius-md) - 4px); }
.mg-core .dropdown-item:hover, .mg-core .dropdown-item:focus { background: var(--mg-primary-soft); color: var(--mg-heading); }

/* Buttons: confident labels and a gentle lift */
.mg-core .btn { font-weight: 600; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.mg-core .btn-primary:hover, .mg-core .btn-primary:focus-visible { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(var(--mg-primary-rgb), .28); }

/* Keyboard focus: a lime ring that shows on light and dark */
.mg-core a:focus-visible, .mg-core .btn:focus-visible, .mg-core .form-control:focus-visible, .mg-core .form-select:focus-visible {
	outline: 3px solid rgba(var(--mg-accent-rgb), .75); outline-offset: 2px; box-shadow: none;
}

/* Page titles: a soft wash of the brand colour, drifting into a cloud on the
   right, and a short lime bar sitting on the band's bottom edge (on the
   edge rather than under the text, so it looks right however a page
   aligns its heading) */
html.mg-title-band .mgcontent > h1:first-of-type,
html.mg-title-band .mgcontent h1.departmentheadline,
html.mg-title-band .mgcontent h1.articleheadline {
	border-left: 0; position: relative;
	background:
		radial-gradient(60% 140% at 100% 0%, rgba(var(--mg-secondary-rgb), .16), transparent 70%),
		linear-gradient(180deg, var(--mg-surface), var(--mg-bg));
	border-bottom: 1px solid var(--mg-border);
}
html.mg-title-band .mgcontent > h1:first-of-type::after,
html.mg-title-band .mgcontent h1.departmentheadline::after,
html.mg-title-band .mgcontent h1.articleheadline::after {
	content: ""; position: absolute; left: 2rem; bottom: -2px; width: 3.5rem; height: 4px;
	border-radius: 4px; background: var(--mg-accent);
}
html.mg-title-band.mg-title-center .mgcontent > h1:first-of-type::after,
html.mg-title-band.mg-title-center .mgcontent h1.departmentheadline::after,
html.mg-title-band.mg-title-center .mgcontent h1.articleheadline::after { left: 50%; transform: translateX(-50%); }

/* Hero sections: two soft clouds of the brand colours behind the content */
.mg-core .mg-section--hero { position: relative; overflow: hidden; isolation: isolate; }
.mg-core .mg-section--hero::before,
.mg-core .mg-section--hero::after {
	content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; filter: blur(8px);
}
.mg-core .mg-section--hero::before { width: 46rem; height: 30rem; right: -12rem; top: -14rem; background: radial-gradient(closest-side, rgba(var(--mg-primary-rgb), .18), transparent); }
.mg-core .mg-section--hero::after { width: 34rem; height: 22rem; left: -10rem; bottom: -12rem; background: radial-gradient(closest-side, rgba(var(--mg-accent-rgb), .20), transparent); }

/* Eyebrows: small caps with a lime dot */
.mg-core .mg-layout .mg-eyebrow { color: var(--mg-primary); letter-spacing: .12em; display: inline-flex; align-items: center; gap: .5rem; }
.mg-core .mg-layout .mg-eyebrow::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--mg-accent); }
.mg-core .mg-layout .mg-on-dark .mg-eyebrow { color: var(--mg-accent); }

/* Cards and listings: rounded, bordered, lifting on hover */
.mg-core .card { border-color: var(--mg-border); border-radius: var(--mg-radius-lg); }
.mg-core .mg-layout .mg-card-icon { border-radius: 14px; background: var(--mg-primary-soft); color: var(--mg-primary); }
.mg-core .mg-layout .mg-card--boxed { border-top: 3px solid var(--mg-accent); }
.mg-listing--grid .mg-item a.mg-item-link,
.mg-listing--carousel .mg-item a.mg-item-link { border: 1px solid var(--mg-border); border-radius: 18px; background: var(--mg-bg); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.mg-listing--grid .mg-item a.mg-item-link:hover,
.mg-listing--carousel .mg-item a.mg-item-link:hover { transform: translateY(-2px); border-color: rgba(var(--mg-primary-rgb), .35); box-shadow: 0 18px 40px rgba(var(--mg-dark-rgb), .12); }
.mg-item .mg-item-type { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mg-primary); }
.mg-core .mg-layout .mg-divider { border-top: 2px solid var(--mg-border); }

/* Tables: quiet rows on the surface colour */
.mg-core .mgcontent .table { --bs-table-bg: transparent; border-color: var(--mg-border); }
.mg-core .mgcontent .table > thead th { color: var(--mg-muted); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-bottom-width: 1px; }
.mg-core .mgcontent .table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--mg-primary-soft); }

/* Sidebars: rounded panels with a brand-coloured heading */
.mg-core .mg-sidebar .catheader { background: var(--mg-primary); color: var(--mg-primary-contrast); border-bottom: 3px solid var(--mg-accent); border-radius: var(--mg-radius-md) var(--mg-radius-md) 0 0; }

/* Login cards: the same soft cloud as the title band */
.mg-core .mg-login-card { border: 1px solid var(--mg-border); border-radius: var(--mg-radius-lg); background: radial-gradient(80% 60% at 100% 0%, rgba(var(--mg-secondary-rgb), .10), transparent 70%), var(--mg-bg); }

/* Footer: the dark band, quiet links that turn lime on hover */
.mg-core .mg-footer a { text-decoration: none; }
.mg-core .mg-footer a:hover { color: var(--mg-accent); }
.mg-core .mg-footer--columns { padding: 4rem 0 2rem; }
.mg-core .mg-footer--columns > .container > .row { row-gap: 2.5rem; }
.mg-core .mg-footer-heading { color: #fff; letter-spacing: .12em; margin-bottom: 1.1rem; }
.mg-core .mg-footer--columns .mg-footer-bottom { margin-top: 3rem; padding-top: 1.5rem; }
.mg-core .mg-footer--columns .mg-copyright { opacity: .7; }
/* Phones: the core footer row's g-5 gutter is wider than the container's
   padding and pushed the page 12px sideways; a smaller gutter fits */
@media (max-width: 575.98px) {
	.mg-core .mg-footer .row { --bs-gutter-x: 1.5rem; }
}
.mg-core .mg-footer-cta { background: radial-gradient(70% 120% at 100% 0%, rgba(var(--mg-accent-rgb), .18), transparent 70%), var(--mg-primary); }

/* Dark mode: logos made for white backgrounds keep a white tile */
:root[data-mg-mode="dark"] .mgcontent img[src*="logo" i] { background: #fff; border-radius: 10px; padding: 8px 12px; box-sizing: content-box; }
@media (prefers-color-scheme: dark) {
	:root:not([data-mg-mode]) .mgcontent img[src*="logo" i] { background: #fff; border-radius: 10px; padding: 8px 12px; box-sizing: content-box; }
}

/* Reduced motion: no lifts */
@media (prefers-reduced-motion: reduce) {
	.mg-core .btn, .mg-listing--grid .mg-item a.mg-item-link, .mg-listing--carousel .mg-item a.mg-item-link { transition: none; }
	.mg-core .btn-primary:hover, .mg-listing--grid .mg-item a.mg-item-link:hover, .mg-listing--carousel .mg-item a.mg-item-link:hover { transform: none; }
}
