/**
 * Manual Teaser Component Styles - Hover Overlay Design
 * 
 * Image with headline at bottom, text overlay slides up on hover
 */

/* Container Section */
.manual-teaser {
  padding: 0;
  background: #ffffff;
}

/* Header */
.manual-teaser__header {
  text-align: center;
  margin-bottom: 3rem;
}

.manual-teaser__headline {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-primary, #0066cc);
  margin: 0;
  line-height: 1.2;
}

/* Grid Layout - 3 Columns */
.manual-teaser__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Handle Drupal's paragraph wrappers */
.manual-teaser__grid > * {
  display: contents;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
  .manual-teaser__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3 columns */
@media (min-width: 992px) {
  .manual-teaser__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

/* Individual Teaser Item */
.manual-teaser-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.manual-teaser-item__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  cursor: pointer;
}

.manual-teaser-item__inner {
  position: relative;
  height: 100%;
  min-height: 400px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

.manual-teaser-item__link:hover .manual-teaser-item__inner,
.manual-teaser-item__inner:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Image Container - Always visible */
.manual-teaser-item__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.manual-teaser-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Headline - Always visible at bottom of image */
.manual-teaser-item__headline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  z-index: 2;
  transition: opacity 0.3s ease;
}

.manual-teaser-item__headline h3 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

/* Hide headline on hover when overlay appears */
.manual-teaser-item__inner:hover .manual-teaser-item__headline {
  opacity: 0;
}

/* Overlay - Slides from bottom to middle on hover */
.manual-teaser-item__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: rgba(0, 102, 204, 0.95); /* Default blue overlay */
  z-index: 3;
  transform: translateY(100%);
  transition: transform 0.4s ease-in-out;
  display: flex;
  align-items: center;
  padding: 2rem 1.5rem;
}

/* Different overlay colors for variety */
.manual-teaser-item:nth-child(1) .manual-teaser-item__overlay {
  background: rgba(52, 152, 219, 0.95); /* Blue */
}

.manual-teaser-item:nth-child(2) .manual-teaser-item__overlay {
  background: rgba(155, 89, 182, 0.95); /* Purple */
}

.manual-teaser-item:nth-child(3) .manual-teaser-item__overlay {
  background: rgba(231, 76, 60, 0.95); /* Red/Coral */
}

.manual-teaser-item:nth-child(4) .manual-teaser-item__overlay {
  background: rgba(46, 204, 113, 0.95); /* Green */
}

.manual-teaser-item:nth-child(5) .manual-teaser-item__overlay {
  background: rgba(0, 102, 204, 0.95); /* Primary Color */
}

.manual-teaser-item:nth-child(6) .manual-teaser-item__overlay {
  background: rgba(26, 188, 156, 0.95); /* Teal */
}

/* Slide overlay up on hover */
.manual-teaser-item__inner:hover .manual-teaser-item__overlay {
  transform: translateY(0);
}

/* Overlay Content */
.manual-teaser-item__overlay-content {
  width: 100%;
  color: #ffffff;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease 0.2s, transform 0.3s ease 0.2s;
}

.manual-teaser-item__inner:hover .manual-teaser-item__overlay-content {
  opacity: 1;
  transform: translateY(0);
}

.manual-teaser-item__overlay-content .manual-teaser-item__title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  line-height: 1.3;
  color: #ffffff;
}

.manual-teaser-item__overlay-content .manual-teaser-item__text {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
}

.manual-teaser-item__overlay-content .manual-teaser-item__text p {
  margin: 0 0 0.5rem 0;
}

.manual-teaser-item__overlay-content .manual-teaser-item__text p:last-child {
  margin-bottom: 0;
}

/* Text-only card (no image) */
.manual-teaser-item--text-only .manual-teaser-item__inner {
  background: var(--color-primary, #0066cc);
  justify-content: center;
  align-items: center;
  padding: 3rem 2rem;
  min-height: 350px;
}

.manual-teaser-item--text-only .manual-teaser-item__headline {
  position: static;
  background: none;
  text-align: center;
  padding: 0;
  margin-bottom: 1.5rem;
}

.manual-teaser-item--text-only .manual-teaser-item__headline h3 {
  font-size: 1.8rem;
}

.manual-teaser-item--text-only .manual-teaser-item__overlay {
  position: static;
  transform: none;
  height: auto;
  background: transparent;
  padding: 0;
}

.manual-teaser-item--text-only .manual-teaser-item__overlay-content {
  opacity: 1;
  transform: none;
  text-align: center;
}

.manual-teaser-item--text-only .manual-teaser-item__overlay-content .manual-teaser-item__title {
  display: none; /* Title already shown in headline */
}

/* Responsive padding adjustments */
@media (min-width: 768px) {
  .manual-teaser {
    padding: 0;
  }
  
  .manual-teaser__header {
    margin-bottom: 4rem;
  }
}

@media (min-width: 1200px) {
  .manual-teaser {
    padding: 0;
  }
}

/* Mobile optimizations */
@media (max-width: 767px) {
  .manual-teaser {
    padding: 0;
  }
  
  .manual-teaser__header {
    margin-bottom: 2rem;
  }
  
  .manual-teaser__grid {
    gap: 1.5rem;
  }
  
  .manual-teaser-item__inner {
    min-height: 350px;
  }
  
  .manual-teaser-item__headline {
    padding: 1.25rem;
  }
  
  .manual-teaser-item__headline h3 {
    font-size: 1.25rem;
  }
  
  .manual-teaser-item__overlay {
    padding: 1.5rem 1.25rem;
    height: 60%; /* Slightly higher on mobile */
  }
  
  .manual-teaser-item__overlay-content .manual-teaser-item__title {
    font-size: 1.25rem;
  }
  
  .manual-teaser-item__overlay-content .manual-teaser-item__text {
    font-size: 0.9rem;
  }
  
  .manual-teaser-item--text-only .manual-teaser-item__inner {
    min-height: 300px;
    padding: 2rem 1.5rem;
  }
  
  .manual-teaser-item--text-only .manual-teaser-item__headline h3 {
    font-size: 1.5rem;
  }
}

/* Accessibility */
.manual-teaser-item__inner:focus-within {
  outline: 3px solid var(--color-primary, #0066cc);
  outline-offset: 2px;
}

.manual-teaser-item__link:focus {
  outline: none;
}

.manual-teaser-item__link:focus .manual-teaser-item__inner {
  outline: 3px solid var(--color-primary, #0066cc);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .manual-teaser-item__inner,
  .manual-teaser-item__headline,
  .manual-teaser-item__overlay,
  .manual-teaser-item__overlay-content {
    transition: none;
  }
}

/* Print styles */
@media print {
  .manual-teaser {
    padding: 0;
  }
  
  .manual-teaser__grid {
    grid-template-columns: 1fr;
  }
  
  .manual-teaser-item__inner {
    border: 1px solid #ddd;
    page-break-inside: avoid;
    min-height: auto;
  }
  
  .manual-teaser-item__overlay {
    position: static;
    transform: none;
    height: auto;
    background: #f5f5f5;
    color: #333;
    page-break-inside: avoid;
  }
  
  .manual-teaser-item__overlay-content {
    opacity: 1;
    transform: none;
    color: #333;
  }
  
  .manual-teaser-item__headline {
    background: none;
    color: #333;
  }
}