/* The news magazine (/news) and its home page section. base.css tokens only; .glass panels keep text readable over
   the backdrop photo in every colour story. */
.nw { padding-block: clamp(20px, 4vw, 44px) clamp(48px, 8vw, 96px); display: grid; gap: clamp(22px, 3.4vw, 40px); }
.nw > * { min-width: 0; }

/* masthead */
.nw-mast { text-align: center; }
.nw-mast__line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; margin: 0; padding-bottom: 10px; border-bottom: 1px solid currentColor; font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.nw-mast h1 { margin: .22em 0 .12em; font-size: clamp(2.6rem, 8.6vw, 6.6rem); line-height: 1; letter-spacing: -.03em; text-wrap: balance; }
.nw-mast__tag { margin: 0 auto .9em; max-width: 60ch; font-family: var(--font-display); font-style: italic; font-size: clamp(1.05rem, 1.8vw, 1.3rem); }
.nw-toc { border-block: 3px double currentColor; }
.nw-toc ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 clamp(12px, 2.6vw, 34px); margin: 0; padding: 4px 0; list-style: none; }
.nw-toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--heading); font-weight: 600; font-size: .95rem; text-decoration: none; }
.nw-toc a:hover { text-decoration: underline; }
.nw-draft { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg); font-weight: 600; }

/* a story */
.nw-story { min-width: 0; position: relative; }
.nw-story__body { min-width: 0; }
.nw-title { margin: 0 0 .4em; font-size: clamp(1.12rem, 1.5vw, 1.3rem); line-height: 1.24; text-wrap: pretty; overflow-wrap: anywhere; }
.nw-title a { color: inherit; text-decoration: none; }
.nw-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.nw-title a::after { content: ''; position: absolute; inset: 0; }
.nw-out { width: .72em; height: .72em; margin-left: .3em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: .55; }
.nw-why { position: relative; z-index: 1; width: fit-content; margin: 0 0 .35em; font-size: .84rem; font-weight: 600; line-height: 1.3; color: var(--link); }
.nw-why a { color: inherit; text-decoration: none; }
.nw-why a:hover { text-decoration: underline; }
.nw-sum { margin: 0 0 .6em; color: var(--text-muted); font-size: .98rem; line-height: 1.5; }
.nw-note { margin: 0 0 .6em; padding-left: 12px; border-left: 3px solid var(--terracotta); font-family: var(--font-display); font-style: italic; line-height: 1.4; }
.nw-by { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 0; font-size: .84rem; color: var(--text-muted); }
.nw-by span { font-weight: 600; }

/* pictures: share image, else the thumbnail, else a plain tile with the topic's first letter */
.nw-pic { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; margin-bottom: 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--terracotta) 22%, var(--bg)); }
.nw-pic img { position: relative; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out, ease); }
.nw-pic:not(:has(img))::before { content: attr(data-letter); position: absolute; inset: 0; display: grid; place-items: center; font: 400 4rem/1 var(--font-display); color: var(--heading); opacity: .5; }
@media (hover: hover) { .nw-story:hover .nw-pic img { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .nw-pic img { transition: none; } .nw-story:hover .nw-pic img { transform: none; } }
.nw-play { position: absolute; inset: 0; display: grid; place-items: center; }
.nw-play svg { width: 54px; height: 54px; padding: 14px; border-radius: 50%; background: var(--cream); fill: var(--ink); }

/* cover */
.nw-cover { overflow: hidden; }
.nw-story--cover { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: stretch; }
.nw-story--cover .nw-pic { height: 100%; min-height: clamp(300px, 40vw, 520px); margin: 0; border-radius: 0; aspect-ratio: auto; }
.nw-story--cover .nw-story__body { align-self: end; padding: clamp(20px, 3vw, 40px); }
.nw-story--cover .nw-title { font-size: clamp(1.7rem, 3.1vw, 2.7rem); line-height: 1.1; }
.nw-intro { padding: clamp(16px, 2.4vw, 26px); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--bg) 72%, transparent); font-family: var(--font-display); font-size: clamp(1.1rem, 1.7vw, 1.32rem); line-height: 1.5; }
.nw-intro > * { max-width: 62ch; }
.nw-intro > :last-child { margin-bottom: 0; }

