/* Import Dongle Font */
@font-face {
  font-family: "Dongle";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../assets/webfonts/Dongle.woff2") format("woff2");
}

/* Import Roboto Font */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("../../assets/webfonts/Roboto.woff2") format("woff2");
}

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

html {
  scroll-behavior: smooth;
}

:root {
  --white: 255, 255, 255;
  --gray: 233, 233, 233;
  --blue: 1, 5, 53;
  --orange: 253, 83, 18;

  --size-3xs: 0.125rem;
  --size-xxs: 0.25rem;
  --size-xs: 0.5rem;
  --size-s: 1rem;
  --size-m: 2rem;
  --size-l: 1.5rem;
  --size-xl: 2rem;
  --size-xxl: 3rem;

  --fz-h1: 3.825rem;
  --fz-h2: 3.825rem;
  --fz-h3: 3.825rem;
  --fz-h4: 1.5rem;
  --fz-h5: 1.25rem;
  --fz-h6: 1.125rem;
  --fz-p: 1rem;
  --fz-small: 0.875rem;
}

body {
  font-family: "Roboto";
  background: rgb(var(--blue));
  color: rgb(var(--white));
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.4;
  overflow-x: hidden;
}

.wrapper {
  position: relative;
  max-width: calc(100vw - 2 * var(--size-m));
  margin: 0 auto;
  /* overflow: hidden; */
}

.wrapper,
.container {
  width: 100%;
  height: 100%;
}

main {
  display: flex;
  flex-wrap: wrap;
}

/* FONT */

h1,
h2,
h3 {
  font-family: "Dongle";
  letter-spacing: -2%;
  line-height: 0.6;
  /* !!! Padding top pour les accents, sinon ils sont coupés */
  padding-top: 0.5rem;
}

h4,
h5,
h6 {
  line-height: 1.1;
}

h2 {
  font-size: var(--fz-h2);
}

h4 {
  font-size: var(--fz-h4);
}

h5 {
  font-size: var(--fz-h5);
}

small {
  font-size: var(--fz-small);
  font-weight: 600;
}

a {
  display: inline-block;
  text-decoration: none;
  color: rgb(var(--blue));
  transition: opacity 0.2s ease-out;
}

a:hover,
.faq-item:hover {
  opacity: 0.75;
}

a.btn {
  display: flex;
  align-items: center;
  gap: var(--size-xs);
}

a.btn img {
  width: var(--size-s);
}

a.btn,
input[type="submit"] {
  width: fit-content;
  font-weight: 600;
  color: rgb(var(--blue));
  padding: var(--size-xs) var(--size-m);
  background: rgb(var(--orange));
  border-radius: var(--size-3xs) var(--size-m);
}

.text-accent {
  color: rgb(var(--orange));
}

/* IMG/VIDEO */

img,
video {
  width: 100%;
  height: auto;
  display: block;
}

video {
  min-width: 100%;
  height: 100%;
  object-fit: cover;
}

/* HEADER */
header {
  background: rgb(var(--blue));
  z-index: 2000;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  transition: transform 0.2s ease-out;
}

.scrolled header {
  transform: translateY(-100%);
}

header .menu {
  display: none;
}

header .wrapper {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding-block: var(--size-xl);
  overflow: visible;
}

header h1 {
  text-indent: -10000px;
  width: clamp(11.25rem, 7.0754rem + 17.8117vw, 15.625rem);
  aspect-ratio: 106/15;
  background: url("../img/logo-noctambus-white.svg") center center no-repeat;
  background-size: contain;
}

header nav ul {
  display: flex;
  align-items: center;
  gap: var(--size-m);
  list-style-type: none;
}

header nav ul li a:not(.btn) {
  font-weight: 600;
  width: 100%;
  color: rgb(var(--white));
}

header nav ul li a:not(.btn):hover,
footer a:hover {
  opacity: 1;
  color: rgb(var(--orange));
}

/* ALL SECTIONS */

section {
  width: 100%;
  padding-block: var(--size-xxl);
}

section:nth-child(even) {
  background: rgb(var(--white));
  color: rgb(var(--blue));
}

section:not(#hero) .wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--size-l);
}

