@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  /* Variable font weight range */
  font-style: normal;
  font-display: swap;
}



* {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  text-transform: inherit;
  text-decoration: inherit;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --background-color: 255, 255, 255;
  --margin: 10vw;
  --calced-position: calc(var(--header-height) / 2 - var(--aside-height) / 2)
}

/* For browsers that support clamp  */
@supports (font-size: clamp(1rem, 1vi, 1rem)) {
  :root {
    --fs-xs: clamp(0.8rem, -0.04vi + 0.81rem, 0.78rem);
    --fs-sm: clamp(0.92rem, 0.02vi + 0.92rem, 0.94rem);
    --fs-base: clamp(1.06rem, 0.11vi + 1.03rem, 1.13rem);
    --fs-md: clamp(1.16rem, 0.14vi + 1.06rem, 1.35rem);
    --fs-lg: clamp(1.41rem, 0.39vi + 1.31rem, 1.62rem);
    --fs-xl: clamp(1.62rem, 0.6vi + 1.47rem, 1.94rem);
    --fs-xxl: clamp(1.86rem, 0.86vi + 1.64rem, 2.33rem);
    --fs-xxxl: clamp(2.14rem, 1.2vi + 1.84rem, 2.8rem);
  }
}

/* For browsers that don't support clamp */
@supports not (font-size: clamp(1rem, 1vi, 1rem)) {
  :root {
    --fs-xs: 0.8rem;
    --fs-sm: 0.92rem;
    --fs-base: 1.06rem;
    --fs-md: 1.22rem;
    --fs-lg: 1.41rem;
    --fs-xl: 1.62rem;
    --fs-xxl: 1.86rem;
    --fs-xxxl: 2.14rem;
  }

  @media screen and (min-width: 1280px) {
    :root {
      --fs-xs: 0.78rem;
      --fs-sm: 0.94rem;
      --fs-base: 1.13rem;
      --fs-md: 1.35rem;
      --fs-lg: 1.62rem;
      --fs-xl: 1.94rem;
      --fs-xxl: 2.33rem;
      --fs-xxxl: 2.8rem;
    }
  }
}

html[lang="en"] [data-lang="en"],
html[lang="de"] [data-lang="de"] {
  display: none;
}

h1 {
  font-size: var(--fs-xxxl);
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 4rem;
}

h2 {
  font-size: var(--fs-xxl);
  font-weight: 650;
  line-height: 1.1;
  margin-block-end: 1em;
  hyphens: auto;
}

h3 {
  font-size: var(--fs-xl);
  font-weight: 650;
  line-height: 1.1;
  margin-block-start: 2em;
  hyphens: auto;
}


h4 {
  font-size: var(--fs-lg);
  font-weight: 620;
  margin-block: 2em;
  line-height: 1.1;
  hyphens: auto;
}

h3+h4 {
  margin-top: 1em;
}

h3+p {
  margin-top: 2em;
}

h5 {
  font-size: var(--fs-md);
  line-height: 1.2;
  font-weight: 580;
}

h6 {
  font-weight: bold;
  font-size: 1.05rem;
  margin-bottom: 0.5em;
}

ul {
  padding-inline: 3em;
}

p {
  margin-bottom: 1rem;
  hyphens: auto;
}

p>p {
  margin-top: 1rem;
}

article p {
  hyphens: auto;
}

#map {
  z-index: 0;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;

  .leaflet-control-attribution a,
  .leaflet-control-attribution span {
    display: none;
  }
}

article p:last-of-type,
section p:last-of-type {
  margin-bottom: 3rem;
}

html {
  font-size: var(--fs-base);
  font-family: 'Montserrat', sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  line-height: 1.4;
}

strong {
  font-weight: 650;
}

small {
  font-size: var(--fs-sm);
}

