/**
 * Sector theming (see inc/sectors.php).
 *
 * The original theme uses --lightgreen / --mediumgreen / --darkgreen / --hovergreen
 * and a few hardcoded greens. A "sector-*" class (on <body>, or on a section while a
 * filter is active) remaps those to the palette of that division.
 *
 * Per sector:   accent  = header, accents etc.
 *               tint    = HM on white background
 *               deep    = HM on dark background
 *               dark    = dark background (white text)
 */

:root {
	--hs-corporate-accent: #7EB21A;
	--hs-corporate-dark: #223400;

	--hs-floortex-accent: #39999F;
	--hs-floortex-tint: #D7ECED;
	--hs-floortex-deep: #1E5558;
	--hs-floortex-dark: #092E30;

	--hs-wood-accent: #C29D52;
	--hs-wood-tint: #EDE1C8;
	--hs-wood-deep: #60491F;
	--hs-wood-dark: #30230F;

	--hs-custom-accent: #85B833;
	--hs-custom-tint: #E9F8DA;
	--hs-custom-deep: #2F460E;
	--hs-custom-dark: #1C2B00;

	/* Defaults = corporate (unchanged look) */
	--hs-dark: var(--hs-corporate-dark);
	--hs-deep: #147702;
	--hs-highlight: #2df00b;
	--hs-shape-fill: #93de47;
	--hs-shape-opacity: 0.2;
}

/* ---------------------------------------------------------------------------
 * Palettes
 * The HM background shape is one fixed SVG at reduced opacity over the page;
 * fill + opacity are chosen so it renders as "tint" on white and "deep" on the
 * dark background.
 * ------------------------------------------------------------------------ */

/* Explicit reset, for a corporate section inside a page of another sector */
.sector-corporate {
	--lightgreen: #7EB21A;
	--mediumgreen: #57A002;
	--darkgreen: #147702;
	--hovergreen: #223400;
	--hs-dark: var(--hs-corporate-dark);
	--hs-deep: #147702;
	--hs-highlight: #2df00b;
	--hs-shape-fill: #93de47;
	--hs-shape-opacity: 0.2;
}

.sector-floortex {
	--lightgreen: var(--hs-floortex-accent);
	--mediumgreen: var(--hs-floortex-accent);
	--darkgreen: var(--hs-floortex-accent);
	--hovergreen: var(--hs-floortex-dark);
	--hs-dark: var(--hs-floortex-dark);
	--hs-deep: var(--hs-floortex-deep);
	--hs-highlight: var(--hs-floortex-accent);
	--hs-shape-fill: #60BCC1;
	--hs-shape-opacity: 0.27;
}

.sector-wood {
	--lightgreen: var(--hs-wood-accent);
	--mediumgreen: var(--hs-wood-accent);
	--darkgreen: var(--hs-wood-accent);
	--hovergreen: var(--hs-wood-dark);
	--hs-dark: var(--hs-wood-dark);
	--hs-deep: var(--hs-wood-deep);
	--hs-highlight: var(--hs-wood-accent);
	--hs-shape-fill: #C89E47;
	--hs-shape-opacity: 0.31;
}

.sector-custom {
	--lightgreen: var(--hs-custom-accent);
	--mediumgreen: var(--hs-custom-accent);
	--darkgreen: var(--hs-custom-accent);
	--hovergreen: var(--hs-custom-dark);
	--hs-dark: var(--hs-custom-dark);
	--hs-deep: var(--hs-custom-deep);
	--hs-highlight: var(--hs-custom-accent);
	--hs-shape-fill: #85CC41;
	--hs-shape-opacity: 0.18;
}

/* ---------------------------------------------------------------------------
 * HM background shape
 * ------------------------------------------------------------------------ */

.backgroundShapeContainer {
	opacity: var(--hs-shape-opacity);
	transition: opacity 0.4s ease;
}

.backgroundShapeContainer .cls-1 {
	fill: var(--hs-shape-fill);
	transition: fill 0.4s ease;
}

/* ---------------------------------------------------------------------------
 * Dark sections (were #223400 -> black)
 * ------------------------------------------------------------------------ */

