@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap");

:root {
  --white: hsl(0, 100%, 100%);
  --grey-200: hsl(210, 46%, 95%);
  --grey-400: hsl(212, 23%, 69%);
  --grey-500: hsl(214, 17%, 51%);
  --grey-900: hsl(217, 19%, 35%);
}

* {
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--grey-200);
  color: var(--grey-900);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: "Manrope", san-serif;
  font-size: clamp(1rem, 4vw, 1.3rem);
  line-height: 1.4;
  font-weight: 400;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

img {
  max-width: 100%;
  height: auto;
}

h2 {
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 1.8rem);
  line-height: 1.3;
  margin: 1rem 0;
}

p {
  margin: 2rem 0;
  color: var(--grey-500);
}

button {
  background-color: transparent;
  border: unset;
  cursor: pointer;
}

footer {
  margin-top: auto;
  margin-bottom: 1rem;
}

.card {
  background-color: var(--white);
  border-radius: 0.75rem;
  box-shadow: 0 2px 14px 0 hsl(212, 23%, 69%, 20%);
  max-width: 30rem;
  position: relative;
}

img.card-img {
  border-radius: 0.75rem 0.75rem 0 0;
}

.card-content {
  padding: 1rem 2rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 3rem 0 1rem 0;
}

img.avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 2rem;
}

.date {
  display: block;
  color: var(--grey-500);
  font-size: clamp(0.9rem, 4vw, 1.1rem);
}

.btn-share {
  margin-left: auto;
  background-color: var(--grey-200);
  color: var(--grey-500);
  width: 2rem;
  height: 2rem;
  border-radius: 1rem;
  transition: all 0.2s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.share-bar {
  background-color: var(--grey-900);
  border-radius: 0 0 0.75rem 0.75rem;
  width: 100%;
  position: absolute;
  bottom: 0;
  transition: transform 0.2s ease;
  transform: scaleY(1);
  transform-origin: bottom;
}

.share-menu {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 2rem;
  padding: 2rem;
}

.share-menu .btn-share,
.btn-share.active {
  background-color: var(--grey-500);
}

.share-menu .btn-share img,
.btn-share.active img {
  filter: brightness(3);
}

.share {
  font-size: clamp(0.875rem, 4vw, 1rem);
  text-transform: uppercase;
  letter-spacing: 0.3rem;
  color: var(--grey-400);
}

.hidden {
  transform: scaleY(0);
}

@media (min-width: 53rem) {
  .card {
    display: flex;
    max-width: 78%;
  }
  img.card-img {
    border-radius: 0.75rem 0 0 0.75rem;
    width: 100%;
    overflow: hidden;
    object-fit: cover;
    object-position: center;
  }
  .share-bar {
    bottom: 6rem;
    right: -6rem;
    border-radius: 0.75rem;
    width: fit-content;
  }
  .share-bar::after {
    content: "";
    position: absolute;
    left: 51%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--grey-900);
  }
  .share-menu {
    padding: 1rem 2rem;
  }
  .share-menu .btn-share {
    display: none;
  }
}

@media (min-width: 66rem) {
  .card {
    max-width: 50rem;
  }
}
