/*
 * DINLEEY shared site shell.
 *
 * Header, navigation, footer, language controls and their responsive behavior
 * live in the theme so all four language sites update together.
 */

header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 10000;
	isolation: isolate;
}

body.admin-bar header.wp-block-template-part {
	top: 32px;
}

.dly-header {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	background: #eaebe7 !important;
	transition:
		background-color .2s ease,
		border-color .2s ease,
		box-shadow .2s ease;
}

.dly-header-inner {
	box-sizing: border-box;
	min-height: 72px;
	padding-top: .5rem !important;
	padding-bottom: .5rem !important;
	gap: clamp(.65rem, 1.4vw, 1.2rem);
}

.dly-brand {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 7px;
	min-height: 44px;
	color: #0f2330;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: .12em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.dly-brand img {
	display: block;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	transition: filter .2s ease;
}

/*
 * Shared scroll state for every language site.
 *
 * JavaScript adds .is-scrolled after the page moves away from the top. The
 * desktop/tablet navigation becomes the same deep navy as the footer; dropdowns and the open mobile
 * menu remain white for readability.
 */
.dly-header.is-scrolled {
	border-color: rgba(255, 255, 255, .18);
	background: #0b1f33 !important;
	box-shadow: 0 10px 28px rgba(11, 31, 51, .18);
}

.dly-header.is-scrolled :where(
	.dly-brand,
	.wp-block-navigation-item__content,
	.wp-block-navigation__submenu-icon,
	.wp-block-navigation__responsive-container-open,
	.dly-language-switcher
) {
	color: #fff !important;
}

.dly-header.is-scrolled .dly-brand img {
	filter: brightness(0) invert(1);
}

.dly-header.is-scrolled .dly-language-switcher summary {
	border-color: rgba(255, 255, 255, .55);
}

.dly-header.is-scrolled .dly-language-switcher summary:hover,
.dly-header.is-scrolled .dly-language-switcher summary:focus-visible {
	border-color: #fff;
}

.dly-header.is-scrolled
	.wp-block-navigation__submenu-container
	.wp-block-navigation-item__content {
	color: #0b1f33 !important;
}

.dly-header.is-scrolled
	.wp-block-navigation__submenu-container
	.wp-block-navigation-item__content:hover,
.dly-header.is-scrolled
	.wp-block-navigation__submenu-container
	.wp-block-navigation-item__content:focus-visible {
	color: #0b1f33 !important;
}

.dly-language-switcher {
	position: relative;
	z-index: 40;
	flex: 0 0 auto;
	margin: 0;
	color: #0b1f33;
	font-size: .875rem;
	line-height: 1.25;
}

.dly-language-switcher summary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	min-height: 44px;
	box-sizing: border-box;
	padding: .55rem .65rem;
	border: 1px solid #cbd2d6;
	background: transparent;
	cursor: pointer;
	list-style: none;
	font-weight: 650;
}

.dly-language-switcher summary::-webkit-details-marker {
	display: none;
}

.dly-language-switcher summary::after {
	content: "";
	width: .45rem;
	height: .45rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-.1rem) rotate(45deg);
}

.dly-language-switcher[open] summary::after {
	transform: translateY(.1rem) rotate(225deg);
}

.dly-language-switcher summary:hover,
.dly-language-switcher summary:focus-visible {
	border-color: #0b1f33;
	outline: none;
}

.dly-language-switcher__list {
	position: absolute;
	top: calc(100% + .35rem);
	right: 0;
	min-width: 10.5rem;
	margin: 0;
	padding: .4rem;
	border: 1px solid #d9dee2;
	background: #fff;
	box-shadow: 0 18px 40px rgba(15, 35, 48, .14);
	list-style: none;
}

.dly-language-switcher__list li {
	margin: 0;
	padding: 0;
}

.dly-language-switcher__list a,
.dly-language-switcher__list span {
	display: block;
	box-sizing: border-box;
	width: 100%;
	padding: .62rem .7rem;
	color: #0b1f33;
	text-decoration: none;
	white-space: nowrap;
}

