/* =============================================================
   ZTRANS — FEUILLE DE STYLE
   Palette extraite du logo fourni :
     - navy  #23292f  (texte "trans" et silhouette du bus)
     - blue  #024791  (le "Z" et la baseline du logo)
   Typographies : Space Grotesk (titres, caractère géométrique et
   affirmé — écho au "Z" dynamique du logo), IBM Plex Sans (texte
   courant), IBM Plex Mono (tableau des départs, esprit panneau de gare).
   ============================================================= */

:root {
  --navy: #1e242a;
  --navy-soft: #2b333b;
  --blue: #024791;
  --blue-bright: #0d63c9;
  --white: #ffffff;
  --mist: #eef1f4;      /* fond clair légèrement bleuté, alternative au blanc pur */
  --ink: #1b1f24;
  --ink-light: #5b6470;
  --line: #dde2e7;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --section-padding: clamp(64px, 8vw, 108px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--white);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, dl { list-style: none; }
button { font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--blue-bright);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: var(--section-padding) 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 600;
  max-width: 620px;
  margin-bottom: 44px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--blue-bright);
  display: inline-block;
  margin-bottom: 14px;
}

.eyebrow-dark { color: var(--blue); }

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-primary {
  background-color: var(--blue);
  color: var(--white);
}
.btn-primary:hover {
  background-color: var(--blue-bright);
  transform: translateY(-2px);
}

/* --- Traitement photo unifié : duotone navy/bleu sur toutes les images --- */
.photo-duotone {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(45%) contrast(1.08) brightness(0.95);
}

/* Le conteneur d'une image dupliquée reçoit l'overlay via ::after en HTML/CSS combinés :
   ici on applique l'overlay directement sur le parent qui contient l'image */
.hero-media, .bento-tile, .why-media, .fares-media {
  position: relative;
  overflow: hidden;
}

.hero-media::after, .bento-tile::after, .why-media::after, .fares-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(2, 71, 145, 0.5), rgba(30, 36, 42, 0.55));
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* Légères variations de teinte pour différencier des photos réutilisées sur plusieurs tuiles */
.hue-a { filter: grayscale(45%) contrast(1.08) brightness(0.95) hue-rotate(6deg); }
.hue-b { filter: grayscale(45%) contrast(1.08) brightness(0.95) hue-rotate(-8deg); }
.hue-c { filter: grayscale(45%) contrast(1.08) brightness(0.95) hue-rotate(10deg); }
.hue-d { filter: grayscale(45%) contrast(1.08) brightness(0.95) hue-rotate(-5deg); }
.hue-e { filter: grayscale(45%) contrast(1.08) brightness(0.95) hue-rotate(4deg); }

/* -------------------------------------------------------------
   HEADER
------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--white);
  box-shadow: 0 1px 0 var(--line);
}

.utility-bar {
  background-color: var(--navy);
  color: rgba(255,255,255,0.82);
  font-size: 0.8rem;
  overflow: hidden;
  max-height: 40px;
  transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.3s ease;
}

.utility-bar.collapsed {
  max-height: 0;
  opacity: 0;
}

.utility-inner {
  display: flex;
  justify-content: space-between;
  padding: 9px 24px;
  flex-wrap: wrap;
  gap: 6px;
}

.utility-inner a { color: var(--white); font-weight: 600; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  transition: padding 0.3s ease;
}

.site-header.scrolled .header-inner {
  padding: 10px 0;
}

.logo-img {
  height: 42px;
  width: auto;
  transition: height 0.3s ease;
}

.site-header.scrolled .logo-img {
  height: 34px;
}

.main-nav ul {
  display: flex;
  gap: 36px;
}

.nav-link {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  position: relative;
  padding-bottom: 4px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background-color: var(--blue);
  transition: width 0.25s ease;
}

.nav-link:hover::after { width: 100%; }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px; height: 38px;
  background: none; border: none; cursor: pointer;
}

.hamburger span {
  display: block; height: 2px; width: 100%;
  background-color: var(--navy);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -------------------------------------------------------------
   HERO — panneau texte sombre + photo en diagonale
------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  min-height: 640px;
}

.hero-panel {
  background-color: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px clamp(28px, 5vw, 72px);
  position: relative;
  z-index: 2;
  /* Bord diagonal qui mord légèrement sur la photo, pour une rupture nette et non arrondie */
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  font-weight: 700;
  margin-bottom: 22px;
}