html,
body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  display: grid;
  grid-template-rows: 1fr auto;
  background-color: rgb(var(--background-color));

  &.gold {
    --background-color: 225, 223, 212;
    /*background-color: #e1dfd4;*/

    aside>div {
      --background-color: 255, 255, 255;
      border-color: white;
    }
  }

  &.dark {
    --background-color: 20, 20, 20;
    --text-color: white;
    color: white;

    main.no-visual .topbar {
      --text-color: white;
    }

    a {
      color: white;
    }

    aside>div {
      --background-color: 0, 0, 0;
      border-color: white;
    }
  }
}

main {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;

  &.no-visual {
    .topbar {
      --text-color: black;
    }

    header {
      position: absolute;
      width: 100%;
      top: -99999px;

      &+article {
        padding-top: clamp(0px, var(--calced-position), 25rem);
      }
    }
  }
}

main>article {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

main>article>* {
  max-width: 50ch;
  margin-left: var(--margin);
}

main>header>*,
main>article>* {
  margin-left: var(--margin);
}

main>article>*>img,
section>*>img {
  min-width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 2rem;
}

main>article.full-width {
  display: grid;
  grid-template-columns: 1fr;
}

main>article.full-width>* {
  max-width: 100%;
  margin-left: var(--margin);
  margin-right: var(--margin);
}

header {
  z-index: -1;
  position: sticky;
  top: 0;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;

  figure {
    position: absolute;
    inset: 0;
    margin: 0;

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

  &::after {
    position: absolute;
    content: "";
    inset: 0 0 50% 0;
    background: linear-gradient(rgba(0, 0, 0, 0.5), transparent);
  }

  h1,
  h2,
  h3,
  h4,
  h5 {
    z-index: 2;
    color: white;
    text-shadow:
      0 0 4px rgba(0, 0, 0, 0.3),
      2px 2px 80px rgba(0, 0, 0, 0.6),
      4px 4px 80px rgba(0, 0, 0, 0.5),
      6px 6px 80px rgba(0, 0, 0, 0.3);
  }

  h1 {
    max-width: 50%;
    width: 15ch;
  }
}

main>article {
  background-color: rgb(var(--background-color));
  min-height: 40vh;
  padding: 80px 0 150px;
  margin-bottom: -1px;
}

aside {
  position: absolute;
  inset: var(--calced-position) var(--margin) 20vh 55%;
  hyphens: auto;
  pointer-events: none;

}

aside>div {
  line-height: 1.4;
  position: sticky;
  top: var(--calced-position);
  padding: 1.5rem;
  border-radius: 33px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-color: rgba(var(--background-color), .8);
  border: none;
  pointer-events: all;
}

aside[data-invisible],
aside[data-invisible]>div {
  position: absolute;
  top: -99999px;
  z-index: -1;
}

aside h5 {
  font-weight: 400;
}

aside .icons {
  display: flex;
  gap: 1rem;
  justify-content: end;
}

aside .icons svg {
  width: 32px;
  height: 32px;
  aspect-ratio: 1;
}

aside .icons a {
  display: block;
  line-height: 0;
}

aside .icons a[href^="tel"] {
  animation: ring 1s 2 ease-in-out;
}

form {
  &>div {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  label {
    display: block;
    font-weight: bold;
  }


  label:has(+ input[required]):after {
    content: "*"
  }


  [type="checkbox"] {
    &+label {
      font-weight: normal;
    }
  }

  input,
  select,
  textarea {
    font-family: inherit;
    width: 100%;
    border-radius: 3px;
    background-color: white;
    padding: .45em .35em;
    color: var(--text-color);
    border: 1px solid rgb(164, 164, 164);
  }

  select {
    height: 38px;
  }

  button {
    background-color: black;
    color: white;
    padding: .45em 1em .55em;
    border: none;
    border-radius: 3px;
    align-self: end;
  }

  span {
    margin-top: 0.25em;
    font-size: var(--fs-xs);
    line-height: 1.2;
    display: none;
  }

  .checkbox-group {
    input {
      width: auto;
      margin-inline-end: 1em;
    }

    &>div {
      display: flex;
      align-items: center;

      &.multiline-checkbox-group {
        align-items: start;

        input {
          margin-top: .25em;
        }
      }
    }
  }
} 

.erfolg-meldung,
.fehler-meldungen {
  margin-top: var(--topbar-height);
  font-weight: bold;
  color: green;
}

.fehler-meldungen {
  color: red;
}

@keyframes ring {
  0% {
    transform: rotate(0);
  }

  25% {
    transform: rotate(-15deg);
  }

  50% {
    transform: rotate(0);
  }

  75% {
    transform: rotate(15deg);
  }

  100% {
    transform: rotate(0);
  }
}

aside p {
  margin-bottom: 0.45rem;
  line-height: 1;
}

#menu-toggle {
  display: none;
}

.menu-toggle-label {
  color: var(--text-color);
  grid-area: nav-toggle;
  display: none;
  justify-content: center;
  font-size: 2rem;
  width: 2rem;
  height: 2rem;
}

.menu-toggle-label::before,
#menu-toggle:checked+.menu-toggle-label::before {
  line-height: 1;
}

.menu-toggle-label::before {
  content: "☰";
}

#menu-toggle:checked+.menu-toggle-label::before {
  content: "×";
}

