/* Header and footer (site chrome). Loaded on every page and in the editor. */

/* ---------- Header ---------- */

.dh-header {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1.5rem;
	min-height: var(--wp--custom--header-height);
	padding-inline: var(--wp--custom--gutter);
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--nude);
}

header.wp-block-template-part:has(.dh-header) {
	position: sticky;
	top: 0;
	z-index: 50;
}

.admin-bar header.wp-block-template-part:has(.dh-header) {
	top: var(--wp-admin--admin-bar--height, 0px);
}

.dh-header > *,
.dh-header__end > * {
	margin-block: 0 !important;
}

.dh-header__cta .wp-block-button__link {
	white-space: nowrap;
}

.dh-header__start {
	justify-self: start;
	align-self: stretch;
	padding-inline-end: 1.5rem;
	border-inline-end: 1px solid var(--wp--preset--color--nude);
}

.dh-header__end {
	justify-self: end;
	align-self: stretch;
	gap: 1.5rem;
	padding-inline-start: 1.5rem;
	border-inline-start: 1px solid var(--wp--preset--color--nude);
}

.dh-header__logo {
	--hacker-logo-width: 16.625rem;
	justify-self: center;
}

.dh-header__nav .wp-block-navigation-item__content {
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	text-decoration: none;
}

.dh-header__nav .wp-block-navigation-item__content:hover,
.dh-header__nav .current-menu-item > .wp-block-navigation-item__content,
.dh-header__nav [aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 0.35em;
}

.dh-header__cta .wp-block-button__link {
	padding: 0.8125rem 1rem;
}

/* Mobile navigation: only below the desktop breakpoint. */
.dh-header .dh-header__mobile-nav {
	display: none;
}

.dh-header__mobile-nav .wp-block-navigation__responsive-container-open,
.dh-header__mobile-nav .wp-block-navigation__responsive-container-close {
	width: 2.75rem;
	height: 2.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.dh-header__mobile-nav .wp-block-navigation__responsive-container.is-menu-open {
	/* Figma: the header bar stays visible, the menu opens below it. */
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 3.4375rem);
	padding: 2rem 1.5rem 3rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	border-top: 1px solid var(--wp--preset--color--nude);
}

.dh-header__mobile-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 0;
}

.dh-header__mobile-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 0.25rem;
	align-items: flex-start;
}

.dh-header__mobile-nav .is-menu-open .dh-nav-label > .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--sans) !important;
	font-size: var(--wp--preset--font-size--caps) !important;
	font-weight: 500 !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase !important;
}

.dh-header__mobile-nav .is-menu-open .dh-nav-gap {
	margin-top: 2rem;
}

.dh-header__mobile-nav .is-menu-open .dh-nav-cta {
	margin-top: 2.5rem;
}

.dh-header__mobile-nav .is-menu-open .dh-nav-cta > .wp-block-navigation-item__content {
	padding: 0.75rem 1rem !important;
	border: 1px solid currentColor;
	font-family: var(--wp--preset--font-family--sans) !important;
	font-size: var(--wp--preset--font-size--caps) !important;
	font-weight: 500 !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase !important;
}

/* The close button takes the burger's place in the header bar. Core animates the overlay
   with a transform, which would make position:fixed relative to the overlay; use a plain fade. */
.dh-header__mobile-nav .wp-block-navigation__responsive-container.is-menu-open {
	animation: dh-fade-in 180ms ease both;
	transform: none;
}

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

.dh-header__mobile-nav .is-menu-open .wp-block-navigation__responsive-container-close {
	position: fixed;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 0.34rem);
	right: 1.5rem; /* same inset as the burger it replaces */

	background: var(--wp--preset--color--white);
}

.dh-header__mobile-nav:has(.is-menu-open) .wp-block-navigation__responsive-container-open {
	visibility: hidden;
}

/* Hide the desktop-only CTA duplicate in the overlay on wide screens (overlay is mobile-only anyway). */
.dh-header__mobile-nav:not(:has(.is-menu-open)) .dh-nav-cta {
	display: none;
}

.dh-header__mobile-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 300;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1.2;
	text-decoration: none;
}

