/* matthensley.io: what the proto[typd] kit and site.css don't cover. Loaded after site.css, before square.css.
   Blog index, 404 and article rules are carried over from prototypd.dev's scoped Astro <style> blocks
   (blog/index.astro, layouts/Post.astro, 404.astro); the :global() wrappers become plain descendant selectors. */

/* the wordmark: the bracket pattern of site.css (.pname .br) set in the display face, standing in for the logo image */
.wordmark { font: var(--display-weight) 1.5rem/1 var(--font-display); letter-spacing: var(--display-tracking); white-space: nowrap; }
.nav__logo { color: var(--ink); }

/* blog index (blog/index.astro) */
.blog { padding: calc(var(--nav) + clamp(3rem, 7vw, 6rem)) 0 clamp(4rem, 8vw, 7rem); }
.blog__intro { display: grid; gap: var(--s-4); max-width: 44rem; margin-bottom: var(--s-6); }
.blog__intro p { color: var(--muted); font-size: var(--t-lead); line-height: 1.5; }
.blog__meta { display: grid; gap: var(--s-2); margin-top: var(--s-4); }
.blog__title { font: var(--display-weight) 1.5rem/1.2 var(--font-display); letter-spacing: var(--display-tracking); }
.blog__desc { color: var(--muted); line-height: 1.5; }
/* feature images are any shape; the source's share images are all 1200x630 */
.blog__sheet img { aspect-ratio: 1200 / 630; object-fit: cover; }
.blog__pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-7); }

/* 404 (404.astro) */
.nf { min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav) + 3rem) 0 4rem; }
.nf__sheet { max-width: 36rem; margin-inline: auto; padding: clamp(28px, 5vw, 56px); display: grid; gap: var(--s-4); }
.nf__sheet h1 { font-size: clamp(2.25rem, 1.4rem + 3vw, 3.5rem); line-height: 1.04; letter-spacing: -0.025em; }
.nf__text { color: var(--muted); font-size: var(--t-lead); line-height: 1.5; }
.nf__links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-6); margin-top: var(--s-4); }

/* article (Post.astro): a light paper sheet on the ink page. The contents column is left out, so the sheet takes the full width. */
.post { --sheet-pad: clamp(28px, 5vw, 64px); padding: calc(var(--nav) + clamp(2.5rem, 6vw, 5rem)) 0 clamp(4rem, 8vw, 7rem); }
.post__grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.post__sheet { min-width: 0; padding: var(--sheet-pad); display: grid; gap: var(--s-7); }
.post__head { display: grid; gap: var(--s-4); }
.post__head h1 { max-width: 20ch; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.25rem); line-height: 1.06; letter-spacing: -0.025em; }
.post__lead { font-size: var(--t-lead); line-height: 1.45; color: var(--muted); max-width: 48ch; }
.post__meta { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; gap: var(--s-4) var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line-strong); font-size: var(--t-small); }
.post__meta dt { color: var(--muted); font-size: var(--t-label); margin-bottom: 0.2rem; }
.post__meta dd { margin: 0; }
.post__meta a { color: var(--ink); text-decoration: underline 1px; text-underline-offset: 0.2em; }
.post__feature { margin: 0; }
.post__feature img { display: block; width: 100%; height: auto; border-radius: var(--r-md); }
.post__feature figcaption { margin-top: 0.8em; font-size: var(--t-small); line-height: 1.5; color: var(--muted); }

