/**
 * @file
 * Article expander component styles.
 */

/* Article teaser wrapper */
.article-teaser-wrapper {
  position: relative;
  margin-bottom: 2rem;
  transition: all 0.3s ease-in-out;
  background-color: rgba(0, 0, 0, 0.02);
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Article content container */
.article-teaser-wrapper .article-content {
  position: relative;
}

/* Expand/Read more button */
.article-teaser-wrapper .expand-article {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.article-teaser-wrapper .expand-article:hover,
.article-teaser-wrapper .expand-article:focus {
  transform: translateX(5px);
}

.article-teaser-wrapper .expand-article[aria-busy="true"] {
  opacity: 0.6;
  cursor: wait;
  pointer-events: none;
}

/* Loading state */
.article-teaser-wrapper.article-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.article-teaser-wrapper.article-loading .article-content::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 5;
}

/* Expanded state */
.article-teaser-wrapper.article-expanded .article-content {
  animation: fadeIn 0.3s ease-in-out;
}

.article-teaser-wrapper.article-expanded .expand-article {
  display: none;
}

/* Collapse button */
.article-teaser-wrapper .collapse-article {
  margin-top: 1.5rem;
  display: inline-block;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading spinner */
.article-teaser-wrapper.article-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Accessibility improvements */
.expand-article:focus,
.collapse-article:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .article-teaser-wrapper.article-expanded {
    padding: 1rem;
  }
}

/* Alert styling for error messages */
.article-content .alert {
  margin-top: 1rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* DFP Ad styling */
.dfp-ad {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

.dfp-ad > div {
  display: inline-block;
}

