/* =========================
   BREAKING POPUPS — TEASER STYLE
========================= */

.breaking-popups {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: min(440px, calc(100vw - 28px));
  pointer-events: none;
}

.breaking-popup {
  position: relative;
  overflow: hidden;
  border: 12px solid #ffffff;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(2, 11, 23, 0.32);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: auto;
  transition: transform 0.26s ease, opacity 0.26s ease;
}

.breaking-popup.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.breaking-popup.is-hiding {
  transform: translateY(24px);
  opacity: 0;
}

.breaking-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(2, 11, 23, 0.72);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.breaking-popup__close:hover {
  background: #d60000;
  transform: scale(1.05);
}

.breaking-popup__link {
  position: relative;
  display: block;
  min-height: 300px;
  color: #ffffff;
  text-decoration: none;
  background: #061a33;
}

.breaking-popup__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(6, 26, 51, 0.96), rgba(214, 0, 0, 0.72)),
    #061a33;
}

.breaking-popup__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 11, 23, 0.04) 0%, rgba(2, 11, 23, 0.16) 42%, rgba(2, 11, 23, 0.88) 100%);
  z-index: 2;
}

.breaking-popup__media img,
.breaking-popup__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.breaking-popup__overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 18px 16px;
}

.breaking-popup__label {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  background: #d60000;
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 18px rgba(214, 0, 0, 0.28);
  animation: breakingFlash 1.15s infinite;
}

.breaking-popup__category {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.breaking-popup__title {
  display: block;
  max-width: 95%;
  color: #ffffff;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-wrap: balance;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.42);
}

.breaking-popup__media.is-image-missing::before {
  content: "BREAKING NEWS";
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.18);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 950;
  letter-spacing: -0.08em;
  text-align: center;
  padding: 20px;
}

