/* The Claude Dispatch: newspaper-style news section (js/features/news.js). */

.news {
  position: relative;
  z-index: 5;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-block: clamp(56px,9vh,88px);
  padding-inline: var(--gutter);
  scroll-margin-top: 84px;
}

/* The page itself: a sheet of newsprint with two more sheets peeking out behind it. */
.news .inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px,3vw,40px);
  background: #FBFAF6;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(20,20,19,.04),0 24px 48px -28px rgba(20,20,19,.25);
}

.news .inner::before,
.news .inner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #F6F3EB;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.news .inner::before {
  transform: rotate(-1.1deg) translate(-6px,8px);
}

.news .inner::after {
  transform: rotate(.7deg) translate(8px,5px);
  background: #F2EEE4;
}

/* ---------- masthead ---------- */

.news .mh-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.news .mh-top {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--fg);
}

.news .mh-top>span:last-child {
  text-align: right;
}

.news .mh-title {
  text-align: center;
  padding: clamp(14px,2.4vw,26px) 0 clamp(10px,2vw,20px);
}

.news h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(44px,7.4vw,96px);
  line-height: .95;
  letter-spacing: -.03em;
  margin: 0;
}

/* The newsboy stands on the top edge of the sheet, hawking the paper. */
.newsboy {
  position: absolute;
  right: clamp(18px,4vw,48px);
  top: calc(-1 * var(--boy-w) * 80 / 136 + 1px);
  --boy-w: clamp(72px,8vw,100px);
  width: var(--boy-w);
  height: auto;
  image-rendering: pixelated;
  cursor: pointer;
}

.news .mh-bot {
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-top: 9px;
  border-top: 4px double var(--fg);
}

.news .mh-bot span+span::before {
  content: "◆";
  margin-right: 18px;
  font-size: 7px;
  vertical-align: 2px;
  color: var(--accent);
}

/* ---------- live wire ---------- */

.news .wire {
  display: flex;
  align-items: stretch;
  margin-top: 22px;
  border-radius: 10px;
  overflow: hidden;
  background: #141413;
  color: #F3F1EA;
  font-size: 14px;
}

.news .wire-tag {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--accent);
  color: #141413;
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.news .wire-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #141413;
  animation: news-wire-pulse 1.4s ease-in-out infinite;
}

.news .wire-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg,transparent,#000 24px,#000 calc(100% - 40px),transparent);
}

.news .wire-run {
  display: flex;
  width: max-content;
}

.news .wire-run.rolling {
  animation: news-wire-roll var(--wire-dur,60s) linear infinite;
}

.news .wire:hover .wire-run,
.news .wire:focus-within .wire-run {
  animation-play-state: paused;
}

.news .wire-row {
  display: flex;
}

.news .wire-row a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 12px 0;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.news .wire-row a::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-left: 12px;
  border-radius: 50%;
  background: #6F6D66;
}

.news .wire-row a:hover {
  color: #FFF;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news .wire-row b {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- front page ---------- */

.news .front {
  display: grid;
  grid-template-columns: minmax(0,1.65fr) minmax(0,1fr);
  gap: 0 clamp(20px,3vw,36px);
  margin-top: 28px;
}

.news .front[aria-busy="true"] {
  min-height: 420px;
}

.news .kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font: 500 10.5px/1.3 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.news .kicker b {
  color: var(--accent-ink);
  font-weight: 500;
}

.news .fresh {
  margin-left: 6px;
  padding: 3px 6px 2px;
  border-radius: 5px;
  background: var(--accent);
  color: #FFF;
  letter-spacing: .08em;
}

.news .ls-link {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.news .ls-art {
  display: block;
  aspect-ratio: 2/1;
  border-radius: 10px;
  overflow: hidden;
  background: #CFCBE3;
  margin-bottom: 4px;
}

.news .ls-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}

.news .ls-link:hover .ls-art img {
  transform: scale(1.035);
}

.news .ls-type {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #FFF;
  font: italic 400 clamp(40px,6vw,76px)/1 var(--display);
  letter-spacing: -.02em;
}

.news .ls-title {
  font: 400 clamp(28px,3.4vw,44px)/1.05 var(--display);
  letter-spacing: -.02em;
  text-wrap: balance;
}

.news .ls-link:hover .ls-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.news .ls-dek {
  color: var(--fg-muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 40em;
}

.news .read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.news .read::after {
  content: "→";
  font-size: 14px;
  transition: transform .2s ease;
}

.news .ls-link:hover .read::after {
  transform: translateX(4px);
}

.news .headlines {
  border-left: 1px solid var(--line);
  padding-left: clamp(20px,3vw,36px);
}

.news .col-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--fg);
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.news .col-h a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 10.5px;
}

