/* Dynamic CVE research pages — additions to the BitFire support standard. */

.cve-hero h1 { max-width: 900px; }

.cve-hero-stage {
  position: relative;
  margin-bottom: 30px;
}

.cve-hero-media { position: relative; }

.cve-hero-image {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(167, 210, 233, 0.18);
  border-radius: 22px;
  background: #0c1926;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.28);
}

.cve-hero-image::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 13, 23, 0.5), rgba(4, 13, 23, 0.14));
}

.cve-hero-image img {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(0.58) saturate(0.86);
}

.cve-hero-title {
  position: absolute;
  z-index: 2;
  top: clamp(28px, 5vw, 72px);
  right: clamp(24px, 5vw, 72px);
  bottom: 0;
  left: clamp(24px, 5vw, 72px);
  color: #fff;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.82);
}

/* Keep the first two title lines full width, then reserve the right third
   for the advisory card. The five-line float makes its lower 3/5 align
   exactly with title lines three through five. */
.cve-hero-heading::before {
  width: 33.333%;
  height: 5lh;
  float: right;
  content: "";
  shape-outside: polygon(100% 40%, 100% 100%, 0 100%, 0 40%);
}

.cve-hero-title h1 {
  max-width: none;
  margin: 0;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.cve-hero-stage .hero-recommendation {
  position: absolute;
  z-index: 3;
  right: clamp(18px, 3vw, 44px);
  bottom: -72px;
  width: min(360px, calc(100% - 36px));
  background: rgba(7, 19, 34, 0.86);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

.cve-hero-details {
  max-width: calc(100% - 410px);
  padding-left: clamp(0px, 1vw, 12px);
}

.cve-hero-details .eyebrow { margin-bottom: 14px; }
.cve-hero-details .hero-lede {
  max-width: 760px;
  margin-bottom: 24px;
  color: #c8d8e2;
}
.cve-hero-details .article-meta small { color: #8fa5b4; }

.cve-risk-card h2 {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: -0.04em;
}

.cve-risk-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.cve-cvss-score {
  min-width: 72px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 107, 103, 0.35);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 107, 103, 0.14);
  text-align: center;
}

.cve-cvss-score small,
.cve-cvss-score strong { display: block; }
.cve-cvss-score small {
  margin-bottom: 2px;
  color: #ffb7b4;
  font-weight: 850;
  letter-spacing: 0.09em;
}
.cve-cvss-score strong { line-height: 1; }

.cve-risk-facts {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
}

.cve-risk-facts div {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.cve-risk-facts dt {
  color: #7992a3;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cve-risk-facts dd {
  margin: 0;
  color: #d8e7ef;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.cve-badge-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.cve-badge {
  padding: 7px 11px;
  border: 1px solid rgba(255, 107, 103, 0.25);
  border-radius: 999px;
  color: #ffb7b4;
  background: rgba(255, 107, 103, 0.08);
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.cve-badge.bg-warning-soft {
  color: #f3ce8d;
  border-color: rgba(243, 206, 141, 0.22);
  background: rgba(243, 206, 141, 0.07);
}

.cve-advisory-preview {
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(167, 210, 233, 0.18);
  border-radius: 22px;
  background: #0c1926;
  box-shadow: 0 46px 100px rgba(0, 0, 0, 0.32);
}

.cve-advisory-grid {
  display: grid;
  grid-template-columns: 0.65fr 1.35fr 1fr;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 13px;
  background: #0a1724;
}

.cve-advisory-grid > div {
  min-width: 0;
  padding: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.cve-advisory-grid > div:last-child { border-right: 0; }
.cve-advisory-grid small { display: block; margin-bottom: 8px; color: #6f899a; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.cve-advisory-grid strong { display: block; color: #ddecf4; line-height: 1.35; }
.cve-advisory-grid code { display: block; color: #79c9ee; overflow-wrap: anywhere; }

.cve-intro .intro-grid { margin-bottom: 0; }
.cve-intro .section-kicker { margin-bottom: 14px; }

.cve-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
}

.cve-source-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #1475a8;
  font-weight: 800;
}

.cve-source-links .icon { width: 15px; }
.cve-key-facts { align-self: start; }
.cve-key-facts ul { margin: 0; padding: 0; }

.cve-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid #dbe4ea;
  border-radius: 18px;
}

.cve-overview-grid article {
  min-height: 125px;
  padding: 24px;
  border-right: 1px solid #e1e8ed;
  border-bottom: 1px solid #e1e8ed;
  background: #fff;
}

.cve-overview-grid article:nth-child(2n) { border-right: 0; }
.cve-overview-grid article:nth-last-child(-n + 2) { border-bottom: 0; }
.cve-overview-grid small { display: block; margin-bottom: 12px; color: #718592; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.cve-overview-grid strong { display: block; color: #1a3446; line-height: 1.4; overflow-wrap: anywhere; }

.cve-quote {
  position: relative;
  margin: 30px 0 0;
  padding: 27px 30px 27px 55px;
  border-radius: 17px;
  color: #dcebf3;
  background: #0a1d2f;
  line-height: 1.6;
}

.cve-quote::before {
  position: absolute;
  top: 18px;
  left: 21px;
  content: "“";
  color: var(--mint);
  font-size: 2.6rem;
  line-height: 1;
}

.cve-research-list {
  display: grid;
  gap: 0;
  border-top: 1px solid #dfe7ec;
}

.cve-research-section {
  padding: 32px 0;
  border-bottom: 1px solid #dfe7ec;
}

.cve-research-section h3 {
  margin-bottom: 12px;
  color: #183346;
  letter-spacing: -0.025em;
}

.cve-research-section p {
  margin: 0;
  color: #536a79;
  line-height: 1.8;
}

.cve-code-stack { display: grid; gap: 18px; }

.code-panel {
  overflow: hidden;
  border: 1px solid #d8e2e8;
  border-radius: 18px;
  background: #0a1826;
}

.code-panel header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  color: #dbe9f1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-panel header .icon { width: 20px; }
.code-panel header small { display: block; color: #7e97a8; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.code-panel header strong { display: block; }
.code-removed header .icon { color: #ff8581; }
.code-added header .icon { color: #63dc91; }

.code-panel pre {
  max-height: 520px;
  margin: 0;
  padding: 24px;
  overflow: auto;
  color: #cce0eb;
  background: #07131f;
  tab-size: 4;
}

.code-panel code {
  font: 0.84rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}

/* Article code excerpts contain only the security-relevant segment, so the
   complete BEFORE and AFTER blocks can identify vulnerable and patched lines. */
.code-removed pre {
  border-left: 4px solid #ff6b67;
  color: #ffd2d0;
  background: linear-gradient(90deg, rgba(255, 107, 103, 0.16), rgba(7, 19, 31, 0.98) 42%);
}

.code-added pre {
  border-left: 4px solid #48cf7b;
  color: #c9f5d8;
  background: linear-gradient(90deg, rgba(72, 207, 123, 0.15), rgba(7, 19, 31, 0.98) 42%);
}

.cve-protection-layers { margin-bottom: 20px; }
.cve-product-frame { margin-top: 25px; }
.cve-product-frame img { width: 100%; max-height: 560px; object-fit: cover; object-position: top; }
.cve-product-frame figcaption { padding: 14px 11px 7px; color: #728a9a; }

@media (max-width: 900px) {
  .cve-hero-stage .hero-recommendation {
    position: relative;
    right: auto;
    bottom: auto;
    width: calc(100% - 32px);
    margin: -36px 16px 0 auto;
  }
  .cve-hero-title {
    top: clamp(20px, 5vw, 44px);
    right: clamp(20px, 5vw, 48px);
    left: clamp(20px, 5vw, 48px);
  }
  .cve-hero-heading::before { display: none; }
  .cve-hero-details {
    max-width: 760px;
    padding-left: 0;
  }
  .cve-advisory-grid { grid-template-columns: 1fr 1fr; }
  .cve-advisory-grid > div:nth-child(2) { border-right: 0; }
  .cve-advisory-grid > div:last-child { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.08); }
}

@media (max-width: 560px) {
  .cve-hero-stage { margin-bottom: 24px; }
  .cve-hero-title { inset: 20px 20px auto; }
  .cve-hero-title h1 { font-size: clamp(2rem, 10vw, 3.2rem); }
  .cve-hero-stage .hero-recommendation { margin-top: -22px; }
  .cve-risk-facts div { grid-template-columns: 1fr; gap: 3px; }
  .cve-advisory-grid { grid-template-columns: 1fr; }
  .cve-advisory-grid > div,
  .cve-advisory-grid > div:nth-child(2) { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .cve-advisory-grid > div:last-child { grid-column: auto; border-top: 0; border-bottom: 0; }
  .cve-overview-grid { grid-template-columns: 1fr; }
  .cve-overview-grid article,
  .cve-overview-grid article:nth-child(2n),
  .cve-overview-grid article:nth-last-child(-n + 2) { min-height: auto; border-right: 0; border-bottom: 1px solid #e1e8ed; }
  .cve-overview-grid article:last-child { border-bottom: 0; }
  .cve-quote { padding: 50px 23px 24px; }
  .code-panel pre { padding: 18px; }
}
