/* Deep Breath — single Update detail template */

.page-update {
  background: var(--bg);
  color: var(--text);
}

.page-update .nav a[aria-current="page"] {
  color: #fff;
}

/* Reuse type badge colours from updates feed when both CSS loaded;
   define here so detail page works standalone. */
.up-type {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.up-type--video {
  color: #f256ec;
  background: rgba(242, 86, 236, 0.12);
  border-color: rgba(242, 86, 236, 0.28);
}

.up-type--conference {
  color: #56ccf2;
  background: rgba(86, 204, 242, 0.12);
  border-color: rgba(86, 204, 242, 0.28);
}

.up-type--publication {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.28);
}

.up-type--news {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.28);
}

.up-type--blog {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.28);
}

/* ---------- Shell ---------- */
.ud-shell {
  padding:
    calc(var(--header-h) + 1.75rem)
    clamp(1.25rem, 4vw, 2.75rem)
    0;
}

.ud-inner {
  width: min(780px, 100%);
  margin: 0 auto;
}

.ud-inner--wide {
  width: min(1120px, 100%);
}

/* ---------- Back ---------- */
.ud-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.75rem;
  transition: color 0.15s ease;
}

.ud-back:hover {
  color: #fff;
}

.ud-back span {
  color: var(--cyan);
}

/* ---------- Header ---------- */
.ud-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 1.15rem;
}

.ud-date {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
}

.ud-date i {
  font-style: normal;
  opacity: 0.45;
  margin: 0 0.12rem;
}

.ud-title {
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 0 0 1rem;
}

.ud-excerpt {
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  max-width: 42rem;
}

/* ---------- Hero media ---------- */
.ud-hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0a0a0a;
  margin-bottom: 2.5rem;
}

.ud-hero img {
  width: 100%;
  height: auto;
  display: block;
  max-height: min(62vh, 520px);
  object-fit: cover;
  object-position: center;
}

.ud-hero--video {
  aspect-ratio: 16 / 9;
  background: #000;
}

.ud-hero--video iframe,
.ud-hero--video video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.ud-hero-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.95rem;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(86, 204, 242, 0.12), transparent 55%),
    #0a0a0a;
}

.ud-hero-placeholder strong {
  display: block;
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

/* ---------- Article body (light) ---------- */
.ud-article {
  background: #f4f7fb;
  color: #0f172a;
  padding:
    clamp(2.5rem, 6vh, 3.75rem)
    clamp(1.25rem, 4vw, 2.75rem)
    clamp(3rem, 7vh, 4.5rem);
}

.ud-article .ud-inner {
  /* prose width */
}

.ud-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #334155;
}

.ud-body > *:first-child {
  margin-top: 0;
}

.ud-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 2rem 0 0.75rem;
}

.ud-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 1.5rem 0 0.55rem;
}

.ud-body p {
  margin: 0 0 1.1rem;
}

.ud-body ul,
.ud-body ol {
  margin: 0 0 1.15rem;
  padding-left: 1.25rem;
}

.ud-body li {
  margin-bottom: 0.4rem;
}

.ud-body a {
  color: #2f80ed;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ud-body code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
}

.ud-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border-left: 3px solid #2f80ed;
  background: #fff;
  border-radius: 0 12px 12px 0;
  color: #475569;
}

/* ---------- Footer of article ---------- */
.ud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.ud-actions .btn-outline {
  border-color: rgba(15, 23, 42, 0.18);
  color: #0f172a;
}

.ud-actions .btn-outline:hover {
  border-color: #2f80ed;
  color: #2f80ed;
  box-shadow: none;
}

.ud-actions .btn-gradient {
  background-image:
    linear-gradient(#0a0a0a, #0a0a0a),
    linear-gradient(100deg, var(--cyan), var(--magenta));
}

/* ---------- Related ---------- */
.ud-related {
  background: #f4f7fb;
  padding: 0 clamp(1.25rem, 4vw, 2.75rem) clamp(4rem, 10vh, 5.5rem);
}

.ud-related-head {
  width: min(1120px, 100%);
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.ud-related-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0;
}

.ud-related-head a {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2f80ed;
}

.ud-related-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.ud-related-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ud-related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.ud-related-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}

.ud-related-card > div {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ud-related-card h3 {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
  color: #0f172a;
}

.ud-related-card .ud-date {
  color: #94a3b8;
  font-size: 0.78rem;
}

/* ---------- Missing id / empty state ---------- */
.ud-missing {
  text-align: center;
  padding: 4rem 1rem 5rem;
}

.ud-missing h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.75rem;
}

.ud-missing p {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .ud-related-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .ud-related-grid {
    grid-template-columns: 1fr;
  }

  .ud-hero img {
    max-height: 42vh;
  }
}
