/* ==========================================================================
   Home page - mobile / tablet fixes
   Loaded from index.php only, after every other stylesheet, so plain
   (non-!important) rules win on equal specificity via source order.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Horizontal overflow
   .eg_tabs / .eg_big_tab_container were sized in viewport units (100vw, and
   104vw under 767px). .eg_tabs is also a Bootstrap .row, so it carried the
   row's negative side margins on top of that width - the page ended up wider
   than the viewport and scrolled sideways on every phone.
   -------------------------------------------------------------------------- */
.eg_tabs,
.eg_big_tab_container {
	width: 100%;
	max-width: 100%;
}

.eg_tabs {
	--bs-gutter-x: 0;
	margin-left: 0;
	margin-right: 0;
}

/* Absolutely positioned inside .carousel-item, which is already full width.
   100vw additionally counted the scrollbar and amplified any overflow. */
.start-screen__bg {
	width: 100%;
}

/* Safety net. `clip` does not create a scroll container, so sticky/fixed
   descendants keep working; `hidden` is the fallback for older browsers. */
body {
	overflow-x: hidden;
	overflow-x: clip;
}


/* --------------------------------------------------------------------------
   2. Hero slider - tablet
   The caption title was pinned at 5.5rem (88px) all the way down to 768px.
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {

	.homepage-slider .carousel-item,
	.start-screen__bg {
		height: 70vh;
		min-height: 420px;
	}

	.homepage-slider .carousel-caption .__title {
		font-size: 3rem;
	}
}


/* --------------------------------------------------------------------------
   3. Hero slider - phone
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {

	.homepage-slider .carousel-item,
	.start-screen__bg {
		height: 65vh;
		min-height: 360px;
	}

	/* Was top:35% against Bootstrap's default bottom:1.25rem, which stretched
	   the caption box. Centre it properly instead. */
	.homepage-slider .carousel-caption {
		top: 50%;
		bottom: auto;
		transform: translateY(-50%);
		width: 100%;
		max-width: 92%;
		padding: 0 12px;
	}

	.homepage-slider .cc-left {
		left: 0 !important;
		text-align: center !important;
		transform: translateY(-50%);
	}

	/* max-width has no effect on display:inline - the title could not wrap
	   inside its box. inline-block makes the constraint real. */
	.homepage-slider .carousel-caption .__title {
		display: inline-block;
		max-width: 100% !important;
		font-size: clamp(1.6rem, 7.5vw, 2.4rem);
		line-height: 1.15;
	}

	/* Controls were 5% wide (~18px) with white icons over a white-tinted
	   image overlay: neither visible nor tappable. Give them a real 44px
	   target and move them clear of the centred caption. */
	.homepage-slider .carousel-control-prev,
	.homepage-slider .carousel-control-next {
		width: 44px !important;
		height: 44px;
		top: auto;
		bottom: 18px;
		opacity: 1;
		background-color: rgba(0, 18, 167, .75);
		border-radius: 50%;
	}

	.homepage-slider .carousel-control-prev {
		left: 12px;
	}

	.homepage-slider .carousel-control-next {
		right: 12px;
	}

	.homepage-slider .carousel-control-prev-icon,
	.homepage-slider .carousel-control-next-icon {
		width: 18px;
		height: 18px;
	}
}


/* Section 4 - the counter strip - moved to mobile-fixes.css, since
   component/counter.php is shared with company-overview.php. */


/* --------------------------------------------------------------------------
   5. "Our Businesses" section
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {

	.application-section .content {
		align-items: stretch;
	}

	/* width:100% plus the inherited margin-right:50px pushed the tab list
	   past its container - a second source of sideways scroll. */
	.application-section .content .list {
		margin-right: 0;
	}

	/* 22px labels on a 60px row are oversized on a phone. The .slider
	   highlight is positioned in hard pixels, so its offsets have to move
	   with the row height. */
	.application-section .content .list label {
		height: 48px;
		line-height: 48px;
		font-size: 16px;
		padding-left: 16px;
	}

	.application-section .content .slider {
		height: 48px;
	}

	.application-section #maize:checked~.list .slider {
		top: 0;
	}

	.application-section #agro:checked~.list .slider {
		top: 48px;
	}

	.application-section #spinning:checked~.list .slider {
		top: 96px;
	}

	.application-section #energy:checked~.list .slider {
		top: 144px;
	}

	.application-section .content .text .title {
		font-size: 20px;
		line-height: 1.3;
	}

	/* Justified text on a ~340px column opens huge word gaps. */
	.application-section .container .text p {
		text-align: left;
	}

	/* The dark overlay sits at z-index:-1 inside a parent that creates no
	   stacking context, so it painted behind the section's own background
	   image and did nothing - white text sat on a bright photo. Raise it and
	   lift the content above it. */
	.application-section .overlay {
		z-index: 0;
	}

	.application-section>.section-heading,
	.application-section>.container {
		position: relative;
		z-index: 1;
	}
}


/* --------------------------------------------------------------------------
   6. "We Are Certified" slider
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {

	/* 20px of padding per item on top of slick's 15px slide margins left the
	   logos tiny. */
	.partners-list .__item {
		padding: 10px;
	}

	/* object-fit:cover was cropping the sides off wider certification marks. */
	.partners-list .__item img {
		object-fit: contain;
	}
}


/* --------------------------------------------------------------------------
   7. Mission / Brand / Ethics / Creativity tabs
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {

	.eg_tab {
		padding: 14px 10px;
		font-size: 15px;
		line-height: 1.3;
	}

	.eg_big_tab {
		padding: 0;
		margin-bottom: 0;
	}

	.txt {
		margin: 0;
		padding: 24px 16px;
	}

	.eg_big_tab_container .txt h3 {
		font-size: 22px;
	}

	.eg_big_tab_container .txt p {
		text-align: left;
		font-size: 15px;
		line-height: 1.7;
	}

	/* g-5 adds 3rem of gutter to a single-column row - pure dead space here. */
	.eg_big_tab_container .txt .row {
		--bs-gutter-y: 0;
	}
}
