/* blog.html only. Loads after summit.css and site.css: the hero's at-a-glance strip, the
   topic filter chips, the featured newest article with its summit map, and the editorial
   list of the rest, each with its own small contour map. The list works without JS;
   blog.js only adds the filter. */

/* ---------------------------------------------------------------- hero */
.blog-title { font-size: clamp(3rem, 7.2vw, 7.4rem); max-width: 15ch; }
.blog-stats {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0; margin-top: clamp(40px, 5vw, 60px);
  border-top: 1px solid var(--line); max-width: 640px;
  opacity: 0; transform: translateY(14px); transition: opacity 1s var(--ease) .55s, transform 1s var(--ease) .55s;
}
body.is-ready .blog-stats, html:not(.js) .blog-stats { opacity: 1; transform: none; }
.blog-stats li { display: flex; flex-direction: column-reverse; gap: 2px; padding: 16px 32px 0 0; margin-right: 32px; border-right: 1px solid var(--line); }
.blog-stats li:last-child { border-right: 0; margin-right: 0; }
.blog-stats b { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1; color: var(--text); }
.blog-stats span { font-family: var(--display); text-transform: uppercase; letter-spacing: .2em; font-size: .78rem; color: var(--text-3); }

/* ---------------------------------------------------------------- section */
.blog-section { padding-block: clamp(56px, 7vw, 96px) clamp(48px, 6vw, 80px); }
.blog-section .display { font-size: clamp(2.7rem, 6.2vw, 5.6rem); max-width: 17ch; }
@media (min-width: 1081px) { .blog-section .section-head:has(.lede) { grid-template-columns: 1.6fr 1fr; } }

/* ---------------------------------------------------------------- topic filter */
.post-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 28px; }
.post-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 18px;
  border: 1px solid var(--line-2); border-radius: 999px; font-weight: 600; font-size: .95rem; color: var(--text-2);
  overflow: hidden; isolation: isolate; -webkit-tap-highlight-color: transparent;
  transition: color .25s, border-color .25s, background-color .25s, transform .15s var(--ease);
}
.chip::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--surface-2); transform: translateY(101%); transition: transform .4s var(--ease); }
.chip:hover { color: var(--text); border-color: var(--brass); }
.chip:hover::before { transform: none; }
.chip:active { transform: scale(.95); }
.chip-n {
  min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px;
  font-family: var(--display); font-weight: 600; font-size: .86rem; letter-spacing: .04em;
  background: var(--surface-2); color: var(--text-2); transition: background-color .25s, color .25s;
}
.chip[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
.chip[aria-pressed="true"]::before { display: none; }
.chip[aria-pressed="true"] .chip-n { background: rgba(7, 18, 37, .16); color: var(--on-brass); }
.post-count { font-family: var(--display); text-transform: uppercase; letter-spacing: .18em; font-size: .82rem; color: var(--text-3); }
.post-count:empty { display: none; }

/* ---------------------------------------------------------------- shared post parts */
.posts { list-style: none; display: grid; }
.post[hidden] { display: none; }
.post-tag {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .2em; font-size: .82rem; color: var(--accent);
}
.post-title { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; line-height: .98; text-wrap: balance; }
.post-link { color: inherit; text-decoration: none; transition: color .3s; }
/* the title link covers its whole card */
.post-link::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: var(--radius); }
.post-excerpt { color: var(--text-2); max-width: 62ch; }
.post-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.post-meta { font-size: .92rem; color: var(--text-3); }
.read-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.read-link .btn-arrow { transition: transform .4s var(--ease); }
.post-n {
  font-family: var(--display); font-weight: 600; line-height: .8; color: transparent; -webkit-text-stroke: 1.5px var(--accent);
  transition: color .45s var(--ease), -webkit-text-stroke-color .45s;
}

/* contour maps */
.topo path { fill: none; stroke: var(--accent); vector-effect: non-scaling-stroke; }
.t-minor { stroke-width: .8; opacity: .34; }
.t-major { stroke-width: 1.3; opacity: .7; }
.peak { fill: var(--brass-hi); filter: drop-shadow(0 0 6px rgba(217, 182, 92, .8)); }
.peak-ring { fill: none; stroke: var(--brass-hi); stroke-width: 1.2; opacity: 0; transform-box: fill-box; transform-origin: center; }
:root[data-theme="light"] .t-minor { opacity: .3; }
:root[data-theme="light"] .t-major { opacity: .6; }
:root[data-theme="light"] .peak { fill: var(--brass); filter: none; }
:root[data-theme="light"] .peak-ring { stroke: var(--accent); }
@keyframes peak-ping { from { transform: scale(.4); opacity: .9; } to { transform: scale(2.2); opacity: 0; } }

