/* ======================
   VARIABLES
====================== */
:root {
  --very-dark-grayish-blue: hsl(217, 19%, 35%);
  --desaturated-dark-blue: hsl(214, 17%, 51%);
  --grayish-blue: hsl(212, 23%, 69%);
  --light-grayish-blue: hsl(210, 46%, 95%);
  --white: hsl(0, 0%, 100%);
}

/* ======================
   RESET
====================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

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

/* ======================
   PAGE
====================== */
body {
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  background-color: var(--light-grayish-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* ======================
   CARD
====================== */
article {
  max-width: 45.625rem; /* 730px */
  background-color: var(--white);
  border-radius: 0.625rem;
  display: grid;
  position: relative;
  box-shadow: 0 2.5rem 2.5rem -0.625rem rgba(201, 213, 225, 0.5);
}

/* ======================
   IMAGE
====================== */
.drawers__img {
  width: 100%;
  height: 12.5rem;
  object-fit: cover;
  object-position: 50% 25%;
  border-radius: 0.625rem 0.625rem 0 0;
}

/* ======================
   CONTENT
====================== */
.content__container {
  padding: 2.4rem 9.8% 1.6rem;
}

.container h1 {
  font-size: 1.1rem;
  line-height: 1.35;
  color: var(--very-dark-grayish-blue);
  font-weight: 700;
  margin-bottom: 0.7em;
}

.container p {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--desaturated-dark-blue);
}

/* ======================
   AUTHOR ROW
====================== */
.avatar {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  height: 4rem;
}

.avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.avatar__text {
  margin-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--very-dark-grayish-blue);
}

.date {
  font-size: 0.75rem;
  color: var(--grayish-blue);
}

/* ======================
   SHARE BUTTON
====================== */
.share-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--light-grayish-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.share-btn img {
  width: 15px;
  height: 15px;
}

.share-btn:hover,
.share-btn.active {
  background-color: var(--desaturated-dark-blue);
}

.share-btn:hover img,
.share-btn.active img {
  filter: brightness(0) invert(1);
}

/* ======================
   SHARE TOOLTIP (DESKTOP)
====================== */
.share-tooltip {
  position: absolute;
  background-color: var(--very-dark-grayish-blue);
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* desktop tooltip text */
.share-tooltip span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.31rem;
  color: var(--grayish-blue);
  line-height: 1;
}

.share-tooltip img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.share-tooltip.active {
  opacity: 1;
  pointer-events: auto;
}

/* ======================
   DESKTOP LAYOUT
====================== */
@media (min-width: 768px) {
  article {
    grid-template-columns: 39% 61%;
  }

  .drawers__img {
    height: 100%;
    border-radius: 0.625rem 0 0 0.625rem;
    object-position: 0% 50%;
  }

  .content__container {
    padding: 2.2rem 9% 1.2rem;
  }

  .container h1 {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  .share-tooltip {
    bottom: 3.7rem;
    right: 3.5rem;
    padding: 1.1rem 2.3rem;
    border-radius: 0.625rem;
    filter: drop-shadow(0 0.625rem 0.3rem rgba(201, 213, 225, 0.5));
  }

  .share-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 50%) rotate(45deg);
    width: 1.05rem;
    height: 1.05rem;
    background-color: var(--very-dark-grayish-blue);
  }
}

/* ======================
   MOBILE SHARE BAR
====================== */
@media (max-width: 767px) {
  article {
    max-width: 327px;
    overflow: hidden;
  }

  .share-tooltip {
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    padding: 0 1.5rem;
    border-radius: 0 0 0.625rem 0.625rem;
    gap: 1.3rem;
  }

  .share-tooltip span {
    letter-spacing: 0.25rem;
  }

  .share-tooltip::after {
    display: none;
  }

  .avatar.share-active img,
  .avatar.share-active .avatar__text {
    display: none;
  }
}
