/* News post (/news/<slug>/). Adds to site.css. A reading page: the head on the map, the post on a flat
   cream panel at about 66 characters a line, then the way on (older, newer, more from the year, back). */
.post { max-width: calc(760px + var(--gutter) * 2); }

/* head */
.post-head { position: relative; padding-top: calc(var(--bar-h) + clamp(72px, 8vw, 110px)); padding-bottom: var(--s1); }
.post-head h1 { font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.4rem); line-height: 1.06; max-width: 22ch; margin-top: .7rem; text-wrap: balance; }
.post-back { font-size: var(--step--1); font-weight: 600; }
.post-back a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
.post-back a:hover { text-decoration: underline; }
}
.post-back a::before { content: '← '; }
.post-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1.1rem; margin-top: 1rem; color: var(--text-soft); }
.post-meta time, .post-meta > span:first-child { font: 650 var(--step-1)/1.3 var(--display); color: var(--text); letter-spacing: .005em; font-variant-numeric: lining-nums tabular-nums; }
.post-by { font-weight: 600; font-size: var(--step-0); }

/* the trail, lightly: a short stretch of track coming down beside the title with the bike parked at its end */
.post-trail { position: absolute; top: 0; bottom: 18px; left: calc(-1 * clamp(80px, 9vw, 130px)); width: 40px; pointer-events: none; }
.post-track { position: absolute; inset: 0 0 34px; width: 100%; height: calc(100% - 34px); overflow: visible; }
.post-track path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.post-track-bed { stroke: rgba(70, 50, 18, .13); stroke-width: 14; }
.post-track-tread { stroke: rgba(41, 30, 12, .5); stroke-width: 1.8; stroke-dasharray: 1.6 5.4; }
.post-bike { position: absolute; left: 50%; bottom: 0; width: 28px; height: auto; max-width: none; margin-left: -14px;
  transform: rotate(186deg); filter: drop-shadow(3px 5px 3px rgba(31, 20, 7, .4)); }
@media (max-width: 1180px) { .post-trail { display: none; } }

/* panel and notes */
.post-panel { padding: clamp(22px, 4vw, 48px); }
.post-note { max-width: var(--measure); margin-bottom: var(--s1); padding: .8rem 1rem; border-left: 3px solid var(--teal); border-radius: 0 var(--radius-media) var(--radius-media) 0;
  background: color-mix(in srgb, var(--teal) 16%, var(--cream)); font-size: var(--step--1); line-height: 1.55; }
.post-figure { margin: 0 0 var(--s1); }
.post-figure img { border-radius: var(--radius-sm); max-width: min(100%, 900px); }
.post-figure img[width] { width: attr(width px, auto); max-width: 100%; height: auto; }
.post-figure.is-portrait img { max-width: min(100%, 440px); }

/* the body: real typographic care */
.post-body { font-size: clamp(1.0625rem, 1rem + .25vw, 1.125rem); line-height: 1.7; hyphens: manual; }
.post-body > * { max-width: 66ch; }
.post-body p { hanging-punctuation: first; }
.post-body a { text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) {
.post-body a:hover { text-decoration-color: currentColor; }
}
.post-body strong { color: var(--ink); }
/* hanging lists: on wider screens the markers sit out in the panel's margin and the text lines up with the paragraphs */
.post-body ul, .post-body ol { padding-left: 1.25em; list-style-position: outside; }
.post-body ul > li::marker { content: '–  '; color: var(--gold-deep); }
@media (min-width: 900px) { .post-body ul, .post-body ol { padding-left: 0; } }
.post-body blockquote { margin-inline: 0; padding: .1em 0 .1em 1.1em; border-left: 3px solid var(--teal); font-family: var(--display); font-size: var(--step-1); line-height: 1.45; }
.post-body blockquote > * + * { margin-top: .6em; }

/* pictures: never larger than the file, a figure with its caption when the post gives one */
.post-body img { border-radius: var(--radius-sm); height: auto; max-height: none; }
.post-body img[width] { width: attr(width px, auto); max-width: 100%; }
.post-body img.is-portrait { max-width: min(100%, 440px); }
.post-body figure { margin-block: 1.8em; }
.post-body figcaption { font-size: var(--step--1); line-height: 1.5; }
/* little logos and pictures dropped into a paragraph sit to the right of the text */
.post-body p img.is-small, .post-body p a > img.is-small { float: right; max-width: min(42%, 240px); margin: .35em 0 .8em 1.4em; }
.post-body p img:not(.is-small) { display: block; margin-block: 1em; }
.post-body > :is(p, figure, div, ul, ol, blockquote, h2, h3) { clear: right; }
.post-body > p { clear: none; }

