/**
 * Reisefroh Rotating Banner - PSYCHOLOGICAL UI DESIGN
 *
 * Design principles applied:
 * - Color psychology (vibrant gradients per category)
 * - Visual hierarchy (F-pattern reading)
 * - Attention triggers (subtle animations, micro-interactions)
 * - Urgency indicators (badges, scarcity cues)
 * - Pattern interrupts (varied colors, textures)
 * - Social proof (trending badges)
 * - Accessibility (WCAG AA contrast, reduced motion)
 */

/* ========================================
   CONTAINER & STRUCTURE
   ======================================== */

.rfhb {
  width: 100%;
  margin: 0 0 20px 0;
  padding: 0;
  height: var(--rfhb-h, 120px);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 10px 35px rgba(0, 0, 0, 0.18),
    0 4px 14px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease;
  cursor: pointer;
  /* Subtle pulse animation to catch attention */
  animation: rfhb-pulse 8s ease-in-out infinite;
}

@keyframes rfhb-pulse {
  0%, 100% { box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18), 0 4px 14px rgba(0, 0, 0, 0.12); }
  50% { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), 0 6px 18px rgba(0, 0, 0, 0.15); }
}

.rfhb:hover {
  transform: translateY(-3px) scale(1.002);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.25),
    0 8px 20px rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(255, 255, 255, 0.15) inset;
  animation: none; /* Stop pulse on hover */
}

@media (max-width: 720px) {
  .rfhb {
    height: var(--rfhb-hm, 86px);
    border-radius: 14px;
    margin-bottom: 16px;
  }
  .rfhb:hover {
    transform: translateY(-1px);
  }
}

/* ========================================
   LINK WRAPPER
   ======================================== */

.rfhb__link {
  display: block;
  height: 100%;
  width: 100%;
  text-decoration: none;
  position: relative;
  color: inherit;
}

/* ========================================
   BACKGROUND (Gradient or Image)
   ======================================== */

.rfhb__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.03);
  filter: saturate(1.15) contrast(1.08) brightness(1.02);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.6s ease;
}

/* Add subtle texture overlay for visual interest */
.rfhb__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.03) 2px,
      rgba(255, 255, 255, 0.03) 4px
    );
  opacity: 0.5;
  pointer-events: none;
}

.rfhb:hover .rfhb__bg {
  transform: scale(1.08);
  filter: saturate(1.25) contrast(1.12) brightness(1.05);
}

/* ========================================
   GRADIENT OVERLAY (for readability)
   ======================================== */

.rfhb__link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.60) 30%,
    rgba(0, 0, 0, 0.48) 55%,
    rgba(0, 0, 0, 0.28) 100%
  );
  z-index: 1;
  transition: background 0.4s ease;
}

.rfhb:hover .rfhb__link::before {
  background: linear-gradient(
    100deg,
    rgba(0, 0, 0, 0.70) 0%,
    rgba(0, 0, 0, 0.55) 30%,
    rgba(0, 0, 0, 0.42) 55%,
    rgba(0, 0, 0, 0.22) 100%
  );
}

/* ========================================
   CONTENT CONTAINER
   ======================================== */

.rfhb__content {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
}

@media (max-width: 720px) {
  .rfhb__content {
    padding: 9px 12px;
    gap: 3px;
  }
}

/* ========================================
   TOP ROW (Badges)
   ======================================== */

