@font-face {
  font-family: "Proxima Nova";
  src: url("../fonts/Proxima-Nova-Regular.ttf");
}

/* General */

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

html {
  --primary-color: rgb(255 155 33);

  --link-color: rgb(0 113 179);

  --primary-text-color: rgb(51 51 51);
  --secondary-text-color: rgb(77 77 77);
  --tertiary-text-color: rgb(255 255 255);

  --primary-svg-background-color: rgb(0 0 0 / 60%);

  --primary-border-color: rgb(230 230 230);

  --font-size-xs: 0.75rem; /*12px*/
  --font-size-s: 0.875rem; /*14px*/
  --font-size-m: 1rem; /*16px*/
  --font-size-l: 1.125rem; /*18px*/
  --font-size-xl: 1.25rem; /*20px*/
  --font-size-xxl: 1.5rem; /*24px*/

  --font-bold: 600;
}

body {
  max-width: 768px; /* Nog niet responsive gemaakt voor breedere schermen */
  color: var(--primary-text-color);
  font-family: "Proxima Nova", sans-serif;
  line-height: 1.5;
}

h1 {
  font-size: var(--font-size-xxl);
  font-weight: var(--font-bold);
}

h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-bold);
}

h3 {
  font-size: var(--font-size-m);
  font-weight: var(--font-bold);
}

a {
  color: var(--link-color);
  text-decoration: none;
}

button {
  cursor: pointer;
  font: inherit;
  background: none;
  border: none;
}

.bold {
  font-weight: var(--font-bold);
}

.visually-hidden {
  display: none;
}

.overflow-hidden {
  overflow: hidden;
}

/* Header */

.main-header {
  background-color: var(--primary-color);
}

.main-nav {
  padding: 0 5px;

  ul {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    list-style: none;

    .menu-list-item {
      @media (min-width: 768px) {
        display: none;
      }
    }

    li a {
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      align-items: center;
      padding: 3px 0;
      gap: 0.25rem;
      color: var(--tertiary-text-color);
      font-size: var(--font-size-xs);
    }

    .secondary-nav-item {
      display: none;

      @media (min-width: 768px) {
        display: inline;
      }

      &:nth-of-type(6) {
        margin-right: 6rem;
      }

      a {
        font-size: var(--font-size-m);
      }
    }
  }
}

.path-nav {
  display: none;
  color: var(--secondary-text-color);

  @media (min-width: 768px) {
    display: flex;
    align-items: center;
    margin: 0.5rem 1rem 0rem 1rem;
    gap: 0.25rem;
  }
}

/* Main content */

.main-image {
  position: relative;

  @media (min-width: 768px) {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    margin: 0.5rem 1rem 1rem 1rem;
    gap: 0.25rem;
    overflow: hidden;
    border-radius: 0.5rem;

    .primary-image {
      grid-area: 1 / 1 / 3 / 3;
      height: 100%;
    }
  }

  img {
    max-width: 100%;
  }

  /* Layout of house images on bigger screen */
  .secondary-image {
    display: none;

    @media (min-width: 768px) {
      display: block;

      &:nth-of-type(1) {
        grid-area: 1 / 3 / 2 / 4;
      }

      &:nth-of-type(2) {
        grid-area: 1 / 4 / 2 / 5;
      }

      &:nth-of-type(3) {
        grid-area: 2 / 3 / 3 / 4;
      }

      &:nth-of-type(4) {
        grid-area: 2 / 4 / 3 / 5;
      }
    }
  }
}

.share-button {
  position: absolute;
  top: 1rem;
  right: -1rem;
  padding: 0.5rem 0.75rem;
  color: var(--link-color);
  background-color: white;
  border-radius: 0.25rem;

  svg {
    display: block;
  }
}

/* Media options nav */

.media-options {
  display: flex;
  justify-content: center;
  padding: 1rem;
  border-bottom: 1px solid var(--primary-border-color);

  @media (min-width: 768px) {
    display: none;
  }

  ul {
    display: flex;
    gap: 0.75rem;
    list-style: none;

    li a {
      display: flex;
      flex-direction: column;
      align-items: center;
      color: var(--link-color);
      font-size: var(--font-size-s);
      text-decoration: none;

      span {
        padding-top: 0.5rem;
      }
    }
  }
}

.media-option-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  width: 76.75px;
  height: 64px;
  overflow: hidden;
  border-radius: 0.25rem;
}

.svg-wrapper {
  position: absolute;
  top: 1rem;
  width: 32px;
  height: 32px;
  padding: 0.25rem;
  background-color: var(--primary-svg-background-color);
  border-radius: 50%;
}

.main-info {
  position: relative;
  margin: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--primary-border-color);
}

.new,
.advertisement-tab {
  padding: 3px 8px;
  color: var(--tertiary-text-color);
  font-size: var(--font-size-xs);
  font-weight: var(--font-bold);
  border-radius: 0.25rem;
}

.new {
  margin-bottom: 0.5rem;
  background-color: var(--primary-color);
}

.map {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;

  .map-svg-wrapper {
    overflow: hidden;
    border-radius: 0.4rem;

    svg {
      display: block;
      object-fit: cover;
      transition: all 0.25s ease;

      &:hover {
        scale: 1.2;
      }
    }
  }
}

.zip-code-wrapper {
  display: flex;
  gap: 0.5rem;
}

.zip-code {
  color: var(--secondary-text-color);
}

.price {
  margin: 0.5rem 0;
  font-size: var(--font-size-xl);
}

.main-info-list {
  display: flex;
  margin: 0.5rem 0;

  dd {
    margin-right: 1rem;
  }
}