.dly-language-switcher__list a:hover,
.dly-language-switcher__list a:focus-visible {
	background: #f2f4f5;
	color: #0b1f33;
	outline: none;
}

.dly-language-switcher__list .is-current {
	background: #f2f4f5;
	font-weight: 700;
}

.dly-language-switcher__list .is-unavailable {
	color: #6f7b82;
	cursor: not-allowed;
	opacity: .65;
}

.dly-footer-brand {
	margin-top: 0;
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: .12em;
}

.dly-footer-brand a {
	color: #fff;
	text-decoration: none;
}

.dly-footer-external {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.dly-footer-external a {
	color: #f6f5f1;
	text-decoration: none;
}

.dly-footer-external a:hover,
.dly-footer-external a:focus-visible {
	color: #fff;
	text-decoration: underline;
}

body.dly-site-language-ko-kr :where(h1, h2, h3, p, li, .wp-block-button__link) {
	word-break: keep-all;
	overflow-wrap: break-word;
}

body.dly-site-language-ja-jp :where(h1, h2, h3, p, li, .wp-block-button__link) {
	line-break: strict;
	overflow-wrap: break-word;
}

body.dly-site-language-de-de :where(h1, h2, h3, p, li, .wp-block-button__link) {
	hyphens: auto;
	overflow-wrap: break-word;
}

body.dly-site-language-de-de :where(h1, h2) {
	-webkit-hyphens: none;
	hyphens: none;
	overflow-wrap: normal;
	word-break: normal;
}

@media (max-width: 1180px) {
	.dly-header-inner {
		min-height: 60px;
	}

	.dly-header .wp-block-navigation {
		font-size: .95rem;
	}

	.dly-header .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none;
	}

	.dly-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.dly-header :is(
		.wp-block-navigation__responsive-container-open,
		.wp-block-navigation__responsive-container-close
	) {
		align-items: center;
		justify-content: center;
		min-width: 44px;
		min-height: 44px;
	}

	.dly-header .wp-block-navigation__responsive-container.is-menu-open {
		padding: 1.5rem;
		background: #fff;
		color: #0b1f33;
	}

	.dly-header .wp-block-navigation__responsive-container.is-menu-open
		:is(.wp-block-navigation__responsive-container-content, .wp-block-navigation__container) {
		align-items: flex-start;
		width: 100%;
		gap: .25rem;
	}

	.dly-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
		width: 100%;
	}

	.dly-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		box-sizing: border-box;
		width: 100%;
		padding: .7rem 0;
	}

	.dly-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
		min-width: 0 !important;
		width: 100% !important;
		padding: .25rem 0 .5rem 1rem !important;
		border: 0 !important;
		box-shadow: none;
	}

	.dly-header.is-scrolled
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-item__content {
		color: #0b1f33 !important;
	}

	.dly-header.is-scrolled
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__responsive-container-close {
		color: #0b1f33 !important;
	}
}

@media (max-width: 782px) {
	body.admin-bar header.wp-block-template-part {
		top: 46px;
	}

	.dly-header-inner {
		min-height: 56px;
		padding-top: .375rem !important;
		padding-bottom: .375rem !important;
	}
}

@media (max-width: 640px) {
	body.dly-site-language-de-de :where(h1, h2) {
		-webkit-hyphens: auto;
		hyphens: auto;
		overflow-wrap: break-word;
	}

	.dly-header-inner {
		gap: .5rem;
	}

	.dly-brand {
		gap: 6px;
		font-size: 20px;
	}

	.dly-brand img {
		flex-basis: 18px;
		width: 18px;
		height: 18px;
	}

	.dly-language-switcher summary {
		min-width: 44px;
		padding-right: .55rem;
		padding-left: .55rem;
	}

	.dly-language-switcher__list {
		min-width: 9.75rem;
	}
}
