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

/* CSS reset */

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

* {
  margin: 0;
}

html,
body {
  height: 100%;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* general stylings */

: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%);
}

body {
  font-family: "Manrope", sans-serif;
  font-size: 0.8rem;
  background-color: var(--Light-Grayish-Blue);
}

/* separate stylings */

.article-section {
  margin: 4rem 0;
}

.article__title{
    color: black;
    font-size: 30px;
}

.article-component {
  display: flex;
  flex-direction: column;
  max-width: 350px;
  margin: 0 auto;
  border-radius: 1em;
  box-shadow: 1rem 1rem 3rem rgba(0 0 0/ 0.1);
  overflow: hidden;
  background-color: white;
}

.article__img {
  height: 200px;
  background-image: url("https://kellychi22.github.io/frontend-mentor-solutions/16-article-preview-component/images/drawers.jpg");
  background-size: cover;
  background-position: center;
}

.article__content {
  padding: 2rem;
  padding-bottom: 1.5rem;
  color: var(--Very-Dark-Grayish-Blue);
}

.article__desc {
  margin: 1rem 0;
  font-size: 15px;
  color: var(--Desaturated-Dark-Blue);
  line-height: 1.75em;
}

.article__user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  position: relative;
}

.user__info {
  display: flex;
}

.user__details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.user__img {
  width: 3rem;
  margin-right: 1rem;
  border-radius: 50%;
  overflow: hidden;
}

.user__date {
  margin-top: 0.2em;
  color: var(--Grayish-Blue);
}

.share-icon {
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--Light-Grayish-Blue);
  color: var(--Desaturated-Dark-Blue);
  font-size: 1rem;
}

.share-icon:hover {
  opacity: 0.75;
}

.share {
  position: absolute;
  top: 0;
  left: -2rem;
  width: calc(100% + 4rem);
  height: calc(100% + 1.5rem);

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 1.5rem 2rem;
  background-color: var(--Very-Dark-Grayish-Blue);
  color: var(--Grayish-Blue);

  display: none;
}

.share__social-media {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: black;
  background-color: aliceblue;
}

.button {
    background-color: black;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
  }

.share__social-media span {
  font-size: 1rem;
  letter-spacing: 0.5ch;
}

.share__social-media a {
  color: var(--Light-Grayish-Blue);
  font-size: 1.75em;
}

.share__social-media a:hover {
  opacity: 0.75;
}

.share-icon.active {
  position: absolute;
  top: 18px;
  left: 280px;
  background-color: var(--Desaturated-Dark-Blue);
  color: var(--Light-Grayish-Blue);
}

.share-icon:hover.active {
  opacity: 0.75;
}

/* attribution styling */

footer {
  width: 100%;
  position: absolute;
  top: 0;
  text-align: center;
}

.attribution {
  font-size: 1em;
  color: var(--Very-Dark-Grayish-Blue);
}

.attribution a {
  color: var(--Desaturated-Dark-Blue);
  text-decoration: underline;
}

.attribution a:hover {
  color: var(--Grayish-Blue);
}

/* media queries */

@media (min-width: 800px) {
  body {
    display: grid;
    place-items: center;
  }

  .article-component {
    flex-direction: row;
    max-width: 800px;
    height: 300px;
    overflow: visible;
  }

  .article__img {
    width: 40%;
    height: inherit;
    border-radius: 0.7rem 0 0 0.7rem;
  }

  .article__content {
    width: 60%;
    height: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem;
  }

  .share {
    position: absolute;
    top: -80px;
    left: 250px;
    width: 62%;
    height: 130%;
    padding: 1rem 2rem;
    border-radius: 1em;
    justify-content: center;
  }

  .share::before {
    position: absolute;
    top: 60px;
    left: 118px;
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 10px 0 10px;
    border-color: var(--Very-Dark-Grayish-Blue) transparent transparent
      transparent;
  }

  #share-icon-close {
    position: absolute;
    top: 83px;
    left: 110px;
  }
}