.news .col-h a::after {
  content: " ↗";
}

.news .col-h a:hover {
  color: var(--accent-ink);
}

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

.news .hl-list li+li {
  border-top: 1px solid var(--line);
}

.news .hl-list a {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 14px;
  padding: 15px 0;
  color: inherit;
  text-decoration: none;
}

.news .hl-n {
  font: italic 400 30px/.9 var(--display);
  color: var(--accent);
  min-width: 1.3em;
}

.news .hl-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news .hl-title {
  font: 400 19px/1.25 var(--display);
  text-wrap: pretty;
}

.news .hl-list a:hover .hl-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ---------- lower fold: videos + Claude Code ---------- */

.news .lower {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
  gap: clamp(20px,3vw,36px);
  margin-top: 30px;
  padding-top: 22px;
  border-top: 4px double var(--fg);
}

.news .reel-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 16px 14px;
  margin-top: 16px;
}

.news .clip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.news .clip-main {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(0,1fr);
  align-items: center;
  gap: 16px;
}

.news .thumb {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: #141413;
}

.news .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}

.news .clip:hover .thumb img {
  transform: scale(1.05);
}

.news .play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: rgba(20,20,19,.78);
  transition: transform .25s ease,background .25s ease;
}

.news .play::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 12px;
  border-left: 12px solid #FFF;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.news .clip-main .play {
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
}

.news .clip-main .play::after {
  left: 21px;
  top: 16px;
  border-left-width: 16px;
  border-top-width: 11px;
  border-bottom-width: 11px;
}

.news .clip:hover .play {
  transform: scale(1.1);
  background: var(--accent);
}

.news .clip-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.news .clip-title {
  font: 400 15px/1.25 var(--display);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news .clip-main .clip-title {
  font-size: clamp(20px,2vw,26px);
  line-height: 1.12;
  -webkit-line-clamp: 3;
}

.news .clip-meta {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* Terminal */
.news .term {
  scroll-margin-top: 100px;
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #141413;
  color: #E9E6DC;
  font: 400 12.5px/1.6 var(--mono);
  box-shadow: 0 18px 36px -22px rgba(20,20,19,.6);
}

.news .term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #22211F;
  border-bottom: 1px solid #2E2D2A;
}

.news .term-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #D97757;
}

.news .term-bar i:nth-child(2) {
  background: #E2B93B;
}

.news .term-bar i:nth-child(3) {
  background: #8DB07A;
}

.news .term-bar span {
  margin-left: 8px;
  margin-right: auto;
  color: #aaa69b;
  font-size: 11px;
}

/* Clawd keeping watch in the title bar's top-right corner. */
.news .term-clawd {
  width: 30px;
  height: auto;
  margin: -5.5px -2px -5.5px 0;
  image-rendering: pixelated;
  cursor: pointer;
}

.news .term-body {
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #514e47 #141413;
}

.news .tl {
  white-space: normal;
  overflow-wrap: anywhere;
}

.news .tl.cmd {
  margin-top: 8px;
}

.news .tl.cmd:first-child {
  margin-top: 0;
}

.news .ps,
.news .plus {
  color: var(--accent);
}

.news .tl.ok {
  color: #9CC98A;
}

