/* ============================================
   MBA Groupe SA — Competence Pages
   ============================================ */

/* --- White/Light Theme (ASV Fenêtres & Portes) --- */
.theme-orange {
  --accent: #E8751A;
  --accent-light: #F4943D;
}

/* Override dark body */
body.theme-orange {
  background: var(--white);
}

/* Light intro section */
.theme-orange .comp-dark-section {
  background: var(--white);
}

.theme-orange .comp-intro__label {
  color: var(--accent);
}

.theme-orange .comp-intro__title {
  color: var(--black);
}

.theme-orange .comp-intro__title .highlight {
  color: var(--accent);
}

.theme-orange .comp-intro__text p {
  color: var(--gray-dark);
}

.theme-orange .comp-intro__logo-bg {
  background:
    radial-gradient(ellipse at 70% 30%, rgba(232, 117, 26, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #f0f0f0 0%, #e8e8e8 50%, #f0f0f0 100%);
}

.theme-orange .comp-intro__logo-bg::after {
  background-image:
    linear-gradient(135deg, transparent 60%, rgba(0,0,0,0.02) 60%, rgba(0,0,0,0.02) 70%, transparent 70%),
    linear-gradient(45deg, transparent 65%, rgba(232,117,26,0.05) 65%, rgba(232,117,26,0.05) 75%, transparent 75%);
}

/* Stats bar */
.theme-orange .comp-stats {
  background: linear-gradient(135deg, var(--accent) 0%, #FDD900 100%);
}

.theme-orange .comp-stats__number {
  color: var(--black);
}

.theme-orange .comp-stats__label {
  color: rgba(0, 0, 0, 0.6);
}

/* Light content area */
.theme-orange .content-competence--dark {
  background: var(--white);
}

.theme-orange .content-competence--dark h2 {
  color: var(--black);
}

.theme-orange .content-competence--dark .gallery-block__sub {
  color: var(--gray-metal);
}

/* Services carousel - light right panel */
.theme-orange .feature-carousel {
  border: 1px solid #e0e0e0;
}

.theme-orange .feature-carousel__left {
  background:
    radial-gradient(ellipse at 70% 30%, rgba(253, 217, 0, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(232, 117, 26, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 50%, #1a1a1a 100%);
}

.theme-orange .feature-carousel__left::after {
  background-image:
    linear-gradient(135deg, transparent 60%, rgba(253,217,0,0.03) 60%, rgba(253,217,0,0.03) 70%, transparent 70%),
    linear-gradient(45deg, transparent 65%, rgba(232,117,26,0.04) 65%, rgba(232,117,26,0.04) 75%, transparent 75%);
}

.theme-orange .feature-carousel__heading {
  color: var(--white) !important;
}

.theme-orange .feature-carousel__chip.active {
  background: var(--accent);
  border-color: var(--accent);
}

.theme-orange .feature-carousel__right {
  background: var(--gray-light);
}

.theme-orange .feature-carousel__card {
  border-color: #e0e0e0;
  background: var(--white);
}

.theme-orange .feature-carousel__card.active {
  border-color: var(--accent);
}

.theme-orange .feature-carousel__card-tag {
  background: var(--accent);
}

/* Hero title */
.theme-orange .seh__title {
  color: var(--white);
}

/* Buttons */
.theme-orange .btn-primary {
  background: var(--accent);
}

.theme-orange .btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 6px 20px rgba(232, 117, 26, 0.3);
}

.theme-orange .carousel-card:hover {
  border-color: var(--accent);
}

.theme-orange .contact-competence .btn-primary {
  background: var(--accent);
}

.theme-orange .contact-competence .btn-primary:hover {
  background: var(--accent-light);
}

/* --- Hero Competence --- */
.hero-competence {
  background: var(--black);
  color: var(--white);
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero-competence::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(135deg, rgba(253, 217, 0, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

/* Image hero variant */
.hero-competence--image {
  background-size: cover;
  background-position: center;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  padding: 0 0 60px;
}

.hero-competence--image::before {
  display: none;
}

.hero-competence__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.7) 100%);
  z-index: 0;
}

.hero-competence--image .container {
  position: relative;
  z-index: 1;
}

.hero-competence .accent-line {
  display: inline-block;
  width: 60px;
  height: 3px;
  background: var(--yellow);
  margin-bottom: 1.5rem;
}

.hero-competence h1 {
  color: var(--white);
  margin-bottom: 1rem;
}

.hero-competence .hero-tagline {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  max-width: 600px;
}

/* --- Content Wrapper --- */
.content-competence {
  padding: 80px 0 0;
}

/* --- Content Sections --- */
.description-block,
.services-block,
.gallery-block,
.advantages-block,
.companies-involved {
  margin-bottom: 80px;
}

.description-block h2,
.services-block h2,
.gallery-block h2,
.advantages-block h2,
.companies-involved h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 12px;
}

.description-block h2::after,
.services-block h2::after,
.gallery-block h2::after,
.advantages-block h2::after,
.companies-involved h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--yellow);
}

.description-block p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gray-dark);
  max-width: none;
}

