/* -------------------- VAR GLOBAL -------------------- */
:root {
  --blue: rgba(65, 74, 226, 1);
  --white: rgba(255, 255, 255, 1);
  --light-grey: rgba(232, 233, 228, 1);
  --grey: rgba(140, 140, 140, 1);
  --dark-grey: rgba(73, 73, 75, 1);
}

/* -------------------- VAR XS -------------------- */
:root {
  /* --header-height: 45px; */

  --fs-header: 18px;
  --lh-header: 1em;
  --ls-header: 0.02em;

  --text-m: 18px;
  --lh-m: 1em;
  --ls-m: 0.02em;

  --text-l: 24px;
  --lh-l: 1em;

  --fs-h2: 32px;
  --lh-h2: 1em;

  --fs-h1: 48px;
  --lh-h1: 0.85em;
  --ls-h1: 0em;

  --grid-margin: 12px;
  --grid-gutter: 10px;

  --fixed-bottom-bar-height: 52px;
}

/* -------------------- TABLET SMALL -------------------- */
@media screen and (min-width: 768px) {
  :root {
    /* --header-height: 49px; */

    --fs-header: 17px;
    --lh-header: 1em;

    --text-m: 17px;
    --lh-m: 1em;

    --fs-h2: 32px;
    --lh-h2: 1em;

    --fs-h1: 72px;
    --lh-h1: 0.85em;

    --grid-margin: 16px;
    --grid-gutter: 12px;
    
    --fixed-bottom-bar-height: 44px;
  }
}

/* -------------------- TABLET BIG -------------------- */
@media screen and (min-width: 992px) {
  :root {
    /* --header-height: 78px; */

    --fs-header: 16px;
    --lh-header: 1em;

    --text-m: 16px;
    --lh-m: 1em;

    --fs-h2: 32px;
    --lh-h2: 1em;

    --fs-h1: 96px;
    --lh-h1: 0.85em;
    --ls-h1: -0.02em;

    --fixed-bottom-bar-height: 36px;
  }
}

/* -------------------- VAR LG -------------------- */
@media screen and (min-width: 1024px) {
  :root {
    --grid-margin: 20px;
    --grid-gutter: 12px;
  }
}

/* -------------------- VAR XL -------------------- */
@media screen and (min-width: 1536px) {
  :root {
  }
}

/* -------------------- VAR XXL -------------------- */
@media screen and (min-width: 1920px) {
  :root {
  }
}

/* -------------------- RESET -------------------- */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
  font-family: "neue-haas-grotesk-display", "Helvetica", "Arial", sans-serif;
  font-weight: 900;
  text-transform: lowercase;
  color: var(--blue);
}

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  padding-top: var(--header-height);
  overflow-x: hidden;
  background-color: var(--white);
}

body.menu-open {
  /* Position fixed is set via JavaScript */
}

::-webkit-scrollbar {
  display: none;
}

:focus {
  outline: none;
}

::selection {
  background: var(--blue);
  color: var(--white);
  text-shadow: none;
}

h1,
h2 {
  margin: 0px;
}

a {
  text-decoration: none;
  text-decoration-thickness: 0.066em !important;
  text-underline-offset: 0.066em !important;
}

a:hover {
  /* cursor: pointer;
    color: var(--white);
    text-decoration: none; */
}

.cta {
  transition: background-color 0.3s ease;
}

.cta:hover {
  background-color: var(--dark-grey);
}

.cta svg path {
  transition: fill 0.3s ease, stroke 0.3s ease;
}

.cta:hover svg path {
  fill: var(--white);
  stroke: var(--white);
}

img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* -------------------- TYPOGRAPHY STYLES -------------------- */
.text-header {
  font-size: var(--fs-header);
  line-height: var(--lh-header);
  letter-spacing: var(--ls-header);
}

.text-m {
  font-size: var(--text-m);
  line-height: var(--lh-m);
  letter-spacing: var(--ls-m);
}

.text-l {
  font-size: var(--text-l);
  line-height: var(--lh-l);
}

h1,
.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: var(--ls-h1);
}

h2,
.h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-h2);
}

