/* CSS Reset */
/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
  padding: 0;
}

button {
  border: none;
  outline: none;
  cursor: pointer;
}

img,
ion-icon {
  display: block;
}

a {
  text-decoration: none;
  color: white;
}

html,
body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: hsl(210, 46%, 95%);
  font-family: "Manrope";
}

main {
  width: 20.4375rem;
  height: auto;
  border-radius: 10px;
  background-color: white;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 1.125rem;
}

.image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-image: url(../images/drawers.jpg);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.description-container {
  margin-right: 1.875rem;
  margin-left: 1.875rem;
  height: auto;
  width: auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.description {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: #48556a;
}

.main-description {
  font-weight: bold;
  line-height: 130%;
  letter-spacing: 0.015625rem;
  font-size: 1.25rem;
}

.secondary-description {
  font-weight: 500;
  line-height: 140%;
  letter-spacing: 0.12%;
  font-size: 0.8125rem;
}

.author-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4rem;
  width: 100%;
  height: auto;
}

.author {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-image: url(../images/avatar-michelle.jpg);
}

.author-name {
  font-weight: bold;
  line-height: 140%;
  letter-spacing: 0.012%;
  font-size: 0.8125rem;
  color: #48556a;
}

.author-time {
  font-weight: 500;
  line-height: 140%;
  letter-spacing: 0.012%;
  font-size: 0.8125rem;
  color: #9daec2;
}

.share {
  position: relative;
}

.share-button {
  background: #ecf2f8;
  padding: 6px;
  border-radius: 20px;
  font-size: 20px;
  color: #6e8098;
  transition: all 0.25s ease;
}

.share-button:hover,
.share-button.active {
  background: #6e8098;
  color: #ecf2f8;
}

.share-option {
  /**
   * variable for transforming `.share-option` box 
   * without repeating all transform value
   */
  --scale: 0;
  --translateX: -50%;
  --translateY: 0;

  background: #48556a;
  position: absolute;
  bottom: calc(100% + 28px);
  left: 50%;
  transform: translate(var(--translateX), var(--translateY)) scale(var(--scale));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 40px;
  border-radius: 10px;
  box-shadow: 0 5px 20px -5px #0003;
  transform-origin: bottom;
  visibility: hidden;
  transition: all 0.25s ease;
}

.share-option.active {
  --scale: 1;
  visibility: visible;
}

.share-option::after {
  content: "";
  background: hsl(217, 19%, 35%);
  width: 20px;
  height: 20px;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -60%) rotate(45deg);
}

.share-option span {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: #9daec2;
  margin-right: 5px;
}

.share-option ion-icon {
  font-size: 22px;
}

.share-option ion-icon:hover,
.main-description:hover,
.author-name:hover {
  filter: invert(1);
}

.attribution {
  display: none;
}

@media (min-width: 48rem) and (max-width: 64rem) {
  main {
    width: 38rem;
    display: flex;
    flex-direction: row;
    padding-bottom: 0rem;
    gap: 2rem;
    align-items: center;
  }

  .image {
    width: 229px;
    height: 346px;
    background-image: url(../images/drawers.jpg);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-top-right-radius: 0px;
  }

  .description-container {
    margin-right: 0rem;
    margin-left: 0rem;
    height: auto;
    width: 19.4375rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .author-container {
    gap: 6.5rem;
  }
}

@media (min-width: 64.0625rem) {
  main {
    width: 45.625rem;
    display: flex;
    flex-direction: row;
    padding-bottom: 0rem;
    gap: 2.5rem;
    align-items: center;
  }

  .image {
    width: 285px;
    height: 280px;
    background-image: url(../images/drawers.jpg);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-top-right-radius: 0px;
  }

  .description-container {
    margin-right: 0rem;
    margin-left: 0rem;
    height: auto;
    width: 22.8125rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .author-container {
    gap: 10rem;
  }
}

@media (max-width: 48rem) {
  .author-container {
    position: relative;
  }

  .share {
    position: static;
    z-index: 1;
  }

  .share-option {
    /**
     * variable for transforming `.share-option` box 
     * without repeating all transform value
     */
    --scale: 1;
    --translateX: 0;
    --translateY: 100%;

    inset: -20px -30px;
    padding: 17px 30px;
    z-index: -1;
    border-radius: 0 0 10px 10px;
  }

  .share-option.active {
    --translateY: 0;
  }

  .share-option::after {
    height: 0;
  }
}