/* CTA Card (logo + text) */
.cta-card {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  border-radius: 12px;
  border: none;
  background: transparent;
  box-shadow: none;
  margin-bottom: 80px;
}

.cta-card__image {
  flex-shrink: 0;
  width: 33%;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.cta-card__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(253, 217, 0, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 50%, #1a1a1a 100%);
}

.cta-card__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, transparent 60%, rgba(255,255,255,0.02) 60%, rgba(255,255,255,0.02) 70%, transparent 70%),
    linear-gradient(45deg, transparent 65%, rgba(253,217,0,0.04) 65%, rgba(253,217,0,0.04) 75%, transparent 75%);
}

.cta-card__image img {
  width: 100%;
  max-width: 240px;
  height: auto;
  position: relative;
  z-index: 1;
}

.cta-card__content {
  flex: 1;
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cta-card__label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.cta-card__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--black);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.cta-card__desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--gray-dark);
  margin-bottom: 12px;
}

.cta-card__content .btn {
  margin-top: 12px;
  align-self: flex-start;
}

.cta-card--reversed .cta-card__content {
  order: 1;
}

.cta-card--reversed .cta-card__image {
  order: 2;
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--white);
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--yellow);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.service-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--black);
}

.service-card p {
  font-size: 0.9rem;
  color: var(--gray-dark);
  line-height: 1.6;
}

/* --- Gallery --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.gallery-placeholder {
  aspect-ratio: 4/3;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.gallery-placeholder:nth-child(1) {
  background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
}

.gallery-placeholder:nth-child(2) {
  background: linear-gradient(135deg, #d5d5d5 0%, #c0c0c0 100%);
}

.gallery-placeholder:nth-child(3) {
  background: linear-gradient(135deg, #dcdcdc 0%, #b8b8b8 100%);
}

.gallery-placeholder:nth-child(4) {
  background: linear-gradient(135deg, #e0e0e0 0%, #c8c8c8 100%);
}

.gallery-placeholder::after {
  content: 'Photo';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--gray-metal);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Expand Gallery --- */
.gallery-block__sub {
  font-size: 0.95rem;
  color: var(--gray-metal);
  margin-bottom: 32px;
}

.expand-gallery {
  display: flex;
  gap: 8px;
  height: 420px;
  width: 100%;
}

.expand-gallery__item {
  position: relative;
  flex: 1;
  min-width: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: flex 0.5s ease;
}

.expand-gallery__item:hover {
  flex: 4;
}

.expand-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* --- Advantages Grid --- */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.advantage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.advantage .icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.advantage:hover .icon-circle {
  background: var(--yellow);
}

.advantage .icon-circle svg {
  width: 28px;
  height: 28px;
  stroke: var(--black);
  fill: none;
  stroke-width: 2;
}

.advantage h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.25rem;
}

