/* News list and article (news.php). Design plan: _work/design-plan.md, "News pages". The post, opened and explained:
   letters on the ink-blue ledger with the oval date stamp. Corners square, buttons 3px. */

/* ---------- The oval date stamp ---------- */
.nstamp { position: relative; container-type: inline-size; width: 200px; aspect-ratio: 220 / 140; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--crimson); line-height: 1; transform: rotate(-9deg); mix-blend-mode: multiply; pointer-events: none; }
.nstamp svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nstamp ellipse { fill: none; stroke: currentColor; stroke-width: 3.2; }
.nstamp ellipse:nth-child(2) { stroke-width: 1.4; }
.nstamp .dash { stroke-width: 1.2; stroke-dasharray: 2 7; animation: dash-turn 40s linear infinite; }
.nstamp__w { position: relative; font-weight: 800; font-size: 6.4cqw; letter-spacing: .2em; text-transform: uppercase; }
.nstamp__d { position: relative; font-family: var(--serif); font-weight: 400; font-size: 15.5cqw; letter-spacing: .01em; margin: .12em 0 .08em; white-space: nowrap; }
.nstamp__y { position: relative; font-weight: 700; font-size: 6.6cqw; letter-spacing: .24em; }
.motion:not(.motion-fail) [data-nstamp] { opacity: 0; }

