/**
 * Solutions Grid Block CSS - Fixed Layout with Specific Naming
 */

/* Main container */
.solutions-grid-block {
	padding: 0;
	background: transparent;
	color: #000;
}

.solutions-grid-block .sgb-container {
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 30px;
}

@media (max-width: 1500px) {
	.solutions-grid-block .sgb-container {
		max-width: 1200px
	}
}

@media (max-width: 1500px) {
	.solutions-grid-block-subtitle {
		font-size: 16px !important;
	}
}

/* Link styling for clickable grid items */
.sg-item-link {
	display: flex;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
	position: relative;
	align-items: stretch;
}

.sg-item-link:hover,
.sg-item-link:focus,
.sg-item-link:visited {
	text-decoration: none;
	color: inherit;
}

/* Ensure background images display properly within links */
.sg-item-link .sg-item-background {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: flex-end;
}

/* Title and subtitle */
.solutions-grid-block-title {
	font-family: 'Hedvig Letters Serif', sans-serif;
	font-size: 36px;
	line-height: 1.2;
	margin-bottom: 16px;
	font-weight: 400;
	color: #000;
}

.solutions-grid-block-subtitle {
	font-family: 'DM Sans', sans-serif;
	font-size: 18px;
	margin-bottom: 32px;
	color: #000;
}

/* Toggle Buttons */
.solutions-grid-toggles {
	display: flex;
	justify-content: center;
	position: relative;
	top: -28px;
	z-index: 10;
}

.toggle-buttons {
	display: flex;
	background-color: #F6F6F6;
	border-radius: 40px;
	box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(1.46px);
	overflow: hidden;
}

.toggle-btn {
	padding: 16px 32px;
	border: none;
	background-color: transparent;
	cursor: pointer;
	font-family: "Hedvig Letters Serif", serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 21px;
	color: #000;
	border-radius: 40px;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.toggle-btn.active {
	background-color: #AA622C;
	color: #FFFFFF;
}

.toggle-btn:hover:not(.active) {
	background-color: rgba(170, 98, 44, 0.1);
}

/* Mobile Toggle */
.mobile-toggle-container {
	display: none;
	justify-content: center;
	margin-bottom: 40px;
	position: relative;
}

.mobile-toggle-dropdown {
	padding: 16px 32px;
	border-radius: 40px;
	border: none;
	background: #AA622C;
	font-family: "Hedvig Letters Serif", serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 21px;
	color: #FFFFFF;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(1.46px);
}

.mobile-toggle-dropdown::after {
	content: '';
	width: 12px;
	height: 12px;
	background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIiBmaWxsPSJub25lIj4KICA8cGF0aCBkPSJNMTAuMjkzIDQuMjkyOTdMNiA4LjU4NkwxLjcwNjk3IDQuMjkyOTdMMC4yOTI5NjcgNS43MDY5N0w2IDExLjQxNEwxMS43MDcgNS43MDY5N0wxMC4yOTMgNC4yOTI5N1oiIGZpbGw9IiNGRkYiLz4KPC9zdmc+');
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	transition: transform 0.3s ease;
}

.mobile-toggle-dropdown.active::after {
	transform: rotate(180deg);
}

.mobile-toggle-options {
	display: none;
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	background: white;
	border: 1px solid #AA622C;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 10;
	margin-top: 8px;
	min-width: 200px;
}

.mobile-toggle-options.show {
	display: block;
}

.mobile-toggle-option {
	padding: 12px 16px;
	color: #000;
	font-family: "Hedvig Letters Serif", serif;
	font-size: 14px;
	cursor: pointer;
	border-bottom: 1px solid #E5E5E5;
}

.mobile-toggle-option:last-child {
	border-bottom: none;
}

.mobile-toggle-option:hover {
	background: #F8F8F8;
}

.mobile-toggle-option.active {
	background: #AA622C;
	color: white;
}

/* Solutions Sections */
.solutions-section {
	margin-bottom: 0;
	padding-bottom: 48px;
}

.practices-section {
	background: #FFF;
	color: #000;
	margin-bottom: 0;
}

.practices-section-cont{
	position: relative;
	width: 100%;
}

.practices-section-cont-bottom-bg {
	position: absolute;
	width: 100%;
	bottom: 0;
	background-color: #290B0B;
	height: 10%;
}

.practices-section-cont.no-industries .practices-section-cont-bottom-bg {
	background-color: transparent;
}

.sg-practise-title{
	color: #000;
	font-family: 'Hedvig Letters Serif', serif;
	font-size: 36px;
	font-style: normal;
	font-weight: 400;
	line-height: 42px;
	margin-bottom: 24px;
}

.sg-practise-description{
	color: #000;
	font-family: 'DM Sans', sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	line-height: 135.903%; /* 21.745px */
	letter-spacing: -0.48px;
	max-width: 270px;
}

.sg-industries-title{
	color: #FFF;
	font-family: 'Hedvig Letters Serif', serif;
	font-size: 36px;
	font-style: normal;
	font-weight: 400;
	line-height: 42px;
	margin-bottom: 24px;
}

.sg-industries-description{
	color: #FFF;
	font-family: 'DM Sans', sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	line-height: 135.903%; /* 21.745px */
	letter-spacing: -0.48px;
	max-width: 270px;
}


.industries-section-cont{
	background-color: #290B0B;
	width: 100%;
}

/* Grid Layout - 4 columns, no gaps, square items */
.sg-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
	width: 100%;
	position: relative;
}

