/* KL Motorsport — site maison */
:root {
  --kl-blue: #2f5aae;
  --kl-blue-line: #5ec8f0;
  --kl-orange: #ff6a00;
  --kl-black: #1a1a1a;
  --kl-text: #272626;
  --kl-muted: #6b6b6b;
  --kl-light: #f4f5f7;
  --kl-white: #ffffff;
  --header-h: 100px;
  --font: "Bai Jamjuree", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--kl-text);
  background: var(--kl-white);
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--kl-white);
  height: var(--header-h);
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 16px;
}

.logo img {
  height: 58px;
  width: auto;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.socials a {
  color: var(--kl-black);
  font-size: 18px;
  line-height: 1;
  transition: color 0.2s;
}

.socials a:hover {
  color: var(--kl-orange);
}

.nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.nav .nav-link {
  font-weight: 400;
  font-size: 15px;
  color: var(--kl-black);
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav .nav-link:hover,
.nav .nav-link.is-active {
  color: var(--kl-orange);
}

.nav .nav-link.is-active {
  font-weight: 500;
}

/* Sélecteur de langue — drapeau rectangulaire coins arrondis */
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 14px;
  width: 28px;
  height: 20px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
  opacity: 0.92;
  transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  line-height: 0;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1.5px rgba(255, 106, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.1);
  outline: none;
}

.lang-switch-flag {
  display: block;
  width: 100%;
  height: 100%;
}

.lang-switch-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  justify-self: end;
}

/* Blue spacer under header */
.header-spacer {
  height: 10px;
  background: var(--kl-blue-line);
  width: 100%;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h) - 10px);
  background: center / cover no-repeat;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: var(--kl-white);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 45%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 20px 48px;
  width: 100%;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.8rem, 9vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1;
}

.hero-orange-bar {
  height: 12px;
  background: var(--kl-orange);
  width: 100%;
}

/* Mouse scroll */
.scroll-downs {
  margin-top: 18px;
}

.mousey {
  width: 22px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  display: inline-block;
  position: relative;
}

.scroller {
  width: 3px;
  height: 8px;
  background: #fff;
  border-radius: 50px;
  position: absolute;
  left: 50%;
  top: 6px;
  margin-left: -1.5px;
  animation: scroll 2.2s cubic-bezier(0.15, 0.41, 0.69, 0.94) infinite;
}

@keyframes scroll {
  0% {
    opacity: 0;
  }
  10% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(14px);
    opacity: 0;
  }
}

/* ——— Sections ——— */
.section {
  padding: 72px 28px;
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.section-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--kl-black);
}

.section-quote {
  margin: 0 auto 28px;
  text-align: center;
  font-style: italic;
  font-weight: 300;
  color: var(--kl-text);
  max-width: 720px;
}

.section-rule {
  height: 1px;
  background: #d8d8d8;
  max-width: 900px;
  margin: 0 auto 48px;
}

.section-rule.orange {
  background: var(--kl-orange);
  height: 2px;
  max-width: 100%;
  margin: 28px 0 48px;
}

/* ——— Services grid ——— */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.service-card {
  position: relative;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  color: #fff;
  background-color: #111;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-bottom: 3px solid var(--kl-orange);
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.88) 28%,
    rgba(0, 0, 0, 0.45) 52%,
    rgba(0, 0, 0, 0.08) 72%,
    transparent 100%
  );
  pointer-events: none;
}

.service-card.pos-top-left {
  background-position: left top;
}

.service-card.pos-top {
  background-position: center top;
}

.service-card.pos-top-right {
  background-position: right top;
}

.service-card.pos-left {
  background-position: left center;
}

.service-card.pos-center {
  background-position: center center;
}

.service-card.pos-right {
  background-position: right center;
}

.service-card.pos-bottom-left {
  background-position: left bottom;
}

.service-card.pos-bottom {
  background-position: center bottom;
}

.service-card.pos-bottom-right {
  background-position: right bottom;
}

.service-card-body {
  position: relative;
  z-index: 1;
  padding: 28px 22px 24px;
}

.service-card h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}

.service-card p {
  margin: 0 0 16px;
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.95);
}

.service-card .btn-link {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.service-card .btn-link:hover {
  color: var(--kl-orange);
  border-color: var(--kl-orange);
}

/* ——— Contact ——— */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 48px;
  align-items: start;
}

.contact-intro p {
  margin: 0 0 14px;
  color: var(--kl-text);
  font-weight: 300;
}

.contact-form {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-form .full {
  grid-column: 1 / -1;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid #cfcfcf;
  background: #fff;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 300;
  color: var(--kl-text);
  outline: none;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--kl-blue);
}

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

.btn-submit {
  grid-column: 1 / -1;
  justify-self: start;
  border: 0;
  background: #c8c8c8;
  color: #fff;
  padding: 12px 28px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: var(--kl-blue);
}

.form-msg {
  grid-column: 1 / -1;
  padding: 10px 12px;
  font-size: 14px;
}

.form-msg.ok {
  background: #e8f6ec;
  color: #1b6b34;
}

.form-msg.err {
  background: #fdecea;
  color: #9b1c1c;
}

.contact-side h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 700;
}

.contact-side p,
.contact-side a {
  margin: 0 0 4px;
  font-weight: 300;
  color: var(--kl-text);
}

.contact-side a {
  color: var(--kl-blue);
}

.contact-side .block {
  margin-bottom: 28px;
}

/* ——— Gallery ——— */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 28px 80px;
}

.gallery-grid a {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #eee;
  cursor: zoom-in;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery-grid a:hover img {
  transform: scale(1.05);
}

/* ——— Lightbox ——— */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 48px 72px;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.04em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  padding: 8px 12px;
  transition: color 0.2s, opacity 0.2s;
  opacity: 0.85;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--kl-orange);
  opacity: 1;
}

.lightbox-close {
  top: 16px;
  right: 20px;
  font-size: 42px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 42px;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .lightbox {
    padding: 56px 12px 24px;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 32px;
  }

  .lightbox-prev {
    left: 4px;
  }

  .lightbox-next {
    right: 4px;
  }
}

/* ——— Footer ——— */
.site-footer {
  background: var(--kl-white);
  border-top: 1px solid #ececec;
  padding: 56px 28px 24px;
}

.footer-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.footer-col h4 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
}

.footer-col a,
.footer-col p {
  display: block;
  margin: 0 0 6px;
  font-weight: 300;
  font-size: 14px;
  color: var(--kl-text);
}

.footer-col a:hover {
  color: var(--kl-blue);
}

.footer-col a.accent {
  color: #5b9bd5;
}

.footer-copy {
  max-width: 1180px;
  margin: 40px auto 0;
  text-align: center;
  color: #a0a0a0;
  font-size: 13px;
  font-weight: 300;
}

/* ——— Responsive ——— */
@media (max-width: 980px) {
  .services-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

@media (max-width: 720px) {
  :root {
    --header-h: 72px;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    padding: 0 16px;
  }

  .logo img {
    height: 42px;
  }

  .socials {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  }

  .nav.is-open {
    display: flex;
  }

  .nav .nav-link {
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav .lang-switch {
    margin: 16px 8px 8px;
    align-self: flex-start;
  }

  .services-grid,
  .gallery-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 70vh;
  }
}