.hero-text {
  color: rgba(255,255,255,0.82);
  max-width: 420px;
  margin-bottom: 34px;
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.hero-phone {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  padding-bottom: 2px;
}

.hero-media {
  margin-left: -60px; /* recouvre légèrement le panneau pour renforcer la diagonale */
}

.hero-media img { min-height: 100%; }

/* -------------------------------------------------------------
   TABLEAU DES DÉPARTS — bandeau signature défilant
------------------------------------------------------------- */
.departures {
  background-color: var(--navy);
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.departures-track {
  display: flex;
  width: max-content;
  animation: scrollDepartures 32s linear infinite;
}

.departures:hover .departures-track,
.departures-track.paused {
  animation-play-state: paused;
}

@keyframes scrollDepartures {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.departure-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 16px 30px;
  background: none;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.1);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.departure-row:hover { background-color: rgba(2, 71, 145, 0.35); }

.dep-code { font-weight: 600; letter-spacing: 0.04em; }
.dep-arrow { color: var(--blue-bright); }
.dep-time { color: rgba(255,255,255,0.65); }
.dep-price { color: #6fb0f2; font-weight: 600; }

/* -------------------------------------------------------------
   DESTINATIONS — bento grid
------------------------------------------------------------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 190px;
  gap: 16px;
}

.bento-tile {
  position: relative;
  border-radius: 3px;
  grid-column: span 1;
  grid-row: span 1;
  cursor: default;
}

.bento-large { grid-column: span 2; grid-row: span 2; }
.bento-wide { grid-column: span 2; grid-row: span 1; }

.bento-tile img { transition: transform 0.6s ease; }
.bento-tile:hover img { transform: scale(1.06); }

.tile-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tile-route {
  font-family: var(--font-display);
  color: var(--white);
  font-weight: 600;
  font-size: 1.05rem;
}

.tile-meta {
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.8);
  font-size: 0.78rem;
}

.bento-large .tile-route { font-size: 1.4rem; }

/* Flash bref quand on arrive depuis le tableau des départs */
.bento-tile.is-highlighted {
  outline: 3px solid var(--blue-bright);
  outline-offset: -3px;
}

/* -------------------------------------------------------------
   TARIFS — cartes façon "billet"
------------------------------------------------------------- */
.fares-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 44px;
}

.fares-intro .section-title { margin-bottom: 0; }

.fares-media {
  width: 220px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.ticket {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--white);
}

.ticket-featured {
  border-color: var(--blue);
  box-shadow: 0 14px 32px rgba(2, 71, 145, 0.14);
}

.ticket-main { padding: 30px 26px; }

.ticket-label {
  display: block;
  font-weight: 600;
  color: var(--ink-light);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.ticket-price {
  display: block;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
}

.ticket-price small {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-light);
}

.ticket-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--ink-light);
}

.ticket-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--blue);
}

/* Le "talon" du billet : bande verticale avec bord perforé simulé */
.ticket-stub {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background-color: var(--mist);
  color: var(--ink-light);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 10px;
  border-left: 2px dashed var(--line);
}

.ticket-featured .ticket-stub {
  background-color: var(--blue);
  color: var(--white);
  border-left-color: rgba(255,255,255,0.4);
}

/* -------------------------------------------------------------
   POURQUOI ZTRANS
------------------------------------------------------------- */
.why-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: center;
}

.why-media {
  aspect-ratio: 4 / 5;
  border-radius: 3px;
}

.reason-list {
  margin-top: 8px;
}

.reason {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.reason:last-child { border-bottom: 1px solid var(--line); }

.reason dt {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  font-size: 1.05rem;
}

.reason-icon {
  width: 26px;
  height: 26px;
  color: var(--blue);
  flex-shrink: 0;
}

.reason dd {
  color: var(--ink-light);
  font-size: 0.95rem;
  max-width: 460px;
}

/* -------------------------------------------------------------
   CONTACT
------------------------------------------------------------- */
.contact { background-color: var(--mist); }

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: start;
}

.station-list li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.station-list strong { color: var(--navy); }
.station-list span { color: var(--ink-light); font-size: 0.92rem; }

.contact-details {
  margin-top: 24px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.contact-details a:hover { color: var(--blue); }

.contact-form {
  background-color: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 4px;
  padding: 34px;
}

.contact-form h3 {
  font-size: 1.2rem;
  margin-bottom: 22px;
}

.form-group { margin-bottom: 18px; display: flex; flex-direction: column; }

.form-group label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 7px;
  color: var(--navy);
}

.form-group input, .form-group textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: 3px;
  border: 1.5px solid var(--line);
  background-color: var(--white);
  color: var(--ink);
}

.form-group.has-error input, .form-group.has-error textarea { border-color: #c0392b; }
.error-msg { color: #c0392b; font-size: 0.8rem; min-height: 18px; margin-top: 4px; }

.form-success {
  margin-top: 16px;
  font-weight: 600;
  color: var(--blue);
  display: none;
}
.form-success.visible { display: block; }

/* -------------------------------------------------------------
   FOOTER
------------------------------------------------------------- */
.site-footer {
  background-color: var(--navy);
  color: rgba(255,255,255,0.75);
  padding-top: 56px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  display: block;
  margin-bottom: 10px;
}

.footer-logo-z { color: var(--blue-bright); }

.footer-brand p { color: rgba(255,255,255,0.55); max-width: 260px; }

.footer-links h3, .footer-social h3 {
  font-family: var(--font-body);
  color: var(--white);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.footer-links li { margin-bottom: 9px; }
.footer-links a:hover, .social-icons a:hover { color: var(--blue-bright); }

.social-icons { display: flex; flex-direction: column; gap: 9px; }

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

/* -------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------- */
@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-large { grid-column: span 2; }
  .why-grid, .contact-grid { grid-template-columns: 1fr; }
  .ticket-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-panel { clip-path: none; padding: 52px 24px; }
  .hero-media { margin-left: 0; height: 280px; }

  .main-nav {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(300px, 80vw);
    background-color: var(--white);
    box-shadow: -12px 0 30px rgba(0,0,0,0.12);
    padding: 100px 30px 30px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 1050;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 24px; }
  .hamburger { display: flex; }
  .utility-inner { flex-direction: column; gap: 2px; }
}

@media (max-width: 640px) {
  .bento-grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .bento-large, .bento-wide { grid-column: span 1; }
  .reason { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .fares-intro { flex-direction: column; align-items: flex-start; }
  .fares-media { width: 100%; height: 160px; }
}
