/**
 * Tabbed Module
 * Horizontal tab nav + 50/50 content/image panel.
 * Below 991px: tab nav hides, each item becomes a vertical accordion trigger.
 */

/* ===========================
   # Section
=========================== */

.tabbed-module {
	padding:    80px 0 80px;
	background: #fff;
}

/* ===========================
   # Section header
=========================== */

.tabbed-module__header {
	display:         flex;
	align-items:     flex-end;
	justify-content: space-between;
	gap:             24px;
	margin-bottom:   40px;
}

.tabbed-module__section-heading {
	margin: 0;
	color:  var(--nec-grey);
}

/* ===========================
   # Section CTA
=========================== */

.tabbed-module__section-cta {
	display:         inline-flex;
	align-items:     center;
	gap:             12px;
	color:           var(--nec-grey);
	font-family:     var(--nec-font);
	font-weight:     500;
	text-decoration: none;
	white-space:     nowrap;
	flex-shrink:     0;
	transition:      color 0.2s ease;
}

.tabbed-module__section-cta:hover,
.tabbed-module__section-cta:focus-visible {
	color:   var(--nec-grey);
	outline: none;
}

.tabbed-module__section-cta:hover .tabbed-module__cta-icon,
.tabbed-module__section-cta:focus-visible .tabbed-module__cta-icon {
	transform: translateX(5px);
}

/* Mobile CTA hidden on desktop (toggled below) — hiding the wrapper is enough,
   the link inside doesn't need its own display:none as well. */
.tabbed-module__mobile-cta-wrap {
	display: none;
}

/* ===========================
   # Desktop tab nav
=========================== */

.tabbed-module__tab-nav {
	display: flex;
	gap:     4px;
}

.tabbed-module__tab {
	flex:            1;
	display:         flex;
	align-items:     center;
	justify-content: space-between;
	gap:             16px;
	padding:         18px 24px;
	background:      var(--nec-light-grey);
	border:          none;
	cursor:          pointer;
	text-align:      left;
	color:           var(--nec-grey);
	transition:      background 0.2s ease, color 0.2s ease;
	border-radius:   4px;
}

.tabbed-module__tab.is-active {
	background: var(--nec-orange);
	color:      #fff;
}

.tabbed-module__tab:focus-visible {
	outline:        2px solid var(--nec-orange);
	outline-offset: -2px;
}

.tabbed-module__tab-title {
	font-family:  var(--nec-font);
	font-size:    clamp(0.875rem, calc(0.855rem + 0.088vw), 1rem);
	font-weight:  500;
	line-height:  1.3;
	flex:         1;
}

/* Tab icon */
.tabbed-module__tab .tabbed-module__tab-icon {
	flex-shrink: 0;
	display:     flex;
	align-items: center;
}

.tabbed-module__tab .tabbed-module__tab-icon svg {
	width:  32px;
	height: 32px;
	color:  var(--nec-orange);
}

/* Active tab: icon becomes white */
.tabbed-module__tab.is-active .tabbed-module__tab-icon svg {
	color: #f4b177;
}

/* ===========================
   # Mobile accordion trigger
   (hidden on desktop)
=========================== */

.tabbed-module__accordion-trigger {
	display: none;
}

/* ===========================
   # Items wrapper
=========================== */



/* ===========================
   # Panel — desktop show/hide
=========================== */

.tabbed-module__panel {
	display: none;
}

.tabbed-module__item.is-active .tabbed-module__panel {
	display: block;
}

/* ===========================
   # Panel row
=========================== */

.tabbed-module__panel-row {
	--bs-gutter-x: 0;
	margin-top: 4px;
}

/* ===========================
   # Content column (left)
=========================== */

.tabbed-module__content-col {
	display: flex;
	padding: 0;
}