/* SECTION - HERO */

#hero {
  margin-top: var(--header-height);
  padding-block: 0 var(--size-m);
  height: calc(100vh - var(--header-height));
}

#hero .container {
  position: relative;
  border: 1px solid rgb(var(--orange));
  border-radius: var(--size-xl) var(--size-xl) calc(var(--size-xl) * 5);
  overflow: hidden;
}

#hero form {
  width: 30%;
  color: rgb(var(--blue));
  position: absolute;
  bottom: var(--size-m);
  right: var(--size-m);
  border-radius: calc(var(--size-xl) - 1rem) calc(var(--size-xl) - 1rem)
    calc(var(--size-xl) * 5 - 1rem);
  overflow: hidden;
}

#hero .routes-options {
  display: flex;
}

#hero .option {
  padding: var(--size-xs) 0;
  text-align: center;
  background: rgb(var(--gray));
  color: rgb(var(--blue));
  position: relative;
  flex-basis: 100%;
  flex: 1;
}

#hero .option:has(input:checked) {
  background: rgb(var(--orange));
  color: rgb(var(--white));
}

#hero .option input {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: none;
}

#hero .option label {
  position: relative;
  padding-left: 1.25rem;
}

#hero .option label::before {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  width: 0.875rem;
  aspect-ratio: 1/1;
}

#hero .option:has(input[id="itinerary"]) label::before {
  background: url("../img/icon-route-blue.svg") center center no-repeat;
  background-size: contain;
}

#hero .option:has(input[id="itinerary"]:checked) label::before {
  background: url("../img/icon-route-white.svg") center center no-repeat;
  background-size: contain;
}

#hero .option:has(input[id="nextDeparture"]) label::before {
  background: url("../img/icon-location-blue.svg") center center no-repeat;
  background-size: contain;
}

#hero .option:has(input[id="nextDeparture"]:checked) label::before {
  background: url("../img/icon-location-white.svg") center center no-repeat;
  background-size: contain;
}

#hero .routes-content {
  background: rgb(var(--white));
  padding: var(--size-xl) var(--size-m) var(--size-l);
}

#hero .routes-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--size-xl);
}

#hero div[data-type="fieldItinerary"],
#hero div[data-type="fieldLine"] {
  display: none;
}

#hero:has(.option input[id="itinerary"]:checked)
  div[data-type="fieldItinerary"],
#hero:has(.option input[id="nextDeparture"]:checked)
  div[data-type="fieldLine"] {
  display: flex;
}

#hero div[data-type="fieldItinerary"] {
  position: relative;
  flex-direction: column;
  gap: var(--size-l);
}

#hero div[data-type="fieldItinerary"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--size-s) / 2 + 0.5px);
  transform: translateY(-50%);
  width: 1px;
  height: 60%;
  background: rgb(var(--blue));
}

#hero .field {
  position: relative;
  padding-left: var(--size-l);
}

#hero .field::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: var(--size-s);
  aspect-ratio: 1/1;
  border-radius: 100%;
  border: 1px solid rgb(var(--blue));
  background: rgb(var(--white));
}

#hero .field:has(input[id="destination"])::before {
  border: 1px solid rgb(var(--orange));
  background: rgb(var(--orange));
}

#hero .field label {
  position: absolute;
  top: 50%;
  left: var(--size-l);
  transform: translateY(-50%);
  transform-origin: top left;
  transition: all 0.2s ease-out;
}

#hero .field input {
  width: 100%;
  border-bottom: 1px solid rgb(var(--blue));
  padding-block: var(--size-xs);
}

#hero .field:has(input:focus) label,
#hero .field:has(input:not(:placeholder-shown)) label {
  top: 0;
  transform: translateY(-50%) scale(0.8);
}

#hero #departureTime {
  display: flex;
  gap: var(--size-xs);
  align-items: center;
  color: rgb(var(--orange));
  text-decoration: underline;
  margin-top: calc(var(--size-xl) / 2 * -1);
}

#hero #departureTime img {
  width: 1rem;
}

/* SECTION - TICKETS */

.tickets-container {
  display: flex;
  flex-direction: column;
  gap: var(--size-m);
}