.topbar {
  --text-color: white;
  z-index: 1;
  position: fixed;
  width: 100%;
  transition: background-color 100ms ease-in-out;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body:has(#menu-toggle:checked) {
  overflow: hidden;
}

.topbar.small-topbar:has(#menu-toggle:checked) {
  inset: 0;
}

.brand {
  grid-area: brand;
  align-self: end;
  fill: var(--text-color);
  width: 12vw;
  min-width: 160px;
  height: auto;
}

.topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "brand navigation";
  justify-items: end;
  width: calc(100% - 2 * var(--margin));
  margin: 6vw auto 20px auto;
  transition: margin 100ms ease-in-out;
}

.topbar-inner>nav {
  grid-area: navigation;
  align-items: end;
}

.small-topbar .topbar-inner {
  margin: 20px auto 20px auto;
}

.small-topbar {
  --text-color: black;
  background-color: rgb(var(--background-color));
}

footer>* {
  --text-color: black;
  font-size: var(--fs-xs);
  display: flex;
  justify-content: space-between;
  align-items: end;
  width: calc(100% - 2 * var(--margin));
  margin: 115px auto;
  background-color: var(--background-color);
}

nav.nav-wrapper {
  display: flex;
  gap: 3rem;
}

nav ul {
  display: flex;
  gap: 1.5rem;
  padding-inline: 0;
}

nav ul li {
  list-style: none;
  padding: 0;
  margin: 0;
  white-space: nowrap;
}

a {
  color: var(--text-color);
}

p>a,
label>a {
  text-decoration: underline;
}

nav ul li a {
  position: relative;

  &:after {
    width: 0;
    transition: width 300ms ease-in-out;
  }

  &:hover:after,
  &.active:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    left: 0;
    top: calc(100% + 2px);
  }
}

nav.primary-nav {
  font-weight: bold;
}

nav.secondary-nav {
  font-size: var(--fs-sm);
}

nav.language-nav {
  position: absolute;
  right: 20px;
  top: 20px;
  transition: transform 300ms ease-in-out;
  font-size: var(--fs-xs);
}

.hide-after-scroll {
  transform: translateY(-100px);
}

.only-on-mobile {
  display: none !important;
}

section {
  padding-left: var(--margin);
  padding-right: var(--margin);
}

section.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8vw 10vw;
}

section.grid>div {
  display: flex;
  gap: 1rem;
}

.team-member-img img {
  width: 140px;
}

.team-member-details {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.team-member-details {
  h5 {
    margin-bottom: .25rem;
  }

  p, p:last-of-type {
    margin-bottom: .5rem;
  }

  ul {
    padding-left: 0;
    margin-left: 1rem;
    font-size: var(--fs-xs);
  }
}

#real-estate-listings {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;

  p {
    margin-bottom: 0.2em;
  }

  img {
    aspect-ratio: 5/3;
    object-fit: cover;
    max-width: 100%;
  }
}