.advantage p {
  font-size: 0.85rem;
  color: var(--gray-dark);
}

/* --- Companies Involved --- */
.companies-involved .companies-box {
  background: var(--gray-light);
  border-radius: 4px;
  padding: 32px 40px;
  border-left: 4px solid var(--yellow);
}

.companies-involved .companies-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.companies-involved .companies-box li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
  color: var(--gray-dark);
}

.companies-involved .companies-box li:last-child {
  border-bottom: none;
}

.companies-involved .companies-box li strong {
  color: var(--black);
  font-weight: 600;
}

/* --- Contact Competence --- */
.contact-competence {
  padding: 80px 0;
  background: var(--gray-light);
}

.contact-competence__grid {
  display: flex;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.contact-competence__photo {
  flex-shrink: 0;
  width: 40%;
}

.contact-competence__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Stacked layout (photo on top, form below) */
.contact-competence__grid--stacked {
  flex-direction: column;
  max-width: 700px;
  margin: 0 auto;
}

.contact-competence__photo--banner {
  width: 100%;
  height: auto;
  background: var(--black);
}

.contact-competence__photo--banner img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.contact-competence__form {
  flex: 1;
  padding: 48px;
}

.contact-competence__form h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  color: var(--black);
  margin-bottom: 8px;
}

.contact-competence__sub {
  font-size: 0.95rem;
  color: var(--gray-metal);
  margin-bottom: 28px;
}

.contact-competence .contact-form label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-dark);
  margin-bottom: 6px;
}

.contact-competence .contact-form input,
.contact-competence .contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--black);
  margin-bottom: 20px;
  transition: border-color 0.2s ease;
  background: var(--white);
}

.contact-competence .contact-form input:focus,
.contact-competence .contact-form textarea:focus {
  outline: none;
  border-color: var(--yellow);
}

.contact-competence .contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

/* --- CTA Competence --- */
.cta-competence {
  background: var(--black);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}

.cta-competence h2 {
  color: var(--white);
  margin-bottom: 1rem;
}

.cta-competence p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* --- Dark Competence Page Override --- */
body:has(.comp-dark-section) {
  background: var(--black);
}

body.theme-orange:has(.comp-dark-section) {
  background: var(--white);
}

/* --- Dark Page Sections --- */
.comp-dark-section {
  background: var(--black);
  padding: 100px 0;
}

.comp-intro {
  display: flex;
  align-items: center;
  gap: 60px;
}

.comp-intro__text {
  flex: 1;
}

.comp-intro__label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 16px;
}

.comp-intro__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 24px;
}

.comp-intro__title .highlight {
  color: var(--yellow);
}

.comp-intro__text p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.8;
  margin-bottom: 16px;
}

.comp-intro__text .btn {
  margin-top: 12px;
}

.comp-intro__logo {
  flex-shrink: 0;
  width: 280px;
  height: 280px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
  position: relative;
  overflow: hidden;
}

.comp-intro__logo-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(253, 217, 0, 0.15) 0%, transparent 55%),
    linear-gradient(180deg, #222 0%, #111 50%, #222 100%);
  border-radius: 8px;
}

.comp-intro__logo-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, transparent 60%, rgba(255,255,255,0.03) 60%, rgba(255,255,255,0.03) 70%, transparent 70%),
    linear-gradient(45deg, transparent 65%, rgba(253,217,0,0.05) 65%, rgba(253,217,0,0.05) 75%, transparent 75%);
}

.comp-intro__logo img {
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

/* Stats bar */
.comp-stats {
  background: var(--yellow);
  padding: 48px 0;
}

.comp-stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.comp-stats__number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--black);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}

.comp-stats__label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Dark content wrapper */
.content-competence--dark {
  background: var(--black);
  padding-top: 80px;
}

.content-competence--dark h2 {
  color: var(--white);
}

.content-competence--dark .gallery-block__sub {
  color: rgba(255, 255, 255, 0.5);
}

/* Dual logos layout */
.comp-intro__logos {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-shrink: 0;
}