.news .tl.dim {
  color: #aaa69b;
}

.news .tl.add {
  color: #E9E6DC;
}

.news .tl a {
  color: #F3F1EA;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #6F6D66;
}

.news .tl a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.news .release-highlights {
  list-style: none;
  margin: 7px 0;
  padding: 0;
}

.news .release-highlights li {
  display: grid;
  gap: 3px;
  padding: 5px 0;
  border-top: 1px solid #302e29;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.news .release-note summary {
  display: grid;
  grid-template-columns: minmax(0,1fr) 10px;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
}

.news .release-note summary::-webkit-details-marker {
  display: none;
}

.news .release-note summary::after {
  content: '+';
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: #aaa69b;
  font-size: 18px;
}

.news .release-note[open] summary::after {
  content: '−';
}

.news .release-title {
  grid-column: 1;
  font: 500 13px/1.35 var(--ui);
}

.news .release-note.full .release-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news .release-note.full[open] .release-title {
  display: block;
}

.news .release-note p {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: #bbb7ab;
  line-height: 1.6;
}

.news .release-note summary:focus-visible {
  outline: 2px solid #e9b298;
  outline-offset: 4px;
  border-radius: 2px;
}

.news .term-update {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #302e29;
}

.news .term-update .cmd {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 0;
}

.news .term-update code {
  font: inherit;
}

.news .term-hint {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.5;
}

.news .cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 4px;
  vertical-align: -2px;
  background: var(--accent);
  animation: news-blink 1s steps(1) infinite;
}

/* A short terminal boot sequence, with no delay when changing releases. */
.news .term.pre .term-body > * {
  visibility: hidden;
}

.news .term.typing .term-body > * {
  animation: news-type-in .3s ease both;
  animation-delay: calc(var(--i) * .12s);
}

.news-fallback {
  margin: 28px 0 0;
  color: var(--fg-muted);
}

.news-fallback a {
  color: var(--accent-ink);
}

@keyframes news-wire-roll {
  to {
    transform: translateX(-50%);
  }
}

@keyframes news-wire-pulse {
  50% {
    opacity: .25;
  }
}

@keyframes news-type-in {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes news-blink {
  50% {
    opacity: 0;
  }
}

@media (max-width:900px) {
  .news .front,
  .news .lower {
    grid-template-columns: minmax(0,1fr);
  }

  .news .headlines {
    border-left: 0;
    padding-left: 0;
    margin-top: 30px;
  }
}

@media (max-width:720px) {
  .news {
    padding-block: 44px;
  }

  .news .inner::before {
    transform: rotate(-1.2deg) translate(-3px,6px);
  }

  .news .inner::after {
    transform: rotate(.8deg) translate(4px,4px);
  }

  .news .mh-top .mh-tag {
    display: none;
  }

  .newsboy {
    --boy-w: 64px;
    right: 14px;
  }

  .news .mh-bot {
    gap: 6px 14px;
    font-size: 9.5px;
  }

  .news .mh-bot span+span::before {
    content: none;
  }

  .news .wire-tag .wd {
    display: none;
  }

  .news .wire {
    font-size: 13px;
  }

  .news .wire-tag {
    padding: 0 10px;
  }

  .news .clip-main {
    grid-template-columns: minmax(0,1fr);
  }

  .news .reel-grid {
    grid-template-columns: minmax(0,1fr);
  }

  .news .clip:not(.clip-main) {
    display: grid;
    grid-template-columns: 132px minmax(0,1fr);
    align-items: center;
    gap: 12px;
  }

  .news .term {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news .wire-tag i,
  .news .cursor {
    animation: none;
  }

  .news .ls-art img,
  .news .thumb img,
  .news .play,
  .news .read::after {
    transition: none;
  }

  .news .term .term-body > * {
    animation: none!important;
    visibility: visible;
  }

  .news .wire-track {
    overflow-x: auto;
    scrollbar-width: none;
  }
}

@media (max-width:600px) {
  .news .term-body {
    max-height: none;
  }
}