.homepageSolutions,
.newsDiv:not(.verticalCategory),
.solutionsPageFaq,
.jobsPageFaq,
.contactMap,
.carouselSection.right,
.refrencesPageContent,
.newsPageContent,
.solutionsPageIntro.intrestedPage,
.bg-green .carouselSection {
	background: transparent linear-gradient(90deg, var(--hs-dark) 0%, #000000 100%) 0% 0% no-repeat padding-box;
}

.accordionItem::after {
	background: linear-gradient(90deg, var(--hs-dark) 0%, #000000 100%);
}

.timeLineTxt {
	border-right-color: var(--hs-dark);
}

.timeLineTxt .date {
	background-color: var(--hs-dark);
}

/* Map on the contact pages */
.contactMap .map .cls-2 {
	fill: var(--hs-dark);
	stroke: var(--hs-deep);
}

/* Country paths all carry .cls-2, so these must out-rank the rule above */
.contactMap .map .targetCountry path.cls-2,
.contactMap .map .targetCountry path {
	fill: var(--hs-highlight);
}

.contactMap .map .targetCountry:hover path.cls-2,
.contactMap .map .targetCountry:hover path {
	fill: #fff;
}

/* "HANDSAEME MACHINERY" wordmark in the quote section */
svg [fill="#7eb21a" i] {
	fill: var(--lightgreen);
}

/* Links in text blocks (was #147702) */
.sector-floortex .wysiwyg a,
.sector-wood .wysiwyg a,
.sector-custom .wysiwyg a {
	color: var(--darkgreen) !important;
}

/* Green text colours set by editors in the WYSIWYG content */
.sector-floortex [style*="#008000" i],
.sector-floortex [style*="#99cc00" i],
.sector-floortex [style*="#339966" i],
.sector-wood [style*="#008000" i],
.sector-wood [style*="#99cc00" i],
.sector-wood [style*="#339966" i],
.sector-custom [style*="#008000" i],
.sector-custom [style*="#99cc00" i],
.sector-custom [style*="#339966" i] {
	color: var(--lightgreen) !important;
}

/* Product page intro: always the colour of the product's own sector */
.sector-floortex .solutionsPageIntro:not(.intrestedPage),
.sector-wood .solutionsPageIntro:not(.intrestedPage),
.sector-custom .solutionsPageIntro:not(.intrestedPage) {
	background-color: var(--lightgreen);
}

/* ---------------------------------------------------------------------------
 * Sector labels and links
 * These always show the colour of their own sector, whatever the page sector
 * is (homepage sector bar, solution cards, reference/news labels, menu).
 * A bare "carpetLink" / "carpetColor" is also the theme's generic accent
 * button/text (contact cards, form submit, product tiles), so it keeps the
 * original var(--lightgreen) = page accent. Floortex labels get "floortexLink".
 * ------------------------------------------------------------------------ */

.floortexLink,
.carpetLink.floortexLink,
.solutionsCardLink:has(.floortexLink),
.floortexLabel,
.dropdown-menu .carpetLink,
.carpetLink[class~="flooring-textile"],
.leftRightLabel[class~="flooring-textile"],
.carpetLink[class~="flooring-textile-machinery"],
.leftRightLabel[class~="flooring-textile-machinery"],
.carpetLink[class~="carpet-textile"],
.leftRightLabel[class~="carpet-textile"],
.carpetLink[class~="carpet-textile-machinery"],
.leftRightLabel[class~="carpet-textile-machinery"] {
	--hovergreen: var(--hs-floortex-dark);
	background-color: var(--hs-floortex-accent);
}

.woodLink,
.carpetLink.woodLink,
.solutionsCardLink:has(.woodLink),
.woodLabel,
.carpetLink[class~="wood"],
.leftRightLabel[class~="wood"],
.carpetLink[class~="hout"],
.leftRightLabel[class~="hout"] {
	--hovergreen: var(--hs-wood-dark);
	background-color: var(--hs-wood-accent);
}

.specialsLink,
.carpetLink.specialsLink,
.solutionsCardLink:has(.specialsLink),
.specialsLabel,
.carpetLink[class~="custom-made"],
.leftRightLabel[class~="custom-made"],
.carpetLink[class~="specials"],
.leftRightLabel[class~="specials"],
.carpetLink[class~="speciale"],
.leftRightLabel[class~="speciale"] {
	--hovergreen: var(--hs-custom-dark);
	background-color: var(--hs-custom-accent);
}

.corporateLink,
.carpetLink.corporateLink,
.solutionsCardLink:has(.corporateLink),
.corporateLabel,
.carpetLink[class~="handsaeme"],
.leftRightLabel[class~="handsaeme"] {
	--hovergreen: var(--hs-corporate-dark);
	background-color: var(--hs-corporate-accent);
}

/* ---------------------------------------------------------------------------
 * Header and footer logo per sector
 * ------------------------------------------------------------------------ */

:is(.logoDiv, .footerLogo) .hs-logo {
	display: none;
}

:is(.logoDiv, .footerLogo) .hs-logo--corporate {
	display: block;
}

.sector-floortex :is(.logoDiv, .footerLogo).has-logo-floortex .hs-logo--corporate,
.sector-wood :is(.logoDiv, .footerLogo).has-logo-wood .hs-logo--corporate,
.sector-custom :is(.logoDiv, .footerLogo).has-logo-custom .hs-logo--corporate {
	display: none;
}

.sector-floortex :is(.logoDiv, .footerLogo).has-logo-floortex .hs-logo--floortex,
.sector-wood :is(.logoDiv, .footerLogo).has-logo-wood .hs-logo--wood,
.sector-custom :is(.logoDiv, .footerLogo).has-logo-custom .hs-logo--custom {
	display: block;
}

.footerLogo .hs-logo {
	width: 100%;
	max-width: 430px;
	height: auto;
}

/* Sector logos carry a baseline; 100px (theme mobile width) makes it unreadable */
.sector-floortex .logoDiv.has-logo-floortex,
.sector-wood .logoDiv.has-logo-wood,
.sector-custom .logoDiv.has-logo-custom {
	width: 160px;
}

@media only screen and (min-width: 1120px) {
	.sector-floortex .logoDiv.has-logo-floortex,
	.sector-wood .logoDiv.has-logo-wood,
	.sector-custom .logoDiv.has-logo-custom {
		width: 250px;
	}
}

/* ---------------------------------------------------------------------------
 * Footer: big sector links in their own colour on hover, the rest in the
 * page accent
 * ------------------------------------------------------------------------ */

.footerTopRight > a {
	transition: color 0.2s ease;
}

.footerTopRight > a:hover {
	color: var(--lightgreen) !important;
}

.footerTopRight > a.hs-footer-sector--floortex:hover {
	color: var(--hs-floortex-accent) !important;
}

.footerTopRight > a.hs-footer-sector--wood:hover {
	color: var(--hs-wood-accent) !important;
}

.footerTopRight > a.hs-footer-sector--custom:hover {
	color: var(--hs-custom-accent) !important;
}

.sector-floortex .footerTopRight > a.hs-footer-sector--floortex,
.sector-wood .footerTopRight > a.hs-footer-sector--wood,
.sector-custom .footerTopRight > a.hs-footer-sector--custom {
	color: var(--lightgreen) !important;
}


/* ---------------------------------------------------------------------------
 * Homepage solution cards: on hover the whole bar fills with the dark tint.
 * The label inside must stay transparent, otherwise the Floortex label keeps
 * its own fill (it has the more specific .carpetLink.floortexLink rule).
 * ------------------------------------------------------------------------ */

.solutionsCardLink p.floortexLink,
.solutionsCardLink p.woodLink,
.solutionsCardLink p.specialsLink,
.solutionsCardLink p.corporateLink {
	background-color: transparent;
}

/* ---------------------------------------------------------------------------
 * Contact cards and news cards follow the sector of their own label, so the
 * job title, contact button and "read more" match the person/article, also on
 * a corporate page (general contact page, news overview).
 * ------------------------------------------------------------------------ */

:is(.contactCard, .newsCard):has(.floortexLink) {
	--lightgreen: var(--hs-floortex-accent);
	--hovergreen: var(--hs-floortex-dark);
}

:is(.contactCard, .newsCard):has(.woodLink) {
	--lightgreen: var(--hs-wood-accent);
	--hovergreen: var(--hs-wood-dark);
}

:is(.contactCard, .newsCard):has(.specialsLink) {
	--lightgreen: var(--hs-custom-accent);
	--hovergreen: var(--hs-custom-dark);
}

:is(.contactCard, .newsCard):has(.corporateLink) {
	--lightgreen: var(--hs-corporate-accent);
	--hovergreen: var(--hs-corporate-dark);
}
