/* Blog: list cards (blog/index.html, the Home teaser) and the article layout
   used by every blog/<slug>.html post. Loaded after style.css. */

/* ---- Post cards ----------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 18px;
}
.post-skeleton { grid-column: 1 / -1; aspect-ratio: 21 / 6; min-height: 180px; }
.post-empty { grid-column: 1 / -1; padding: 36px 16px; border: 1px dashed var(--border-hi); text-align: center; color: var(--text-dim); }

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--yellow); background: var(--bg-card); }

.post-cover { aspect-ratio: 16 / 9; overflow: hidden; background: #000; border-bottom: 1px solid var(--border); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.post-card:hover .post-cover img { transform: scale(1.04); }

.post-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.post-kicker { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.badge-latest { padding: 2px 7px; background: var(--yellow); color: #0a0a0f; font-size: 10px; letter-spacing: .12em; }
.post-body h2 { margin: 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.2; text-transform: uppercase; letter-spacing: .03em; }
.post-body p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-dim); }
.post-go { margin-top: auto; padding-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); }

/* The newest post gets a wide, side-by-side card when there is room. */
@media (min-width: 900px) {
  .post-card.lead { grid-column: 1 / -1; flex-direction: row; }
  .post-card.lead .post-cover { flex: 0 0 56%; aspect-ratio: 16 / 9; border-bottom: 0; border-right: 1px solid var(--border); }
  .post-card.lead .post-body { padding: clamp(20px, 2.6vw, 36px); justify-content: center; }
  .post-card.lead h2 { font-size: clamp(22px, 2.4vw, 32px); }
  .post-card.lead p { font-size: 15px; }
}

/* ---- Article -------------------------------------------------------------- */
/* Wide page (same --page-max as the rest of the site): the article column grows with the screen, with a
   sticky "On this page" sidebar beside it on desktop. Paragraphs keep a
   readable line length; figures, tables and tiers use the full column. */
main.post { max-width: var(--page-max); }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 64px; }
@media (min-width: 1100px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}

.post-toc { display: none; }
@media (min-width: 1100px) {
  .post-toc { display: block; position: sticky; top: 96px; align-self: start; padding: 34px 0 0; }
}
.toc-title { margin-bottom: 12px; font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); }
.post-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--border); }
.post-toc a { display: block; margin-left: -1px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text-dim); transition: color .15s, border-color .15s; }
.post-toc a:hover { color: var(--text); }
.post-toc a.on { color: var(--yellow); border-left-color: var(--yellow); }