/* -------------------- GRID -------------------- */
.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-column-gap: var(--grid-gutter);
  padding: 0px var(--grid-margin);
}

/* -------------------- HEADER -------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  padding-top: var(--grid-gutter);
  padding-bottom: var(--grid-gutter);
  background-color: var(--white);
  z-index: 1000;
  will-change: transform;
}

.header:has(.menu.is-open) {
  z-index: 1001;
}

.header.showing {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.menu a,
.sub-menu a {
  color: var(--grey);
  transition: color 0.3s ease;
}

.menu a:hover,
.sub-menu a:hover {
  color: var(--dark-grey);
}

.menu a.is-open,
.sub-menu a.is-open {
  color: var(--blue);
}

.sub-menu-desktop {
  grid-column: span 8;
}

.sub-menu-mobile {
  display: none;
}

.menu-toggle {
  display: none;
}

/* Header Mobile */
@media screen and (max-width: 991px) {
  .header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .header .logo a {
    position: relative;
    z-index: 1003;
  }

  .menu-toggle {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    cursor: pointer;
    z-index: 1003;
  }

  .menu-toggle span {
    position: absolute;
    display: block;
    background-color: var(--blue);
    height: 22px;
    width: 1.2px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease-in-out;
  }

  .menu-toggle span:first-child {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  .menu-toggle span:last-child {
    transform: translate(-50%, -50%) rotate(90deg);
  }

  .menu-toggle.is-open span:first-child {
    transform: translate(-50%, -50%) rotate(-90deg);
  }

  .menu-toggle.is-open span:last-child {
    transform: translate(-50%, -50%) rotate(-90deg);
  }

  .menu {
    position: fixed;
    width: 100%;
    height: 100dvh;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    padding: calc(var(--header-height) + 16px) var(--grid-margin) var(--grid-margin) 50%;
    background-color: var(--white);
    transform: translateY(-100%);
    transition: transform 0.4s ease-out;
    z-index: 999;
  }

  .menu.is-open {
    transform: translateY(0);
    z-index: 1002;
  }


  .sub-menu-desktop {
    display: none;
  }

  .sub-menu-mobile {
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    padding: 48px var(--grid-margin);
  }
}

/* -------------------- FOOTER -------------------- */
.footer {
  display: flex;
  flex-direction: row;
  column-gap: 40px;
  align-items: flex-end;
  padding: var(--grid-margin);
  margin-bottom: var(--fixed-bottom-bar-height);
}

.footer-logo a img {
  display: block;
  height: 80px;
  margin-bottom: 2px;
}

.footer-text-back-to-top {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
}

#back-to-top-link {
  background-color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  transition: background-color 0.3s ease;
}

#back-to-top-link:hover {
  background-color: var(--dark-grey);
}

#back-to-top-link svg path {
  transition: stroke 0.3s ease;
}

#back-to-top-link:hover svg path {
  stroke: var(--white);
}

/* Footer Mobile */
@media screen and (max-width: 991px) {
  .footer {
    flex-direction: column;
    padding-bottom: calc(var(--grid-margin) * 2);
  }

  .footer-logo {
    display: block;
    width: 100%;
  }

  .footer-logo a {
    display: block;
    width: 100%;
  }

  .footer-logo a img {
    display: block;
    height: auto;
    width: 100%;
    margin-bottom: 20px;
  }
}

/* -------------------- FIXED BOTTOM BAR -------------------- */
.fixed-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--fixed-bottom-bar-height);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--grid-margin);
  background-color: var(--white);
  border-top: 1px solid var(--blue);
  z-index: 1000;
}

.fixed-bottom-bar.has-project-info-panel,
.fixed-bottom-bar.has-loved-item-info-panel {
  border-top: none;
}

.prev-next-desktop {
  /* width: 100%; */
  display: flex;
  flex-direction: row;
  align-items: center;
  column-gap: 24px;
}

.fixed-bottom-bar.panel-open .prev-next-desktop {
  display: none;
}

.fixed-bottom-bar.panel-open .go-back-mobile {
  display: none;
}

