/**
 * Model Content Styles (Gutenberg Patterns)
 * CMS-driven sections for car_model CPT single pages
 *
 * @package MG
 */

/* ========================================
   Base Section Wrappers
   ======================================== */

.model-intro-section,
.model-specs-section,
.model-media-section,
.model-video-section,
.model-downloads-section {
	max-width: 1440px;
	margin: 0 auto 60px; /* Mobile */
	padding: 0 30px;
}

@media (min-width: 768px) {
	.model-intro-section,
	.model-specs-section,
	.model-media-section,
	.model-video-section,
	.model-downloads-section {
		margin-bottom: 80px; /* Tablet+ */
		padding: 0 40px;
	}
}

/* Remove bottom margin from last section */
.model-intro-section:last-child,
.model-specs-section:last-child,
.model-media-section:last-child,
.model-video-section:last-child,
.model-downloads-section:last-child {
	margin-bottom: 0;
}

/* ========================================
   1. Intro (Hasło + Tekst)
   ======================================== */

.model-intro__text {
	font-size: 18px;
	line-height: 1.6;
	color: #333;
	max-width: 800px;
	margin: 0 auto;
	text-align: center;
}

/* ========================================
   2. Specs (Parametry techniczne)
   CSS Grid auto-layout (NO wp:columns)
   ======================================== */

.model-specs__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-top: 0;
}

@media (min-width: 768px) {
	.model-specs__grid {
		gap: 24px;
	}
}

.model-specs__item {
	background: #f9f9f9;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	padding: 20px;
	margin-bottom: 0 !important; /* Override Gutenberg group margins */
}

.model-specs__label {
	font-size: 14px;
	font-weight: 350;
	color: rgb(115, 115, 140);
	text-transform: uppercase;
	line-height: 1.2;
	margin: 0 0 8px;
}

.model-specs__value {
	font-size: 40px;
	font-weight: 350;
	color: #000;
	line-height: 1.3;
	margin: 0;
}

/* ========================================
   3. Media (Galeria)
   ======================================== */

.model-media__gallery {
	margin-top: 0;
}