/* sections */
.nw-sec { padding: clamp(18px, 3vw, 36px); scroll-margin-top: calc(var(--nav-h) + 16px); }
.nw-sec__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; margin-bottom: clamp(16px, 2.2vw, 26px); padding-bottom: 10px; border-bottom: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
.nw-sec__head h2, .nw-sec__head p { margin: 0; }
.nw-sec__head p { color: var(--text-muted); }

/* Postcards: pictures framed like prints, the first one double width */
.nw-post { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 22px); }
.nw-post .nw-story { padding: 10px 10px 14px; border-radius: 4px; background: var(--bg); box-shadow: var(--shadow-glass); }
.nw-post .nw-story:first-child { grid-column: span 2; grid-row: span 2; }
.nw-post .nw-pic { border-radius: 2px; aspect-ratio: 4 / 3; }
.nw-post .nw-story:first-child .nw-title { font-size: clamp(1.35rem, 2.2vw, 1.9rem); }
/* five stories fill the 4-column grid; a sixth onward sit in a full row of their own */
.nw-post .nw-story:nth-child(n+6) { grid-column: span 2; }

/* one big story beside a list */
.nw-feature, .nw-home__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: start; }
.nw-feature--flip > :first-child { order: 2; }
.nw-feature:not(:has(.nw-rows > *)) { grid-template-columns: minmax(0, 720px); }
.nw-story--big .nw-title { font-size: clamp(1.45rem, 2.4vw, 2.05rem); line-height: 1.15; }
.nw-rows { display: grid; }
.nw-story--row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; padding-block: 16px; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.nw-story--row:first-child { padding-top: 0; border-top: 0; }
.nw-story--row .nw-pic { margin: 0; aspect-ratio: 1; }
.nw-story--row .nw-title { font-size: 1.08rem; }

/* columns with rules between them */
.nw-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(24px, 3.4vw, 48px); }
.nw-cols .nw-story:not(:nth-child(3n+1))::before { content: ''; position: absolute; left: calc(clamp(24px, 3.4vw, 48px) / -2); top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, currentColor 18%, transparent); }

/* text only */
.nw-index { columns: 2; column-gap: clamp(24px, 4vw, 56px); }
.nw-index .nw-story { break-inside: avoid; padding-block: 14px; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); }

/* videos: always dark */
.nw-sec--watch { background: color-mix(in srgb, var(--ink) 82%, transparent); }
.nw-sec--watch :is(.nw-why, .nw-by, .nw-sec__head p) { color: var(--sand); }
.nw-watch { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 20px; }
.nw-watch .nw-pic { aspect-ratio: 16 / 9; }

.nw-foot { padding: clamp(16px, 2.4vw, 26px); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--bg) 72%, transparent); font-size: .92rem; }
.nw-foot h2 { font-size: 1.2rem; margin-bottom: .3em; }
.nw-foot ul { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 16px; padding: 0; list-style: none; }
.nw-foot li a { display: inline-flex; align-items: center; min-height: 36px; }
.nw-foot p { margin: 0; max-width: 72ch; }

/* home page section */
.nw-home__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 28px; }
.nw-home__head h2 { margin-bottom: .2em; }

@media (max-width: 1000px) {
  .nw-post { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nw-cols { grid-template-columns: 1fr 1fr; }
  .nw-cols .nw-story::before { display: none; }
}
@media (max-width: 767px) {
  .nw-story--cover, .nw-feature, .nw-home__grid { grid-template-columns: minmax(0, 1fr); }
  .nw-story--cover .nw-pic { min-height: 0; height: auto; aspect-ratio: 4 / 3; }
  .nw-feature--flip > :first-child { order: 0; }
  .nw-rows { border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); padding-top: 16px; }
  .nw-index { columns: 1; }
  .nw-toc ul { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 22px; scrollbar-width: none; }
  .nw-toc a { white-space: nowrap; }
}
@media (max-width: 560px) {
  .nw-cols { grid-template-columns: minmax(0, 1fr); }
  .nw-post { grid-template-columns: minmax(0, 1fr); }
  .nw-post .nw-story, .nw-post .nw-story:first-child, .nw-post .nw-story:nth-child(n+6) { grid-column: auto; grid-row: auto; }
  .nw-post .nw-story:not(:first-child) { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 14px; padding: 10px; }
  .nw-post .nw-story:not(:first-child) .nw-pic { margin: 0; aspect-ratio: 1; }
  .nw-story--row { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; }
}
