/*
 *
 * @info Site header and menu (snippets/site/header.php)
 * @path assets/css/snippets/header.css
 *
 */

 
/*--------------------*/

 #siteHeader { 
  /* overflow: hidden; */
	/* position: sticky; */
	/* top: 0; */
	overflow-x: hidden;
 }
 

/*--------------------*/
 

/* [data-has-js][data-template-intended="home"] #siteTitle span:nth-of-type(6) {
  opacity: 0;
} */

#siteTitle { 

	--font-size: var(--font-size-2);
	--grid-column: v-start / v-end;
	
	text-align: center;
	color: var(--color-interactive);
	text-transform: uppercase;
	user-select: none;
	font-weight: 400;
	display: block;
	max-height: 10ch;
	overflow: hidden;
	padding-block-start: var(--space-m);
	padding-block-end: var(--space-m);

	
	a {
		text-decoration: none;
		/* transition: all 125ms ease-in-out; */
	}
	
	span:nth-of-type(1) {
		/* line-height:1; */
		&::after {
			content: "";
			background-color: var(--color-accent);
			width: .2ch;
			height: 2.2ch;
			margin-inline: .5ch;
			top: 1ch;
			display: inline-block;
			position: relative;
		}
	}

	span:nth-of-type(2),
	span:nth-of-type(4) {
	display: none;
	}
 
	span:nth-of-type(5) {
		/* font-weight: 400; */
		&::before {
			content: "";
			background-color: var(--color-accent);
			width: .2ch;
			height: 2.2ch;
			margin-inline: .5ch;
			top: .01ch;
			display: inline-block;
			position: relative;
		}
	}
 

	span:nth-of-type(6) {
	/* position: absolute; */
	
		transform: scale(.6) rotate(18deg);
		transform-origin: center center;
		color: var(--color-interactive);
		font-weight: 600;
		/* the word at .55 of the title; the offsets below are divided by it,
		   so they stay in the title's ch */
		--tag: .65;
		font-size: calc(var(--tag) * 1em);
		z-index:10;
		display: block;
		position: relative;
		top: calc(-7ch / var(--tag));
		/* width: 10ch; */
		left: calc(15ch / var(--tag));
		padding-block: calc(3ch / var(--tag));
		user-select: none;
		pointer-events: none;

		/* the green star behind the blue word, centred on it and sized to
		   it (em), so they keep their proportion at every width */
		&::before {
			content: "";
			position: absolute;
			z-index: -1;
			inset-block-start: 50%;
			inset-inline-start: 50%;
			width: var(--star-size, 7em);
			aspect-ratio: 1;
			translate: -50% -50%;
			background: url("/assets/images/star.svg") center / contain no-repeat;
		}
	}
 
	/* a:hover {
		filter: opacity(.4) saturate(0);

		span:nth-of-type(6) {
			opacity:0;
		}
	} */
}



/*----------    ----------*/

@media (max-width: 70ch) {

	#siteTitle {
		height: 15ch;
		padding-block: var(--space-xs);
		/* overflow: hidden; */
		position: relative;
		--font-size: var(--font-size-3);
		--grid-column: c-start / c-end;

		&::before {
			content: "";
			display: block;
			/* padding-right: .5ch;
			margin-right: .5ch; */
			border-right: .15ch solid var(--color-accent);
			/* font-size: 120%; */
			position: absolute;
			top: 1ch;
			width: .15ch;
			height: 7ch;
			left: -.5ch;
			background-color: var(--color-accent);
		}
			
		span {
			display: block;
			text-align: left;
		}
		

		span:nth-of-type(1)::after, span:nth-of-type(5)::before {
			display: none;
		}

		span:nth-of-type(6) {
			top: calc(-.5ch / var(--tag));
			/* width: 10ch; */
			left: calc(9ch / var(--tag));
			position: absolute;
			padding-block: calc(4ch / var(--tag));
			padding-inline: calc(2ch / var(--tag));
			text-align: center;
			transform-origin: center center;
		}

	}
}




/*--------------------*/

#siteMenu {
 
	--flex-direction: row;
	--justify-content: space-between;
	--nav-height: 3ch;
	--top-position: 0ch;
  
	background-color: var(--background-color);
	grid-row: 1;
	min-height: var(--nav-height);
	padding-block: var(--space-2xs);
	position:sticky;
	top: var(--top-position);
	z-index:20;
  transition: top 0.6s;
	 

	[data-link-target="index"] a {
		position: relative;
	}
	/* [data-link-target="index"] a:before {
		content: "[+]";
		display: block;
		position: absolute;
		top: calc(var(--font-size-0)*.25);
		left: -1.5ch;
	} */


	li {
		padding-block: .5ch; 
		text-align: center;
		
 	}

	 &.hide:not(:focus-within) {
		--top-position: -100%;
	}
 
 	a {
		user-select: none;
		padding-block: 1ch;
		padding-inline: 1ch;
		font-weight: 600;
		text-decoration: none;
		text-transform: uppercase;
		

	}
 
	a:not([aria-current="page"]) {
		text-decoration: none;
	}
	
	a:not([aria-current="page"]):hover {
		color: var(--color-interactive);
	}

	[aria-current="page"] {
		position: relative;
		&::before {
			content: "";
			height: 1.1ch;
			width: 1.1ch;
			position: absolute;
			left: -1ch;
			top: 1.45ch;
			background-color: var(--color-accent);
			border-radius: 0%;
			display: block;
		}

		&:hover {
			color: var(--color-interactive);
		}
		
	}

	@media (max-width: 90ch) {
		[data-link-target="startseite"], [data-link-target="home"] {
			display: none;
		}
	}

	@media (max-width: 35rem) {

		& {
			justify-content: space-between;
		}

		li {
			text-align: left;
		}

		li:not(:last-child) {
			display: none;
		}
		
		a {
			padding-inline: calc(var(--space-xs) + var(--space-0-m));	
		}

		[aria-current="page"]::before {
			display: none;
			width: 0;
		}

		[data-link-target="index"] a:after {
			content: "Inhalt/Menü";
			display: inline-block;
			/* position: relative; */
			transform: initial;
			font-weight: 600;
			text-transform: uppercase;
		}

		[data-link-target="index"] span {
			display: none;
		}
	}


}