@keyframes breakingFlash {
  0% {
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(214, 0, 0, 0.28);
    opacity: 1;
  }

  50% {
    transform: scale(1.04);
    box-shadow: 0 10px 24px rgba(214, 0, 0, 0.4);
    opacity: 0.88;
  }

  100% {
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(214, 0, 0, 0.28);
    opacity: 1;
  }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 760px) {
  .breaking-popups {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  .breaking-popup {
    border-width: 10px;
  }

  .breaking-popup__link {
    min-height: 240px;
  }

  .breaking-popup__overlay {
    padding: 14px 14px 13px;
  }

  .breaking-popup__label {
    top: 10px;
    left: 10px;
    min-height: 24px;
    padding: 5px 8px;
    font-size: 10px;
  }

  .breaking-popup__category {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .breaking-popup__title {
    max-width: 100%;
    font-size: clamp(20px, 7vw, 28px);
    line-height: 0.97;
  }

  .breaking-popup__close {
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .breaking-popup,
  .breaking-popup__label {
    transition: none;
    animation: none;
  }
}


/* =========================
   BREAKING POPUP — HIGHLIGHT OVERRIDE
   Paste at the end of breaking-popups.css
========================= */

.breaking-popups {
  right: 22px;
  bottom: 28px;
  width: min(360px, calc(100vw - 32px));
}

.breaking-popup {
  border: 8px solid #ffffff;
  outline: 3px solid #d60000;
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.95),
    0 0 0 8px rgba(214, 0, 0, 0.16),
    0 22px 60px rgba(2, 11, 23, 0.38);
  transform: translateY(18px) scale(0.96);
}

.breaking-popup::before {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 50%, rgba(214, 0, 0, 0.22), transparent 68%);
  animation: breakingOuterGlow 1.8s infinite;
  pointer-events: none;
}

.breaking-popup.is-visible {
  transform: translateY(0) scale(1);
}

.breaking-popup.is-hiding {
  transform: translateY(18px) scale(0.96);
}

/* Размер самого тизера */
.breaking-popup__link {
  min-height: 235px;
}

/* Затемнение картинки чуть сильнее, чтобы текст читался */
.breaking-popup__media::after {
  background:
    linear-gradient(
      180deg,
      rgba(2, 11, 23, 0.06) 0%,
      rgba(2, 11, 23, 0.22) 42%,
      rgba(2, 11, 23, 0.92) 100%
    ),
    linear-gradient(
      90deg,
      rgba(2, 11, 23, 0.42) 0%,
      rgba(2, 11, 23, 0.04) 72%
    );
}

/* Мигающий бейдж заметнее */
.breaking-popup__label {
  top: 12px;
  left: 12px;
  min-height: 26px;
  padding: 6px 10px;
  background: #d60000;
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 10px;
  box-shadow:
    0 0 0 3px rgba(214, 0, 0, 0.35),
    0 8px 20px rgba(214, 0, 0, 0.35);
}

/* Заголовок компактнее */
.breaking-popup__title {
  max-width: 94%;
  font-size: clamp(21px, 1.8vw, 28px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.62),
    0 8px 20px rgba(0, 0, 0, 0.42);
}

/* Категория как маленькая строка над заголовком */
.breaking-popup__category {
  display: inline-flex;
  align-self: flex-start;
  width: fit-content;
  margin-bottom: 7px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.14);
  border-left: 3px solid #d60000;
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Кнопка закрытия чуть меньше и контрастнее */
.breaking-popup__close {
  top: 9px;
  right: 9px;
  width: 28px;
  height: 28px;
  background: rgba(2, 11, 23, 0.82);
  border: 2px solid #ffffff;
  font-size: 20px;
}

@keyframes breakingOuterGlow {
  0% {
    opacity: 0.55;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.95;
    transform: scale(1.02);
  }

  100% {
    opacity: 0.55;
    transform: scale(0.98);
  }
}

/* =========================
   MOBILE HIGHLIGHT
========================= */

@media (max-width: 760px) {
  .breaking-popups {
    left: 14px;
    right: 14px;
    bottom: 18px;
    width: auto;
  }

  .breaking-popup {
    border-width: 7px;
    outline-width: 2px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.95),
      0 0 0 6px rgba(214, 0, 0, 0.18),
      0 18px 48px rgba(2, 11, 23, 0.42);
  }

  .breaking-popup__link {
    min-height: 205px;
  }

  .breaking-popup__overlay {
    padding: 13px 13px 12px;
  }

  .breaking-popup__label {
    top: 9px;
    left: 9px;
    min-height: 23px;
    padding: 5px 8px;
    font-size: 9px;
  }

  .breaking-popup__category {
    margin-bottom: 6px;
    padding: 3px 6px;
    font-size: 9px;
  }

  .breaking-popup__title {
    max-width: 96%;
    font-size: clamp(18px, 6vw, 24px);
    line-height: 1;
    letter-spacing: -0.04em;
  }

  .breaking-popup__close {
    top: 7px;
    right: 7px;
    width: 27px;
    height: 27px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .breaking-popup::before {
    animation: none;
  }
}
/* =========================
   PAGE BLUR WHEN POPUP IS ACTIVE
========================= */

body.breaking-popup-active {
  overflow-x: hidden;
}

body.breaking-popup-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(2, 11, 23, 0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  animation: breakingBackdropIn 0.22s ease both;
}

body.breaking-popup-active .site-header,
body.breaking-popup-active .page-shell,
body.breaking-popup-active .site-footer,
body.breaking-popup-active #marketTickerMount {
  filter: blur(2px);
  transform: scale(0.997);
  transition: filter 0.22s ease, transform 0.22s ease;
}

body.breaking-popup-active #breakingPopupsMount,
body.breaking-popup-active .breaking-popups,
body.breaking-popup-active .breaking-popup {
  filter: none;
  transform: none;
}

@keyframes breakingBackdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  body.breaking-popup-active::before {
    background: rgba(2, 11, 23, 0.28);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  body.breaking-popup-active .site-header,
  body.breaking-popup-active .page-shell,
  body.breaking-popup-active .site-footer,
  body.breaking-popup-active #marketTickerMount {
    filter: blur(1.6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.breaking-popup-active::before {
    animation: none;
  }
}
/* =========================
   COMPACT POPUP TITLE OVERRIDE
========================= */

.breaking-popup__title {
  display: -webkit-box;
  max-width: 92%;
  overflow: hidden;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;

  color: #ffffff;
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;

  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.72),
    0 6px 18px rgba(0, 0, 0, 0.46);
}

.breaking-popup__overlay {
  padding: 14px 14px 13px;
}

.breaking-popup__category {
  margin-bottom: 6px;
  font-size: 9px;
}

@media (max-width: 760px) {
  .breaking-popup__title {
    max-width: 94%;
    font-size: clamp(16px, 4.8vw, 19px);
    line-height: 1.1;
    letter-spacing: -0.02em;

    -webkit-line-clamp: 3;
  }

  .breaking-popup__overlay {
    padding: 11px 11px 10px;
  }

  .breaking-popup__category {
    margin-bottom: 5px;
    font-size: 8px;
  }
}