.monthly-costs-wrapper {
  display: flex;
  align-items: start;
  height: fit-content;
  gap: 0.5rem;
}

.description {
  display: flex;
  flex-direction: column;
  margin: 1rem;
  gap: 1rem;
}

.advertisement-tab {
  margin-left: 1rem;
  background-color: rgb(153 153 153);
}

.large-advertisement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 1rem 1rem 1rem;
  padding: 1rem 0 0.5rem 0;
  border-top: 1px solid var(--primary-border-color);
  border-bottom: 1px solid var(--primary-border-color);

  img {
    width: 120px;
    border-radius: 0.5rem;
  }

  .logo-thuis-in-staal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-xs);

    img {
      width: 24px;
    }
  }
}

.advertisement-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 3px 12px;
  border: 1px solid var(--link-color);
  border-radius: 0.25rem;

  @media (min-width: 768px) {
    margin: 0;
  }
}

.features {
  padding: 0.5rem 1rem;

  section:nth-of-type(1) {
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom: none;
  }

  section {
    margin-top: 1rem;
    padding: 0.5rem 0.5rem 0 0.5rem;
    border: 1px solid var(--primary-border-color);
    border-radius: 0.5rem;

    h3 {
      display: flex;
      padding: 0.5rem 0.5rem 0 0.5rem;
      gap: 0.5rem;
    }

    dl {
      margin: 0.5rem 0.5rem 0 0.5rem;

      @media (min-width: 768px) {
        display: grid;
        grid-template-columns: 40% 60%;
      }

      dt {
        padding: 0.5rem 0 0.25rem 0;
        color: var(--secondary-text-color);
        border-top: 1px solid var(--primary-border-color);
      }

      dd {
        padding-bottom: 0.5rem;
        color: var(--primary-text-color);

        @media (min-width: 768px) {
          border-top: 1px solid var(--primary-border-color);
          padding: 0.5rem 0 0.25rem 0;
        }
      }
    }
  }
}

.small-advertisement {
  padding: 1rem;
  background-color: rgb(238 239 245);
  border: 1px solid var(--primary-border-color);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;

  @media (min-width: 768px) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;

    p {
      margin-left: 6rem;
    }
  }

  img {
    width: auto;
    height: 24px;
    margin-bottom: 0.5rem;

    @media (min-width: 768px) {
      margin: 0;
    }
  }
}

.oppervlakten-en-inhoud {
  dt:nth-of-type(1) {
    color: var(--primary-text-color);
  }

  /* Selects the 2nd - 4th <dt> and 1st to 3rd <dd> */
  dt:nth-of-type(n + 2):nth-of-type(-n + 4),
  dd:nth-of-type(-n + 4) {
    padding-left: 1rem;
  }

  dd:nth-of-type(-n + 4) {
    @media (min-width: 768px) {
      padding-left: 0rem;
    }
  }
}

.energy {
  .info-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-text-color);
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-color: rgb(204 204 204);
    text-underline-offset: 6px;
  }

  dd {
    display: flex;
    align-items: center;
    margin-top: 0.25rem;
    gap: 1rem;

    @media (min-width: 768px) {
      margin: 0;
    }
  }
}

.i-animation {
  animation-name: --i-animation;
  animation-duration: 0.5s;
  animation-timing-function: ease;
}

@keyframes --i-animation {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.5);
  }

  100% {
    transform: scale(1);
  }
}

.popup {
  --y: 0px; /* Gets changed into the scrollY value in JS */

  position: absolute;
  top: calc(
    var(--y) + 20vh
  ); /* Puts the popup 20vh lower than the top of the screen */
  max-width: 760px;
  height: 80vh;
  padding: 1rem;
  overflow: auto;
  background-color: white;
  border: 1px solid black;
  border-radius: 0.5rem;

  .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: end;

    h3 {
      font-size: var(--font-size-xl);
    }

    .close-button {
      display: flex;
      justify-content: center;
      align-items: center;
      height: fit-content;
      padding: 0.25rem;
      border-radius: 0.25rem;
      transition: all 0.5s ease;

      &:hover {
        background-color: rgb(0 0 0 / 10%);
      }

      svg {
        width: 24px;
        height: 24px;

        path {
          fill: black;
        }
      }
    }
  }

  .popup-explanation {
    padding: 1rem 0;
  }

  ul {
    list-style: none;

    li {
      margin-top: 1.25rem;
      padding-top: 1.25rem;
      border-top: 1px solid var(--primary-border-color);

      .label-wrapper {
        display: flex;
        gap: 1rem;

        .popup-energy-label {
          display: flex;
          min-width: 2.75rem;
          height: 1.5rem;
          padding-inline: 0.625rem;
          padding-right: 1rem;
          clip-path: polygon(
            0 0,
            calc(100% - 0.6rem) 0,
            100% 50%,
            calc(100% - 0.6rem) 100%,
            0 100%
          );
        }

        .energy-label-a {
          color: var(--tertiary-text-color);
          background-color: #009342;
        }

        .energy-label-b {
          color: var(--tertiary-text-color);
          background-color: #1ba943;
        }

        .energy-label-c {
          color: var(--primary-text-color);
          background-color: #9ecf1b;
        }

        .energy-label-d {
          color: var(--primary-text-color);
          background-color: #f8f51c;
        }

        .energy-label-e {
          color: var(--primary-text-color);
          background-color: #f4b003;
        }

        .energy-label-f {
          color: var(--tertiary-text-color);
          background-color: #df6d14;
        }

        .energy-label-g {
          color: var(--tertiary-text-color);
          background-color: #db261d;
        }

        h4 {
          margin-bottom: 0.5rem;
          font-size: var(--font-size-l);
        }
      }
    }
  }
}