/* YouTube facades: nothing loads from YouTube until you press play */
.yt-group { display: grid; gap: 14px; margin-block: 1.4em 1.8em; max-width: 560px; }
.yt-group.is-many { max-width: 66ch; }
.yt-group.is-many { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.yt { position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: var(--radius-media); overflow: hidden; background: var(--ink); }
.post-body .yt { margin-block: 0; max-width: none; }
.post-body > .yt { margin-block: 1.6em; max-width: 560px; }
.yt-link { position: absolute; inset: 0; display: block; color: var(--cream); text-decoration: none; }
.yt-link img, .post-body .yt-link img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 0;
  filter: saturate(.9) brightness(.82); transition: filter .3s var(--ease), transform .6s var(--ease); }
@media (hover: hover) and (pointer: fine) {
.yt-link:hover img { filter: saturate(1) brightness(.92); transform: scale(1.015); }
}
.yt-play { position: absolute; left: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: 0 16px 0 12px;
  border-radius: var(--radius-pill); background: rgba(31, 20, 7, .86); font: 600 15px/1 var(--sans); transition: background-color .2s var(--ease), transform .15s var(--ease); }
.yt-play svg { width: 22px; height: 22px; color: var(--teal-2); }
@media (hover: hover) and (pointer: fine) {
.yt-link:hover .yt-play { background: var(--ink); }
}
.yt-link:active .yt-play { transform: scale(.97); }
.yt-link:focus-visible { outline-offset: -4px; outline-color: var(--teal-2); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-group.is-many .yt-play { left: 10px; bottom: 10px; font-size: 14px; }

/* foot of the post */
.post-foot { margin-top: var(--s2); }
.post-foot > * + * { margin-top: var(--s2); }
.post-events { max-width: 60ch; font-size: var(--step-0); }
.post-events a { font-weight: 600; }
.post-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s0); }
.post-pager-link { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.2rem 1.05rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 74%, transparent); color: var(--panel-text); text-decoration: none;
  transition: background-color .2s var(--ease), transform .15s var(--ease); }
.post-pager-label { font: 600 var(--step--1)/1.4 var(--sans); color: var(--link); }
.post-pager-prev .post-pager-label::before { content: '← '; }
.post-pager-next .post-pager-label::after { content: ' →'; }
.post-pager-title { font: 650 var(--step-1)/1.25 var(--display); text-wrap: balance; }
.post-pager-link time { font-size: var(--step--1); color: color-mix(in srgb, var(--panel-text) 72%, transparent); }
@media (hover: hover) and (pointer: fine) {
.post-pager-link:hover { background: var(--panel); color: var(--panel-text); }
}
@media (hover: hover) and (pointer: fine) {
.post-pager-link:hover .post-pager-title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
}
.post-pager-link:active { transform: translateY(1px); }
.post-pager-next { grid-column: 2; text-align: right; align-items: flex-end; }

.post-more h2 { font-size: var(--step-2); }
.post-more-list { margin-top: .6rem; }
.post-more-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .1rem 1rem; padding-block: .7rem; border-bottom: 1px solid var(--rule); }
.post-more-list li:last-child { border-bottom: 0; }
.post-more-list a { font: 650 var(--step-0)/1.35 var(--display); font-size: var(--step-1); color: var(--text); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
.post-more-list a:hover { color: var(--link); text-decoration: underline; }
}
.post-more-list time { font-size: var(--step--1); color: var(--text-soft); white-space: nowrap; }

@media (max-width: 640px) {
  .post-head { padding-bottom: var(--s0); }
  .post-panel { margin-inline: calc(var(--gutter) * -0.5); padding: 22px 18px 26px; }
  .post-pager { grid-template-columns: 1fr; }
  .post-pager-next { grid-column: 1; grid-row: 1; }
  .post-body p img.is-small, .post-body p a > img.is-small { max-width: min(46%, 170px); margin-left: 1em; }
  .post-more-list li { display: block; }
  .post-more-list time { display: block; margin-top: .15rem; }
}

@media print {
  .post-trail, .post-back, .post-pager, .post-more, .post-index, .yt-group, .yt { display: none !important; }
  .post { max-width: none; }
  .post-head { padding-top: 0; }
  .post-panel { margin: 0; padding: 0; background: transparent; box-shadow: none; }
  .post-head h1 { max-width: none; }
  .post-body { font-size: 11pt; line-height: 1.5; }
  .post-body p, .post-body li { orphans: 3; widows: 3; }
  .post-body a[href^="http"]::after { content: none; }
  .post-body img { max-height: 16cm; object-fit: contain; }
  .post-note { background: transparent; }
}

@media (max-width: 760px) {
  .yt-play, .yt-group.is-many .yt-play { font-size: 1rem; min-height: 44px; }
  .post-back { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .post-pager-link { background: var(--panel); }
}
