/* Green header that runs into the photos of the front page, chosen 2026-11-18.
   Loaded after pme-design.css. Removing the file, or returning false from the filter pme_green_header, gives the white header back. */

.site-header,
.woocommerce-active .site-header {
	background: var(--pme-green) !important;
	box-shadow: none;
	color: var(--pme-white);
}

/* the black logo and the coloured social icons become white */
.pme-header__logo img,
.pme-social a[href*="instagram"] img {
	filter: brightness(0) invert(1);
}

/* the white facebook logo keeps the f cut out, a filter would make it a white dot */
.pme-social a[href*="facebook"] img {
	content: url('../pictures/Facebook_Logo_Secondary.png');
}

.pme-social a { opacity: 0.9; }
.pme-social a:hover { opacity: 1; }

/* menu */
.pme-menu > li > a { color: var(--pme-white); }

.pme-menu > li > a:hover,
.pme-menu > li.current-menu-item > a,
.pme-menu > li.current-menu-ancestor > a {
	color: var(--pme-white);
	box-shadow: inset 0 -3px 0 var(--pme-orange);
}

/* the drop down menus stay white, so the dark text is kept */
.pme-menu .sub-menu a { color: var(--pme-black); }

/* search: a white field on the green */
.pme-search .search-field {
	border-color: var(--pme-white);
	color: var(--pme-black);
}

.pme-search .search-field:focus {
	outline: 2px solid var(--pme-orange);
	outline-offset: 1px;
}

/* language */
.pme-lang--header summary {
	border-color: rgba(255, 255, 255, 0.4);
	color: var(--pme-white);
}

.pme-lang--header summary:hover { background: rgba(255, 255, 255, 0.12); }
.pme-lang--header .pme-lang__flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }

/* account and cart */
.pme-header__account,
.pme-cart { color: var(--pme-white); }

.pme-header__account:hover,
.pme-cart:hover { color: var(--pme-white); opacity: 0.85; }

.pme-cart__tax,
.pme-tax-suffix { color: var(--pme-green-tint); }

/* the number in the cart is the only orange spot besides the shipping bar */
.pme-cart__count {
	background: var(--pme-orange);
	color: var(--pme-black);
}

/* Privat / Företag */
.pme-mode { border-color: var(--pme-white); }

.pme-mode a,
.pme-mode span { color: var(--pme-white); }

.pme-mode a:hover { background: rgba(255, 255, 255, 0.12); color: var(--pme-white); }

.pme-mode .is-active {
	background: var(--pme-white);
	color: var(--pme-green);
}

/* free shipping */
.pme-ship__inner { color: var(--pme-white); }
.pme-ship strong { color: var(--pme-orange); }
.pme-ship__track { background: rgba(255, 255, 255, 0.22); }

/* who a visitor supports from a sales link: white on the green and the photos, the team and the amount stay orange */
.pme-supporting {
	color: var(--pme-white);
	text-shadow: 0 1px 8px rgba(0, 30, 16, 0.5);
}

/* the menu button on phones */
.pme-header__toggle {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.5);
	color: var(--pme-white);
}

.pme-header__toggle:hover,
.pme-header__toggle[aria-expanded="true"] {
	background: rgba(255, 255, 255, 0.12);
	border-color: var(--pme-white);
	color: var(--pme-white);
}

@media (max-width: 782px) {
	.pme-lang--menu { border-bottom-color: rgba(255, 255, 255, 0.2); }
	.pme-lang--menu .pme-lang__item { color: var(--pme-white); }
	.pme-lang--menu .pme-lang__item.is-current { border-color: var(--pme-orange); }
	.pme-menu .sub-menu { background: transparent; }
	.pme-menu .sub-menu a { color: rgba(255, 255, 255, 0.85); }
	.pme-menu .sub-menu a:hover { background: transparent; color: var(--pme-white); }
}


/* Pages that open with a photo: the photo runs up behind the header and BRG green fades in from the top down.
   pme-design.php sets --pme-header-h to the height of the header, and pme-scrolled once the page is scrolled. */
body:has(.pme-hero, .pme-page-head.has-photo, .pme-salj__hero) .site-header {
	background: transparent !important;
	transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

/* a guess of the height until the script has measured it, so the page does not jump */
:root { --pme-header-h: 128px; }
@media (max-width: 1240px) { :root { --pme-header-h: 150px; } }
@media (max-width: 782px) { :root { --pme-header-h: 178px; } }

/* scrolled down the header is solid again, the content under it is white, and the open menu on phones needs it too */
body.pme-scrolled:has(.pme-hero, .pme-page-head.has-photo, .pme-salj__hero) .site-header,
body:has(.pme-hero, .pme-page-head.has-photo, .pme-salj__hero) .site-header:has(.pme-header__nav.is-open) {
	background: var(--pme-green) !important;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
}

.pme-hero,
.pme-page-head.has-photo,
.pme-salj__hero {
	margin-top: calc(-1 * var(--pme-header-h, 0px));
}

/* BRG at the top behind the header, the photo shows more further down */
.pme-hero__photos::after,
.pme-page-head.has-photo,
.pme-page-head--product.has-photo,
.pme-salj__hero {
	--pme-fade: linear-gradient(180deg, rgba(0, 66, 37, 1) 0%, rgba(0, 66, 37, 0.9) 22%, rgba(0, 66, 37, 0.62) 62%, rgba(0, 66, 37, 0.45) 100%);
}

.pme-hero__photos::after { background: var(--pme-fade); }

.pme-page-head.has-photo,
.pme-page-head--product.has-photo {
	padding-top: calc(64px + var(--pme-header-h, 0px));
	background: var(--pme-fade), var(--pme-photo) center 45% / cover no-repeat, var(--pme-green);
}

.pme-hero__inner { padding-top: calc(56px + var(--pme-header-h, 0px)); }

/* Sälj med oss: the same fade over its own photo, the header height is added so the text keeps its place */
.pme-salj__hero {
	min-height: calc(560px + var(--pme-header-h, 0px));
	padding-top: var(--pme-header-h, 0px);
	box-sizing: border-box;
}
.pme-salj__hero:before { background: var(--pme-fade); }

/* the white text keeps its contrast where the photo is light */
.pme-hero h1, .pme-hero p,
.pme-page-head.has-photo h1, .pme-page-head.has-photo p,
.pme-salj__hero h1, .pme-salj__hero p { text-shadow: 0 1px 12px rgba(0, 30, 16, 0.45); }

/* the colour of the product moves from the top to the bottom of the green, the photo now starts at the top */
.pme-page-head--product.has-band {
	border-top: 0;
	border-bottom: 10px solid var(--pme-band);
}

@media (max-width: 782px) {
	.pme-hero__photos::after { background: var(--pme-fade); }

	.pme-page-head.has-photo,
	.pme-page-head--product.has-photo {
		padding-top: calc(44px + var(--pme-header-h, 0px));
		background: var(--pme-fade), var(--pme-photo) center / cover no-repeat, var(--pme-green);
	}

	.pme-hero__inner { padding-top: calc(40px + var(--pme-header-h, 0px)); }

	.pme-salj__hero { min-height: 0; }
}

/* the admin bar adds its own space above the head, the header height already covers it */
@media (min-width: 783px) {
	.admin-bar .pme-page-head.has-photo { padding-top: calc(64px + var(--pme-header-h, 0px)); }
}