.comp-intro__logos .comp-intro__logo {
  width: 220px;
  height: 180px;
  padding: 36px;
}

.comp-intro__logo-bg--light {
  background: #f0f0f0 !important;
}

.comp-intro__logo-bg--light::after {
  background-image:
    linear-gradient(135deg, transparent 60%, rgba(0,0,0,0.02) 60%, rgba(0,0,0,0.02) 70%, transparent 70%),
    linear-gradient(45deg, transparent 65%, rgba(232,117,26,0.04) 65%, rgba(232,117,26,0.04) 75%, transparent 75%) !important;
}

/* --- Before/After Comparison Slider --- */
.comparison-section h2 {
  color: var(--white);
  margin-bottom: 8px;
}

.comparison-section__sub {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 80px;
}

.img-comparison {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.img-comparison__before {
  display: block;
  width: 100%;
  height: auto;
}

.img-comparison__after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
}

.img-comparison__after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left;
}

.img-comparison__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.img-comparison__handle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  color: var(--gray-dark);
  transition: transform 0.2s ease;
}

.img-comparison.dragging .img-comparison__handle-btn {
  transform: scale(1.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.img-comparison__label {
  position: absolute;
  bottom: 12px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 2;
}

.img-comparison__label--avant {
  right: 12px;
}

.img-comparison__label--apres {
  left: 12px;
}

/* Section heading above carousel */
.section-heading {
  margin-bottom: 32px;
}

/* --- Feature Carousel (Services) --- */
.feature-carousel {
  display: flex;
  border-radius: 24px;
  overflow: hidden;
  min-height: 500px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 80px;
}

.feature-carousel__left {
  width: 40%;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(253, 217, 0, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 50%, #1a1a1a 100%);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.feature-carousel__left::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, transparent 60%, rgba(255,255,255,0.02) 60%, rgba(255,255,255,0.02) 70%, transparent 70%),
    linear-gradient(45deg, transparent 65%, rgba(253,217,0,0.04) 65%, rgba(253,217,0,0.04) 75%, transparent 75%);
  pointer-events: none;
}

.feature-carousel__heading {
  color: var(--yellow);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 32px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 1;
}

.feature-carousel__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.feature-carousel__chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.4s ease;
  text-align: left;
}

.feature-carousel__chip:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.feature-carousel__chip.active {
  background: var(--yellow);
  color: var(--black);
  border-color: var(--yellow);
}

.feature-carousel__chip svg {
  flex-shrink: 0;
}

.feature-carousel__right {
  flex: 1;
  background: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.feature-carousel__cards {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4/5;
}

.feature-carousel__card {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid rgba(253, 217, 0, 0.4);
  background: #1a1a1a;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: scale(0.85) translateX(80px);
  pointer-events: none;
}

.feature-carousel__card.active {
  opacity: 1;
  transform: scale(1) translateX(0);
  z-index: 3;
  pointer-events: auto;
  border-color: var(--yellow);
}

.feature-carousel__card.prev {
  opacity: 0.4;
  transform: scale(0.88) translateX(-60px) rotate(-3deg);
  z-index: 2;
  filter: grayscale(0.5) brightness(0.8);
}

.feature-carousel__card.next {
  opacity: 0.4;
  transform: scale(0.88) translateX(60px) rotate(3deg);
  z-index: 1;
  filter: grayscale(0.5) brightness(0.8);
}

.feature-carousel__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feature-carousel__card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.feature-carousel__card.active .feature-carousel__card-overlay {
  opacity: 1;
}

.feature-carousel__card-tag {
  display: inline-block;
  background: var(--yellow);
  color: var(--black);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 12px;
  border-radius: 50px;
  margin-bottom: 10px;
  width: fit-content;
}

.feature-carousel__card-overlay p {
  color: var(--white);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 0;
}

/* --- Competences Carousel --- */
.competences-carousel {
  padding: 80px 0;
  background: var(--gray-light);
}

.competences-carousel__title {
  color: var(--black);
}

.competences-carousel__title {
  text-align: center;
  margin-bottom: 40px;
}

.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 0;
  flex: 1;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 28px 24px;
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
}

.carousel-card:hover {
  border-color: var(--yellow);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.carousel-card__img {
  width: 100%;
  height: 120px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e0e0e0 0%, #c8c8c8 100%);
  margin-bottom: 16px;
  overflow: hidden;
}

.carousel-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 6px;
}

.carousel-card p {
  font-size: 0.8rem;
  color: var(--gray-metal);
  margin-bottom: 0;
  line-height: 1.5;
}

.carousel-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-dark);
  transition: all 0.2s ease;
}

