/*
 * Header bar, mega menu panels and the mobile menu.
 */

/* Bar */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	height: var(--header-h);
	border-bottom: 1px solid #e6e8f2;
	background: var(--c-white);
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: min(100% - 2 * var(--gutter), var(--container));
	height: 100%;
	margin-inline: auto;
}

.site-logo {
	display: block;
	flex: none;
}

.site-logo__img {
	width: auto;
	height: 30px;
}

.site-logo__img--white {
	display: none;
}

.primary-nav {
	display: none;
}

.nav-toggle {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin-right: -8px;
	padding: 0;
	border: 0;
	border-radius: var(--radius);
	background: none;
	color: var(--c-ink);
	cursor: pointer;
}

/* WordPress admin bar (logged-in users) */

.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

@media (max-width: 600px) {
	.admin-bar .site-header {
		top: 0;
	}
}

/* Desktop navigation */

@media (min-width: 1100px) {
	.site-header {
		border-bottom-color: #cfcfcf;
	}

	.site-header__bar {
		padding-inline: 14px;
	}

	.site-logo__img {
		height: 37px;
	}

	.nav-toggle {
		display: none;
	}

	.primary-nav {
		display: flex;
		align-items: center;
		gap: 28px;
		height: 100%;
	}

	.primary-nav__list {
		display: flex;
		gap: 28px;
		height: 100%;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.primary-nav__item {
		height: 100%;
	}

	.primary-nav__link {
		position: relative;
		display: flex;
		align-items: center;
		height: 100%;
		color: var(--c-ink);
		font-size: 16px;
		font-weight: 500;
		line-height: 24px;
		text-decoration: none;
		white-space: nowrap;
		transition: color 0.15s ease;
	}

	/* Active indicator: 3px bar sitting on the bottom edge of the header. */
	.primary-nav__link::after {
		content: "";
		position: absolute;
		inset: auto 0 -1px;
		height: 3px;
		background: var(--c-primary);
		opacity: 0;
		transform: scaleX(0.6);
		transition: opacity 0.15s ease, transform 0.15s ease;
	}

	.primary-nav__link:hover,
	.primary-nav__item.is-current > .primary-nav__link,
	.primary-nav__item.is-open > .primary-nav__link {
		color: var(--c-blue);
	}

	.primary-nav__item.is-current > .primary-nav__link::after,
	.primary-nav__item.is-open > .primary-nav__link::after {
		opacity: 1;
		transform: none;
	}
}

/* Mega menu panel */

.mega {
	position: absolute;
	inset-inline: 0;
	top: calc(100% + 1px);
	max-height: calc(100vh - var(--header-h) - 24px);
	overflow: hidden auto;
	border-top: 1px solid var(--c-line-strong);
	border-radius: 0 0 var(--radius-lg) var(--radius-lg);
	background: var(--c-white);
	box-shadow: var(--shadow-xl);
	animation: syb-mega-in 0.16s ease both;
}

@keyframes syb-mega-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

.mega__body {
	display: flex;
	align-items: stretch;
	gap: 32px;
	padding-block: 28px 32px;
}

.mega-col {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.mega-col__title {
	padding: 0 0 6px 12px;
	color: var(--c-mute);
	font-size: 12px;
	font-weight: 600;
	line-height: 18px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.mega-col__items {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mega-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px;
	border-radius: var(--radius-md);
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mega-item__tile {
	display: grid;
	flex: none;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 10px;
	background: var(--c-tile);
	color: var(--c-blue);
	transition: background-color 0.15s ease;
}

.mega-item__text {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mega-item__title {
	color: var(--c-ink);
	font-size: 16px;
	font-weight: 600;
	line-height: 22px;
	transition: color 0.15s ease;
}

.mega-item__desc {
	color: var(--c-body);
	font-size: 14px;
	line-height: 20px;
}

.mega-item__arrow {
	color: var(--c-blue);
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.mega-item:hover,
.mega-item:focus-visible {
	background: var(--c-tile);
}

.mega-item:hover .mega-item__tile,
.mega-item:focus-visible .mega-item__tile {
	background: var(--c-white);
}

.mega-item:hover .mega-item__title,
.mega-item:focus-visible .mega-item__title {
	color: var(--c-blue);
}

.mega-item:hover .mega-item__arrow,
.mega-item:focus-visible .mega-item__arrow {
	opacity: 1;
	transform: none;
}

/* Column style: large cards ("Solutions by role") */

.mega-col--cards .mega-col__title {
	padding-left: 0;
}

.mega-col--cards .mega-col__items {
	gap: 10px;
}

.mega-col--cards .mega-item {
	min-height: 100px;
	padding: 16px;
	border: 1px solid var(--c-border);
	background: var(--c-white);
}

.mega-col--cards .mega-item__tile {
	width: 52px;
	height: 52px;
	border-radius: var(--radius-md);
	background: linear-gradient(135deg, #2b47e1 0%, #6e85ff 100%);
	color: var(--c-white);
}

.mega-col--cards li:nth-child(even) .mega-item__tile {
	background: var(--c-dark);
}

.mega-col--cards .mega-item__title {
	font-size: 18px;
	line-height: 24px;
}

.mega-col--cards .mega-item__arrow {
	color: var(--c-mute);
	opacity: 1;
	transform: none;
}

.mega-col--cards .mega-item:hover,
.mega-col--cards .mega-item:focus-visible {
	border-color: var(--c-primary);
	background: #f3f8ff;
}

.mega-col--cards .mega-item:hover .mega-item__tile,
.mega-col--cards .mega-item:focus-visible .mega-item__tile {
	background: linear-gradient(135deg, #2b47e1 0%, #6e85ff 100%);
}

.mega-col--cards li:nth-child(even) .mega-item:hover .mega-item__tile,
.mega-col--cards li:nth-child(even) .mega-item:focus-visible .mega-item__tile {
	background: var(--c-dark);
}

.mega-col--cards .mega-item:hover .mega-item__arrow,
.mega-col--cards .mega-item:focus-visible .mega-item__arrow {
	color: var(--c-primary);
}

/* Column style: latest articles */

.mega-post {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px;
	border-radius: var(--radius-md);
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.mega-post:hover,
.mega-post:focus-visible {
	background: var(--c-tile);
}

.mega-post__thumb {
	flex: none;
	width: 84px;
	height: 64px;
	overflow: hidden;
	border-radius: var(--radius);
	background: linear-gradient(135deg, #1b1965 0%, #3a35b8 100%);
}

.mega-post__thumb--b {
	background: linear-gradient(135deg, #0067b7 0%, #43a0f9 100%);
}

.mega-post__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mega-post__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.mega-post__title {
	color: var(--c-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.mega-post:hover .mega-post__title {
	color: var(--c-blue);
}

.mega-post__date {
	color: var(--c-mute);
	font-size: 12px;
	line-height: 16px;
}

/* Feature card */

.mega-feature {
	position: relative;
	display: flex;
	flex: 0 0 30.32%;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	min-height: 246px;
	padding: 24px;
	overflow: hidden;
	border-radius: var(--radius-lg);
	background-color: var(--c-navy);
	background-image: url("../img/pattern-looper.svg");
	background-repeat: no-repeat;
	background-position: 120px -10px;
	background-size: 453px 453px;
	color: var(--c-white);
}

.mega-feature--dark {
	background-color: var(--c-dark);
	background-image: url("../img/pattern-rings.svg");
	background-position: 120px 0;
	background-size: 369px 369px;
}

.mega-feature--blue {
	background-color: #3854ed;
	background-image: url("../img/pattern-dots.png"), linear-gradient(180deg, #2b47e1 0%, #3854ed 34%, #6e85ff 100%);
	background-position: center bottom, center;
	background-size: 100% auto, cover;
	box-shadow: inset 0 4px 4px rgba(255, 255, 255, 0.25);
}

.mega-feature__text {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 328px;
}

.mega-feature__eyebrow {
	color: #cfe6ff;
	font-size: 13px;
	font-weight: 500;
	line-height: 18px;
}

.mega-feature__title {
	font-size: 20px;
	font-weight: 600;
	line-height: 28px;
}

/* Strip under the panel */

.mega-strip {
	background: #f7f8fd;
}

.mega-strip__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-block: 14px;
}

.mega-strip__note {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--c-body);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
}

.mega-strip__note .icon {
	color: var(--c-blue);
}

.mega-strip__link {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 6px;
	color: var(--c-blue);
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
	text-decoration: none;
}

.mega-strip__link:hover .icon {
	transform: translateX(3px);
}

.mega-strip__link .icon {
	transition: transform 0.15s ease;
}

/* Scrim behind an open panel */

.mega-scrim {
	position: fixed;
	inset: 0;
	z-index: 90;
	background: rgba(16, 24, 40, 0.45);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.mega-open .mega-scrim {
	opacity: 1;
	pointer-events: auto;
}

/* Transparent header over a dark hero (homepage design) */

.has-transparent-header .site-header {
	position: fixed;
	inset-inline: 0;
}

.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) {
	border-bottom-color: transparent;
	background: transparent;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .site-logo__img--color {
	display: none;
}

.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .site-logo__img--white {
	display: block;
}

.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .primary-nav__link,
.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .nav-toggle {
	color: var(--c-white);
}

.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .site-header__cta {
	background: var(--c-white);
	color: #1f1f2b;
	box-shadow: var(--shadow-lg), inset 0 -3px 3px rgba(132, 132, 132, 0.28);
}

.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .site-header__cta::before {
	display: none;
}

/* The bar keeps the standard content width, so nothing shifts when the header turns solid on scroll. */
@media (min-width: 1100px) {
	.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .primary-nav__item.is-current > .primary-nav__link::after {
		background: var(--c-white);
	}
}

/* Mobile menu (full-screen drawer with accordion) */

.mobile-menu {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	flex-direction: column;
	background: var(--c-white);
	/*
	 * Closed: off to the right, where the menu button is. theme.js adds is-open to slide
	 * it in and removes it to send it back the same way, a little quicker.
	 */
	opacity: 0;
	transform: translateX(100%);
	transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

.mobile-menu.is-open {
	opacity: 1;
	transform: none;
	transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

/* The links arrive just behind the panel, one after another. */
.mobile-menu__list > li,
.mobile-menu__actions {
	opacity: 0;
	transform: translateX(16px);
}

.mobile-menu.is-open .mobile-menu__list > li,
.mobile-menu.is-open .mobile-menu__actions {
	opacity: 1;
	transform: none;
	transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1), transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
	transition-delay: calc(0.1s + var(--i, 0) * 0.04s);
}

.mobile-menu.is-open .mobile-menu__list > li:nth-child(2) { --i: 1; }
.mobile-menu.is-open .mobile-menu__list > li:nth-child(3) { --i: 2; }
.mobile-menu.is-open .mobile-menu__list > li:nth-child(4) { --i: 3; }
.mobile-menu.is-open .mobile-menu__list > li:nth-child(5) { --i: 4; }
.mobile-menu.is-open .mobile-menu__list > li:nth-child(6) { --i: 5; }
.mobile-menu.is-open .mobile-menu__list > li:nth-child(n + 7) { --i: 6; }
.mobile-menu.is-open .mobile-menu__actions { --i: 7; }

.mobile-menu__bar {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	height: 60px;
	padding-inline: 20px;
	border-bottom: 1px solid #e6e8f2;
}

.mobile-menu__nav {
	flex: 1;
	overflow-y: auto;
	padding: 4px 20px 12px;
	overscroll-behavior: contain;
}

.mobile-menu__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mobile-item {
	border-bottom: 1px solid var(--c-line-strong);
}

.mobile-item__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	min-height: 58px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--c-ink);
	font-family: inherit;
	font-size: 18px;
	font-weight: 500;
	line-height: 26px;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.mobile-item__row .icon {
	color: var(--c-mute);
	transition: transform 0.2s ease;
}

.mobile-item__row[aria-expanded="true"] {
	color: var(--c-blue);
}

.mobile-item__row[aria-expanded="true"] .icon {
	color: var(--c-blue);
	transform: rotate(180deg);
}

/*
 * A sub menu opens by growing to its own height (0fr -> 1fr needs no measuring) while
 * its content fades in; it closes the same way. theme.js adds is-open and keeps the
 * closed ones hidden, so their links cannot be reached with the Tab key.
 */
.mobile-item__sub {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.3s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-item__sub[hidden] {
	display: none;
}

.mobile-item__sub.is-open {
	grid-template-rows: 1fr;
}

.mobile-item__sub-inner {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.mobile-item__sub.is-open .mobile-item__sub-inner {
	opacity: 1;
	transition-delay: 0.08s;
}

/* The space under an open sub menu is part of what grows. */
.mobile-item__sub-inner::after {
	content: "";
	flex: none;
	height: 4px;
}

.mobile-item__sub .mega-col {
	flex: none;
}

.mobile-item__sub .mega-col__title {
	padding-left: 0;
}

.mobile-item__sub .mega-col--list .mega-item {
	gap: 12px;
	padding: 10px 0;
	border-radius: 0;
	background: none;
}

.mobile-item__sub .mega-col--list .mega-item__tile {
	width: 40px;
	height: 40px;
	background: var(--c-tile);
}

.mobile-item__sub .mega-col--list .mega-item__title {
	font-size: 15px;
	line-height: 20px;
}

.mobile-item__sub .mega-col--list .mega-item__desc {
	font-size: 13px;
	line-height: 18px;
}

.mobile-item__sub .mega-col--list .mega-item__arrow {
	display: none;
}

.mobile-item__sub .mega-col--cards .mega-item {
	min-height: 0;
	padding: 14px;
}

.mobile-item__sub .mega-col--cards .mega-item__tile {
	width: 44px;
	height: 44px;
}

.mobile-item__sub .mega-col--cards .mega-item__title {
	font-size: 16px;
	line-height: 22px;
}

.mobile-item__sub .mega-col--cards .mega-item__desc {
	font-size: 13px;
	line-height: 18px;
}

.mobile-item__sub .mega-post {
	padding: 8px 0;
	border-radius: 0;
	background: none;
}

.mobile-item__all {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 6px;
	color: var(--c-blue);
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
	text-decoration: none;
}

.mobile-menu__actions {
	flex: none;
	padding: 16px 20px 28px;
	border-top: 1px solid var(--c-line-strong);
	background: var(--c-white);
}

@media (min-width: 1100px) {
	.mobile-menu {
		display: none;
	}
}

/*
 * Language switcher: EN | ID. On desktop it sits in the bar before the button
 * ("bar", with a globe); below 1100px a smaller one sits next to the menu button
 * ("compact"), and the mobile menu has one with the full names ("menu").
 */

.lang-switch {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 2px;
}

.lang-switch__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	color: var(--c-mute);
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.lang-switch__item:hover {
	color: var(--c-ink);
}

.lang-switch__item:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}

.lang-switch__item.is-active {
	background: var(--c-white);
	color: var(--c-ink);
	box-shadow: 0 1px 2px rgba(30, 32, 54, 0.12), 0 0 0 1px rgba(30, 32, 54, 0.06);
}

.lang-switch--bar,
.lang-switch--compact {
	padding: 3px;
	border-radius: 999px;
	background: var(--c-tile);
}

.lang-switch--bar .lang-switch__item,
.lang-switch--compact .lang-switch__item {
	min-width: 32px;
	height: 26px;
	padding: 0 8px;
	font-size: 12px;
	letter-spacing: 0.04em;
}

.lang-switch__icon {
	flex: none;
	margin: 0 4px 0 6px;
	color: var(--c-mute);
}

.lang-switch--compact {
	margin-left: auto;
}

@media (min-width: 1100px) {
	.lang-switch--compact {
		display: none;
	}
}

/* Mobile menu: two halves above the button. */
.lang-switch--menu {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin-bottom: 12px;
	padding: 4px;
	border-radius: 12px;
	background: var(--c-tile);
}

.lang-switch--menu .lang-switch__item {
	height: 40px;
	border-radius: 9px;
	font-size: 14px;
}

/* Over a dark hero (transparent header) the switcher turns light. */
.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .lang-switch--bar,
.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .lang-switch--compact {
	background: rgba(255, 255, 255, 0.14);
}

.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .lang-switch__icon,
.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .lang-switch__item {
	color: rgba(255, 255, 255, 0.78);
}

.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .lang-switch__item:hover {
	color: var(--c-white);
}

.has-transparent-header .site-header:not(.is-scrolled):not(.is-mega-open) .lang-switch__item.is-active {
	background: var(--c-white);
	color: var(--c-ink);
}