/* keyboard focus lands on the title link; show it on the whole card */
@supports selector(:has(*)) {
  .post-link:focus-visible { outline: none; box-shadow: none; }
  .post:has(.post-link:focus-visible) > article { outline: 3px solid var(--accent); outline-offset: 4px; }
  .post:has(.post-link:focus-visible) .post-n { color: var(--accent); }
  .post:has(.post-link:focus-visible) .read-link { opacity: 1; transform: none; }
  .post:has(.post-link:focus-visible) .post-go { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- featured: the newest article */
.post-feature { margin-bottom: clamp(28px, 4vw, 48px); }
.feature-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); overflow: hidden;
  background: linear-gradient(160deg, rgba(194, 161, 77, .1), transparent 55%), var(--surface);
}
.feature-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 3; background: linear-gradient(90deg, #C2A14D, #D9B65C); }
.feature-card:hover { border-color: var(--brass); }
.feature-card:active .post-n { color: var(--accent); }
.feature-card:active { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) scale(.99); transition-duration: .1s; }

.feature-art {
  position: relative; min-height: 440px; overflow: hidden; border-right: 1px solid var(--line);
  background: radial-gradient(90% 80% at 62% 40%, rgba(194, 161, 77, .16), transparent 65%), var(--bg-2);
}
.feature-art svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.feature-art .topo {
  transform-box: view-box; transform-origin: 60% 42%;
  transform: translate(calc((var(--gx, 50%) - 50%) * -.06), calc((var(--gy, 50%) - 50%) * -.06)) scale(1.04);
  transition: transform 1.4s var(--ease);
}
.feature-card:hover .feature-art .topo { transform: translate(calc((var(--gx, 50%) - 50%) * -.06), calc((var(--gy, 50%) - 50%) * -.06)) scale(1.1); }
.feature-art .trail {
  fill: none; stroke: var(--brass-hi); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 8;
  vector-effect: non-scaling-stroke;
}
:root[data-theme="light"] .feature-art .trail { stroke: var(--accent); }
.feature-art .peak-ring { animation: peak-ping 2.4s var(--ease) infinite; }
.feature-art .flag line { stroke: var(--text); stroke-width: 2; }
.feature-art .flag path { fill: var(--brass-hi); transform-box: fill-box; transform-origin: 0 50%; animation: flag-wave 2.4s ease-in-out infinite; }
.feature-stamp {
  position: absolute; left: clamp(20px, 3vw, 32px); bottom: clamp(18px, 3vw, 30px); display: flex; align-items: flex-end; gap: 12px;
  font-family: var(--display); font-weight: 600; text-transform: uppercase; line-height: .8;
}
.feature-stamp b { font-size: clamp(5rem, 9vw, 8.4rem); font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.feature-stamp span { padding-bottom: .5em; font-size: 1rem; letter-spacing: .22em; color: var(--text-2); }
.feature-badge {
  position: absolute; top: 22px; left: clamp(20px, 3vw, 32px); display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; color: var(--accent);
}
.feature-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); animation: ping 2.4s infinite; }

.feature-body { position: relative; display: flex; flex-direction: column; padding: clamp(28px, 4vw, 52px); }
.post-top { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.feature-body .post-n { font-size: 3.4rem; }
.feature-body .post-title { font-size: clamp(2.3rem, 3.9vw, 3.7rem); margin-bottom: 20px; }
.feature-body .post-excerpt { font-size: clamp(1.05rem, 1.3vw, 1.18rem); }
.feature-body .post-foot { margin-top: auto; padding-top: 32px; border-top: 1px solid var(--line); }
.feature-body .post-excerpt + .post-foot { margin-top: 32px; }
@media (min-width: 901px) { .feature-body .post-excerpt + .post-foot { margin-top: auto; } .feature-body .post-excerpt { margin-bottom: 36px; } }
@media (hover: hover) and (pointer: fine) {
  .feature-card:hover .post-n { color: var(--accent); }
  .feature-card:hover .post-link { color: var(--accent); }
  .feature-card:hover .read-link .btn-arrow { transform: translateX(6px); }
}

/* ---------------------------------------------------------------- the rest: editorial rows */
.posts .post:not(.post-feature):not([hidden]) ~ .post:not([hidden]) .post-row::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--line); transition: opacity .3s; }
.post-row {
  position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr) 168px; gap: clamp(20px, 3vw, 44px); align-items: center;
  padding: clamp(28px, 3vw, 40px) clamp(16px, 2vw, 28px); border-radius: var(--radius); border: 1px solid transparent;
  transition: transform .5s var(--ease), background-color .4s, border-color .4s, box-shadow .5s var(--ease);
}
/* a brass rule grows down the left edge on hover */
.post-row::after {
  content: ''; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, #D9B65C, #C2A14D);
  transform: scaleY(0); transform-origin: 50% 0; transition: transform .5s var(--ease);
}
.post-row .post-n { display: flex; flex-direction: column; gap: 14px; font-size: clamp(4rem, 6vw, 5.6rem); align-self: start; }
.post-n small {
  display: flex; align-items: center; gap: 8px; font-size: .8rem; line-height: 1; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); -webkit-text-stroke: 0;
  transition: color .45s;
}
.post-n small::before { content: ''; width: 18px; height: 1.5px; background: var(--brass); transition: width .5s var(--ease); }