/* ---------- List opener: letters on the ink-blue ledger ---------- */
.nl-open { position: relative; overflow: clip; min-height: max(62vh, 560px); display: flex; flex-direction: column; padding-top: var(--head-h); background: var(--ink-blue); color: var(--on-dark); }
.nl-open::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 55% 75% at 76% 52%, rgba(163,24,62,.34), rgba(163,24,62,0) 70%); pointer-events: none; }
.nl-open__ruling { position: absolute; inset: -40px 0 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='36'%3E%3Crect y='35' width='8' height='1' fill='rgba%28140%2C175%2C215%2C.1%29'/%3E%3C/svg%3E"); animation: rule-drift-36 20s linear infinite; pointer-events: none; }
.nl-open__ruling::before { content: ''; position: absolute; top: 0; bottom: 0; left: clamp(14px, 2.2vw, 36px); width: 1px; background: rgba(226,71,95,.55); }
.nl-open__grid { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .92fr); align-items: center; gap: clamp(28px, 4vw, 72px); padding-block: clamp(40px, 7vh, 80px); }
.nl-open h1 { color: #fff; font-size: clamp(2.6rem, 5vw, 5rem); margin-bottom: 22px; }
.nl-open__lede { margin-bottom: 30px; }
.nl-latest { display: flex; align-items: center; gap: 14px 18px; padding: 16px 18px 16px 0; border-top: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(255,255,255,.2); color: #fff; text-decoration: none; }
.nl-latest__k { flex: none; padding: 5px 9px; background: var(--highlight); color: var(--wine); font-weight: 800; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; line-height: 1.2; }
.nl-latest__t { flex: 1; font-weight: 600; font-size: 1.08rem; line-height: 1.35; }
.nl-latest svg { width: 20px; height: 20px; flex: none; color: var(--highlight); transition: transform .35s var(--ease); }
a.nl-latest:hover svg, a.nl-latest:focus-visible svg { transform: translateX(6px); }
a.nl-latest:hover .nl-latest__t { text-decoration: underline; text-decoration-color: var(--highlight); text-underline-offset: 4px; }
.nl-latest--none { margin: 0; }

.nl-stack { position: relative; perspective: 1400px; }
.nl-stack__tilt { position: relative; width: min(100%, 560px); margin-inline: auto; aspect-ratio: 560 / 440; transform-style: preserve-3d; }
.nl-letter { position: absolute; left: 50%; top: 50%; width: 74%; transform: translate(-50%, -50%) translate(var(--lx0, 0), var(--ly0, 0)) rotate(var(--lr, 0deg)); }
.nl-letter__in { position: relative; padding: 26px 28px 30px; background: #FFFEFC; color: var(--ink); box-shadow: 0 30px 60px rgba(4,8,14,.5); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 27px, #EEE3E5 27px, #EEE3E5 28px); background-position: 0 14px; border-left: 3px solid var(--crimson); will-change: transform; }
.nl-letter--0 { --lr: -2.5deg; z-index: 3; }
.nl-letter--1 { --lx0: 13%; --ly0: -12%; --lr: 6deg; z-index: 2; }
.nl-letter--2 { --lx0: -14%; --ly0: 11%; --lr: -9deg; z-index: 1; }
.nl-letter p { margin: 0; }
.nl-letter__date { font-weight: 700; font-size: .9rem; color: var(--claret); margin-bottom: 10px !important; }
.nl-letter__t { font-family: var(--serif); font-size: clamp(1.25rem, 1.6vw, 1.55rem); line-height: 1.2; margin-bottom: 12px !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nl-letter__s { font-size: .98rem; line-height: 1.5; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nl-letter__lines { display: block; height: 44px; margin-top: 14px; background: linear-gradient(#D9CDD0, #D9CDD0) 0 6px / 92% 6px no-repeat, linear-gradient(#D9CDD0, #D9CDD0) 0 22px / 78% 6px no-repeat, linear-gradient(#D9CDD0, #D9CDD0) 0 38px / 54% 6px no-repeat; opacity: .7; }
.nl-letter__stamp { position: absolute; right: -40px; bottom: -46px; width: 186px; }
.motion:not(.motion-fail) [data-nl-letter] { opacity: 0; }

/* ---------- The journal: one ruled line per article ---------- */
.nl-journal { position: relative; overflow: clip; background: var(--paper); padding-block: clamp(72px, 9vw, 124px); }
.nl-journal__ruling { position: absolute; inset: -40px 0 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='36'%3E%3Crect y='35' width='8' height='1' fill='rgba%28117%2C21%2C35%2C.06%29'/%3E%3C/svg%3E"); animation: rule-drift-36 26s linear infinite; pointer-events: none; }
.nl-journal__ruling::before { content: ''; position: absolute; top: 0; bottom: 0; left: clamp(14px, 2.2vw, 36px); width: 1px; background: rgba(163,24,62,.28); }
.nl-journal .wrap { position: relative; }
.nl-journal__head { margin-bottom: clamp(30px, 4vw, 52px); }
.nl-count { margin: 0; font-weight: 600; color: var(--ink-soft); }
.nl-rows { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--rule); }
.nl-row { position: relative; }
.nl-row::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--claret); opacity: .35; transform-origin: 0 50%; transform: scaleX(var(--rule-x, 1)); }
.nl-row__link { position: relative; display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; align-items: start; gap: 12px clamp(20px, 3vw, 48px); padding: clamp(22px, 2.6vw, 34px) clamp(10px, 1.4vw, 20px); color: inherit; text-decoration: none; isolation: isolate; }
.nl-row__link::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--blush); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.nl-row__link:hover::before, .nl-row__link:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.nl-row__date { display: grid; justify-items: start; line-height: 1; padding-top: 4px; }
.nl-row__date b { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 3vw, 3.1rem); color: var(--crimson); }
.nl-row__date span { margin-top: 8px; font-weight: 700; font-size: .95rem; color: var(--ink-soft); }
.nl-row__main { display: grid; gap: 10px; }
.nl-row__t { font-family: var(--serif); font-size: clamp(1.4rem, 1.9vw, 1.85rem); line-height: 1.2; color: var(--ink); }
.nl-row--first .nl-row__t { font-size: clamp(1.7rem, 2.5vw, 2.15rem); }
.nl-row__s { max-width: 120ch; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.55; }
.nl-row__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .93rem; font-weight: 600; color: var(--ink-soft); }
.nl-row__tags i { font-style: normal; padding: 3px 9px; border: 1px solid rgba(117,21,35,.35); color: var(--claret); font-weight: 700; }
.nl-row__go { display: inline-flex; align-items: center; gap: 8px; align-self: start; margin-top: .5em; font-weight: 700; color: var(--claret); white-space: nowrap; }
.nl-row__go svg { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.nl-row__link:hover .nl-row__go svg { transform: translateX(6px); }
.motion:not(.motion-fail) [data-nl-row] { --rule-x: 0; }
.motion:not(.motion-fail) [data-nl-row] .nl-row__link { opacity: 0; }
.motion:not(.motion-fail) :is([data-na-body] > :not(h2), .na-sign) { opacity: 0; }

.nl-empty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: center; gap: clamp(28px, 4vw, 64px); }
.nl-empty h2 { margin-bottom: 18px; }
.nl-empty .lede { margin-bottom: 26px; }
.nl-empty__media { margin: 0; }
.nl-empty__media .frame { aspect-ratio: 1264 / 848; max-height: var(--media-cap); }

/* ---------- The crimson band that closes both pages ---------- */
.ncta { overflow: clip; }
.ncta__oval { position: absolute; left: -12%; top: 50%; width: min(1000px, 90vw); transform: translateY(-50%); pointer-events: none; animation: ncta-sway 14s ease-in-out infinite; }
@keyframes ncta-sway { 0%, 100% { transform: translateY(-50%) rotate(-5deg); } 50% { transform: translateY(-46%) rotate(5deg) scale(1.05); } }
.rm .ncta__oval { animation: none; }
.ncta__oval ellipse { fill: none; stroke: rgba(255,255,255,.16); stroke-width: 1.5; }
.ncta__oval .dash { stroke: rgba(242,214,75,.4); stroke-dasharray: 4 14; animation: dash-turn 40s linear infinite; }
.ncta__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) min(400px, calc(var(--media-cap) * .617)); align-items: center; gap: clamp(32px, 5vw, 90px); }
.ncta h2 { color: #fff; margin-bottom: 20px; }
.ncta .lede { margin-bottom: 28px; }
.ncta__media { position: relative; margin: 0; width: 100%; }
.ncta__frame { aspect-ratio: 1000 / 1621; box-shadow: 18px 18px 0 rgba(34,9,15,.35); }

/* ---------- Article: reading progress ---------- */
.na-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 101; pointer-events: none; }
.na-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--crimson), #E2475F 70%, var(--highlight)); transform-origin: 0 50%; transform: scaleX(0); }
.no-js .na-progress, .rm .na-progress { display: none; }

