/*
 * Dini 10 — Header.
 *
 * Visual states (classes set by header.js on header.dh):
 *   default        black bar, white text, light logo (inner pages / scrolled)
 *   .is-at-top     with .dh--overlay: transparent over the hero, at page top
 *   .is-light      white bar, black text, dark logo — mouse over the header,
 *                  a mega panel, the search box or a drop-down is open
 *   .is-scrolled   compact heights after scrolling
 *   .is-top-hidden top bar slid away (scrolling down)
 * Measures follow the source design; see docs/developer-guide.md §5 Header.
 */

.dh {
	--dh-top-h: 36px;
	--dh-main-h: 104px;
	--dh-logo-h: 60px;
	--dh-fg: #fff;
	--dh-bg: var(--dini-black);
	--dh-top-fg: var(--dini-black);
	--dh-top-bg: var(--dini-white);

	position: fixed;
	inset: 0 0 auto;
	z-index: 1000;
	font-family: var(--dini-font);
	transition: transform var(--dini-ease);
}
.dh:not(.dh--sticky) { position: absolute; }
.dh.is-scrolled { --dh-main-h: 70px; --dh-logo-h: 44px; }
.dh.is-top-hidden { transform: translateY(calc(-1 * var(--dh-top-h))); }
.dh--no-top.is-top-hidden { transform: none; }

.dh--overlay.is-at-top { --dh-bg: transparent; }
.dh.is-light {
	--dh-fg: var(--dini-black);
	--dh-bg: var(--dini-white);
	--dh-top-fg: var(--dini-white);
	--dh-top-bg: var(--dini-black);
}

.dh ul { list-style: none; margin: 0; padding: 0; }
.dh a { color: inherit; text-decoration: none; }
.dh button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

/* ---------------------------------------------------------------- */
/* Top bar                                                           */
/* ---------------------------------------------------------------- */

.dh-top {
	height: var(--dh-top-h);
	background: var(--dh-top-bg);
	color: var(--dh-top-fg);
	font-size: 13px;
	transition: background var(--dini-ease), color var(--dini-ease);
}
.dh-top-in { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.dh-top-nav { display: flex; align-items: center; gap: 26px; height: 100%; }
.dh-tl { position: relative; height: 100%; display: flex; align-items: center; }
.dh-tl-link { display: inline-flex; align-items: center; gap: 4px; height: 100%; white-space: nowrap; }
.dh-tl-link:hover { color: var(--dini-green); }
.dh-chev { width: 12px; height: 12px; stroke-width: 2.2; transition: transform var(--dini-ease); }
.dh-tl.is-open .dh-chev, .dh-lang.is-open .dh-chev { transform: rotate(180deg); }

/* Small drop-downs (top bar items and language). */
.dh-dd {
	position: absolute;
	top: 100%;
	inset-inline-start: -12px;
	min-width: 190px;
	padding: 8px !important;
	background: var(--dini-white);
	color: var(--dini-black);
	border-radius: var(--dini-radius);
	box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .2s, transform .2s, visibility .2s;
	z-index: 5;
}
.dh-dd a { display: block; padding: 8px 12px; border-radius: 6px; font-size: 13.5px; white-space: nowrap; }
.dh-dd a:hover, .dh-dd a[aria-current] { background: var(--dini-mint); color: var(--dini-black); }
.dh-dd a[aria-current] { font-weight: 600; }
.dh-tl.is-open > .dh-dd,
.dh-lang.is-open > .dh-dd { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) {
	.dh-tl.has-sub:hover > .dh-dd,
	.dh-lang:hover > .dh-dd { opacity: 1; visibility: visible; transform: none; }
}

.dh-lang { position: relative; height: 100%; display: flex; align-items: center; }
.dh-lang-btn { display: inline-flex; align-items: center; gap: 5px; height: 100%; }
.dh-lang-btn:hover { color: var(--dini-green); }
.dh-globe { width: 14px; height: 14px; stroke-width: 1.7; }
.dh-lang-code { font-weight: 500; letter-spacing: .02em; }

/* ---------------------------------------------------------------- */
/* Main bar                                                          */
/* ---------------------------------------------------------------- */

.dh-main {
	position: relative;
	background: var(--dh-bg);
	color: var(--dh-fg);
	transition: background var(--dini-ease), color var(--dini-ease);
}
/* Soft shade behind white text while the header floats over the hero. */
.dh--overlay.is-at-top:not(.is-light) .dh-main::before {
	content: "";
	position: absolute;
	inset: 0 0 -70px;
	background: linear-gradient(rgba(0, 0, 0, .42), rgba(0, 0, 0, 0));
	pointer-events: none;
}
.dh-main-in {
	position: relative;
	height: var(--dh-main-h);
	display: flex;
	align-items: center;
	gap: 24px;
	transition: height var(--dini-ease);
}

.dh-logo { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; }
.dh-logo-img { height: var(--dh-logo-h); width: auto; transition: height var(--dini-ease); }
.dh-logo-dark { display: none; }
.dh.is-light .dh-logo-light { display: none; }
.dh.is-light .dh-logo-dark { display: block; }
.dh-logo-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.dh-logo-text strong { font-size: 17px; font-weight: 700; white-space: nowrap; }
.dh-logo-text span { font-size: 12px; opacity: .82; white-space: nowrap; }
.dh.is-scrolled .dh-logo-text strong { font-size: 15px; }

.dh-nav { margin-inline-start: auto; }
.dh-menu { display: flex; align-items: center; gap: clamp(14px, 2vw, 34px); }
.dh-item { position: static; }
.dh-link {
	position: relative;
	display: inline-block;
	padding: 10px 0;
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
}
.dh-link::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: 4px;
	height: 2px;
	background: var(--dini-green);
	transform: scaleX(0);
	transition: transform var(--dini-ease);
}
.dh-item:hover > .dh-link::after,
.dh-item.is-open > .dh-link::after,
.dh-link:focus-visible::after { transform: scaleX(1); }

