/* Frontend Mentor - Article Preview Component Styles */

body {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  color: hsl(217, 19%, 35%);
  background-color: hsl(210, 46%, 95%);
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.attribution { 
  font-size: 11px; 
  text-align: center; 
  margin-top: 20px;
}

.attribution a { 
  color: hsl(228, 45%, 44%); 
}

.article-preview {
  display: flex;
  flex-direction: column;
  max-width: 327px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 40px 40px -10px rgba(201, 213, 225, 0.5);
}

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

.article-content {
  padding: 36px 32px 20px 32px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 12px 0;
  color: hsl(217, 19%, 35%);
}

.article-text {
  color: hsl(214, 17%, 51%);
  font-size: 13px;
  line-height: 1.54;
  margin: 0 0 32px 0;
  flex-grow: 1;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 0 32px 20px 32px;
}

.author {
  display: flex;
  align-items: center;
}

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

.author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.author-name {
  font-weight: 700;
  font-size: 13px;
  color: hsl(217, 19%, 35%);
}

.author-date {
  color: hsl(212, 23%, 69%);
  font-size: 13px;
}

.share-button {
  background: hsl(210, 46%, 95%);
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.share-button:hover {
  background: hsl(217, 19%, 35%);
}

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

.share-button svg {
  width: 15px;
  height: 13px;
}

.share-tooltip {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: hsl(217, 19%, 35%);
  color: white;
  border-radius: 10px;
  padding: 18px 36px;
  box-shadow: 0 10px 10px rgba(201, 213, 225, 0.5);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 10;
  font-size: 13px;
  letter-spacing: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

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

.share-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 12px;
  border-style: solid;
  border-color: hsl(217, 19%, 35%) transparent transparent transparent;
}

.share-tooltip span {
  color: hsl(212, 23%, 69%);
  font-weight: 500;
  margin-right: 5px;
  letter-spacing: 5px;
  font-size: 13px;
}

.share-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.share-icons svg {
  width: 20px;
  height: 20px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.share-icons svg:hover {
  transform: scale(1.1);
}

/* Mobile-specific styles */
@media (max-width: 767px) {
  .share-tooltip {
    bottom: 70px;
    width: 248px;
  }
}

@media (min-width: 768px) {
  .article-preview {
    flex-direction: row;
    max-width: 730px;
    height: 280px;
  }
  
  .article-image {
    width: 285px;
    height: 280px;
    object-fit: cover;
  }
  
  .article-content {
    padding: 32px 40px 32px 40px;
    width: calc(100% - 285px);
  }
  
  .article-title {
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 12px;
  }
  
  .article-text {
    margin-bottom: 20px;
  }
  
  .article-footer {
    padding: 0;
    margin-top: auto;
  }
  
  .share-tooltip {
    bottom: 90px;
    right: -68px;
    left: auto;
    transform: none;
    width: auto;
  }
  
  .share-tooltip::after {
    left: 50%;
    transform: translateX(-50%);
  }
}
