/* gigantmedia.se. Loaded only on pages with the Elementor Canvas template (see gigant-se.php).
   The header is the one of the ab page (gigant.dev/ab, values from its stylesheet); the page content is Elementor,
   styled per element. This file also covers the contact form (Contact Form 7, html_class="gm-cf7") and the phone
   columns of the client logos (Basic Gallery with the CSS class "gse-logos"). */

html:has(> body.gse-page) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:has(> body.gse-page) { scroll-behavior: auto; } }
body.gse-page { margin: 0; }
/* Section links land below the fixed header (ab: section { scroll-margin-top: 90px }). */
body.gse-page .elementor-section[id],
body.gse-page .e-con[id] { scroll-margin-top: 90px; }

/* ---------- Header ---------- */
.gse-header {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 100;
	background: #163300;
	font-family: 'Poppins', Helvetica, Arial, sans-serif;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
.gse-nav {
	position: relative;
	display: flex;
	align-items: center;
	gap: 18px;
	box-sizing: border-box;
	max-width: 1160px;
	margin: 0 auto;
	padding: 14px 24px;
}
body.gse-page .gse-logo { display: flex; align-items: center; text-decoration: none; }
.gse-logo img { height: 42px; width: auto; max-width: none; display: block; }
.gse-links { display: flex; gap: 32px; margin: 0 auto; }
body.gse-page .gse-links a { color: #FFFFFF; text-decoration: none; font-weight: 500; font-size: 15px; }
body.gse-page .gse-links a:hover { color: #9FE870; }
body.gse-page .gse-btn {
	display: inline-block;
	flex: none;
	border-radius: 999px;
	padding: 11px 22px;
	background: #9FE870;
	color: #163300;
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	transition: background 0.15s ease;
}
body.gse-page .gse-btn:hover { background: #80E142; color: #163300; }
.gse-right { display: flex; align-items: center; gap: 14px; }
body.gse-page .gse-lang {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	border: 1.5px solid rgba(255, 255, 255, 0.55);
	border-radius: 50%;
	color: #FFFFFF;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
}
body.gse-page .gse-lang:hover { border-color: #9FE870; color: #9FE870; }
body.gse-page .gse-burger { display: none; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.gse-burger svg { display: block; width: 26px; height: 26px; stroke: #FFFFFF; stroke-width: 2.5; stroke-linecap: round; fill: none; }

@media (max-width: 960px) {
	.gse-nav { justify-content: space-between; }
	body.gse-page .gse-btn { display: none; }
	.gse-right { gap: 12px; }
	body.gse-page .gse-lang { width: 34px; height: 34px; font-size: 11px; }
	body.gse-page .gse-burger { display: block; }
	.gse-logo img { height: 40px; }
	.gse-links {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		gap: 0;
		margin: 0;
		padding: 6px 24px 18px;
		background: #163300;
		border-top: 1px solid rgba(255, 255, 255, 0.12);
	}
	.gse-header.is-open .gse-links { display: flex; }
	body.gse-page .gse-links a { display: block; padding: 12px 0; font-size: 17px; }
}

/* ---------- Client logos ---------- */
/* Elementor shows the chosen number of columns from 768px, 2 from 480px and 1 below; here 4 on tablets, 2 on phones. */
@media (min-width: 768px) and (max-width: 1024px) {
	body.gse-page .gse-logos .elementor-image-gallery .gallery .gallery-item { max-width: 25%; }
}
@media (max-width: 479px) {
	body.gse-page .gse-logos .elementor-image-gallery .gallery .gallery-item { max-width: 50%; }
}
body.gse-page .gse-logos .gallery-item img { width: 100%; height: auto; }
/* The gap comes from a negative right margin on .gallery, which pushes the page 4px wide on phones: clip it. */
body.gse-page .gse-logos { overflow: hidden; }

/* ---------- Client logos as on gigant.media (1.0.2: the "Update logos" button adds the class "gse-logos-media") ---------- */
/* Values measured on gigant.media's logo grid (gm.css 1.1.5 and its Elementor grid): 5 per row, 48px between the
   columns and 49px between the rows (tablets 4 per row, 40/20; phones 2, 40/21), each logo in a 190 x 62 box, the
   image at most 80px high, multiply so the white of the PNGs disappears, their grey frame clipped, 78% opacity and
   full on hover. Flex instead of grid, so a last row that is not full stays centred. No negative margins any more,
   so nothing to clip. */
body.gse-page .gse-logos.gse-logos-media { overflow: visible; }
body.gse-page .gse-logos.gse-logos-media .elementor-image-gallery .gallery {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 49px 48px;
	margin: 0 !important;
}
body.gse-page .gse-logos.gse-logos-media .elementor-image-gallery .gallery .gallery-item {
	display: flex;
	justify-content: center;
	align-items: center;
	flex: 0 0 calc((100% - 4 * 48px) / 5 - 0.5px);
	width: auto;
	max-width: calc((100% - 4 * 48px) / 5 - 0.5px);
	margin: 0;
	padding: 0 !important;
}
body.gse-page .gse-logos.gse-logos-media .gallery-icon {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	max-width: 190px;
	height: 62px;
}
body.gse-page .gse-logos.gse-logos-media .gallery-item img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 80px;
	border: 0;
	object-fit: contain;
	mix-blend-mode: multiply;
	clip-path: inset(1.5px);
	opacity: 0.78;
	transition: opacity 600ms ease;
}
body.gse-page .gse-logos.gse-logos-media .gallery-item:hover img { opacity: 1; }
@media (max-width: 1024px) {
	body.gse-page .gse-logos.gse-logos-media { padding: 0 14px; }
	body.gse-page .gse-logos.gse-logos-media .elementor-image-gallery .gallery { gap: 40px 20px; }
	body.gse-page .gse-logos.gse-logos-media .elementor-image-gallery .gallery .gallery-item {
		flex-basis: calc((100% - 3 * 20px) / 4 - 0.5px);
		max-width: calc((100% - 3 * 20px) / 4 - 0.5px);
	}
}
@media (max-width: 767px) {
	body.gse-page .gse-logos.gse-logos-media .elementor-image-gallery .gallery { gap: 40px 21px; }
	body.gse-page .gse-logos.gse-logos-media .elementor-image-gallery .gallery .gallery-item {
		flex-basis: calc((100% - 21px) / 2 - 0.5px);
		max-width: calc((100% - 21px) / 2 - 0.5px);
	}
}
@media (prefers-reduced-motion: reduce) {
	body.gse-page .gse-logos.gse-logos-media .gallery-item img { transition: none; }
}

/* ---------- Varför Gigant block (1.0.1: its three sections have the CSS class "gse-why") ---------- */
/* Spacing as in the design: the widgets carry every gap, so no default margins on the paragraphs, and no extra
   var(--kit-widget-spacing) (20px) that Elementor adds under widgets with a custom width. The team notes cards
   (1.0.6, class "gse-notes") use the same paragraph rule. */
body.gse-page .gse-why .elementor-widget-text-editor p,
body.gse-page .gse-notes .elementor-widget-text-editor p { margin: 0; }
body.gse-page .gse-why .elementor-widget { --kit-widget-spacing: 0px; }

/* ---------- 404 page (1.0.7, templates/404.php): forest block like the page heroes, footer like the pages' ---------- */
body.gse-404-page { background: #163300; }
body.gse-page .gse-404 {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: calc(100vh - 118px);
	padding: 150px 24px 96px;
	background: #163300;
	text-align: center;
	font-family: 'Poppins', Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}
.gse-404-inner { max-width: 760px; }
body.gse-page .gse-404-badge {
	display: inline-block;
	margin-bottom: 28px;
	padding: 7px 18px;
	border: 1px solid rgba(159, 232, 112, 0.5);
	border-radius: 999px;
	color: #9FE870;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	line-height: 1.2;
}
body.gse-page .gse-404 h1 { margin: 0; color: #FFFFFF; font-size: 56px; font-weight: 700; line-height: 1.18; letter-spacing: -0.7px; }
body.gse-page .gse-404 p { max-width: 620px; margin: 26px auto 0; color: #DCE5D3; font-size: 19px; line-height: 1.6; }
.gse-404-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 36px; }
body.gse-page .gse-404-btn {
	display: inline-block;
	padding: 14px 28px;
	border-radius: 999px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
body.gse-page .gse-404-btn--primary { background: #9FE870; color: #163300; }
body.gse-page .gse-404-btn--primary:hover { background: #80E142; color: #163300; }
body.gse-page .gse-404-btn--ghost { border: 1.5px solid rgba(255, 255, 255, 0.55); color: #FFFFFF; }
body.gse-page .gse-404-btn--ghost:hover { border-color: #9FE870; color: #9FE870; }
body.gse-page .gse-footer {
	padding: 34px 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	background: #163300;
	color: #B8C9A8;
	font-family: 'Poppins', Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}
.gse-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; max-width: 1160px; margin: 0 auto; }
body.gse-page .gse-footer-brand { display: flex; align-items: center; gap: 22px; color: #B8C9A8; text-decoration: none; }
.gse-footer-brand img { display: block; width: 120px; height: auto; }
@media (max-width: 767px) {
	body.gse-page .gse-404 { min-height: calc(100vh - 160px); padding: 130px 24px 64px; }
	body.gse-page .gse-404 h1 { font-size: 32px; }
	body.gse-page .gse-404 p { font-size: 17px; }
	body.gse-page .gse-footer { padding: 28px 24px; }
	.gse-footer-inner { flex-direction: column; justify-content: center; }
	body.gse-page .gse-footer-brand { gap: 16px; }
	.gse-footer-brand img { width: 110px; }
	.gse-footer-copy { text-align: center; }
}

/* ---------- Contact form (Contact Form 7 puts html_class="gm-cf7" on the <form> itself) ---------- */
body.gse-page .wpcf7-form.gm-cf7 { display: flex; flex-direction: column; gap: 18px; margin: 0; position: relative; font-family: 'Poppins', Helvetica, Arial, sans-serif; }
body.gse-page .gm-cf7 label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; color: #163300; line-height: 1.3; }
body.gse-page .gm-cf7 .wpcf7-form-control-wrap { display: block; }
body.gse-page .gm-cf7 input[type="text"],
body.gse-page .gm-cf7 input[type="email"],
body.gse-page .gm-cf7 textarea {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 14px 18px;
	border: 1.5px solid #E4E6E0;
	border-radius: 14px;
	background: #FFFFFF;
	color: #163300;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	box-shadow: none;
	outline: none;
	transition: border-color 150ms ease, box-shadow 150ms ease;
}
body.gse-page .gm-cf7 textarea { display: block; resize: vertical; }
body.gse-page .gm-cf7 input[type="text"]:focus,
body.gse-page .gm-cf7 input[type="email"]:focus,
body.gse-page .gm-cf7 textarea:focus { border-color: #9FE870; box-shadow: 0 0 0 3px rgba(159, 232, 112, 0.35); }
body.gse-page .gm-cf7 input::placeholder,
body.gse-page .gm-cf7 textarea::placeholder { color: #7A8C74; opacity: 1; }
body.gse-page .gm-cf7 .wpcf7-submit {
	align-self: flex-start;
	margin: 4px 0 0;
	padding: 14px 28px;
	border: 0;
	border-radius: 999px;
	background: #163300;
	color: #FFFFFF;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease;
}
body.gse-page .gm-cf7 .wpcf7-submit:hover { background: #0D1F00; }
body.gse-page .gm-cf7 .gm-cf7-note { margin: 0; font-size: 13px; line-height: 1.5; color: #5A7247; }
body.gse-page .gm-cf7 .gm-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
body.gse-page .gm-cf7 .wpcf7-not-valid-tip { margin-top: 6px; font-size: 13px; font-weight: 600; color: #A12B00; }
/* Messages under the form: lime green after a successful send, light yellow with dark text otherwise. */
body.gse-page .wpcf7 form.gm-cf7 .wpcf7-response-output { margin: 0; padding: 12px 16px; border: 0; border-radius: 14px; background: #FFEB69; color: #163300; font-size: 14px; }
body.gse-page .wpcf7 form.gm-cf7.sent .wpcf7-response-output { background: #9FE870; }
body.gse-page .wpcf7 form.gm-cf7.init .wpcf7-response-output,
body.gse-page .wpcf7 form.gm-cf7.submitting .wpcf7-response-output,
body.gse-page .wpcf7 form.gm-cf7.resetting .wpcf7-response-output { display: none; }