/* ---------- Article opener: blush, the stamp lands on the date ---------- */
.na-open { position: relative; overflow: clip; display: flex; min-height: max(52vh, 460px); flex-direction: column; padding-top: var(--head-h); background: var(--blush); }
.na-open__ruling { position: absolute; inset: -40px 0 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='36'%3E%3Crect y='35' width='8' height='1' fill='rgba%28117%2C21%2C35%2C.08%29'/%3E%3C/svg%3E"); animation: rule-drift-36 20s linear infinite; pointer-events: none; }
.na-open__ruling::before { content: ''; position: absolute; top: 0; bottom: 0; left: clamp(14px, 2.2vw, 36px); width: 1px; background: rgba(163,24,62,.4); }
.na-open__grid { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 4vw, 72px); padding-block: clamp(34px, 6vh, 70px); }
.na-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 14px; font-weight: 700; color: var(--claret); text-decoration: none; }
.na-back svg { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.na-back:hover svg { transform: translateX(-5px); }
.na-open h1 { font-size: clamp(2.3rem, 4.3vw, 4.2rem); color: var(--claret); margin-bottom: 18px; }
.na-open__lede { margin-bottom: 24px; color: var(--ink-soft); }
.na-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; font-weight: 600; color: var(--ink); }
.na-meta li { display: inline-flex; align-items: center; gap: 9px; }
/* fixed widths, so the row does not shift when the web font arrives */
.na-meta li:has(time) { min-width: 10.6em; }
.na-meta li:nth-child(2) { min-width: 8.6em; }
.na-meta svg { width: 19px; height: 19px; color: var(--crimson); flex: none; }
.na-meta .na-tag { padding: 3px 10px; border: 1px solid rgba(117,21,35,.35); color: var(--claret); font-weight: 700; font-size: .93rem; }
.na-open__stamp { width: clamp(220px, 21vw, 300px); margin-right: clamp(0px, 2vw, 30px); }