.rfhb__top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Ad disclosure badge (legal requirement) */
.rfhb__badge {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.rfhb:hover .rfhb__badge {
  background: rgba(255, 255, 255, 0.30);
  border-color: rgba(255, 255, 255, 0.40);
  transform: scale(1.05);
}

/* Category tag */
.rfhb__tag {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

/* PSYCHOLOGY BADGE (Urgency/Social Proof/Scarcity) */
.rfhb__psych-badge {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  /* Eye-catching gradient */
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  box-shadow:
    0 4px 12px rgba(245, 87, 108, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
  /* Subtle glow animation */
  animation: rfhb-badge-glow 3s ease-in-out infinite;
}

@keyframes rfhb-badge-glow {
  0%, 100% { box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4); }
  50% { box-shadow: 0 4px 18px rgba(245, 87, 108, 0.6), 0 0 20px rgba(245, 87, 108, 0.3); }
}

.rfhb:hover .rfhb__psych-badge {
  transform: scale(1.08) translateY(-1px);
  box-shadow:
    0 6px 18px rgba(245, 87, 108, 0.6),
    0 0 24px rgba(245, 87, 108, 0.4);
}

@media (max-width: 720px) {
  .rfhb__badge,
  .rfhb__tag,
  .rfhb__psych-badge {
    font-size: 9px;
    padding: 3px 6px;
  }
}

/* ========================================
   ARTICLE TITLE (Main focus)
   ======================================== */

.rfhb__title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 0.2px;
  color: #ffffff;
  text-shadow:
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  transition: text-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 1px;
}

/* Subtle underline effect on hover */
.rfhb:hover .rfhb__title {
  text-shadow:
    0 6px 18px rgba(0, 0, 0, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 255, 255, 0.2);
  transform: translateX(2px);
}

@media (max-width: 720px) {
  .rfhb__title {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
    -webkit-line-clamp: 2;
  }
}

/* ========================================
   BOTTOM ROW (CTA + Site)
   ======================================== */

.rfhb__bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  background: transparent;
  min-height: 0;
}

.rfhb__site-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.05;
}

/* CALL-TO-ACTION BUTTON (Primary conversion driver) */
.rfhb__cta {
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: relative;
  overflow: hidden;
}

/* Shine effect on CTA button */
.rfhb__cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.6s ease;
}

.rfhb:hover .rfhb__cta::before {
  left: 100%;
}

.rfhb:hover .rfhb__cta {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.26),
    0 0 0 2px rgba(255, 255, 255, 0.24) inset;
  transform: translateY(-1px) scale(1.03);
}

.rfhb__cta:active {
  transform: translateY(0) scale(1.02);
}

@media (max-width: 720px) {
  .rfhb__cta {
    font-size: 8px;
    padding: 5px 7px;
    border-radius: 8px;
  }
  .rfhb:hover .rfhb__cta {
    transform: scale(1.03);
  }
}

/* Site name badge */
.rfhb__site {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
  transition: color 0.3s ease;
}

.rfhb__brand {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.35px;
  text-transform: uppercase;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rfhb:hover .rfhb__site {
  color: rgba(255, 255, 255, 1);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
}

.rfhb:hover .rfhb__brand {
  color: rgba(255, 255, 255, 0.94);
}

@media (max-width: 720px) {
  .rfhb__bottom {
    gap: 6px;
  }
  .rfhb__site {
    font-size: 10px;
  }
  .rfhb__brand {
    font-size: 8px;
    margin-top: 1px;
  }
}

/* ========================================
   CROSSFADE ANIMATION
   ======================================== */

.rfhb--fade .rfhb__content {
  opacity: 0.12;
  transform: translateY(3px);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.rfhb__content {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 320ms ease-in, transform 320ms ease-in;
}

/* ========================================
   ACCESSIBILITY & PERFORMANCE
   ======================================== */

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .rfhb,
  .rfhb__bg,
  .rfhb__link::before,
  .rfhb__content,
  .rfhb__badge,
  .rfhb__psych-badge,
  .rfhb__title,
  .rfhb__cta,
  .rfhb__cta::before,
  .rfhb__site,
  .rfhb__brand {
    transition: none !important;
    animation: none !important;
  }

  .rfhb:hover {
    transform: none;
  }

  .rfhb:hover .rfhb__bg {
    transform: scale(1.03);
  }
}

/* Print styles */
@media print {
  .rfhb {
    display: none;
  }
}

/* Focus styles for keyboard navigation */
.rfhb__link:focus {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

.rfhb__link:focus:not(:focus-visible) {
  outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .rfhb__link::before {
    background: linear-gradient(
      100deg,
      rgba(0, 0, 0, 0.85) 0%,
      rgba(0, 0, 0, 0.70) 100%
    );
  }

  .rfhb__title,
  .rfhb__cta {
    font-weight: 900;
  }
}
