/*
Theme: Twenty Twenty-Five Child (FH Quote Loader Styles)
Author: Frank Helmers
Description: Stile für FH Quote Loader Block - Namespace-sicher
*/

/* Haupt-Container */
.wp-block-fh-quote-loader {
  margin-block: 2rem;
}

.fh-quotes-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Quote Items */
.fh-quote-item {
  margin: 0;
  padding: 0;
  /* Basis-Transition für neue Posts */
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Animation für neu geladene Posts */
.fh-quote-item.fh-loading {
  opacity: 0;
  transform: translateY(30px);
}

.fh-quote-item.fh-in-view {
  opacity: 1;
  transform: translateY(0);
}

.fh-quote-item blockquote {
  margin: 0;
  padding: 2rem;
  font-size: 1.1rem;
  line-height: 1.6;
  position: relative;
}

/* Thumbnail-Styles */
.fh-quote-item .fh-quote-thumbnail {
  float: inline-end;
  margin: 0 0 1rem 1rem;
  overflow: hidden;
  max-width: 150px;
}

.fh-quote-item .fh-quote-thumbnail img {
  width: 100%;
  height: auto;
  object-fit: cover;
  /* Sanfte Transition für Bilder */
  transition: opacity 0.3s ease;
}

/* Page Image Container - Separater Container über dem Content */
.fh-page-image-container {
  margin-bottom: 1.5rem;
  text-align: center;
  overflow: hidden;
  border-radius: 8px;
}

.fh-page-image-container img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.fh-page-image-container a:hover img {
  transform: scale(1.02);
}

.fh-quote-item .fh-quote-thumbnail img.fh-lazy {
  opacity: 0;
}

/* Text-Styles */
.fh-quote-item blockquote p {
  margin-bottom: 1rem;
  font-style: italic;
  text-align: start;
}

/* Expandierbarer Content für Pages - Additive Approach */
.fh-expandable-content {
  margin-bottom: 1rem;
  font-style: italic;
  text-align: start;
}

/* Sichtbarer Content (bleibt immer da) */
.fh-visible-content {
  font-style: italic;
}

.fh-visible-content p {
  margin-bottom: 0;
  font-style: italic;
}

/* Zusätzlicher Content (wird hinzugefügt) */
.fh-additional-content {
  font-style: italic;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fh-additional-content p {
  margin-bottom: 0.75rem;
  font-style: italic;
}

.fh-additional-content p:first-child {
  margin-top: 0; /* Nahtloser Übergang zum vorherigen Text */
}

.fh-additional-content p:last-child {
  margin-bottom: 0;
}

/* Formatierung für Rich Content in zusätzlichem Content */
.fh-additional-content h1,
.fh-additional-content h2,
.fh-additional-content h3,
.fh-additional-content h4,
.fh-additional-content h5,
.fh-additional-content h6 {
  font-style: normal;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.fh-additional-content ul,
.fh-additional-content ol {
  font-style: normal;
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.fh-additional-content blockquote {
  font-style: italic;
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid #ddd;
}

/* Sanfte Einblendung für neuen Content */
.fh-additional-content.fh-expanding {
  opacity: 0;
  transform: translateY(10px);
}

.fh-additional-content.fh-expanded {
  opacity: 1;
  transform: translateY(0);
}

/* Sanfte Übergänge */
.fh-limited-text,
.fh-full-text {
  transition: all 0.8s ease-in-out;
}

.fh-limited-text {
  opacity: 1;
}

.fh-full-text {
  opacity: 0;
}

/* Expandierbar Status Klassen */
.fh-expandable-content.fh-expanding .fh-limited-text {
  opacity: 0;
  transform: translateY(-10px);
}

.fh-expandable-content.fh-expanded .fh-full-text {
  opacity: 1;
  transform: translateY(0);
}

/* Animation für Button während Expansion */
.fh-quote-load-more-btn:disabled {
  opacity: 0.7;
  transform: scale(0.98);
  transition: all 0.3s ease;
}

/* Hover-Effekte für Page Images */
.fh-page-image-container {
  position: relative;
  overflow: hidden;
}

.fh-page-image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(0,0,0,0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.fh-page-image-container:hover::before {
  opacity: 1;
}

.fh-quote-item .fh-quote-excerpt {
  margin-block: 1rem;
  font-size: 0.95rem;
  font-style: normal;
  line-height: 1.5;
}

.fh-quote-item .fh-quote-excerpt p {
  margin: 0;
  font-style: normal;
  font-size: var(--wp--preset--font-size--xx-large);
}

/* Citation Styles */
.fh-quote-item cite {
  display: block;
  margin-top: 1.5rem;
  font-style: normal;
  line-height: 1.2;
}

.fh-quote-item cite em {
  font-style: normal;
  font-weight: 600;
}

.fh-quote-item cite a {
  text-decoration: none;
}

.fh-quote-item .fh-quote-date {
  font-weight: normal;
}

/* Load More Button Container */
.fh-quote-load-more-container {
  text-align: center;
  margin-block: 2rem;
  /* Transition für Container */
  transition: opacity 0.6s ease;
}

/* Load More Button */
.fh-quote-load-more-btn {
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  min-width: 180px;
  /* Sanfte Transition für Button */
  transition: transform 0.2s ease, opacity 0.3s ease;
}

.fh-quote-load-more-btn:disabled {
  cursor: not-allowed;
}

.fh-quote-load-more-btn.is-style-outline {
  background-color: #000;
  border: 2px solid #0073aa;
}

/* Keyframe-Animation für den Load-Button */
@keyframes fhButtonPulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.fh-quote-load-more-btn:disabled {
  animation: fhButtonPulse 1.5s infinite;
}

/* Staggered Animation für neue Posts */
.fh-quote-item:nth-child(1) { animation-delay: 0ms; }
.fh-quote-item:nth-child(2) { animation-delay: 150ms; }
.fh-quote-item:nth-child(3) { animation-delay: 300ms; }
.fh-quote-item:nth-child(4) { animation-delay: 450ms; }
.fh-quote-item:nth-child(5) { animation-delay: 600ms; }

/* Fade-In-Animation für neue Posts */
@keyframes fhFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fh-quote-item.fh-animate-in {
  animation: fhFadeInUp 0.6s ease forwards;
}

/* No Quotes Message */
.fh-no-quotes {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 3rem 2rem;
}

/* Editor Preview Styles */
.fh-quote-loader-editor .fh-editor-preview {
  border: 2px dashed #ddd;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 8px;
  background-color: #fafafa;
}

.fh-quote-loader-editor .fh-quote-item.fh-preview {
  /* Keine speziellen Preview-Stile nötig */
}

.fh-quote-loader-editor .fh-preview-button {
  cursor: default;
}

.fh-quote-loader-editor .fh-editor-info {
  margin-top: 1rem;
  padding: 0.5rem;
  background-color: #f0f0f1;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
  .fh-quote-item blockquote {
    padding: 1.5rem;
    font-size: 1rem;
  }
  
  .fh-quote-item .fh-quote-thumbnail {
    float: none;
    margin-block-end: 1rem;
    max-width: 100%;
  }
  
  .fh-page-image-container {
    margin-bottom: 1rem;
  }
  
  .fh-page-image-container img {
    max-height: 200px;
  }
  
  .fh-quote-item cite {
    text-align: start;
  }
  
  .fh-quote-load-more-btn {
    min-width: 150px;
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  .fh-quotes-container {
    gap: 1.5rem;
  }
  
  .fh-quote-item blockquote {
    padding: 1rem;
  }
  
  .fh-page-image-container img {
    max-height: 150px;
  }
  
  .fh-quote-load-more-btn {
    width: 100%;
    max-width: 300px;
  }
}

/* Performance-Optimierung für Animationen */
.fh-quote-item {
  will-change: opacity, transform;
}

.fh-quote-item.fh-loading {
  will-change: auto;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .fh-quote-item,
  .fh-quote-load-more-btn,
  .fh-quote-thumbnail img {
    transition: none;
    animation: none;
  }
  
  .fh-quote-item {
    opacity: 1;
    transform: none;
  }
}

/* Accessibility Improvements */
.fh-quote-load-more-btn:focus {
  outline: 2px solid #005cee;
  outline-offset: 2px;
}

.fh-quote-item a:focus {
  outline: 2px solid #005cee;
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .fh-quote-item blockquote {
    border: 1px solid;
  }
  
  .fh-quote-load-more-btn {
    border: 2px solid;
  }
}