.carousel-btn:hover {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--black);
}

/* --- Scroll-Expansion Hero --- */
.seh__scroll {
  height: 300vh;
  position: relative;
}

.seh__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
}

.seh__bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(0.3);
  opacity: calc(1 - var(--p, 0) * 0.5);
  transform: scale(1.1);
}

.seh__media {
  position: relative;
  z-index: 2;
  overflow: hidden;
  box-shadow: 0 4px 80px rgba(0, 0, 0, 0.6);
  --sw: 300px;
  --sh: 400px;
  width: calc(var(--sw) + var(--p, 0) * (100vw - var(--sw)));
  height: calc(var(--sh) + var(--p, 0) * (100vh - var(--sh)));
  border-radius: calc(16px * (1 - var(--p, 0)));
}

.seh__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.seh__media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.seh__titles {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.seh__title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 800;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.1;
  margin-bottom: 0;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.seh__title--top {
  opacity: 1;
  transform: none;
}

.seh__tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--white);
  font-weight: 500;
  margin-top: 12px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.seh__hint {
  margin-top: 20px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: calc(1 - var(--p, 0) * 4);
  animation: seh-pulse 2.5s ease-in-out infinite;
}

@keyframes seh-pulse {
  0%, 100% { transform: translateY(0); opacity: calc((1 - var(--p, 0) * 4) * 0.4); }
  50% { transform: translateY(4px); opacity: calc(1 - var(--p, 0) * 4); }
}

/* --- Projets actuels grid --- */
.projets-actuels {
  background: var(--black);
  padding: 80px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.projets-actuels__title {
  color: var(--white);
  text-align: center;
  margin-bottom: 48px;
}

.projets-actuels__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.projet-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.35s ease;
}

.projet-card:hover {
  border-color: var(--yellow);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(253, 217, 0, 0.1);
}

.projet-card__img {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.projet-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.projet-card:hover .projet-card__img img {
  transform: scale(1.05);
}

.projet-card__body {
  padding: 24px;
}

.projet-card__body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 8px;
}

.projet-card__body p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0;
}

/* --- Realisations Carousels --- */
.projet-realisations {
  background: var(--black);
  padding: 80px 0;
}

.projet-realisations h2 {
  color: var(--white);
  text-align: center;
  margin-bottom: 8px;
}

.projet-realisations__sub {
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-bottom: 48px;
}

.realisations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.realisation-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.realisation-carousel__viewport {
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

.realisation-carousel__track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.realisation-carousel__track img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: #111;
  flex-shrink: 0;
}

.realisation-carousel__prev,
.realisation-carousel__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.2s ease;
  color: var(--black);
}

.realisation-carousel__prev { left: 12px; }
.realisation-carousel__next { right: 12px; }

.realisation-carousel__prev:hover,
.realisation-carousel__next:hover {
  background: var(--white);
  transform: translateY(-50%) scale(1.1);
}

.realisation-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.realisation-carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.realisation-carousel__dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--white);
}

/* Orange theme overrides for realisations */
.theme-orange .projet-realisations {
  background: var(--black);
}