.ticket-option {
  border-radius: var(--size-xxs);
  background: rgb(var(--white));
  color: rgb(var(--blue));
  padding: var(--size-m);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticket-option img {
  width: 1.25rem;
}

/* SECTION - VISIT GENEVA I CAROUSEL */

.cards-container {
  padding-inline: var(--size-m);
  margin-left: calc(var(--size-m) * -1);
  overflow-x: auto;
  display: flex;
  gap: var(--size-m);
  min-width: 100vw;
  scroll-snap-type: x proximity;
}

.card {
  scroll-snap-align: center;
  min-width: 80%;
  aspect-ratio: 3/2;
  overflow: hidden;
  position: relative;
  border: 3px solid rgb(var(--orange));
  border-radius: var(--size-m) var(--size-m) calc(var(--size-m) * 4);
}

.card:hover {
  border: 3px solid rgb(var(--blue));
}

.card img:first-child,
.map img {
  object-fit: cover;
  min-width: 100%;
  height: 100%;
}

.card-informations {
  display: flex;
  align-items: center;
  gap: var(--size-xs);
  position: absolute;
  bottom: 0;
  left: 0;
  padding: var(--size-s) var(--size-m);
  background: rgb(var(--orange));
  border-top-right-radius: var(--size-m);
}

/* SECTION - LINES */

.lines-container,
.all-lines {
  display: flex;
  /* flex-direction: column; */
  gap: var(--size-l);
}

.all-lines {
  flex-direction: column;
}

.all-lines,
.map {
  width: 50%;
}

#map {
  width: 100%;
  height: 100%;
}

.gmnoprint {
  display: none !important;
}

.urban,
.regional,
.trains {
  display: flex;
  flex-direction: column;
  gap: var(--size-m);
}

.urban-lines,
.regional-lines,
.trains-lines {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-xs);
}

.line-pill {
  border-radius: 999px;
  text-align: center;
  width: 4rem;
  font-weight: 600;
}

.map {
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 1px solid rgb(var(--orange));
  border-radius: var(--size-m) var(--size-m) calc(var(--size-m) * 4);
}

/* SECTION - FAQ */

.faq-container {
  display: flex;
  flex-direction: column;
  gap: var(--size-m);
}

.faq-item {
  display: flex;
  flex-direction: column;
  background: rgb(var(--blue));
  color: rgb(var(--white));
  border-radius: var(--size-xs);
  overflow: hidden;
  transition: opacity 0.2s ease-out;
}

.faq-question {
  position: relative;
  padding: var(--size-m);
}

.faq-question::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--size-m);
  transform: translateY(-50%);
  width: var(--size-s);
  aspect-ratio: 1/1;
  background: url("../img/icon-more.svg") center center no-repeat;
  background-size: contain;
}

.faq-question h5 {
  width: 80%;
}

.faq-answer-wrapper {
  max-height: 0;
  transition: max-height 0.5s ease-in-out;
}

.faq-answer {
  padding: 0 var(--size-m) var(--size-m);
}

.faq-item.opened .faq-answer-wrapper {
  max-height: 100vh;
}

.faq-item.opened .faq-question::after {
  background: url("../img/icon-less.svg") center center no-repeat;
  background-size: contain;
}

/* SECTION - APP */

.app-container {
  height: 100%;
  position: relative;
  border: 1px solid rgb(var(--orange));
  border-radius: var(--size-l) var(--size-l) calc(var(--size-l) * 4);
  overflow: hidden;
  padding: var(--size-m);
  background: url("../img/tpg-bus-background.png") center center no-repeat;
  background-size: cover;
  display: flex;
  align-items: end;
}

.app-informations {
  display: flex;
  flex-direction: column;
  gap: var(--size-m);
  padding: var(--size-m);
  border-radius: var(--size-s) var(--size-s) calc(var(--size-s) * 5);
  background: rgb(var(--white));
  color: rgb(var(--blue));
}

.stores-block {
  display: flex;
  flex-direction: column;
  gap: var(--size-s);
}

.stores-block img {
  width: 11rem;
}

/* FOOTER */
footer {
  background: rgb(var(--gray));
  color: rgb(var(--blue));
}