.dh-actions { display: flex; align-items: center; gap: 18px; }
.dh-icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; }
.dh-icon-btn .dini-icon { width: 22px; height: 22px; stroke-width: 2; }
.dh-icon-btn:hover { color: var(--dini-green); }

.dh-cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 44px;
	padding-inline: 16px 12px;
	border-radius: var(--dini-radius);
	background: var(--dini-green);
	color: var(--dini-black) !important;
	font-size: 14.5px;
	font-weight: 600;
	white-space: nowrap;
	transition: background var(--dini-ease);
}
.dh-cta:hover { background: var(--dini-green-dark); }
.dh-cta-icon {
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--dini-black);
	color: var(--dini-white);
}
.dh-cta-icon .dini-icon { width: 12px; height: 12px; stroke-width: 2.6; }

.dh-burger, .dh-lang--main { display: none; }

/* ---------------------------------------------------------------- */
/* Mega panel                                                        */
/* ---------------------------------------------------------------- */

.dh-mega {
	position: absolute;
	top: 100%;
	inset-inline: 0;
	background: rgba(255, 255, 255, .93);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	color: var(--dini-black);
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity .22s, transform .22s, visibility .22s;
}
.dh-item.is-open > .dh-mega { opacity: 1; visibility: visible; transform: none; }

.dh-mega-in {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, .95fr);
	padding-block: 44px 30px;
	min-height: 360px;
}
.dh-mega-in > * { padding-inline: 0 36px; }
.dh-mega-in > * + * { border-inline-start: 1px solid #cfcfcf; }
.dh-mega-intro { padding-inline-end: 48px; }
.dh-mega-title { margin: 0 0 14px; font-size: clamp(26px, 2.4vw, 36px); font-weight: 600; line-height: 1.25; }
.dh-mega-desc { margin: 0; font-size: 14.5px; line-height: 1.9; color: #2b2b2b; max-width: 440px; }

.dh-mega-groups { padding-inline: 0 !important; }
.dh-group {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-block: 18px;
	padding-inline: 52px 36px;
	font-size: 16px;
	font-weight: 600;
	transition: background .18s;
}
.dh-group.is-active, .dh-group:hover { background: rgba(0, 195, 137, .14); }
.dh-arrow {
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--dini-green);
	color: var(--dini-black);
	flex-shrink: 0;
}
.dh-arrow .dini-icon { width: 13px; height: 13px; stroke-width: 2.6; }

.dh-mega-links { padding-inline: 40px 8px !important; }
.dh-links {
	display: none !important;
	max-height: 330px;
	overflow-y: auto;
	padding-inline-end: 20px !important;
	scrollbar-width: thin;
	scrollbar-color: var(--dini-green) #e6e6e6;
}
.dh-links.is-active { display: grid !important; gap: 14px; align-content: start; }
.dh-links a { font-size: 15px; line-height: 1.6; background: linear-gradient(var(--dini-green), var(--dini-green)) 0 100% / 0 1px no-repeat; transition: background-size .25s; }
.dini-rtl .dh-links a { background-position: 100% 100%; }
.dh-links a:hover, .dh-links a:focus-visible { background-size: 100% 1px; }

/* ---------------------------------------------------------------- */
/* Search                                                            */
/* ---------------------------------------------------------------- */

.dh-search { background: var(--dini-white); color: var(--dini-black); box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .4); }
.dh-search-form { display: flex; align-items: center; gap: 12px; padding-block: 22px; }
.dh-search-form input {
	flex: 1;
	height: 54px;
	padding-inline: 18px;
	border: 1.5px solid var(--dini-line);
	border-radius: var(--dini-radius);
	font: inherit;
	font-size: 17px;
	background: #fafafa;
}
.dh-search-form input:focus { outline: none; border-color: var(--dini-green); background: #fff; }
.dh-search-submit, .dh-search-close { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: var(--dini-radius); }
.dh-search-submit { background: var(--dini-green) !important; }
.dh-search-submit .dini-icon, .dh-search-close .dini-icon { width: 22px; height: 22px; }
.dh-search-close:hover { color: var(--dini-green); }

/* ---------------------------------------------------------------- */
/* Mobile drawer                                                     */
/* ---------------------------------------------------------------- */

.dh-drawer {
	position: fixed;
	inset: 0;
	z-index: 1100;
	display: flex;
	flex-direction: column;
	background: var(--dini-white);
	color: var(--dini-black);
	font-family: var(--dini-font);
	animation: dh-fade .2s ease-out;
}
.dh-drawer[hidden] { display: none; }
.dh-drawer ul { list-style: none; margin: 0; padding: 0; }
.dh-drawer a { color: inherit; text-decoration: none; }
.dh-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px var(--dini-gutter);
	border-bottom: 1px solid var(--dini-line);
}
.dh-drawer-head .dh-logo-light { display: none; }
.dh-drawer-head .dh-logo-dark { display: block; height: 44px; }
.dh-drawer-head .dh-logo-text strong { font-size: 14px; }
.dh-drawer-head .dh-logo-text span { font-size: 11px; }
.dh-drawer-close { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; color: inherit; }
.dh-drawer-close .dini-icon { width: 26px; height: 26px; stroke-width: 1.6; }

