/* Reel News - Story Detail Page */

/* global.css disables scrolling for the feed; the detail page needs it */
body.detail-page {
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
}

.story-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  color: #f3f4f6;
}

.detail-lower-background {
  display: flow-root;
  position: relative;
  isolation: isolate;
}

.detail-lower-background::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 16px;
  bottom: -500px;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: #0f1528;
}

.story-detail h1 {
  color: #fff;
  font-size: 36px;
  line-height: 1.15;
  margin: 24px 0 8px;
}

.story-detail h2 {
  color: #fff;
  font-size: 22px;
  margin: 32px 0 8px;
}

.story-detail p {
  line-height: 1.6;
}

.back-link,
.story-detail a {
  color: #ffb3b9;
}

.story-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
}

.story-meta,
.source-publisher {
  color: #c9ccd3;
  font-size: 14px;
}

.placeholder {
  color: #c9ccd3;
  font-style: italic;
}

.source-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.source-list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.source-publisher {
  display: block;
}

.source-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  margin-top: 0.25rem;
}

.source-framing-badge {
  --badge-gold: #dfa528;
  --badge-paper: #fff8e9;
  --badge-ink: #253447;
  --badge-icon: #253447;
  --badge-shape: polygon(
    0.6rem 0, calc(100% - 0.6rem) 0, 100% 0.6rem,
    100% calc(100% - 0.6rem), calc(100% - 0.6rem) 100%,
    0.6rem 100%, 0 calc(100% - 0.6rem), 0 0.6rem
  );

  display: inline-grid;
  box-sizing: border-box;
  inline-size: 9.5rem;
  block-size: 2.2rem;
  padding: 2px;
  background: var(--badge-gold);
  color: var(--badge-ink);
  clip-path: var(--badge-shape);
}

.source-framing-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
  padding-inline: 0.55rem 1.2rem;
  background: var(--badge-paper);
  clip-path: var(--badge-shape);
}

/* Folded corner and compact newspaper icon. */
.source-framing-inner::after {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: 0.65rem;
  block-size: 0.65rem;
  background: var(--badge-gold);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  content: "";
}

.source-framing-icon {
  position: relative;
  box-sizing: border-box;
  width: 1.25rem;
  height: 0.75rem;
  border: 2px solid var(--badge-icon);
  border-bottom: 0;
  border-radius: 1rem 1rem 0 0;
}

/* Rotate the needle from the bottom center of the meter. */
.source-framing-icon::before {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2px;
  height: 0.48rem;
  border-radius: 2px;
  background: var(--badge-icon);
  transform: translateX(-50%) rotate(var(--needle-angle, 0deg));
  transform-origin: center bottom;
  content: "";
}

.source-framing-copy {
  display: grid;
  gap: 0.1rem;
  padding-inline-start: 0.4rem;
  border-inline-start: 1px solid var(--badge-gold);
  line-height: 1;
  white-space: nowrap;
}

.source-framing-caption {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
}

.source-framing-copy strong {
  font-size: 0.85rem;
  font-style: italic;
}

.source-framing-badge[data-rating="Left"],
.source-framing-badge[data-rating="Lean left"] {
  --badge-paper: #eaf3ff;
  --badge-ink: #123f85;
  --badge-icon: #0866d9;
}

.source-framing-badge[data-rating="Right"],
.source-framing-badge[data-rating="Lean right"] {
  --badge-paper: #fff0ed;
  --badge-ink: #a4131b;
  --badge-icon: #e32636;
}

.source-framing-unclear {
  color: #c9ccd3;
  font-size: 0.8rem;
  font-style: italic;
}

.source-framing-badge[data-rating="Left"]       { --needle-angle: -52deg; }
.source-framing-badge[data-rating="Lean left"]  { --needle-angle: -28deg; }
.source-framing-badge[data-rating="Lean right"] { --needle-angle: 28deg; }
.source-framing-badge[data-rating="Right"]      { --needle-angle: 52deg; }