/* Home page — NEWS: fixed top-right on desktop; inline under hero CTA on mobile */

.home-news-floating {
  position: fixed;
  top: max(67px, calc(env(safe-area-inset-top, 0px) + 20px));
  right: max(34px, calc(env(safe-area-inset-right, 0px) + 20px));
  z-index: 10020;
}

/* Attention: gentle shake every 5s */
@keyframes home-news-shake {
  0%, 14%, 100% {
    transform: rotate(0deg);
  }
  2% {
    transform: rotate(-5deg);
  }
  4% {
    transform: rotate(5deg);
  }
  6% {
    transform: rotate(-4deg);
  }
  8% {
    transform: rotate(4deg);
  }
  10% {
    transform: rotate(-2deg);
  }
  12% {
    transform: rotate(0deg);
  }
}

.home-news-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  margin: 0;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  color: #2b178c !important;
  box-shadow: 0 2px 10px rgba(20, 184, 166, 0.45);
  transform-origin: center center;
  animation: home-news-shake 5s ease-in-out infinite;
  will-change: transform;
}

.home-news-btn i {
  color: #2b178c;
}

.home-news-btn:hover,
.home-news-btn:focus {
  color: #2b178c !important;
  filter: brightness(1.06);
  animation-play-state: paused;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .home-news-btn {
    animation: none;
    box-shadow: 0 2px 10px rgba(20, 184, 166, 0.45);
  }
}

.home-news-badge {
  position: absolute;
  top: -4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  color: #fff;
  background: #e53935;
  border-radius: 999px;
}

.home-news-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(20, 12, 48, 0.55);
}

.home-news-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  pointer-events: none;
}

.home-news-modal__inner {
  pointer-events: auto;
  width: 100%;
  max-width: 520px;
  max-height: min(85vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(34, 22, 84, 0.28);
  border: 1px solid #e2ddf5;
  overflow: hidden;
}

.home-news-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #f3f0ff 0%, #fff 55%);
  border-bottom: 1px solid #ece8f7;
}

.home-news-modal__head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2b178c;
}

.home-news-modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #6e62a3;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.home-news-modal__close:hover {
  background: #f3f0ff;
  color: #2b178c;
}

.home-news-modal__body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  font-size: 0.95rem;
  color: #1e1a2e;
}

.home-news-item {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #eeeef5;
}

.home-news-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.home-news-item__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2b178c;
}

.home-news-item__meta {
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.home-news-item__body {
  line-height: 1.55;
}

/* “News for you” popup each load until “Got it” (sessionStorage); × / backdrop / Esc hide for this view only */
.home-news-auto-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10080;
  background: rgba(20, 12, 48, 0.55);
}

.home-news-auto-modal {
  position: fixed;
  inset: 0;
  z-index: 10090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  pointer-events: none;
}

.home-news-auto-modal__foot {
  flex-shrink: 0;
  padding: 12px 18px 18px;
  border-top: 1px solid #ece8f7;
  background: linear-gradient(180deg, #faf9ff 0%, #fff 100%);
  text-align: center;
}

.home-news-auto-modal__ok {
  min-width: 132px;
  font-weight: 600;
}

/* Mobile: inline under hero CTA (not fixed bottom-right) */
@media (max-width: 991px) {
  .home-news-floating {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    display: flex;
    justify-content: center;
    margin-top: 18px;
  }
}

@media (max-width: 480px) {
  .home-news-btn {
    padding: 10px 18px;
    font-size: 0.99rem;
  }
}