.dh-drawer-nav {
	flex: 1;
	overflow-y: auto;
	padding: 18px var(--dini-gutter);
	scrollbar-width: thin;
	scrollbar-color: var(--dini-green) #e6e6e6;
}
.dh-dr-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 0;
	font-size: 22px;
	font-weight: 500;
	cursor: pointer;
	list-style: none;
}
.dh-dr-link--small { font-size: 18px; color: #333; }
.dh-dr summary::-webkit-details-marker { display: none; }
.dh-dr summary { list-style: none; }
.dh-dr .dh-chev { width: 16px; height: 16px; }
.dh-dr[open] > summary .dh-chev { transform: rotate(180deg); }
.dh-dr-sub { padding-inline-start: 14px !important; border-inline-start: 2px solid var(--dini-green); margin-bottom: 8px !important; }
.dh-dr-group { display: flex; align-items: center; gap: 8px; padding: 10px 0; font-size: 17px; font-weight: 600; cursor: pointer; }
.dh-dr-links { padding: 0 0 8px !important; padding-inline-start: 12px !important; }
.dh-dr-links a { display: block; padding: 7px 0; font-size: 15.5px; color: #444; }
.dh-dr-links a:hover { color: var(--dini-green-dark); }
.dh-cta--drawer {
	justify-content: space-between;
	margin: 12px var(--dini-gutter) 22px;
	height: 52px;
	padding-inline: 18px 14px;
	font-size: 16px;
}

body.dh-lock { overflow: hidden; }

@keyframes dh-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- */
/* Responsive                                                        */
/* ---------------------------------------------------------------- */

@media (max-width: 1280px) {
	.dh-logo-text span { display: none; }
	.dh-link { font-size: 14px; }
}

@media (max-width: 1180px) {
	.dh { --dh-main-h: 78px; --dh-logo-h: 46px; }
	.dh.is-scrolled { --dh-main-h: 64px; --dh-logo-h: 40px; }
	.dh-top, .dh-nav, .dh-cta--bar { display: none; }
	.dh.is-top-hidden { transform: none; }
	.dh-actions { margin-inline-start: auto; gap: 10px; }
	.dh-lang--main { display: flex; }
	.dh-lang--main .dh-lang-btn { font-size: 15px; gap: 6px; }
	.dh-lang--main .dh-dd { inset-inline-start: auto; inset-inline-end: -8px; }
	.dh-burger {
		display: inline-grid;
		place-items: center;
		width: 44px;
		height: 44px;
		border-radius: 50%;
		background: var(--dini-green) !important;
		color: var(--dini-black) !important;
	}
	.dh-burger .dini-icon { width: 22px; height: 22px; }
	.dh-logo-text strong { font-size: 14px; }
	.dh-logo-text span { display: block; font-size: 11px; }
}

@media (max-width: 520px) {
	.dh-logo-text span { display: none; }
	.dh-logo-text strong { white-space: normal; max-width: 9em; line-height: 1.3; }
	.dh-actions { gap: 4px; }
}
