/* ==========================================================================
   blog.html — page-local styles ("Ledger Press")
   Loads AFTER css/styles.css. Tokens only: white / black / silver.
   Posts are ledger lines on a white sheet; the featured post is a vault card.
   ========================================================================== */

/* ---- page head ---- */
.page-head .h1 { font-size: clamp(3rem, 7vw, 6.3rem); } /* "The ImproveU blog" holds one line at 1440 */
.page-head .lead { max-width: 40ch; }

#posts.section { padding-top: clamp(48px, 6vw, 80px); } /* the featured card reaches the first fold */

/* ---- ledger toolbar: category filters + running count ---- */
.blog-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 44px); }
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-filter { cursor: pointer; background: transparent; transition: border-color .2s, color .2s, background-color .2s, transform .3s var(--ease-out); }
.blog-filter:hover { border-color: #0A0A0B; color: #0A0A0B; transform: translateY(-1px); }
.blog-filter[aria-pressed="true"] { background: #0A0A0B; color: #FFFFFF; border-color: #0A0A0B; }
.blog-count { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: #26272B; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- the featured post: a vault card standing on the mist ---- */
.blog-feat {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: clamp(28px, 4vw, 52px) clamp(24px, 4vw, 56px);
  border-radius: var(--radius-lg);
  border: 1px solid #26272B;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-2);
  transition: border-color .3s, box-shadow .3s var(--ease-out);
}
.blog-feat::after { /* chrome top rim, like the bevel of a card */
  content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 1px; background: var(--chrome-edge); opacity: .7; transition: opacity .3s; z-index: 1;
}
.blog-feat:hover { --lift: -6px; border-color: #8E9199; }
.blog-feat:hover::after { opacity: 1; }
.blog-feat > * { position: relative; z-index: 1; }
.blog-feat .eyebrow { margin-bottom: 14px; }
.blog-feat .feat-idx { font-family: var(--font-mono); color: #DDDFE3; }
.blog-feat h2 { font-size: clamp(1.8rem, 3.6vw, 3.1rem); max-width: 22ch; color: #FFFFFF; }
.blog-feat .excerpt { margin-top: 18px; max-width: 58ch; font-size: 1.05rem; line-height: 1.6; color: #C9CCD2; }
.blog-feat .feat-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 28px; }
.blog-feat .feat-meta { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: #8E9199; }
.blog-feat .read { transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.blog-feat:hover .read { transform: translateX(4px); }
/* the ledger index, printed large in the card's dark corner */
.feat-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(6rem, 14vw, 13rem);
  line-height: .8;
  letter-spacing: -.06em;
  color: #1A1B1E;
  font-variant-numeric: tabular-nums;
  user-select: none;
  pointer-events: none;
  margin: 0 -.06em -.06em 0;
  transition: transform .5s var(--ease-out), color .5s;
}
.blog-feat:hover .feat-num, .blog-feat.active .feat-num { color: #26272B; transform: translateY(-6px); }
.blog-feat.active { border-color: #FFFFFF; }
.blog-feat.active .read .arrow { transform: rotate(-90deg); }
.blog-feat h2 button { color: inherit; }

/* ---- the ledger sheet ---- */
.blog-ledger { margin-top: clamp(28px, 4vw, 44px); background: #FFFFFF; border: 1px solid #DDDFE3; border-radius: var(--radius); box-shadow: var(--shadow-1); }
.blog-ledger-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) 190px 150px; gap: 20px; padding: 16px 28px; border-bottom: 1px solid #DDDFE3; }
.blog-ledger-head > span:last-child { text-align: right; }
.blog-card-item { position: relative; }
.blog-card-item:first-of-type .blog-row { border-top-left-radius: 0; border-top-right-radius: 0; }
.blog-card-item:last-of-type .blog-row { border-bottom: 0; }
.blog-card-item:last-of-type .blog-article-content { border-bottom: 0; }
.blog-card-item:last-of-type .blog-row:not(.active) { border-radius: 0 0 var(--radius) var(--radius); }

/* each post is a ledger line: index | title + excerpt | category | read time (the chrome pill slides over it) */
.blog-row {
  grid-template-columns: 64px minmax(0, 1fr) 190px 150px;
  gap: 20px;
  padding: 24px 28px;
  cursor: pointer;
  background: #FFFFFF;
  transition: background-color .3s, color .3s, border-color .3s;
}
.blog-row::after { /* press line: a chrome hairline draws along the bottom rule on hover */
  content: ''; position: absolute; left: 28px; right: 28px; bottom: 0; height: 1px;
  background: var(--chrome-edge-dark); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease-out);
}
.blog-row:hover { --lift: -3px; }
.blog-row:hover::after { transform: scaleX(1); }
.blog-n { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: #8E9199; font-variant-numeric: tabular-nums; align-self: start; padding-top: .2em; transition: color .3s, transform .3s var(--ease-out); }
.blog-row:hover .blog-n { color: #0A0A0B; transform: translateX(4px); }
.blog-row h3 { font-size: 1.22rem; line-height: 1.2; letter-spacing: -.012em; color: #0A0A0B; transition: color .3s; }
.blog-title-btn { display: inline; width: auto; padding: 0; text-align: left; font: inherit; font-variation-settings: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.blog-title-btn:focus-visible { outline: 3px solid #FFFFFF; box-shadow: 0 0 0 5px #0A0A0B; }
.blog-row .excerpt { margin-top: 8px; font-size: .95rem; line-height: 1.55; color: #26272B; max-width: 62ch; transition: color .3s; }
.blog-cat { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: #26272B; align-self: start; padding-top: .35em; transition: color .3s; }
.blog-meta { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: #26272B; text-align: right; align-self: start; padding-top: .35em; font-variant-numeric: tabular-nums; transition: transform .3s var(--ease-out), opacity .3s, color .3s; }
.blog-row:hover .blog-meta, .blog-row.active .blog-meta { transform: translateX(-10px); opacity: 0; }
/* the chrome "Read →" pill parks fully off the right edge; it slides in on hover (styles.css) and stays while open */
.blog-row .read { right: 28px; transform: translate(calc(100% + 48px), -50%); }
.blog-row:hover .read, .blog-row.active .read { transform: translate(0, -50%); }
.read .arrow { display: inline-block; transition: transform .3s var(--ease-out); }
.blog-row.active .read .arrow { transform: rotate(-90deg); }
/* the open row is pressed: it turns to vault, the sheet below carries the article */
.blog-row.active { background: #0A0A0B; border-color: #0A0A0B; --lift: 0px; }
.blog-row.active::after { background: var(--chrome-edge); transform: scaleX(1); }
.blog-row.active .blog-n { color: #FFFFFF; transform: translateX(4px); }
.blog-row.active h3 { color: #FFFFFF; }
.blog-row.active .excerpt { color: #C9CCD2; }
.blog-row.active .blog-cat { color: #8E9199; }
.blog-row.active .blog-title-btn:focus-visible { outline-color: #0A0A0B; box-shadow: 0 0 0 5px #FFFFFF; }

/* ---- the article sheet (grid-rows collapse, same mechanism as the FAQ) ---- */
.blog-article-content { position: relative; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease-out); border-bottom: 1px solid #DDDFE3; }
.blog-article-content.expanded, html:not(.js) .blog-article-content { grid-template-rows: 1fr; }
.blog-article-content::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--chrome-edge); transform: scaleY(0); transform-origin: top; transition: transform .5s var(--ease-out) .1s; }
.blog-article-content.expanded::before, html:not(.js) .blog-article-content::before { transform: scaleY(1); }
.blog-article-inner { min-height: 0; overflow: hidden; }
.blog-article-inner > * { margin-left: clamp(28px, 8vw, 112px); margin-right: 28px; max-width: 68ch; }
.blog-article-inner > :first-child { padding-top: clamp(32px, 4vw, 48px); }
.blog-article-inner > :last-child { padding-bottom: clamp(36px, 5vw, 56px); }
.blog-article-inner h3, .blog-article-inner h4 { font-size: 1.15rem; margin-top: 30px; margin-bottom: 10px; color: #0A0A0B; }
.blog-article-inner > h3:first-child, .blog-article-inner > h4:first-child { margin-top: 0; }
.blog-article-inner p { font-size: 1rem; line-height: 1.7; color: #26272B; margin-bottom: 14px; }
.blog-article-inner ul, .blog-article-inner ol { margin-top: 4px; margin-bottom: 20px; padding-left: 22px; }
.blog-article-inner ul { list-style: disc; }
.blog-article-inner ol { list-style: decimal; }
.blog-article-inner li { margin-bottom: 8px; line-height: 1.6; color: #26272B; }
.blog-article-inner strong { color: #0A0A0B; }
/* featured post opens a white sheet under the vault card */
.blog-feat-item .blog-article-content { margin-top: -1px; background: #FFFFFF; border: 1px solid #DDDFE3; border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.blog-feat-item .blog-article-content::before { left: 0; border-radius: 0 0 0 var(--radius-lg); }
.blog-feat-item .blog-feat.active { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .blog-ledger-head, .blog-row { grid-template-columns: 56px minmax(0, 1fr) 150px 130px; gap: 16px; padding-left: 22px; padding-right: 22px; }
  .blog-row::after { left: 22px; right: 22px; }
  .blog-row .read { right: 22px; }
}
@media (max-width: 768px) {
  .blog-tools { flex-direction: column; align-items: flex-start; }
  .blog-feat { grid-template-columns: 1fr; gap: 0; }
  .feat-num { position: absolute; right: -.08em; top: -.1em; font-size: 8rem; opacity: .9; z-index: 0; }
  .blog-ledger-head { display: none; }
  .blog-card-item:first-of-type .blog-row { border-radius: var(--radius) var(--radius) 0 0; }
  .blog-row { grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; gap: 10px 14px; padding: 22px 18px 20px; }
  .blog-row::after { left: 18px; right: 18px; }
  .blog-n { grid-row: 1 / span 2; font-size: .95rem; }
  .blog-row h3 { font-size: 1.1rem; }
  .blog-row .excerpt { font-size: .92rem; }
  .blog-cat { grid-column: 2; grid-row: 2; padding-top: 4px; }
  .blog-meta { grid-column: 2; grid-row: 2; text-align: right; }
  /* no hover on touch: the pill lives in the flow, under the excerpt, always visible */
  .blog-row .read, .blog-row:hover .read, .blog-row.active .read { position: static; transform: none; grid-column: 2; grid-row: 3; justify-self: start; }
  .blog-row .blog-meta { transform: none; opacity: 1; }
  .blog-row:hover .blog-meta, .blog-row.active .blog-meta { transform: none; opacity: 1; }
  .blog-row:hover { --lift: 0px; }
  .blog-article-inner > * { margin-left: 18px; margin-right: 18px; }
  .blog-article-inner > :first-child { padding-top: 28px; }
  .blog-article-inner > :last-child { padding-bottom: 32px; }
}
@media (max-width: 420px) {
  .blog-feat { padding: 26px 20px 28px; }
  .blog-feat h2 { font-size: 1.7rem; }
  .blog-feat .eyebrow { font-size: .64rem; letter-spacing: .16em; }
  .blog-row { padding: 20px 16px 18px; grid-template-columns: 34px minmax(0, 1fr); }
  .blog-row::after { left: 16px; right: 16px; }
  .blog-cat, .blog-meta { font-size: .62rem; letter-spacing: .14em; }
  .blog-article-inner > * { margin-left: 16px; margin-right: 16px; }
}
/* no pointer hover (tablets in landscape): the pill is simply parked in view */
@media (hover: none) and (min-width: 769px) {
  .blog-row .read { transform: translate(0, -50%); }
  .blog-row .blog-meta { transform: translateX(-10px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 769px) {
  .blog-row .read { transform: translate(0, -50%); }
  .blog-row .blog-meta { transform: translateX(-10px); opacity: 0; }
}