/* ---------- Article: the paper sheet on the ruled desk ---------- */
.na-desk { position: relative; overflow: clip; background: var(--paper); padding-block: clamp(56px, 7vw, 100px); }
.na-desk__ruling { position: absolute; inset: -40px 0 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='36'%3E%3Crect y='35' width='8' height='1' fill='rgba%28117%2C21%2C35%2C.055%29'/%3E%3C/svg%3E"); animation: rule-drift-36 28s linear infinite; pointer-events: none; }
.na-desk__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: clamp(32px, 4vw, 64px); }
.na-sheet { position: relative; background: #fff; border: 1px solid var(--rule); border-left: 3px solid var(--crimson); box-shadow: 0 26px 60px rgba(34,9,15,.09); padding: clamp(28px, 4.4vw, 64px) clamp(22px, 4.6vw, 70px); }
.na-body { font-size: 1.1rem; line-height: 1.75; color: var(--ink); }
.na-body > :first-child { margin-top: 0; }
.na-body p { margin: 0 0 1.15em; }
.na-body h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 2vw, 1.95rem); line-height: 1.2; color: var(--claret); margin: 1.5em 0 .6em; }
.na-body a { color: var(--claret); font-weight: 600; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.na-body a:hover { color: var(--crimson); }
.na-body ul, .na-body ol { margin: 0 0 1.3em; padding: 0; }
.na-body ul li { position: relative; padding-left: 30px; margin-bottom: .45em; }
.na-body ul li::before { content: ''; position: absolute; left: 4px; top: .62em; width: 9px; height: 6px; border: 2px solid var(--crimson); border-radius: 50%; }
.na-body ol { counter-reset: na; }
.na-body ol li { position: relative; padding-left: 38px; margin-bottom: .55em; counter-increment: na; }
.na-body ol li::before { content: counter(na); position: absolute; left: 0; top: .05em; font-family: var(--serif); font-size: 1.15rem; color: var(--crimson); }
.na-body strong, .na-body b { font-weight: 700; }
.na-body u { text-decoration-color: var(--highlight); text-decoration-thickness: .2em; text-underline-offset: 2px; }
.na-table { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--rule); }
.na-table table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.na-table th, .na-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.na-table th { background: var(--blush); color: var(--claret); font-weight: 700; }
.na-table tr:last-child td { border-bottom: 0; }
.na-sign { margin: 2.2em 0 0; padding-top: 1.4em; border-top: 1px dashed #D5C3C7; color: var(--ink-soft); font-size: 1rem; }
.na-sign a { color: var(--claret); font-weight: 700; }

.na-aside { position: sticky; top: calc(var(--head-h) + 28px); }
.na-aside__in { display: grid; gap: 14px; padding: 26px 24px; background: var(--blush); border-top: 3px solid var(--crimson); }
.na-aside__h { margin: 0; font-weight: 800; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--claret); }
.na-toc { display: grid; gap: 2px; margin: 0 0 8px; padding: 0; list-style: none; }
.na-toc a { position: relative; display: flex; align-items: center; min-height: 44px; padding: 6px 0 6px 16px; font-weight: 600; line-height: 1.35; color: var(--ink-soft); text-decoration: none; transition: color .25s; }
.na-toc a::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--crimson); transform: scaleY(0); transition: transform .35s var(--ease); }
.na-toc a:hover, .na-toc a.is-on { color: var(--claret); }
.na-toc a.is-on::before { transform: scaleY(1); }
.na-copy { display: inline-flex; align-items: center; gap: 10px; justify-self: start; min-height: 46px; padding: 10px 16px; border: 1.5px solid var(--claret); border-radius: var(--btn-r); background: #fff; color: var(--claret); font-weight: 700; cursor: pointer; transition: background .3s, color .3s; }
.na-copy:hover, .na-copy:focus-visible { background: var(--claret); color: #fff; }
.na-copy svg { width: 18px; height: 18px; }
.na-copy.is-done { background: var(--claret); color: #fff; }
.na-aside__all { justify-self: start; margin-top: 6px; }

/* ---------- Article: more letters on the ink-blue band ---------- */
.na-more { overflow: clip; }
.na-more__ruling { position: absolute; inset: -40px 0 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='36'%3E%3Crect y='35' width='8' height='1' fill='rgba%28140%2C175%2C215%2C.09%29'/%3E%3C/svg%3E"); animation: rule-drift-36 22s linear infinite; pointer-events: none; }
.na-more .wrap { position: relative; }
.na-more__head { margin-bottom: clamp(30px, 4vw, 52px); }
.na-more h2 { color: #fff; }
.na-more__all { color: var(--highlight); }
.na-more__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 34px); }
.letter { position: relative; display: grid; align-content: start; gap: 12px; height: 100%; padding: 28px 26px 26px; background: #FFFEFC; color: var(--ink); text-decoration: none; border-left: 3px solid var(--crimson); background-image: radial-gradient(circle at var(--lx, 50%) var(--ly, 0%), rgba(242,214,75,.18), rgba(242,214,75,0) 45%), repeating-linear-gradient(to bottom, transparent 0, transparent 27px, #F0E6E8 27px, #F0E6E8 28px); box-shadow: 0 22px 44px rgba(4,8,14,.4); }
.letter__date { font-weight: 700; font-size: .9rem; color: var(--claret); }
.letter__t { font-family: var(--serif); font-size: clamp(1.3rem, 1.6vw, 1.55rem); line-height: 1.2; }
.letter__s { color: var(--ink-soft); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.letter__go { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 700; color: var(--claret); }
.letter__go svg { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.letter:hover .letter__go svg { transform: translateX(6px); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1099px) {
  .nl-open__grid { grid-template-columns: 1fr; padding-block: 34px 56px; }
  .nl-stack__tilt { width: min(100%, 480px); }
  .na-desk__grid { grid-template-columns: 1fr; }
  .na-aside { position: static; }
  .na-more__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nl-empty, .ncta__grid { grid-template-columns: 1fr; }
  .ncta__media { width: min(100%, 300px); }
  .ncta__oval { left: -40%; top: 34%; width: 170vw; }
  .na-open__grid { grid-template-columns: 1fr; }
  .na-open__stamp { width: 190px; margin: -6px 0 0 auto; }
  .nl-row__link { grid-template-columns: 82px minmax(0, 1fr); }
  .nl-row__go { grid-column: 2; justify-self: start; }
}
@media (max-width: 600px) {
  .nl-open__ruling::before, .nl-journal__ruling::before, .na-open__ruling::before { display: none; }
  .nl-open h1 { font-size: clamp(2.3rem, 10vw, 2.9rem); }
  .nl-open__grid { padding-bottom: 92px; }
  .nl-letter { width: 82%; }
  .nl-letter__in { padding: 20px 20px 22px; }
  .nl-letter__stamp { width: 148px; right: -18px; bottom: -40px; }
  .nl-letter__s { -webkit-line-clamp: 2; }
  .nl-row__date b { font-size: 2.2rem; }
  .na-more__grid { grid-template-columns: 1fr; }
  .na-open h1 { font-size: clamp(2rem, 8.6vw, 2.6rem); }
  .na-sheet { border-left-width: 3px; }
  .na-body { font-size: 1.05rem; }
}