.post-back { display: inline-block; margin-bottom: 18px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.post-back:hover { color: var(--yellow); }

.post-hero { padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.post-hero h1 { margin: 12px 0 16px; font-size: clamp(28px, 4.4vw, 58px); line-height: 1.04; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
.post-hero h1 .accent { color: var(--yellow); }
.post-hero h1 .alt { color: var(--cyan); }
.post-hero .dek { margin: 0; color: var(--text-dim); font-size: clamp(15px, 1.6vw, 18px); }
.post-hero .post-meta { margin-top: 18px; }

.prose { display: flex; flex-direction: column; gap: 48px; padding-top: 34px; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.7; }
.prose section { display: flex; flex-direction: column; gap: 14px; }
.prose p, .prose li { margin: 0; text-wrap: pretty; }
.prose strong { font-weight: 700; }
.prose h2 { margin: 0; display: flex; gap: 12px; align-items: baseline; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.2; text-transform: uppercase; letter-spacing: .03em; text-wrap: balance; }
.prose h2 .num { flex: none; padding: 4px 7px 3px; background: var(--yellow); color: #0a0a0f; font-size: 12px; letter-spacing: .06em; transform: translateY(-3px); }
.prose h3 { margin: 0; font-size: 17px; text-transform: uppercase; letter-spacing: .05em; }
.prose a { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; }
.prose .foil { color: var(--cyan); font-weight: 700; }
.prose .yel { color: var(--yellow); font-weight: 700; }

.post-fig { margin: 6px 0 0; padding: 20px; background: var(--bg-panel); border: 1px solid var(--border); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); }
.fig-label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.fig-label span:last-child { color: var(--yellow); }
.post-fig figcaption { margin-top: 16px; font-size: 15px; line-height: 1.5; color: var(--text-dim); text-align: center; text-wrap: balance; }
.post-fig > img { display: block; width: 100%; height: auto; border: 1px solid var(--border); }

.stacks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 22px; }
.stacks h4 { margin: 0 0 10px; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; }
.stacks h4.cy { color: var(--cyan); }
.stacks svg { display: block; width: 100%; height: auto; }

.table-scroll { overflow-x: auto; }
.readout { width: 100%; border-collapse: collapse; font-size: .92em; }
.readout th, .readout td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.readout th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.readout td:first-child { font-weight: 700; color: var(--yellow); white-space: nowrap; }

.callout { padding: 14px 18px; border-left: 3px solid var(--cyan); background: var(--bg-card); font-size: .95em; }
.callout b { display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }

.tiers { display: flex; flex-direction: column; gap: 16px; }
/* Protection steps up with the card's value: grey (bulk) -> cyan (deck) ->
   yellow with a glow (chase cards). --tc drives the border, number, bullets
   and buttons of each tier. */
.tier { --tc: var(--text-dim); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 20px; padding: 22px 24px; background: var(--bg-panel); border: 1px solid color-mix(in srgb, var(--tc) 55%, var(--border)); border-left: 3px solid var(--tc); }
/* Number and title share the first row; the list and buttons run the full width under them. */
.tier .lvl { min-width: 48px; font-size: 38px; font-weight: 900; line-height: 1; color: var(--tc); }
.tier h3 { align-self: center; }
.tier ul, .tier .shop { grid-column: 1 / -1; }
.tier.t1 { --tc: #b9b9c6; }
.tier.t2 { --tc: var(--cyan); }
.tier.t3 { --tc: var(--yellow); box-shadow: 0 0 32px -14px var(--yellow); }
.tier ul { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.tier li { position: relative; padding-left: 20px; font-size: .95em; }
.tier li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; background: var(--tc); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.shop { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* A real 1px border on both buttons: a clipped corner used to cut the outlined
   button's border off at the corner. */
.prose .shop a { padding: 9px 12px; border: 1px solid var(--tc); background: var(--tc); color: #0a0a0f; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.prose .shop a.ghost { background: transparent; color: var(--tc); }
.prose .shop a:hover { filter: brightness(1.12); }

.take { padding: 26px 24px; background: var(--yellow); color: #0a0a0f; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%); }
.take h2 { color: #0a0a0f; }
.take p { margin-top: 4px; font-weight: 600; }
.prose .take { gap: 8px; }

.post-end { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }

/* Phones: edge-to-edge blocks with less padding, so the text gets the width. */
@media (max-width: 600px) {
  .post-back { margin-bottom: 12px; }
  .post-hero { padding-bottom: 20px; }
  .prose { gap: 36px; padding-top: 26px; }
  .post-fig { margin-inline: calc(var(--gutter) * -1); padding: 14px var(--gutter); clip-path: none; border-inline: 0; }
  .fig-label { font-size: 12px; }
  .post-fig figcaption { font-size: 13px; }
  .stacks { gap: 18px; }
  .tier { padding: 16px; gap: 4px 14px; }
  .tier .lvl { font-size: 30px; }
  .readout { font-size: 14px; }
  .readout th, .readout td { padding: 10px 8px; }
  .readout td:first-child { white-space: normal; min-width: 76px; }
  .callout { padding: 12px 14px; }
  .take { padding: 20px 18px; }
  .prose h2 { flex-direction: column; gap: 8px; }
  .post-end .cta { flex: 1 1 140px; }
}

/* ---- Home teaser ---------------------------------------------------------- */
#blog-section .post-grid { grid-template-columns: 1fr; }