@media (max-width: 1023px) {
	.dh-header {
		grid-template-columns: auto 1fr;
		min-height: 3.4375rem;
		padding-inline: 1.5rem;
		gap: 1rem;
	}

	.dh-header .dh-header__start {
		display: none;
	}

	.dh-header__logo {
		--hacker-logo-width: 12.5rem;
		justify-self: start;
		grid-column: 1;
	}

	.dh-header__end {
		grid-column: 2;
		border: 0;
		padding: 0;
		gap: 0.5rem;
	}

	/* Figma mobile shows the short label "Termin"; the full text stays the accessible name. */
	.dh-header__cta .wp-block-button__link {
		padding: 0.625rem 0.75rem;
		font-size: 0;
		letter-spacing: 0;
	}

	.dh-header__cta .wp-block-button__link::before {
		content: "Termin";
		content: "Termin" / "";
		font-size: var(--wp--preset--font-size--caps);
		letter-spacing: 0.1em;
	}

	.dh-header .dh-header__mobile-nav {
		display: flex;
	}
}

@media (max-width: 420px) {
	.dh-header__logo {
		--hacker-logo-width: 10rem;
	}
}

/* ---------- Footer ---------- */

.dh-footer {
	border-top: 1px solid var(--wp--preset--color--ink);
}

.dh-footer > *,
.dh-footer__intro > *,
.dh-footer__grid > *,
.dh-footer__cell > *,
.dh-footer__block > * {
	margin-block: 0 !important;
}

.dh-footer p {
	margin: 0;
}

.dh-footer a {
	text-decoration: none;
}

.dh-footer a:hover {
	text-decoration: underline;
}

.dh-footer__intro {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: end;
	border-bottom: 1px solid var(--wp--preset--color--ink);
}

.dh-footer__claim {
	padding: var(--wp--preset--spacing--80) var(--wp--custom--gutter) var(--wp--preset--spacing--50);
	max-width: 52rem;
}

.dh-footer__mark {
	--hacker-logo-width: 5.625rem;
	padding: var(--wp--preset--spacing--50);
}

.dh-footer__grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	grid-template-rows: auto auto;
	border-bottom: 1px solid var(--wp--preset--color--ink);
}

.dh-footer__cell {
	padding: var(--wp--preset--spacing--50) var(--wp--custom--gutter);
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.dh-footer__cell + .dh-footer__cell {
	border-inline-start: 1px solid var(--wp--preset--color--ink);
}

.dh-footer__hours {
	grid-row: span 2;
	gap: 2rem;
}

.dh-footer__locations {
	gap: 1.5rem;
}

.dh-footer__follow {
	border-top: 1px solid var(--wp--preset--color--ink);
}

.dh-footer__legal {
	border-top: 1px solid var(--wp--preset--color--ink);
}

.dh-footer__times {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
}

.dh-footer__times > p {
	min-width: 12.75rem;
}

.dh-footer__label {
	font-size: var(--wp--preset--font-size--caps) !important;
	margin: 0 !important;
}

.dh-footer__social {
	gap: 0.5rem !important;
}

.dh-footer__social .wp-social-link a {
	padding: 0.5rem;
	margin: -0.5rem;
}

.dh-footer__wordmark {
	padding: var(--wp--preset--spacing--50) var(--wp--custom--gutter);
}

@media (max-width: 781px) {
	.dh-footer__intro {
		grid-template-columns: 1fr;
		align-items: start;
	}

	.dh-footer__claim {
		padding: var(--wp--preset--spacing--70) 1.5rem 1.5rem;
	}

	.dh-footer__mark {
		--hacker-logo-width: 4.4375rem;
		padding: 0 1.5rem 1.5rem;
	}

	.dh-footer__grid {
		grid-template-columns: 1fr 1fr;
	}

	.dh-footer__cell {
		padding: 1.5rem;
	}

	.dh-footer__hours {
		grid-column: 1 / -1;
		grid-row: auto;
		border-bottom: 1px solid var(--wp--preset--color--ink);
	}

	.dh-footer__cell + .dh-footer__cell {
		border-inline-start: 0;
	}

	.dh-footer__contact,
	.dh-footer__legal {
		border-inline-start: 1px solid var(--wp--preset--color--ink) !important;
	}

	.dh-footer__follow {
		grid-row: auto;
		border-top: 1px solid var(--wp--preset--color--ink);
	}

	.dh-footer__wordmark {
		padding: 1.5rem;
	}
}

/* Footer text links: 40px touch targets (phone, mail, legal). */
.dh-footer__cell p a {
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
}

.dh-footer__cell p:has(a) {
	line-height: 1.2;
}