.tabbed-module__content {
	display:                 flex;
	flex-direction:          column;
	justify-content:         space-between;
	width:                   100%;
	padding:                 64px 48px 64px 40px;
	gap:                     48px;
	min-height:              480px;
	border-top-left-radius:  4px;
	border-bottom-left-radius: 4px;
	border-top: 1px solid var(--nec-grey20, #ebeced);
  border-left: 1px solid var(--nec-grey20, #ebeced);
  border-bottom: 1px solid var(--nec-grey20, #ebeced);
}

.tabbed-module__content-top {
	display:        flex;
	flex-direction: column;
	gap:            20px;
}

/* ===========================
   # Sub-header (matches introduction_module)
=========================== */

.tabbed-module__sub-header {
	display:     flex;
	align-items: center;
	gap:         12px;
}

.tabbed-module__dot {
	display:      block;
	width:        10px;
	height:       10px;
	border-radius: 50%;
	background:   var(--nec-orange);
	box-shadow:   0 0 0 5px rgba(235, 110, 0, 0.18);
	flex-shrink:  0;
}

.tabbed-module__sub-header-text {
	font-family:    var(--nec-font);
	font-size:      clamp(0.8125rem, calc(0.793rem + 0.088vw), 0.9375rem);
	font-weight:    400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color:          var(--nec-grey);
}

/* ===========================
   # Panel heading
=========================== */

.tabbed-module__heading {
	margin: 0;
	color:  var(--nec-grey);
}

/* ===========================
   # Content bottom
=========================== */

.tabbed-module__content-bottom {
	display:        flex;
	flex-direction: column;
	gap:            24px;
}

.tabbed-module__body {
	color:       var(--nec-grey);
	line-height: 1.7;
}

.tabbed-module__body p:first-child {
	margin-top: 0;
}

.tabbed-module__body p:last-child {
	margin-bottom: 0;
}

/* ===========================
   # CTA links
=========================== */

.tabbed-module__cta {
	display:         inline-flex;
	align-items:     center;
	gap:             12px;
	color:           var(--nec-grey);
	font-family:     var(--nec-font);
	font-weight:     500;
	text-decoration: none;
	transition:      color 0.2s ease;
}

.tabbed-module__cta:hover,
.tabbed-module__cta:focus-visible {
	color:   var(--nec-grey);
	outline: none;
}

.tabbed-module__cta-icon {
	display:     flex;
	align-items: center;
	flex-shrink: 0;
	transition:  transform 0.25s ease;
}

.tabbed-module__cta:hover .tabbed-module__cta-icon,
.tabbed-module__cta:focus-visible .tabbed-module__cta-icon {
	transform: translateX(5px);
}

.tabbed-module__cta .tabbed-module__cta-icon svg {
	width:  34px;
	height: 34px;
	color:  var(--nec-orange);
}

.tabbed-module__section-cta .tabbed-module__cta-icon svg {
	width:  34px;
	height: 34px;
	color:  var(--nec-orange);
}

/* ===========================
   # Image column (right)
=========================== */

.tabbed-module__image-col {
	padding: 0;
}

.tabbed-module__image-wrap {
	height:     100%;
	min-height: 480px;
	overflow:   hidden;
}

.tabbed-module__image {
	width:        100%;
	height:       100%;
	object-fit:   cover;
	object-position: center;
	display:      block;
	border-top-right-radius:  4px;
	border-bottom-right-radius: 4px;
}

.tabbed-module__image--left {
	object-position: left center;
}

.tabbed-module__image--right {
	object-position: right center;
}

/* ===========================
   # Responsive — 1280px
=========================== */

@media (max-width: 1280px) {
	.tabbed-module {
		padding-top: 64px;
	}

	.tabbed-module__content {
		padding: 56px 40px 56px 32px;
	}

	.tabbed-module__tab {
		padding: 16px 20px;
	}
}

/* ===========================
   # Responsive — 991px (switch to accordion)
=========================== */

@media (max-width: 991px) {
	.tabbed-module {
		padding-top: 48px;
	}

	.tabbed-module__header {
		margin-bottom: 28px;
	}

	/* Hide desktop tab nav */
	.tabbed-module__tab-nav {
		display: none;
	}

	/* Show mobile accordion triggers */
	.tabbed-module__accordion-trigger {
		display:         flex;
		align-items:     center;
		justify-content: space-between;
		gap:             16px;
		width:           100%;
		padding:         16px 20px;
		background:      var(--nec-light-grey);
		border:          none;
		border-radius:   4px;
		cursor:          pointer;
		text-align:      left;
		color:           var(--nec-grey);
		transition:      background 0.2s ease, color 0.2s ease;
	}

	.tabbed-module__accordion-trigger:focus-visible {
		outline:        2px solid var(--nec-orange);
		outline-offset: -2px;
	}

	.tabbed-module__item.is-active .tabbed-module__accordion-trigger {
		background:     var(--nec-orange);
		color:          #fff;
		/* Square off the bottom so it sits flush against the content panel below */
		border-radius:  4px 4px 0 0;
	}

	.tabbed-module__item.is-active .tabbed-module__accordion-trigger .tabbed-module__tab-icon svg {
		color: #fff;
	}

	.tabbed-module__accordion-trigger .tabbed-module__tab-icon svg {
		width:  28px;
		height: 28px;
		color:  var(--nec-orange);
	}

	/* Rounded, gapped cards instead of one continuous bordered list */
	.tabbed-module__items {
		display:        flex;
		flex-direction: column;
		gap:            4px;
		border:         none;
	}

	/* Panel: CSS grid animation for smooth height transition.
	   Must be display:grid here to override the desktop display:none rule's
	   lower specificity — the active selector below also needs display:grid. */
	.tabbed-module__panel {
		display:            grid;
		grid-template-rows: 0fr;
		transition:         grid-template-rows 0.35s ease;
	}

	/* Must explicitly set display:grid here — otherwise the desktop
	   two-class rule (.tabbed-module__item.is-active .tabbed-module__panel)
	   wins with higher specificity and overrides to display:block. */
	.tabbed-module__item.is-active .tabbed-module__panel {
		display:            grid;
		grid-template-rows: 1fr;
	}

	.tabbed-module__panel-inner {
		overflow: hidden;
	}

	/* Content col padding reset for mobile stacked layout — no card border/radius,
	   it now sits flush below the accordion trigger rather than beside the image */
	.tabbed-module__content {
		padding:       20px;
		min-height:    0;
		gap:           28px;
		border:        none;
		border-radius: 0;
	}

	.tabbed-module__image-wrap {
		min-height:  280px;
		margin-top:  0px;
		margin-bottom: 40px;
		border-radius: 0px 0px 4px 4px;
	}

	/* Square off — was only rounded on the right for the desktop side-by-side layout */
	.tabbed-module__image {
		border-radius: 0;
	}

	/* Hide desktop header CTA, show mobile bottom CTA */
	.tabbed-module__section-cta--desktop {
		display: none;
	}

	.tabbed-module__mobile-cta-wrap {
		display:    block;
		margin-top: 32px;
	}
	.tabbed-module__content-col {
		border:        1px solid var(--nec-grey20, #ebeced);
		border-bottom: none;
		border-radius: 4px 4px 0 0;
	}

	/* Flush against the content box above — no gap between them */
	.tabbed-module__image-wrap {
		margin-top: 0;
	}
	.tabbed-module__image-col {
		margin-bottom: 15px;
	}
}

/* ===========================
   # Responsive — 599px
=========================== */

@media (max-width: 599px) {
	.tabbed-module {
		padding-top: 36px;
	}

	.tabbed-module__content {
		gap: 24px;
	}

	.tabbed-module__image-wrap {
		min-height:    220px;
		margin-bottom: 28px;
	}
}
