:root {
    --veryDarkGrayishBlue: hsl(217, 19%, 35%);
    --desaturatedDarkBlue: hsl(214, 17%, 51%);
    --grayishBlue: hsl(212, 23%, 69%);
    --lightGrayishBlue: hsl(210, 46%, 95%);
    --shadow--: hsl(214, 17%, 51%, 0.1);
    --previewBorderRadius: 10px;
}

* {
  box-sizing: border-box;
}


body {
    
    font-family: "Manrope", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    font-size: 13px;

    min-height: 100vh;
    background-color: var(--lightGrayishBlue);
    display: flex;
    flex-direction: column;
}

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


div.container {
    background-color: white;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    width: 900px;
    height: 350px;
    margin: 0;
    border-radius: var(--previewBorderRadius);
    box-shadow: 20px 50px 30px var(--shadow--);
}    

img.article-image {
    height: 100%;
    width: auto;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: left;
    border-radius: var(--previewBorderRadius) 0 0 var(--previewBorderRadius);
}

div.text {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

div.upper {
    display: flex;
    flex-direction: column;
    padding: 40px 40px 20px 20px;
}

h1{
    color: var(--veryDarkGrayishBlue);
    font-weight: 700;
    margin: auto;
}

p.description {
  margin: auto;
}
.articleLink {
    text-decoration: none;
}

.articleLink:hover h2,
.articleLink:focus h2 {
    color: var(--grayishBlue);
}
p {
    color: var(--desaturatedDarkBlue);
    font-size: 0.9375rem;
}

div.bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between; 
    width: 100%;
    margin-top: auto;
    padding-left: 20px;  
    padding-right: 40px;
}

div.author {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

img.authorAvatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
}

div.authorInfo {
    display: flex;
    flex-direction: column;
}


a.authorName {
    font-weight: 800;
    text-decoration: none;
    color: var(--veryDarkGrayishBlue);
}

.authorName:hover,
.authorName:focus {
  color: var(--grayishBlue);
}
.publishDate {
    font-size: 0.8125rem;
    color: var(--grayishBlue);
}

.shareButton {
    width: 40px;
    height: 40px;
    background-color: var(--lightGrayishBlue);
    border: none;
    color: var(--veryDarkGrayishBlue);
    padding: 10px 10px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 50%;
    z-index: 20;
    position: relative;
    vertical-align: middle;
}

.shareButton:hover {
    background-color: var(--desaturatedDarkBlue);
    color: white;
    cursor: pointer;
}

.shareMenu {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  background: var(--veryDarkGrayishBlue);
  box-shadow: 0 10px 25px -5px var(--desaturatedDarkBlue);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.95);
  font-weight: 700;
}

.shareMenu.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.shareMenu button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--lightGrayishBlue);
  transition: color 0.2s;
}

.shareMenu button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: currentColor;
}

.shareMenu button:hover,
.shareMenu button:focus-visible {
  color: var(--grayishBlue);
  background: transparent;
  outline: none;
}

.systemShareButton {
  background: transparent !important;
}


@media (min-width: 641px) {         /*-----------------DESKTOP-----------------*/
  .shareWrapper {
    position: relative;
  }

  .shareMenu {
    font-size: 40px;
    border-radius: var(--previewBorderRadius);
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    white-space: nowrap;
    padding: 5px 15px;
    opacity: 0;
    transition: none;
  }

  .shareMenu.active {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .shareMenu::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: var(--veryDarkGrayishBlue);
    border-radius: 2px;
  }
}

@media (max-width: 640px) {             /*-----------------MOBILE-----------------*/
  div.container {
    flex-direction: column;
    width: 90vw;
    height: auto;
    overflow: clip;
  }

  img.article-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: top;
    border-radius: var(--previewBorderRadius) var(--previewBorderRadius) 0 0;
  }

  div.bottom {
    position: relative;
    height: 80px;         
    display: flex;
    align-items: center;
    padding-left: 20px;
    padding-right: 20px;
  }

  .shareMenu {
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0 0 var(--previewBorderRadius) var(--previewBorderRadius);
    background: var(--veryDarkGrayishBlue);
    padding: 10px 10px;
    display: flex;
    justify-content: flex-start;
    gap: 0;
    transform: translateY(100%);
    opacity: 0;         
    transition: none;
    pointer-events: none;
    z-index: 10;
    justify-content: flex-start;
  }
    .shareMenu.active {
    transform: translateY(0);
    pointer-events: auto;
    transition: transform 0.3s ease;
  }

  .shareMenu::after {
    display: none;
  }

  .shareButton {
    position: relative;
    z-index: 20;
  }
}

footer.attribution {
    font-size: 0.6875rem;
    text-align: center;
}