.filter-group {
  position: sticky;
  top: var(--topbar-height);
  background-color: rgb(var(--background-color));
  grid-column: 1 / -1;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 20px;

  label {
    cursor: pointer;
  }

  input {
    display: none;
  }

  input:checked+label {
    font-weight: bold;
  }

  label:hover {
    font-weight: 550;
  }
}

blockquote {
  display: none;

  p:first-of-type {
    font-size: var(--fs-md);
    text-indent: 2rem;
  }

  p:last-of-type {
    text-align: end;
  }
}

*:not(li, .topbar-inner)>a:hover {
  filter: invert(0.5);
}

.aside-cta {
  font-weight: 560;
}



/* Extra small devices (phones) */
@media (max-width: 560px) {

  header {
    aspect-ratio: 9 / 16;

    h1,
    h2,
    h3,
    h4,
    h5 {
      width: 100%;
      max-width: 100%;
      max-width: 15ch;
      text-align: center;
      margin-left: auto;
      margin-right: auto;
    }
  }

  main {
    &.no-visual {
      & header {
        &+article {
          padding-top: 10rem;
        }
      }
    }
  }

  aside {
    inset: calc(100svh - var(--aside-height) - var(--margin)) 0 0 0;
    margin-inline: 1rem;
  }

  aside div {
    top: calc(100svh - var(--aside-height) - var(--margin));
  }

  header>*,
  main>article>* {
    margin-right: var(--margin);
  }

  main>header>*,
  main>article>* {
    padding-right: 0;
  }

  main>article {
    display: grid;
    grid-template-columns: 1fr;
  }

  main>article {
    max-width: 100%;
    padding-bottom: calc(var(--aside-height) + 4 * var(--margin));
  }

  #map {
    aspect-ratio: 1;
  }

  section {
    margin-top: var(--margin);
  }

  main>article>p:last-of-type {
    margin-bottom: 0;
  }

  footer>* {
    flex-direction: column;
    align-items: start;
    gap: 3rem;
    margin: 115px auto var(--margin);
  }

  aside>div {
    padding-block: 1rem;

    gap: 1rem;
  }

  .only-on-desktop {
    display: none !important;
  }

  .only-on-mobile {
    display: block !important;
  }
}

/* Extra small devices (phones) */
@media (max-width: 1000px) {
  :root {
    --margin: 20px;
  }

  nav.nav-wrapper {
    display: none;
  }

  nav.language-nav {
    position: inherit;
  }

  .hide-after-scroll {
    transform: none;
  }

  .menu-toggle-label {
    display: flex;
  }

  #menu-toggle:checked+.menu-toggle-label+nav.nav-wrapper {
    display: flex;
  }


  .topbar-inner {
    grid-template-areas:
      "brand nav-toggle"
      "navigation navigation";
    margin: 20px auto 20px auto;
  }

  .topbar-inner>nav {
    justify-self: start;
  }

  nav.nav-wrapper {
    flex-direction: column;
    align-items: start;
    gap: 4rem;
    margin-inline-start: 20%;
    margin-block: 8%;
  }

  nav.nav-wrapper ul {
    flex-direction: column;
  }

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

/* Medium devices (tablets) */
@media (min-width: 451px) and (max-width: 700px) {
  header {
    aspect-ratio: 1;
  }
}

@media screen and (orientation: portrait) and (min-width: 700px) {
  header {
    aspect-ratio: 1;
  }

}

@media (orientation: landscape) and (max-width: 1000px) {
  #menu-toggle:checked+.menu-toggle-label+nav.nav-wrapper {
    flex-direction: row;
  }
}

@media (orientation: landscape) and (max-width: 800px) {
  html {
    font-size: 15px;
  }

  .small-topbar .topbar-inner {
    margin: 10px var(--margin) 10px var(--margin);
  }

  aside>div {
    padding: var(--margin);
  }

  header h1 {
    display: none;
  }

  .only-on-desktop {
    display: none;
  }
}


/* Large devices (laptops/desktops) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  nav.nav-wrapper {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Extra large devices (large desktops) */
@media (min-width: 1200px) {
  aside {
    hyphens: none;
  }
}