.theme-orange .realisation-carousel h3 {
  color: var(--accent);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero-competence {
    padding: 100px 0 60px;
  }

  .content-competence {
    padding: 60px 0 0;
  }

  .description-block,
  .services-block,
  .gallery-block,
  .advantages-block,
  .companies-involved {
    margin-bottom: 60px;
  }

  .cta-card {
    flex-direction: column;
  }

  .cta-card__image {
    width: 100%;
    padding: 36px;
  }

  .cta-card__image img {
    max-width: 140px;
  }

  .cta-card__content {
    padding: 28px 24px;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .expand-gallery {
    height: auto;
    gap: 0;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 12px;
    position: relative;
  }

  .expand-gallery::-webkit-scrollbar {
    display: none;
  }

  .expand-gallery__item {
    flex: 0 0 85%;
    min-width: 85%;
    height: auto;
    aspect-ratio: 4/3;
    border-radius: 0;
    scroll-snap-align: center;
    margin-right: 8px;
  }

  .expand-gallery__item:first-child {
    border-radius: 12px 0 0 12px;
  }

  .expand-gallery__item:last-child {
    border-radius: 0 12px 12px 0;
    margin-right: 0;
  }

  .expand-gallery__item:hover {
    flex: 0 0 85%;
  }

  .expand-gallery__item img {
    border-radius: 0;
  }

  /* Mobile gallery dots */
  .gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
  }

  .gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .gallery-dot.active {
    background: var(--yellow);
    width: 20px;
    border-radius: 4px;
  }

  .advantages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .companies-involved .companies-box {
    padding: 24px 20px;
  }

  .cta-competence {
    padding: 60px 0;
  }

  .contact-competence {
    padding: 50px 0;
  }

  .comp-intro {
    flex-direction: column-reverse;
    gap: 24px;
    text-align: center;
  }

  .comp-intro__logo {
    width: 200px;
    height: 200px;
    padding: 20px;
    margin: 0 auto;
  }

  .comp-intro__label {
    display: none;
  }

  .comp-intro__logos {
    order: 2;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .comp-intro__logos {
    flex-direction: row;
    justify-content: center;
  }

  .comp-intro__logos .comp-intro__logo {
    width: 160px;
    height: 140px;
    padding: 28px;
  }

  .comp-dark-section {
    padding: 60px 0;
  }

  .comp-stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .feature-carousel {
    flex-direction: column;
    min-height: auto;
    border-radius: 16px;
  }

  .feature-carousel__left {
    width: 100%;
    padding: 32px 24px;
  }

  .feature-carousel__chip {
    padding: 10px 18px;
    font-size: 0.75rem;
  }

  .feature-carousel__right {
    padding: 24px;
    min-height: 400px;
  }

  .feature-carousel__cards {
    max-width: 300px;
  }

  .feature-carousel__card {
    border-width: 4px;
    border-radius: 14px;
  }

  .competences-carousel {
    padding: 50px 0;
  }

  .carousel-btn {
    display: none;
  }

  .carousel-card {
    flex: 0 0 180px;
  }

  .contact-competence__grid {
    flex-direction: column;
  }

  .contact-competence__photo {
    width: 100%;
    height: auto;
    max-height: 450px;
  }

  .contact-competence__photo img {
    object-position: center top;
    height: auto;
    max-height: 450px;
  }

  .contact-competence__form {
    padding: 28px 24px;
  }

  .seh__scroll {
    height: 220vh;
  }

  .seh__media {
    --sw: 220px;
    --sh: 300px;
  }

  .seh__title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .projets-actuels__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .realisations-grid {
    grid-template-columns: 1fr;
  }

  .projet-realisations {
    padding: 50px 0;
  }
}

@media (max-width: 480px) {
  .feature-carousel__left {
    padding: 24px 20px;
  }

  .feature-carousel__chip {
    padding: 8px 14px;
    font-size: 0.7rem;
  }

  .projets-actuels__grid {
    gap: 16px;
  }

  .projet-card__img {
    height: 160px;
  }

  .projet-card__body {
    padding: 16px;
  }

  .projet-card__body h3 {
    font-size: 0.95rem;
  }
}