.fixed-bottom-bar.has-loved-item-info-panel.panel-open .fixed-bottom-bar-logo,
.fixed-bottom-bar.has-loved-item-info-panel.panel-open .fixed-bottom-bar-contacts {
  display: none;
}

.fixed-bottom-bar.has-loved-item-info-panel .loved-item-info-button {
  display: none;
}

.fixed-bottom-bar.has-loved-item-info-panel.panel-open {
  justify-content: flex-start;
}

.fixed-bottom-bar.has-loved-item-info-panel.panel-open .loved-item-info-button {
  display: inline-block;
  flex: 1;
  text-align: left;
}

.loved-item-info-button {
  cursor: pointer;
}

.loved-item-info-button .loved-item-info-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--grey);
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: color 0.3s ease;
}

.loved-item-info-button .loved-item-info-toggle:hover {
  color: var(--dark-grey);
}

.fixed-bottom-bar-logo a {
  display: block;
}

.fixed-bottom-bar-logo a img {
  display: block;
  width: 100px;
}

.fixed-bottom-bar-contacts {
  display: flex;
  flex-direction: row;
  align-items: center;
  column-gap: 12px;
}

.fixed-bottom-bar-contact a {
  transition: color 0.3s ease;
}

.fixed-bottom-bar-contact a:hover {
  color: var(--dark-grey);
}

.single-project-info-button {
  cursor: pointer;
}

.single-project-info-button .project-info-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--grey);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 0.3s ease;
}

.single-project-info-button .project-info-toggle:hover {
  color: var(--dark-grey);
}

.single-project-info-panel {
  position: fixed;
  bottom: var(--fixed-bottom-bar-height);
  left: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  background-color: var(--white);
  border-top: 1px solid var(--blue);
  transform: translateY(calc(100% - 1px));
  transition: transform 0.3s ease, max-height 0.3s ease;
  z-index: 997;
}

.single-project-info-panel.is-open {
  transform: translateY(0);
  max-height: calc(100dvh - var(--header-height) - var(--fixed-bottom-bar-height));
  overflow-y: auto;
}

.single-project-info-panel-content {
  padding: var(--grid-margin);
  display: flex;
  flex-direction: column;
  row-gap: var(--lh-m);
}

.single-project-info-panel-content p {
  width: 50%;
}

.loved-item-info-panel {
  position: fixed;
  bottom: var(--fixed-bottom-bar-height);
  left: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  background-color: var(--white);
  border-top: 1px solid var(--blue);
  transform: translateY(calc(100% - 1px));
  z-index: 997;
}

.loved-item-info-panel.is-open {
  transform: translateY(0);
  max-height: calc(100dvh - var(--header-height) - var(--fixed-bottom-bar-height));
  overflow-y: auto;
}

.loved-item-info-panel-content {
  padding: var(--grid-margin);
  display: flex;
  flex-direction: column;
  row-gap: 20px;
}

.loved-item-info-panel-content .loved-item-panel-description {
  width: 50%;
}

/* Fixed Bottom Bar Mobile */
@media screen and (max-width: 1023px) {
  .fixed-bottom-bar {
    display: none;
  }

  .single-project-info-panel-content p {
    width: 100%;
  }

  .loved-item-info-button .loved-item-info-toggle {
    text-align: center;
    width: 50%;
  }

  .loved-item-info-panel {
    border-top: none;
  }

  .loved-item-info-panel.is-open {
    bottom: var(--fixed-bottom-bar-height);
    border-top: 1px solid var(--blue);
  }

  .loved-item-info-panel-content .loved-item-panel-title,
  .loved-item-info-panel-content .loved-item-panel-description,
  .loved-item-info-panel-content .loved-item-panel-description p {
    width: 100%;
  }

}

/* -------------------- PAGE TRANSITIONS -------------------- */
body.preload {
  opacity: 0;
  overflow: hidden;
  height: 100vh;
}

body.fade-in {
  opacity: 1;
  transition: opacity 0.5s ease;
}

body.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
  background-color: var(--white) !important;
}

#transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
  z-index: 9999;
}

body.fade-in #transition-overlay {
  opacity: 0;
  pointer-events: none;
}

body.fade-out #transition-overlay {
  opacity: 1;
  pointer-events: all;
}
