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

/* Reset styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  background-color: var(--light-grayish-blue);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.container {
  max-width: 730px;
  margin: 0 auto;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  position: relative;
}

.article-content {
  display: grid;
  grid-template-columns: 1fr;
  overflow: visible;
  border-radius: 10px;
}

@media (min-width: 768px) {
  .article-content {
    grid-template-columns: 285px 1fr;
  }
}

.article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

@media (min-width: 768px) {
  .article-image {
    height: 100%;
  }
}

.article-text {
  padding: 2rem;
}

.article-title {
  color: var(--very-dark-blue);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.article-excerpt {
  color: var(--desaturated-blue);
  margin-bottom: 1.5rem;
}

.author-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  color: var(--very-dark-blue);
  font-weight: 700;
}

.article-date {
  color: var(--grayish-blue);
}

.share-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background-color: var(--light-grayish-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.share-popup {
  position: absolute;
  background-color: var(--very-dark-blue);
  padding: 1rem 2rem;
  border-radius: 10px;
  gap: 1.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  display: none;
}

.share-popup-text {
  color: var(--grayish-blue);
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 0.8rem;
}

.share-links {
  display: flex;
  gap: 1rem;
}

.share-links a {
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-links img {
  width: 20px;
  height: 20px;
}

.attribution {
  margin-top: 2rem;
  font-size: 11px;
  text-align: center;
  color: var(--desaturated-blue);
}

.attribution a {
  color: var(--very-dark-blue);
  text-decoration: none;
}

@media (max-width: 767px) {
  .author-section {
    padding: 1rem 2rem;
    margin: 0 -2rem -2rem -2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }

  .author-section.sharing {
    background-color: var(--very-dark-blue);
    border-radius: 0 0 1rem 1rem;
  }

  .author-section.sharing .author-info {
    display: none;
  }

  .share-popup {
    display: none;
    position: static;
    background: none;
    box-shadow: none;
    padding: 0;
    width: auto;
  }

  .share-popup.active {
    display: flex;
    align-items: center;
    order: 2;
    margin-left: auto;
  }

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

  .share-button {
    position: relative;
    z-index: 2;
    order: 1;
  }

  .share-links {
    display: flex;
    gap: 1rem;
  }

  .share-links img {
    width: 20px;
    height: 20px;
  }

  .share-popup-text {
    color: var (--grayish-blue);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 5px;
  }
}

@media (min-width: 768px) {
  .share-popup {
    display: none;
    bottom: 50px;
    right: -105px;
    transform: none;
    z-index: 100;
  }

  .share-popup.active {
    display: flex;
  }

  .share-popup::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: var(--very-dark-blue)
      transparent transparent transparent;
  }

  .share-popup.active {
    display: flex;
  }

  .share-button {
    background-color: var(--light-grayish-blue);
  }

  .share-button.active {
    background-color: var(--desaturated-blue);
  }

  .share-button.active svg path {
    fill: white;
  }
}

@media (max-width: 425px) {
  .author-section {
    padding: 1rem;
  }
}
