/* fonts loaded via link in HTML */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  color: #6d7f97;
  background-color: #ecf2f8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* container */
.container {
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
}
.wrapper {
  display: grid;
  grid-template-columns: 2fr 3fr;
  box-shadow: 0 13px 24px rgba(0, 0, 0, 0.04);
  max-width: 770px;
}

/* image */
.wrapper-image {
  overflow: hidden;
  max-height: 280px;
  border-radius: 1rem 0 0 1rem;
}
.wrapper-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* info */
.wrapper-info {
  padding: 2.5rem;
  position: relative;
  border-radius: 0 1rem 1rem 0;
  background-color: #fff;
}
.wrapper-info h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #213547;
  margin-bottom: 1rem;
  line-height: 1.4;
}
.wrapper-info p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #677b8d;
}

/* profile */
.profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.profile > img {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  object-fit: cover;
}
.profile figcaption {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 0.2rem;
}
.profile h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #213547;
  margin-bottom: 0.25rem;
}
.profile p {
  font-size: 0.9rem;
  color: #9eafc2;
  margin: 0;
}

/* share block */
.share {
  position: relative;
  display: inline-block;
}
.button-share {
  border: 0;
  background-color: #ecf2f8;
  color: #213547;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.18s ease;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button-share img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  transition: filter 0.18s ease;
  display: block;
}

/* active state for the button */
.button-share.social-active,
.button-share:hover {
  background-color: #6d7f97;
  color: #fff;
}
.button-share.social-active img,
.button-share:hover img {
  filter: grayscale(1) brightness(200%);
}

/* social panel (desktop) */
.social-media {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(25px);
  background: #48556a;
  padding: 1.25rem 1.6rem;
  border-radius: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 13px 24px rgba(0, 0, 0, 0.04);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.24s ease;
}

/* show */
.social-media.social-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* arrow */
.social-media::before {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
  border-style: solid;
  border-width: 12px 10px 12px 0;
  border-color: transparent #48556a transparent transparent;
  box-shadow: 0 13px 24px rgba(0, 0, 0, 0.04);
}

/* label */
.social-media span {
  text-transform: uppercase;
  color: #6d7f97;
  letter-spacing: 0.25rem;
  font-size: 0.82rem;
  margin-right: 0.6rem;
}

/* icons in panel */
.social-media a {
  display: inline-block;
  width: 18px;
  height: 18px;
  transition: transform 0.12s ease;
  color: #ecf2f8;
}
.social-media a img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.social-media a:hover {
  transform: translateY(-3px);
}

/* responsive */
@media (max-width: 768px) {
  .wrapper {
    grid-template-columns: 1fr;
    overflow: hidden;
    border-radius: 1rem;
  }
  .wrapper-image {
    height: 220px;
  }
  .wrapper-image img {
    border-radius: 1rem 1rem 0 0;
    height: 100%;
  }
  .wrapper-info {
    padding: 0;
    border-radius: 0 0 1rem 1rem;
  }

  /* mobile social panel: full width bottom panel */
  .txt {
    padding: 2rem;
    padding-bottom: 0;
  }
  .profile {
    padding: 1rem 2rem;
    gap: 0.75rem;
    padding-top: 1rem;
    position: relative;
  }
  .share {
    margin-left: auto;
    position: static;
  } /* push share to the right */
  .social-media {
    left: 0;
    bottom: 0;
    transform: translateY(100%);
    width: 100%;
    height: 100%;
    border-radius: 0 0 1rem 1rem;
    box-shadow: none;
    padding: 1.5rem 2rem;
    opacity: 1;
    visibility: hidden;
  }
  .button-share {
    position: relative;
    z-index: 10;
  }
  .social-media.social-active {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
  }
  .social-media::before {
    display: none;
  }
  .social-media span {
    font-size: 1rem;
    color: #6d7f97;
  }
  .social-media a {
    width: 22px;
    height: 22px;
    margin: 0 0.6rem;
  }
}