footer .wrapper {
  padding-block: var(--size-xxl);
  display: flex;
  flex-direction: column;
  gap: var(--size-xxl);
}

footer .logo {
  display: flex;
  flex-direction: column;
  gap: var(--size-xs);
}

.footer-main-informations {
  display: flex;
  justify-content: space-between;
}

.footer-columns-wrapper {
  display: flex;
  justify-content: space-between;
  gap: var(--size-xxl);
}

.footer-columns-wrapper {
  display: flex;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: var(--size-m);
}

.footer-column h4 {
  font-weight: 400;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--size-m);
}

footer a:not(.logo) {
  text-decoration: underline;
}

.footer-links a {
  font-size: var(--fz-h5);
}

.footer-secondary-informations {
  padding-top: var(--size-l);
  border-top: 1px solid rgb(var(--blue));
  display: flex;
  justify-content: space-between;
}

.footer-legal {
  display: flex;
  gap: var(--size-l);
}

/* ONLY DESKTOP */
@media screen AND (min-width: 969px) {
  .desktop-half {
    width: 50%;
  }

  .desktop-half .wrapper {
    max-width: calc(50vw - 2 * var(--size-m));
  }

  .card {
    min-width: 40%;
  }
}

/* RESPONSIVE MOBILE */
@media screen AND (max-width: 968px) {
  :root {
    --size-3xs: 0.125rem;
    --size-xxs: 0.25rem;
    --size-xs: 0.5rem;
    --size-s: 0.75rem;
    --size-m: 1rem;
    --size-l: 1.5rem;
    --size-xl: 2rem;
    --size-xxl: 3rem;

    --fz-h2: 3.825rem;
  }

  /* FONT */

  a.btn img {
    width: var(--size-m);
  }

  /* HEADER */
  header h1 {
    width: clamp(11.25rem, 7.0754rem + 17.8117vw, 15.625rem);
  }

  header .menu {
    display: block;
    width: 1.5rem;
    aspect-ratio: 1/1;
    margin-bottom: 0.25rem;
    background: url("../img/icon-menu.svg") center center no-repeat;
    background-size: contain;
  }

  header nav {
    background: rgb(var(--blue));
    width: 100vw;
    position: absolute;
    top: calc(var(--header-height) - 2px);
    left: calc(var(--size-m) * -1);
    padding: 0 var(--size-m) var(--size-xl);
    display: none;
  }

  header nav ul {
    flex-direction: column;
    align-items: start;
  }

  header nav ul li a {
    padding-block: var(--size-xs);
  }

  .menu-open header .wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: calc(var(--size-m) * -1);
    width: 100vw;
    height: 100vh;
    background: rgba(var(--blue), 0.5);
    z-index: -1;
  }

  .menu-open header nav {
    display: block;
  }

  .menu-open header .menu {
    background: url("../img/icon-close.svg") center center no-repeat;
    background-size: contain;
  }
  /* SECTION - HERO */

  #hero form {
    width: calc(100% - 2 * var(--size-m));
    left: 50%;
    right: 0;
    transform: translateX(-50%);
  }

  #hero #departureTime {
    gap: var(--size-m);
  }

  /* SECTION - VISIT GENEVA */

  .cards-container {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none;
  }
  
  .cards-container::-webkit-scrollbar {
    display: none;
  }
  

  /* SECTION - LINES */

  .lines-container {
    flex-direction: column;
  }

  .all-lines,
  .map {
    width: 100%;
  }

  /* SECTION - FAQ */

  .faq-question::after {
    width: var(--size-m);
  }

  /* SECTION - APP */

  .app-informations {
    border-radius: var(--size-m) var(--size-m) calc(var(--size-m) * 5);
  }

  .stores-block {
    gap: var(--size-m);
  }

  /* FOOTER */

  .footer-columns-wrapper {
    flex-direction: column;
    gap: var(--size-xxl);
  }

  .footer-main-informations {
    flex-direction: column;
    gap: calc(2 * var(--size-l));
  }

  .footer-secondary-informations,
  .footer-legal {
    flex-direction: column;
    gap: var(--size-l);
  }

  footer .logo img {
    width: 40%;
  }
}