.model-media__gallery img {
	border-radius: 10px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* Override Gutenberg gallery gaps */
.model-media__gallery.blocks-gallery-grid {
	gap: 20px;
}

@media (min-width: 768px) {
	.model-media__gallery.blocks-gallery-grid {
		gap: 30px;
	}
}

/* ========================================
   4. Video (YouTube/Vimeo Embed)
   ======================================== */

.model-video__embed {
	max-width: 900px;
	margin: 0 auto;
}

.model-video__embed iframe {
	border-radius: 10px;
	border: none;
}

/* Gutenberg embed responsive wrapper */
.model-video__embed.wp-block-embed {
	margin-top: 0;
}

.model-video__embed .wp-block-embed__wrapper {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 aspect ratio */
	height: 0;
	overflow: hidden;
}

.model-video__embed iframe,
.model-video__embed object,
.model-video__embed embed {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* ========================================
   5. Downloads (Lista plików)
   ======================================== */

.model-downloads__list {
	max-width: 700px;
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

.model-downloads__list .wp-block-list-item {
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	padding: 20px 0;
	margin: 0;
}

.model-downloads__list .wp-block-list-item:last-child {
	border-bottom: none;
}

.model-downloads__list .wp-block-file {
	margin: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.model-downloads__list .wp-block-file a {
	color: #181818;
	text-decoration: none;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	transition: opacity 0.2s ease;
}

.model-downloads__list .wp-block-file a:hover {
	opacity: 0.7;
}

.model-downloads__list .wp-block-file .wp-block-file__button {
	display: none; /* Hide default Gutenberg download button */
}

@media (max-width: 520px) {
	.model-downloads__list .wp-block-file {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
}

/* ========================================
   FOUNDATION v1.1 — Premium Patterns Base
   Contract: DEV_CONTRACT.md v1.1, FREEZE
   ======================================== */

/* ========================================
   A) Base Container Pattern (REUSABLE)
   Contract 2.1: max-width 1440px, padding 30/40, spacing 60/80
   ======================================== */

/* Premium sections base container */
.model-hero-kpi-section,
.model-params-section,
.model-intro-params-section,
.model-narrative-section,
.model-features-section,
.model-media-slider-section,
.model-configurations-section {
	max-width: 1440px;
	margin: 0 auto 60px; /* Mobile: 60px vertical spacing */
	padding: 0 30px; /* Mobile: 30px horizontal padding */
}

@media (min-width: 768px) {
	.model-hero-kpi-section,
	.model-params-section,
	.model-intro-params-section,
	.model-narrative-section,
	.model-features-section,
	.model-media-slider-section,
	.model-configurations-section {
		margin-bottom: 80px; /* Tablet+: 80px vertical spacing */
		padding: 0 40px; /* Tablet+: 40px horizontal padding */
	}
}

/* Remove bottom margin from last section */
.model-hero-kpi-section:last-child,
.model-params-section:last-child,
.model-intro-params-section:last-child,
.model-narrative-section:last-child,
.model-features-section:last-child,
.model-media-slider-section:last-child,
.model-configurations-section:last-child {
	margin-bottom: 0;
}

/* S3B FIX: Reduce features section bottom margin (desktop only) */
@media (min-width: 768px) {
	.model-features-section,
	.model-features-section.wp-block-group {
		margin-bottom: 40px; /* Override global 80px */
	}
}

/* ========================================
   B) Gutenberg Reset Pattern (SCOPED)
   Contract: Reset margins/padding only in premium sections
   ======================================== */

/* Reset Gutenberg block group wrappers */
.model-hero-kpi-section.wp-block-group,
.model-params-section.wp-block-group,
.model-narrative-section.wp-block-group,
.model-features-section.wp-block-group,
.model-media-slider-section.wp-block-group,
.model-configurations-section.wp-block-group {
	margin: 0 auto 60px; /* Override WP margin, preserve vertical spacing */
	padding: 0 30px; /* Override WP padding, preserve horizontal padding */
}

@media (min-width: 768px) {
	.model-hero-kpi-section.wp-block-group,
	.model-params-section.wp-block-group,
	.model-narrative-section.wp-block-group,
	.model-features-section.wp-block-group,
	.model-media-slider-section.wp-block-group,
	.model-configurations-section.wp-block-group {
		margin-bottom: 80px;
		padding: 0 40px;
	}
}

/* Reset nested Gutenberg blocks inside premium sections */
.model-hero-kpi-section .wp-block-image,
.model-params-section .wp-block-image,
.model-narrative-section .wp-block-image,
.model-features-section .wp-block-image,
.model-media-slider-section .wp-block-image,
.model-configurations-section .wp-block-image,
.model-hero-kpi-section .wp-block-gallery,
.model-params-section .wp-block-gallery,
.model-narrative-section .wp-block-gallery,
.model-features-section .wp-block-gallery,
.model-media-slider-section .wp-block-gallery,
.model-configurations-section .wp-block-gallery,
.model-hero-kpi-section .wp-block-video,
.model-params-section .wp-block-video,
.model-narrative-section .wp-block-video,
.model-features-section .wp-block-video,
.model-media-slider-section .wp-block-video,
.model-configurations-section .wp-block-video {
	margin: 0; /* Remove default WP vertical margins */
}

/* Reset group margins inside premium sections */
.model-hero-kpi-section .wp-block-group,
.model-params-section .wp-block-group,
.model-narrative-section .wp-block-group,
.model-features-section .wp-block-group,
.model-media-slider-section .wp-block-group,
.model-configurations-section .wp-block-group,
.model-intro-params-section .wp-block-group {
	margin: 0; /* Remove default WP group margins */
}

/* Force display for layout containers (Gutenberg override) */
/* NOTE: Inner container fixes moved to specific sections below */
/* Keeping only non-premium section overrides here */
.model-hero-kpi__grid.wp-block-group,
.model-params__grid.wp-block-group {
	display: flex !important; /* Explicit flex for grid-like layouts using flex */
}

/* NOTE: Removed non-existent selectors:
   - .model-intro-params__layout (markup uses __content and __kpis, not __layout)
   - .model-narrative__layout (markup uses __content and __media, not __layout)
*/

/* NOTE: Premium section display overrides (intro-params, features, configurations, slider)
   moved to their respective sections below to target inner-container correctly */

/* ========================================
   C) Rounded Media Pattern (REUSABLE)
   Contract 2.2: border-radius 10px, overflow hidden, object-fit cover
   Reuse from technology.css pattern
   ======================================== */

/* Media wrapper with rounded corners */
.model-media__frame {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	background-color: #000; /* Fallback background */
}

/* Image layer for absolute positioning (hero-like overlays) */
.model-media__layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
}

/* Image styling inside media layer */
.model-media__layer img,
.model-media__layer video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Simple rounded image (no absolute positioning) */
.model-media__frame img,
.model-media__frame video {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
}

/* Aspect ratio variants (optional, controlled by BEM modifiers) */
.model-media__frame--4-3 {
	aspect-ratio: 4 / 3;
}

.model-media__frame--16-9 {
	aspect-ratio: 16 / 9;
}

.model-media__frame--square {
	aspect-ratio: 1 / 1;
}

/* Force cover when aspect ratio is set */
.model-media__frame--4-3 img,
.model-media__frame--4-3 video,
.model-media__frame--16-9 img,
.model-media__frame--16-9 video,
.model-media__frame--square img,
.model-media__frame--square video {
	object-fit: cover;
	height: 100%;
}

/* ========================================
   PREMIUM SECTIONS v1.1 — Full Implementation
   Contract: prd_content_model_sections.md + DEV_CONTRACT.md v1.1
   ======================================== */

/* ========================================
   A) Hero KPI Section (mg/model-hero-kpi)
   Premium hero enhancement with KPI metrics
   ======================================== */

.model-hero-kpi__grid {
	display: grid;
	grid-template-columns: 1fr; /* Mobile: 1 column */
	gap: 24px;
	margin-top: 32px;
}

@media (min-width: 520px) {
	.model-hero-kpi__grid {
		grid-template-columns: repeat(2, 1fr); /* Tablet: 2 columns */
	}
}

@media (min-width: 1024px) {
	.model-hero-kpi__grid {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Desktop: auto-fit, max 4 */
		gap: 32px;
	}
}

.model-hero-kpi__item {
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	padding: 24px;
	text-align: center;
	margin: 0; /* Reset Gutenberg */
}

/* First item on desktop: remove left separator */
.model-hero-kpi__item:first-child {
	border-left: 1px solid rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
	.model-hero-kpi__item {
		border-left: 2px solid #e0e0e0;
		border-top: none;
		border-right: none;
		border-bottom: none;
		border-radius: 0;
		padding: 20px 24px;
	}

	.model-hero-kpi__item:first-child {
		border-left: none;
	}
}

.model-hero-kpi__label {
	font-size: 14px;
	font-weight: 350;
	color: rgb(115, 115, 140);
	text-transform: uppercase;
	line-height: 1.2;
	margin: 0 0 12px;
}

.model-hero-kpi__value {
	font-size: 40px;
	font-weight: 350;
	color: #000;
	line-height: 1.1;
	margin: 0;
}

/* ========================================
   B) Parametry (KPI Strip) (mg/model-params)
   Horizontal parameter strip with separators
   ======================================== */

.model-params__grid {
	display: flex;
	flex-direction: column;
	gap: 0;
}

@media (min-width: 768px) {
	.model-params__grid {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
}

.model-params__item {
	padding: 24px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	text-align: center;
	margin: 0; /* Reset Gutenberg */
}

.model-params__item:first-child {
	border-top: none;
}

@media (min-width: 768px) {
	.model-params__item {
		flex: 1;
		padding: 20px 24px;
		border-top: none;
		border-left: 2px solid #e0e0e0;
	}

	.model-params__item:first-child {
		border-left: none;
	}
}

.model-params__label {
	font-size: 14px;
	font-weight: 350;
	color: rgb(115, 115, 140);
	text-transform: uppercase;
	line-height: 1.2;
	margin: 0 0 12px;
}

.model-params__value {
	font-size: 40px;
	font-weight: 350;
	color: #000;
	line-height: 1.1;
	margin: 0;
}

/* ========================================
   C) Intro + Parametry (mg/model-intro-params)
   Full-width text + horizontal KPI row
   ======================================== */

/* ETAP 1.1 B2: Remove section padding, transfer to content */
.model-intro-params-section {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Text content: full-width with transferred padding */
.model-intro-params__content {
	width: 100%;
	max-width: none; /* ETAP 1.1 B3: removed 800px limit */
	margin: 0 auto 40px;
	text-align: left;
	padding: 0 30px; /* ETAP 1.1 B2: transferred from section */
}

@media (min-width: 768px) {
	.model-intro-params__content {
		margin-bottom: 60px;
		padding: 0 40px; /* ETAP 1.1 B2: transferred from section (desktop) */
	}
}

.model-intro-params__title {
	font-size: 28px;
	font-weight: 400;
	color: rgb(46, 46, 56);
	line-height: 1.2;
	margin: 0 0 20px;
}

@media (min-width: 768px) {
	.model-intro-params__title {
		font-size: 48px; /* ETAP 1.1 B1: increased from 36px */
	}
}

.model-intro-params__text {
	font-size: 16px;
	font-weight: 350;
	color: #505062;
	line-height: 1.6;
	margin: 0;
}

/* KPI items: horizontal row with separators */
/* INNER CONTAINER FIX: Gutenberg wraps children in .wp-block-group__inner-container */
.model-intro-params__kpis {
	width: 100%; /* Outer can have width */
	padding: 0 30px; /* ETAP 1.1 B2: transferred from section */
}

@media (min-width: 768px) {
	.model-intro-params__kpis {
		padding: 0 40px; /* ETAP 1.1 B2: transferred from section (desktop) */
	}
}

.model-intro-params__kpis > .wp-block-group__inner-container {
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
}

@media (min-width: 768px) {
	.model-intro-params__kpis > .wp-block-group__inner-container {
		flex-direction: row;
		justify-content: center;
		align-items: center;
	}
}

.model-intro-params__kpi-item {
	padding: 24px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	text-align: center;
	margin: 0;
}

.model-intro-params__kpi-item:first-child {
	border-top: none;
}

@media (min-width: 768px) {
	.model-intro-params__kpi-item {
		flex: 1;
		padding: 20px 24px;
		border-top: none;
		border-left: 2px solid #e0e0e0;
	}

	.model-intro-params__kpi-item:first-child {
		border-left: none;
	}
}

.model-intro-params__kpi-label {
	font-size: 14px;
	font-weight: 350;
	color: rgb(115, 115, 140);
	text-transform: uppercase;
	line-height: 1.2;
	margin: 0 0 12px;
}

.model-intro-params__kpi-value {
	font-size: 40px;
	font-weight: 350;
	color: #000;
	line-height: 1.1;
	margin: 0;
}

/* ========================================
   D) Narrative Section (mg/model-narrative)
   Stacked layout: content + full-width media
   ======================================== */

.model-narrative-section {
	/* No background color */
}

.model-narrative__content {
	width: 100%;
	max-width: none; /* S7 FIX: Full-width content (not centered 800px) */
	margin: 0 auto 32px;
	text-align: left;
}

@media (min-width: 768px) {
	.model-narrative__content {
		margin-bottom: 40px;
	}
}

.model-narrative__eyebrow {
	font-size: 14px;
	font-weight: 500;
	color: rgb(115, 115, 140);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0 0 30px; /* ETAP 1.1 C1: increased from 16px for ~30px eyebrow→title spacing */
}

.model-narrative__title {
	font-size: 28px;
	font-weight: 400;
	color: rgb(46, 46, 56);
	line-height: 1.2;
	margin: 0 0 20px;
}

@media (min-width: 768px) {
	.model-narrative__title {
		font-size: 48px; /* ETAP 1.1 C2: increased from 36px */
	}
}

.model-narrative__text {
	font-size: 16px;
	font-weight: 350;
	color: #505062;
	line-height: 1.6;
	margin: 0;
}

/* Full-width media below content */
.model-narrative__media {
	width: 100%;
	margin: 0;
}

/* S2 FIX: Remove black fallback background (scoped to narrative only) */
.model-narrative__media .model-media__frame {
	background-color: transparent;
}

/* S1 FIX: Remove forced 16:9 aspect-ratio in narrative (allow natural img ratio) */
.model-narrative__media .model-media__frame--16-9 {
	aspect-ratio: auto;
}

.model-narrative__media .model-media__frame--16-9 img {
	height: auto;
	width: 100%;
	object-fit: cover;
	display: block;
}

/* ========================================
   D) Features Accordion (mg/model-features-left / right)
   50/50 layout with media + CSS-only accordion
   ======================================== */

/* INNER CONTAINER FIX: Gutenberg wraps children in .wp-block-group__inner-container */
.model-features__layout > .wp-block-group__inner-container {
	display: flex;
	flex-direction: column;
	gap: 32px;
	align-items: flex-start;
}

@media (min-width: 768px) {
	.model-features__layout > .wp-block-group__inner-container {
		flex-direction: row;
		gap: 40px;
		align-items: flex-start; /* S1 FIX: media height independent of accordion */
	}
}

/* Image on left (default) */
.model-features--image-left .model-features__media {
	order: 1;
}

.model-features--image-left .model-features__accordion {
	order: 2;
}

/* Image on right */
.model-features--image-right .model-features__media {
	order: 2;
}

.model-features--image-right .model-features__accordion {
	order: 1;
}

.model-features__media {
	flex: 1;
	width: 100%;
}

@media (min-width: 768px) {
	.model-features__media {
		width: 50%;
	}
}

/* ETAP 1.1 E1: Features image fills container without black bg */
.model-features__media .model-media__frame {
	min-height: 300px; /* Minimum height on mobile */
	background-color: transparent; /* ETAP 1.2: transparent background (image fills) */
}

@media (min-width: 768px) {
	.model-features__media .model-media__frame {
		min-height: 400px; /* Taller on desktop */
	}
}

.model-features__media .model-media__frame img {
	height: 100%; /* Fill frame vertically */
	object-fit: cover; /* Crop to fill, no letterbox */
}

/* S3A FIX: Remove forced 4:3 aspect-ratio in features (allow natural img ratio) */
.model-features__media .model-media__frame--4-3 {
	aspect-ratio: auto;
}

.model-features__media .model-media__frame img {
	height: auto; /* Override height:100% above - allow natural ratio */
	width: 100%;
	object-fit: cover;
	display: block;
}

.model-features__accordion {
	flex: 1;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 0;
}

@media (min-width: 768px) {
	.model-features__accordion {
		width: 50%;
	}
}

/* Accordion item (using <details> element for CSS-only) */
.model-features__item {
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	margin: 0;
}

.model-features__item:last-child {
	border-bottom: none;
}

/* Summary (clickable header) */
.model-features__item-title {
	font-size: 18px;
	font-weight: 500;
	color: #000;
	line-height: 1.4;
	padding: 20px 0;
	cursor: pointer;
	list-style: none;
	user-select: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 0;
}

/* Remove default marker */
.model-features__item-title::-webkit-details-marker {
	display: none;
}

/* Plus/minus icon */
.model-features__item-title::after {
	content: '+';
	font-size: 24px;
	font-weight: 300;
	color: #000;
	transition: transform 0.4s ease-out;
}

.model-features__item[open] .model-features__item-title::after {
	content: '−';
}

/* Content (expandable) */
.model-features__item-content {
	font-size: 16px;
	font-weight: 350;
	color: #505062;
	line-height: 1.6;
	padding: 0 0 20px 0;
	margin: 0;
	overflow: hidden;
}

/* ========================================
   E) Media Slider (mg/model-media-slider)
   Slider for model media galleries
   ======================================== */

/* S6: Hide unused section title in slider (backward compat for old instances) */
.model-media-slider-section > .wp-block-heading.t-section-title,
.model-media-slider-section > .wp-block-group__inner-container > .wp-block-heading.t-section-title {
	display: none;
}

/* Slider container with edge gutters (like hero) */
.mg-model-slider {
	position: relative; /* Required for absolute button positioning */
	width: 100%;
	max-width: none;
	flex: 1 1 auto;
	min-width: 0;
}

/* Keyboard focus indicator for slider root */
.mg-model-slider:focus-visible {
	outline: 2px solid #000;
	outline-offset: 8px;
	border-radius: 10px;
}

.mg-model-slider:focus:not(:focus-visible) {
	outline: none;
}

.mg-model-slider .swiper-container {
	overflow: hidden;
	width: 100%;
	max-width: none;
	display: block;
}

/* INNER CONTAINER FIX: Gutenberg wraps children in .wp-block-group__inner-container */
.mg-model-slider .swiper-wrapper > .wp-block-group__inner-container {
	display: flex;
	width: 100%;
	max-width: none;
}

.mg-model-slider .swiper-slide {
	flex-shrink: 0;
}

/* Edge-only gutters: controlled by JS classes */
.mg-model-slider.is-first .swiper-container {
	padding-left: 0; /* ETAP 1.1 D1: slider starts from edge */
	padding-right: 0;
}

.mg-model-slider.is-last .swiper-container {
	padding-left: 0;
	padding-right: 30px;
}

.mg-model-slider.is-single .swiper-container {
	padding-left: 30px;
	padding-right: 30px;
}

/* Slide opacity states (non-active slides dimmed) */
.mg-model-slider .swiper-slide {
	opacity: 0.6;
	transition: opacity 0.25s ease;
}

.mg-model-slider .swiper-slide-active {
	opacity: 1;
}

/* Media frame inside slide */
.mg-model-slider .model-media__frame {
	width: 100%;
	height: 100%;
}

.mg-model-slider .model-media__frame img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
}

/* ========================================
   Model Slider Navigation Buttons
   Based on carshowcase pattern (models.css:292-325)
   UX FIX: Visible prev/next controls
   ======================================== */

.mg-model-slider__nav-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 46px;
	height: 46px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	line-height: 1;
	color: #000;
	cursor: pointer;
	transition: all 0.3s ease;
	z-index: 10;
	pointer-events: auto;
	padding: 0;
	font-family: inherit;
}

.mg-model-slider__nav-btn:hover {
	background: #f7f7f7;
	border-color: rgba(0, 0, 0, 0.25);
}

.mg-model-slider__nav-btn:focus-visible {
	outline: 2px solid #000;
	outline-offset: 4px;
}

.mg-model-slider__nav-btn:active {
	transform: translateY(-50%) scale(0.95);
}

.mg-model-slider__nav-btn--prev {
	left: 12px;
}

.mg-model-slider__nav-btn--next {
	right: 12px;
}

/* Hide buttons on single slide */
.mg-model-slider.is-single .mg-model-slider__nav-btn {
	display: none;
}

/* Disable prev on first slide, next on last slide */
.mg-model-slider.is-first .mg-model-slider__nav-btn--prev,
.mg-model-slider.is-last .mg-model-slider__nav-btn--next {
	opacity: 0.3;
	pointer-events: none;
}

/* Responsive: adjust sizing on mobile */
@media (max-width: 767px) {
	.mg-model-slider__nav-btn {
		width: 40px;
		height: 40px;
		font-size: 28px;
	}

	.mg-model-slider__nav-btn--prev {
		left: 8px;
	}

	.mg-model-slider__nav-btn--next {
		right: 8px;
	}
}

/* ========================================
   F) Configurations Grid (mg/model-configurations-grid)
   Grid of configuration cards
   ======================================== */

/* INNER CONTAINER FIX: Gutenberg wraps children in .wp-block-group__inner-container */
.model-configurations__grid > .wp-block-group__inner-container {
	display: grid;
	grid-template-columns: 1fr; /* Mobile: 1 column */
	gap: 24px;
	margin-top: 32px;
}

@media (min-width: 520px) {
	.model-configurations__grid > .wp-block-group__inner-container {
		grid-template-columns: repeat(2, 1fr); /* Tablet: 2 columns */
	}
}

@media (min-width: 1024px) {
	.model-configurations__grid > .wp-block-group__inner-container {
		grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Desktop: auto-fit */
		gap: 32px;
	}
}

.model-configurations__card {
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0; /* Reset Gutenberg */
}

.model-configurations__card-image {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 10px;
	overflow: hidden;
	background: #f5f5f5;
	margin: 0;
}

.model-configurations__card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 10px;
}

.model-configurations__card-title {
	font-size: 20px;
	font-weight: 500;
	color: #000;
	line-height: 1.3;
	margin: 0;
}

.model-configurations__card-description {
	font-size: 16px;
	font-weight: 350;
	color: #505062;
	line-height: 1.5;
	margin: 0;
}

/* Specs list inside card */
.model-configurations__specs {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.model-configurations__spec {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.model-configurations__spec:last-child {
	border-bottom: none;
}

.model-configurations__spec-label {
	font-size: 14px;
	font-weight: 350;
	color: rgb(115, 115, 140);
	margin: 0;
}

.model-configurations__spec-value {
	font-size: 16px;
	font-weight: 500;
	color: #000;
	margin: 0;
}

/* CTA link */
.model-configurations__cta {
	margin-top: auto;
	padding-top: 8px;
}

/* S2 FIX: DS Bordered Button Styling (transparent bg + 1px solid black) */
.model-configurations__cta .wp-block-button__link,
.model-configurations__cta .wp-block-file__button {
	/* Base button styles */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: var(--mg-space-3) var(--mg-space-6);
	font-family: var(--mg-font-sans);
	font-size: var(--mg-text-base);
	font-weight: var(--mg-font-weight-medium);
	line-height: var(--mg-leading-none);
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;

	/* Bordered + Transparent variant (DS buttons.css:90-108) */
	background: transparent;
	background-color: transparent;
	background-image: none;
	border: 1px solid #000;
	border-radius: var(--mg-radius-md);
	color: #000;
	transition: background-color 0.3s ease, color 0.3s ease, transform 0.1s ease;
}

.model-configurations__cta .wp-block-button__link:hover,
.model-configurations__cta .wp-block-button__link:focus-visible,
.model-configurations__cta .wp-block-file__button:hover,
.model-configurations__cta .wp-block-file__button:focus-visible {
	background: #000;
	background-color: #000;
	border-color: #000;
	color: #fff;
}

/* S4 FIX: Hide filename link from wp:file (backward compat) */
.model-configurations__cta a:not(.wp-block-file__button):not(.wp-block-button__link) {
	display: none;
}

/* ========================================
   HERO CAR_MODEL (Premium)
   Contract: prd_content_model_sections.md C1
   Scoped to car_model CPT only
   ======================================== */

/* Premium hero for car_model: larger, title top, KPI bottom */
body.single-car_model .page-hero {
	min-height: 600px; /* Premium: larger hero */
	display: flex;
	flex-direction: column;
	justify-content: space-between; /* Title top, KPI bottom */
	position: relative;
}

@media (min-width: 768px) {
	body.single-car_model .page-hero {
		min-height: 700px; /* Desktop: even larger */
	}
}

/* Header (title at top) */
body.single-car_model .page-hero__header {
	padding-top: 60px;
	text-align: left;
	max-width: 1440px;
	margin: 0;
	padding-left: 30px;
	padding-right: 30px;
	z-index: 2;
	position: relative;
}

@media (min-width: 768px) {
	body.single-car_model .page-hero__header {
		padding-top: 80px;
		padding-left: 40px;
		padding-right: 40px;
	}
}

/* Premium hero title typography */
body.single-car_model .page-hero__title {
	font-size: 48px;
	font-weight: 350;
	color: #fff;
	line-height: 1.1;
	margin: 0;
	text-align: left;
}

@media (min-width: 768px) {
	body.single-car_model .page-hero__title {
		font-size: 80px;
	}
}

/* KPI section (bottom) */
body.single-car_model .page-hero__kpi {
	display: flex;
	flex-direction: column;
	gap: 0;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 30px; /* ETAP 1.2: removed 40px bottom padding */
	width: 100%;
	z-index: 2;
	position: relative;
}

@media (min-width: 768px) {
	body.single-car_model .page-hero__kpi {
		flex-direction: row;
		justify-content: center;
		align-items: center;
		padding: 0 40px; /* ETAP 1.2: removed 60px bottom padding */
	}
}

/* KPI item */
body.single-car_model .page-hero__kpi-item {
	padding: 24px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	text-align: center;
	flex: 1;
	min-width: 0;
}

body.single-car_model .page-hero__kpi-item:first-child {
	border-top: none;
}

@media (min-width: 768px) {
	body.single-car_model .page-hero__kpi-item {
		padding: 20px 24px;
		border-top: none;
		border-left: 2px solid rgba(255, 255, 255, 0.2); /* ETAP 1.2: white borders for dark overlay */
	}

	body.single-car_model .page-hero__kpi-item:first-child {
		border-left: none;
	}
}

/* KPI label (FREEZE typography) */
body.single-car_model .page-hero__kpi-label {
	font-size: 14px;
	font-weight: 500; /* ETAP 1.2: BOLD for readability on dark overlay */
	color: rgba(255, 255, 255, 0.7); /* ETAP 1.1 A1: white semi-transparent for dark overlay */
	text-transform: uppercase;
	line-height: 1.2;
	margin: 0 0 12px;
}

/* KPI value (FREEZE typography) */
body.single-car_model .page-hero__kpi-value {
	font-size: 32px; /* ETAP 1.1 A1: reduced from 40px (mobile) */
	font-weight: 350;
	color: #fff; /* ETAP 1.1 A1: white for dark overlay */
	line-height: 1.1;
	margin: 0;
}

@media (min-width: 768px) {
	body.single-car_model .page-hero__kpi-value {
		font-size: 36px; /* ETAP 1.1 A1: desktop slightly larger */
	}
}

/* ========================================
   P1 FIX: Single Source Spacing
   Reset container padding completely
   Premium sections are sole source of horizontal padding
   ======================================== */

/* Reset container padding completely */
body.single-car_model .page-content-container {
	padding: 0 !important; /* Override BASE (page-content.css) */
}

/* Vertical spacing: first element in entry-content (can be group/heading/paragraph) */
body.single-car_model .entry-content > .wp-block-group:first-child,
body.single-car_model .entry-content > .wp-block-heading:first-child,
body.single-car_model .entry-content > p:first-child {
	margin-top: 60px; /* Mobile: space after hero */
}

@media (min-width: 768px) {
	body.single-car_model .entry-content > .wp-block-group:first-child,
	body.single-car_model .entry-content > .wp-block-heading:first-child,
	body.single-car_model .entry-content > p:first-child {
		margin-top: 80px; /* Desktop: more breathing room */
	}
}

/* Vertical spacing: last premium section (typically a group block) */
body.single-car_model .entry-content > .wp-block-group:last-child {
	margin-bottom: 60px; /* Mobile: space before CTA/footer */
}

@media (min-width: 768px) {
	body.single-car_model .entry-content > .wp-block-group:last-child {
		margin-bottom: 80px; /* Desktop: more breathing room */
	}
}

/* ========================================
   ETAP 1.3 — car_model premium title ownership
   Fix: Premium section titles override global .entry-content h2
   Scope: Only .model-*__title classes (not plain h2)
   ======================================== */

/* Premium titles: base (mobile) - override page-content.css:161-175 */
body.single-car_model .entry-content .model-intro-params__title,
body.single-car_model .entry-content .model-narrative__title {
	font-size: 28px;
	line-height: 1.2;
	margin-top: 0; /* Override .entry-content h2 (2em) */
	margin-bottom: 20px;
	color: rgb(46, 46, 56); /* Override .entry-content h2 (color: #000) */
}

/* Premium titles: desktop */
@media (min-width: 768px) {
	body.single-car_model .entry-content .model-intro-params__title,
	body.single-car_model .entry-content .model-narrative__title {
		font-size: 48px; /* Override .entry-content h2 (28px) */
	}
}
