/* Base styles for the Article Preview Component */
body {
  font-family: 'Manrope', sans-serif;
  background: hsl(210, 46%, 95%);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.article-preview {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(72, 85, 106, 0.1);
  display: flex;
  max-width: 43.4rem;
  margin: 2rem;
}

.article-preview__image img {
  width: 17.8rem;
  height: 100%;
  object-fit: cover;
  border-bottom-left-radius: 15px;
  border-top-left-radius: 15px;
}

.article-preview__content {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.article-preview__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(217, 19%, 35%);
  margin: 0 0 1rem 0;
  line-height: 1.3;
}

.article-preview__text {
  color: hsl(214, 17%, 51%);
  font-size: 1.1rem;
  line-height: 1.6;
  padding-bottom: 2rem;
}

.article-preview__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-preview__author {
  display: flex;
  align-items: center;
}

.author__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  margin-right: 1rem;
}

.author__info {
  display: flex;
  flex-direction: column;
}

.author__name {
  font-weight: 700;
  color: hsl(217, 19%, 35%);
  font-size: 1rem;
}

.author__date {
  color: hsl(212, 23%, 69%);
  font-size: 0.95rem;
}

.article-preview__share {
  position: relative;
}

.share__button {
  background: hsl(210, 46%, 95%);
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}


.share__button img {
  filter: brightness(0) invert(1);
}

.share__button:hover, .article-preview__share:hover .share__button {
  background: hsl(217, 19%, 35%);
}

.share__popup {
  display: none;
  position: absolute;
  bottom: 180%; 
  left: 50%;
  transform: translateX(-50%);
  background: hsl(217, 19%, 35%);
  color: #fff;
  border-radius: 10px;
  padding: 1.3rem 3rem;
  box-shadow: 0 8px 16px rgba(72, 85, 106, 0.15);
  align-items: center;
  gap: 1rem;
}

.article-preview__share:hover .share__popup,
.article-preview__share:focus-within .share__popup {
  display: flex;
}

.share__button.active {
  background: hsl(214, 17%, 51%);
}

.share__popup span {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 0.9rem;
  margin-right: 1rem;
}

.share__popup a img {
  width: 20px;
  height: 20px;
  margin: 0 0.25rem;
}

.share__popup-arrow {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  width: 24px;
  height: 12px;
  overflow: hidden;
  pointer-events: none;
}

.share__popup-arrow::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background: hsl(217, 19%, 35%);
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 0 2px 6px rgba(72, 85, 106, 0.08);
}

.article-preview__sharebar {
  display: none;
}

/* Responsive styles */
@media (max-width: 37.5rem) {
  .article-preview {
    flex-direction: column;
    max-width: 90vw;
    border-radius: 15px;
    overflow: hidden;
  }
  .article-preview__image img {
    width: 100%;
    height: 250px;
    border-radius: 15px 15px 0 0;
    object-fit: cover;
  }
  .article-preview__content {
    padding: 1.5rem 0 1.5rem 0;
    border-radius: 15px;
  }
  .article-preview__footer {
    position: relative;
    padding: 0;
    padding: 0 3rem;
    background: none;
  }
  .article-preview__author {
    display: flex;
  }
  .article-preview__sharebar {
    display: none;
    position: absolute;
    left: 0;
    bottom: -18px;
    right: 0;
    background: hsl(217, 19%, 35%);
    border-radius: 0 0 15px 15px;
    padding: 1.2rem 3rem;
    gap: 1rem;
    align-items: center;
  }
  .article-preview.share-active .article-preview__sharebar {
    display: flex;
  }
  .sharebar__label {
    color: hsl(212, 23%, 69%);
    text-transform: uppercase;
    letter-spacing: 5px;
    font-size: 0.95rem;
    margin-right: 1.2rem;
    font-weight: 500;
  }
  .sharebar__icon img {
    filter: brightness(0) invert(1);
    width: 22px;
    height: 22px;
    margin: 0 0.2rem;
  }
  .article-preview__sharebar .share__button {
    margin-left: auto;
    background: hsl(214, 17%, 51%);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    box-shadow: none;
  }
  .article-preview__sharebar .share__button img {
    filter: brightness(0) invert(1);
    width: 18px;
    height: 18px;
  }
  .article-preview__title {
    font-size: 1.1rem;
    padding-left: 3rem;
    padding-right: 3rem;
  }
  .article-preview__text {
    padding-left: 3rem;
    padding-right: 3rem;
    font-size: 0.95rem;
  }
  /* Mobile active states */
  .share__button.active {
    background: hsl(217, 19%, 35%);
  }
  .article-preview.share-active {
    border-radius: 15px;
  }
}

.attribution {
  font-size: 11px;
  text-align: center;
  margin-top: 2rem;
}
.attribution a {
  color: hsl(228, 45%, 44%);
} 