/* Create square grid items */
.sg-grid > * {
	aspect-ratio: 1;
	width: 100%;
}

/* Section Content Item - Same size as other square items */
.sg-content-item {
	grid-column: 1 / 2;
	grid-row: 1 / 2;
	aspect-ratio: 1; /* Square like other items */
	background: transparent !important;
	display: flex;
	justify-content: flex-start;
	text-align: left;
}

.practices-section .sg-content-item {
	background: #FFF !important;
}


/* Grid Items - Let them flow naturally after section content */
.sg-item:not(.sg-content-item) {
	position: relative;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.3s ease;
	border: none;
	margin: 0;
	aspect-ratio: 1; /* Ensure square shape */
	display: flex;
	align-items: stretch;
}

.sg-item-background {
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	position: relative;
	display: flex;
	align-items: flex-end;
	transition: transform 0.3s ease;
}

/* Hover zoom effect for grid item images */
.sg-item:not(.sg-content-item):hover .sg-item-background {
	transform: scale(1.1);
}

.sg-item-no-image {
	background-color: #666;
}

.sg-item-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	top: 0;
	background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.8));
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sg-item-title {
	color: #FFF;
	text-align: center;
	font-family: 'DM Sans', sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 600;
	line-height: 22px; /* 137.5% */
	letter-spacing: 5.28px;
	text-transform: uppercase;
}

/* Hide/Show items based on filter */
.sg-item.hidden {
	display: none;
}

.solution-mobile-view-style{
	display: none;
}

/* Mobile View Toggle Styles */
.solution-mobile-view-style svg {
	transition: opacity 0.3s ease;
}

.solution-mobile-view-style svg:hover {
	opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
	.sg-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.sg-content-item {
		grid-column: 1 / 2;
		grid-row: 1 / 2;
		aspect-ratio: 1;
	}

	.sg-content h2 {
		font-size: 24px;
	}
}