/* article typography */
.post__body { min-width: 0; font-family: var(--font-text); font-size: 1.125rem; line-height: 1.6; color: var(--ink); }
.post__body > * { max-width: 68ch; }
.post__body > * + * { margin-top: 1.1em; }
.post__body h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); letter-spacing: -0.025em; line-height: 1.1; margin-top: 2.4em; scroll-margin-top: calc(var(--nav) + 1.5rem); }
.post__body h2:first-child { margin-top: 0; }
.post__body h3, .post__body h4 { font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; letter-spacing: -0.01em; line-height: 1.25; margin-top: 2em; scroll-margin-top: calc(var(--nav) + 1.5rem); }
.post__body h2 + p, .post__body h3 + *, .post__body h4 + * { margin-top: 0.9em; }
.post__body a { color: var(--ink); text-decoration: underline 1px; text-underline-offset: 0.2em; padding-block: 0.2em; }
.post__body ol, .post__body ul { padding-left: 1.3em; display: grid; gap: 0.6em; list-style: revert; }
.post__body strong { font-weight: 600; }
.post__body blockquote { margin-inline: 0; padding: 0.2em 0 0.2em 1.25em; border-left: 2px solid var(--ink); font-family: var(--font-display); font-size: 1.3rem; line-height: 1.35; }
.post__body figure { margin-inline: 0; }
.post__body img { max-width: 100%; height: auto; }
.post__body figcaption { margin-top: 0.8em; font-size: var(--t-small); line-height: 1.5; color: var(--muted); text-align: left; }
.post__body code { font-family: var(--font-mono); font-size: 0.88em; letter-spacing: 0; }
.post__body pre { font-family: var(--font-mono); font-size: var(--t-small); line-height: 1.6; padding: var(--s-4); background: var(--surface); border-radius: var(--r-md); overflow-x: auto; }
.post__body pre code { font-size: inherit; background: none; padding: 0; }
.post__body hr { border: 0; border-top: 1px solid var(--line-strong); }
.post__body table { width: 100%; border-collapse: collapse; font-size: var(--t-small); line-height: 1.5; }
.post__body th { text-align: left; font-weight: 600; font-size: var(--t-label); padding: 0 0.9rem 0.7rem 0; border-bottom: 1px solid var(--line-strong); vertical-align: bottom; }
.post__body td { padding: 0.8rem 0.9rem 0.8rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }

/* Koenig cards: wide fills the sheet's content box, full runs edge to edge across the sheet's padding */
.post__body > .kg-width-wide { max-width: none; }
.post__body > .kg-width-full { max-width: none; margin-inline: calc(-1 * var(--sheet-pad)); }
.post__body .kg-width-full img { width: 100%; border-radius: 0; }
.post__body .kg-image-card img, .post__body .kg-gallery-image img { display: block; }
.post__body .kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; }
.post__body .kg-gallery-row { display: flex; gap: 0.75rem; }
.post__body .kg-gallery-image { flex: 1 1 0; min-width: 0; }
.post__body .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.post__body .kg-bookmark-card { margin: 0; }
.post__body .kg-bookmark-container { display: flex; min-height: 8rem; color: var(--ink); text-decoration: none; border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; }
.post__body .kg-bookmark-content { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; padding: var(--s-4); gap: 0.4em; }
.post__body .kg-bookmark-title { font-family: var(--font-display); font-weight: 500; font-size: 1.1rem; line-height: 1.3; }
.post__body .kg-bookmark-description { color: var(--muted); font-size: var(--t-small); line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post__body .kg-bookmark-metadata { display: flex; align-items: center; gap: 0.5em; margin-top: auto; color: var(--muted); font-size: var(--t-label); }
.post__body .kg-bookmark-icon { width: 1.25rem; height: 1.25rem; }
.post__body .kg-bookmark-thumbnail { position: relative; flex: 0 0 33%; }
.post__body .kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.post__body .kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.post__body .kg-embed-card iframe { max-width: 100%; }
.post__body .kg-card { max-width: 100%; }

@media (max-width: 767px) {
  .post__meta { grid-template-columns: 1fr 1fr; }
  .post__body { font-size: 1.0625rem; }
  .post__body .kg-gallery-row { flex-direction: column; }
  .post__body .kg-bookmark-container { flex-direction: column-reverse; }
  .post__body .kg-bookmark-thumbnail { flex: 0 0 auto; aspect-ratio: 1200 / 630; }
}
@media (max-width: 639px) { .post { --sheet-pad: var(--s-5); } }

/* Ghost admin font picker (Design > Typography); falls back to the kit faces */
html:root { --font-display: var(--gh-font-heading, "Jost", "Segoe UI", Arial, sans-serif); --font-text: var(--gh-font-body, "Segoe UI", Arial, sans-serif); }