.post-row .post-title { font-size: clamp(1.8rem, 2.7vw, 2.6rem); margin: 10px 0 12px; }
.post-row .post-foot { margin-top: 16px; }
.post-row .read-link { opacity: 0; transform: translateX(-10px); transition: opacity .35s, transform .45s var(--ease); }

.post-art {
  position: relative; width: 168px; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(80% 80% at 55% 45%, rgba(194, 161, 77, .12), transparent 70%), var(--bg-2);
  transition: border-color .4s, transform .6s var(--ease);
}
.post-art svg { width: 100%; height: 100%; display: block; }
.post-art .topo { transform-box: view-box; transform-origin: 50% 50%; transition: transform 1.4s var(--ease); }
.post-go {
  position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: var(--brass); color: var(--on-brass); box-shadow: 0 10px 24px -8px rgba(194, 161, 77, .7);
  opacity: 0; transform: scale(.5) rotate(-45deg); transition: opacity .3s, transform .5s var(--ease);
}
.post-go .btn-arrow { width: 20px; height: 20px; }

/* hover lifts the row and wakes its map; touch gets a press state instead of a sticky hover */
@media (hover: hover) and (pointer: fine) {
  .post-row:hover { transform: translateY(-6px); background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
  :root[data-theme="light"] .post-row:hover { background: var(--surface-2); }
  .post:hover + .post .post-row::before, .post-row:hover::before { opacity: 0; }
  .post-row:hover::after { transform: none; }
  .post-row:hover .post-n { color: var(--accent); }
  .post-row:hover .post-n small { color: var(--text-2); }
  .post-row:hover .post-n small::before { width: 30px; }
  .post-row:hover .post-link { color: var(--accent); }
  .post-row:hover .read-link { opacity: 1; transform: none; }
  .post-row:hover .post-art { border-color: var(--brass); }
  .post-row:hover .post-art .topo { transform: scale(1.14) rotate(-6deg); }
  .post-row:hover .peak-ring { animation: peak-ping 1.8s var(--ease) infinite; }
  .post-row:hover .post-go { opacity: 1; transform: none; }
  .post-row:active { transform: translateY(-2px) scale(.99); transition-duration: .1s; }
}
@media not ((hover: hover) and (pointer: fine)) {
  .post-row .read-link { opacity: 1; transform: none; }
  .post-row:active { background: var(--surface); transform: scale(.985); transition-duration: .1s; }
  .post-row:active::after { transform: none; }
  .post-row:active .post-n { color: var(--accent); }
}

/* filter changes cross-fade where the browser supports view transitions */
.post:nth-child(1) { view-transition-name: post-1; }
.post:nth-child(2) { view-transition-name: post-2; }
.post:nth-child(3) { view-transition-name: post-3; }
.post:nth-child(4) { view-transition-name: post-4; }
.post:nth-child(5) { view-transition-name: post-5; }
.post:nth-child(6) { view-transition-name: post-6; }
::view-transition-group(*) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .post-row { grid-template-columns: 96px minmax(0, 1fr) 132px; }
  .post-art { width: 132px; }
}
@media (max-width: 900px) {
  .feature-card { grid-template-columns: 1fr; }
  .feature-art { min-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .post-row {
    grid-template-columns: minmax(0, 1fr) 76px; grid-template-areas: "n art" "main main"; gap: 14px 16px; align-items: start;
    padding: 26px 12px 30px;
  }
  .posts { margin-inline: -12px; }
  .post-feature { margin-inline: 12px; }
  .post-row .post-n { grid-area: n; font-size: 3.6rem; align-self: end; gap: 10px; }
  .post-row .post-main { grid-area: main; }
  .post-row .post-art { grid-area: art; width: 76px; }
  .post-row .post-title { font-size: clamp(1.7rem, 7vw, 2.1rem); }
  .post-go { display: none; }
  .post-row::after { top: 26px; bottom: 30px; }
}
@media (max-width: 640px) {
  .blog-stats li { padding-right: 18px; margin-right: 18px; }
  .post-tools { margin-bottom: 18px; }
  .post-filter { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scrollbar-width: none; scroll-padding-inline: var(--gutter); }
  .post-filter::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .feature-art { min-height: 230px; }
  .feature-body .post-n { font-size: 2.8rem; }
  .feature-body .post-title { font-size: clamp(2rem, 9vw, 2.6rem); }
}
@media (prefers-reduced-motion: reduce) {
  .feature-art .peak-ring, .post-row:hover .peak-ring, .feature-art .flag path, .feature-badge .dot { animation: none !important; }
  .feature-art .topo, .post-art .topo { transition: none !important; }
  .blog-stats { opacity: 1 !important; transform: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
