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

:root { /* fonts and stuff */
  font-family: Arial, Helvetica, sans-serif;
  --bg-color: white;
  --main-color: lightblue;
  --rev-color: #F0FFF0;
}

html {
  scrollbar-gutter: stable;
}

body {
  background-color: var(--bg-color, white);
}

main {
  width: 100%;
}

/* #region: header */

header {
  height: 7vh;
  border-bottom: 5px solid black;
  background-color: var(--main-color, lightblue);
  padding: 1%;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;

  display: flex; 
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

#logo {
  display: block;
  text-align: left;
  text-indent: 0;
  justify-self: left;
  font-size: 1.4rem;
  font-weight: bold;
  padding: 0;
}

#nav-bar {
  width: 270px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

#nav-bar a {
  background-color: white;
  display: inline-block;
  padding: 10px;  /* --- */
  color: black;
  display: block;
  border-radius: 15px;
  text-align: center;
  width: fit-content;
  padding: 1%;  /* 2 padding values */
  transition: background-color 0.3s;
}

#nav-bar a:hover {
  background-color: aqua;
}

/* #endregion */


.spacer {
  height: 7vh;
}


#introduction {
  width: 100%;
}

#main-img {
  width: 100%;
  max-width: 900px;
  opacity: 0;
  transition: all 0.8s ease-in;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* #region: title sequence */

#title-sequence {
  border-radius: 5vw;
  background-color: #ffffffb3;
  text-align: center;
  position: absolute;
  top: 46vw;  /* era la 46vw */
  left: 0;
  right: 0;
  margin: 0 auto;
  align-self: center;
  max-width: 900px; 
  opacity: 0;
  transition: opacity 0.8s ease-in;
}

h1, #title-sequence h2 {
  display: block;
  opacity: 0;
  transition: opacity 0.8s ease-in;
}

h1 {
  font-style: italic;
  font-size: clamp(16px, 6vw, 70px);
}

#title-sequence h2 {
  font-size: 1.2rem;
  font-size: clamp(8px, 4vw, 50px);
  color: #464847;
}

/* #endregion */


p, strong {
  font-size: clamp(20px, 3vw, 25px);
  text-indent: 25px;
  padding: 0 5% 5% 5%;
  margin: 10px 0;
}

strong {
  display: inline-block;
} 

img {
  display: block;
  border-radius: 4%;
  margin: auto;
}

button {
  padding: 10px;
  background-color: white;
  color: black;
  font-size: 1.2rem;
  border-radius: 15px;
  transition: color 0.3s, background-color 0.3s;
}

button:hover {
  background-color: black;
  color: white;
  border-color: gray;
  cursor: pointer;
}

#apartment-selector {
  display: grid;
  grid-template-columns: 1fr;
  background-color: #ADD8E6;
  padding: 1vw;
  border-radius: 15px;
}

.selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;

  transition: scale 0.3s ease;
  border-radius: 15px;
}

.selector:hover {
  scale: 1.05;
  background-color: #A2C8D6;
}

.selector img {
  width: 50vw;
  height: 50vw;
  object-fit: cover;
}

.selector h2 {
  font-size: clamp(20px, 80vw, 50px);
  text-align: center;
}

/* #region: rating */

#rating-section {
  justify-self: center;
  background-color: var(--rev-color);
  border: green 5px solid;
  border-radius: 10px;
  margin: 5% auto;
  padding: 1%;

  display: grid;
  grid-template-columns: 2;
  grid-template-rows: 2;
  grid-template-areas: 
  "rating title"
  "rating details";
  align-items: center;
  gap: 10px;
}

#rating-container {
  grid-area: rating;
  border: 3px solid lightgreen;
  border-radius: 50%;
  width: 6vw;
  height: 6vw;
  color: green;
  display: flex;
  justify-content: center;
  align-items: center;
}

#rating-container p {
  font-weight: bold;
}

#rating-section h4 {
  grid-area: title;
  align-self: end;
  padding: 0;
  margin: 0;
  font-size: clamp(20px, 5vw, 30px);
  color: green;
  font-weight: bold;
}

#rating-section p {
  grid-area: details;
  text-indent: 0;
  padding: 0;
  margin: 2px 0 0 0;
  font-size: clamp(20px, 3vw, 20px);
}

/* #endregion */


/* #region: presentation */

#presentation {
  background-color: var(--main-color, lightblue); /* brown it was before */
  display: flow-root;
  width: 95%;
  padding: 3%;
  margin: 10px auto 0 auto;
  border-radius: 20px 10px 20px 10px;
  color: black;
}

.float-left, .float-right {
  width: clamp(40px,50%, 400px);
}

.float-left {
  float: left;
  margin: 10px 20px 10px 0; /* checked */
  box-shadow: 5px 5px 5px grey;
  border-radius: 0px 5px 5px 0;    /* values should be relative */
}
.float-right {
  float: right;
  margin: 10px 0 10px 20px; /* Checked */
  box-shadow: -5px 5px 5px grey;
  border-radius: 5px 0 0 5px;    /* values should be relative */
}

/* #endregion */


/* #region: footer */

footer {
  background-color: var(--main-color, lightblue);
  padding: 5vh;
}

address {
  width: 100%;
  margin: auto;
  display: grid;
  grid-template-columns: auto auto;
  gap: 5px;
  grid-template-rows: repeat(3, auto);
  justify-items: center;
}

address span {
  align-self: center;
  text-align: center;
  font-size: clamp(8px, 5vw, 20px);
}

address h4 {
  grid-column: 1/-1;
  font-size: clamp(20px, 6vw, 30px);
}

/* #endregion */


#introduction > section, #introduction > p {
  animation: show-up 1.2s linear;
  animation-timeline: view();
  animation-range: entry 0% cover 30%;
}

/* #region: keyframes and media */

@keyframes show-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.75);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 900px) {
  main {
    width: 95%;
    margin: auto;
  }

  #title-sequence {
    top: 360px;
  }

  #apartment-selector {
  grid-template-columns: 1fr 1fr;
  padding: 1vw;
  border-radius: 15px;
  }

  .selector img {
  width: 25vw;
  height: 25vw;
  object-fit: cover;
  }

}

@media (prefers-reduced-motion: no-preference) {
  * {
  scroll-behavior: smooth;
  }
}

/* #endregion */