@media (max-width: 768px) {
	.sgb-container {
		padding: 0 !important;
	}

	.sg-practise-title{
		margin-left: 20px;
	}

	.sg-industries-title{
		margin-left: 20px;
	}

	.sg-industries-description{
		margin-left: 20px;
		max-width: unset;
	}

	.sg-practise-description{
		margin-left: 20px;
		max-width: unset;
	}

	/* Hide desktop toggle */
	.solutions-grid-toggles {
		display: none;
	}

	.solution-mobile-view-style{
		display: flex;
		gap: 18px;
		margin-left: 20px;
		margin-top: 53px;
		align-items: center;
	}

	.grid-view-options-text{
		color: #000;
		font-family: 'DM Sans', sans-serif;
		font-size: 16px;
		font-style: normal;
		font-weight: 400;
		line-height: 135.903%;
		letter-spacing: -0.48px;
	}
	.grid-view-options-text-industries{
		color: #FFFFFF;
		font-family: 'DM Sans', sans-serif;
		font-size: 16px;
		font-style: normal;
		font-weight: 400;
		line-height: 135.903%;
		letter-spacing: -0.48px;
	}

	/* Show mobile toggle */
	.mobile-toggle-container {
		display: flex;

	}

	.solutions-section {
		padding: 40px 0;
	}

	.industries-section {
		padding-top: 74px;
		padding-left: 0;
		padding-right: 0;
		padding-bottom: 207px;
	}

	.solution-mobile-toggle-container{
		display: none;
	}

	/* Default mobile grid - 2 columns */
	.sg-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Grid view state - 2 columns (default) */
	.sg-grid.sg-grid-view {
		grid-template-columns: repeat(2, 1fr);
	}

	.sg-grid.sg-grid-view .sg-content-item {
		grid-column: 1 / 3;
		grid-row: 1 / 2;
		aspect-ratio: unset;
		margin-bottom: 30px;
	}

	.sg-grid.sg-grid-view .sg-item:not(.sg-content-item) {
		aspect-ratio: 1;
	}

	/* List view state - 1 column, text only */
	.sg-grid.sg-list-view {
		grid-template-columns: 1fr;
	}

	.sg-grid.sg-list-view .sg-content-item {
		grid-column: 1 / 2;
		grid-row: 1 / 2;
		aspect-ratio: unset;
		margin-bottom: 30px;
	}

	.sg-grid.sg-list-view .sg-item:not(.sg-content-item) {
		aspect-ratio: unset;
		min-height: 60px;
		background: transparent !important;
		display: flex;
		align-items: center;
		position: relative;
		overflow: visible;
	}

	/* Remove background images in list view but keep structure */
	.sg-grid.sg-list-view .sg-item-background {
		background-image: none !important;
		background-color: transparent !important;
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		transform: none !important;
		transition: none !important;
	}

	/* Disable hover effects in list view */
	.sg-grid.sg-list-view .sg-item:not(.sg-content-item):hover .sg-item-background {
		transform: none !important;
	}

	.sg-grid.sg-list-view .sg-item:not(.sg-content-item) {
		transform: none !important;
		transition: none !important;
	}

	/* Restructure overlay for list view to show content properly */
	.sg-grid.sg-list-view .sg-item-overlay {
		position: static;
		background: none;
		padding: 16px 20px;
		display: flex;
		align-items: center;
		width: 100%;
		height: 100%;
		min-height: 60px;
	}

	/* Style titles for list view */
	.sg-grid.sg-list-view .sg-item-title {
		color: #000;
		font-family: "DM Sans", sans-serif;
		font-size: 18px;
		font-style: normal;
		font-weight: 500;
		line-height: 24px; /* 133.333% */
		letter-spacing: 0.9px;
		text-transform: uppercase;
		text-align: left;
		margin: 0;
		width: 100%;
	}

	/* Practices section list view - black text */
	.practices-section .sg-grid.sg-list-view .sg-item:not(.sg-content-item) {
		color: #000;
	}

	.practices-section .sg-grid.sg-list-view .sg-item-title {
		color: #000 !important;
	}

	/* Industries section list view - white text */
	.industries-section .sg-grid.sg-list-view .sg-item:not(.sg-content-item) {
		color: #FFF;
	}

	.industries-section .sg-grid.sg-list-view .sg-item-title {
		color: #FFF !important;
	}

	/* Hide red background section in list view */
	.practices-section-cont:has(.sg-grid.sg-list-view) .practices-section-cont-bottom-bg {
		display: none;
	}

	/* Fallback for browsers that don't support :has() */
	.practices-section-cont.list-view-active .practices-section-cont-bottom-bg {
		display: none;
	}
	.sg-grid.sg-list-view .sg-item-link {
		display: flex;
		align-items: center;
		width: 100%;
		height: 100%;
		padding: 0;
		text-decoration: none;
	}

	.sg-grid.sg-list-view .sg-item-link:hover,
	.sg-grid.sg-list-view .sg-item-link:focus,
	.sg-grid.sg-list-view .sg-item-link:visited {
		text-decoration: none;
	}

	/* Fallback for grids without specific view class - default to grid view */
	.sg-grid:not(.sg-grid-view):not(.sg-list-view) {
		grid-template-columns: repeat(2, 1fr);
	}

	.sg-grid:not(.sg-grid-view):not(.sg-list-view) .sg-content-item {
		grid-column: 1 / 3;
		grid-row: 1 / 2;
		aspect-ratio: unset;
		margin-bottom: 30px;
	}

	.sg-content-item {
		aspect-ratio: unset;
		margin-bottom: 30px
	}

	.sg-content h2 {
		font-size: 22px;
		margin-bottom: 8px;
	}

	.sg-item-overlay {
		padding: 15px;
	}
}
