/* ==========================================================================
   BLOG: index, topic pages and posts. Loaded after site.css.
   Built from "Blog.dc.html" + "Blog Post.dc.html" (1200px design values).
   ========================================================================== */

/* ---------- Shared bits ---------- */
.blog-label { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--driftwood); }
.blog-chip {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1.5px solid currentColor; border-radius: 999px; padding: 5px 10px; color: var(--espresso); text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.blog-chip:hover, .blog-chip[aria-current="page"] { background: var(--espresso); border-color: var(--espresso); color: var(--cream); }
/* drafts only show in the dev preview */
.blog-draft { background: var(--terracotta); color: var(--cream); border-radius: 999px; padding: 3px 9px; font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- Index hero + sheet ---------- */
.blog-hero { padding: 0 var(--gutter) clamp(80px, 8vw, 110px); position: relative; }
.blog-hero > .nav { padding-left: 0; padding-right: 0; }
.blog-hero__head { max-width: 1072px; margin: 40px auto 0; padding-bottom: 50px; display: flex; justify-content: space-between; align-items: end; gap: 40px; flex-wrap: wrap; }
.blog-hero__script { font-size: clamp(32px, 3vw, 40px); color: var(--honey); }
.blog-hero h1 { font-size: clamp(48px, 5.8vw, 76px); line-height: 0.94; margin-top: 10px; color: var(--cream); max-width: 640px; text-wrap: balance; }
.blog-hero__lede { font-size: 15.5px; line-height: 1.7; color: var(--cream-body); max-width: 380px; }

.blog-sheet {
  max-width: 1072px; margin: 0 auto; position: relative; color: var(--espresso);
  border-radius: 22px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  padding: clamp(32px, 4vw, 56px) clamp(24px, 4vw, 60px);
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(36px, 5vw, 60px); align-items: start;
}
.blog-sheet .deco { pointer-events: none; }
.blog-sheet__flower { z-index: 0; }

/* ---------- Letter list ---------- */
.blog-list { display: grid; gap: 44px; position: relative; z-index: 1; }
.blog-card { border-top: 1.5px solid #C9C1AD; padding-top: 28px; }
.blog-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--driftwood); }
.blog-meta__topic { color: var(--olive); text-decoration: none; }
.blog-meta__topic:hover { color: var(--espresso); }
.blog-card__title { font-size: clamp(28px, 2.8vw, 38px); line-height: 1.02; margin-top: 12px; text-wrap: balance; }
.blog-card__title a { text-decoration: none; transition: color 0.2s; }
.blog-card__title a:hover { color: var(--olive); }
.blog-card__excerpt { font-size: 15.5px; line-height: 1.75; color: var(--bark); margin-top: 14px; }
.blog-more { display: inline-block; font-size: 13px; font-weight: 700; border-bottom: 2px solid var(--sunny); padding-bottom: 2px; margin-top: 16px; text-decoration: none; }
.blog-more:hover { color: var(--olive); }
.blog-empty { font-size: 15.5px; color: var(--bark); }
.blog-pager { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; }
.blog-pager__btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 26px; border: 1.5px solid var(--espresso); border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; transition: background 0.2s, color 0.2s; }
.blog-pager__btn:hover { background: var(--espresso); color: var(--cream); }

/* ---------- Sidebar ---------- */
.blog-aside { position: sticky; top: 30px; display: grid; gap: 26px; }
.blog-deeper { display: grid; gap: 12px; margin-top: 14px; }
.blog-deeper__card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-md); padding: 12px; display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; text-decoration: none; transition: transform 0.25s var(--ease-out), box-shadow 0.25s; }
.blog-deeper__card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.blog-deeper__card img { width: 56px; }
.blog-deeper__name { font-family: var(--font-display); font-size: 17px; line-height: 1.05; }
.blog-deeper__meta { margin-top: 4px; }
.blog-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- Newsletter signup ---------- */
.subscribe { background: var(--sunny); color: var(--espresso); border-radius: 18px; position: relative; }
.subscribe__form { display: grid; gap: 10px; margin-top: 12px; }
.subscribe__form input { width: 100%; background: #fff; border: 0; border-radius: 999px; padding: 11px 16px; font: inherit; font-size: 13px; color: var(--espresso); }
.subscribe__form input::placeholder { color: var(--driftwood); }
.subscribe__form .btn { height: 44px; padding: 0 20px; font-size: 13px; background: var(--espresso); color: var(--cream); }
.subscribe__form .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.subscribe .signup__status { color: var(--espresso); font-size: 13px; margin-top: 10px; min-height: 0; }
.subscribe .signup__status:empty { display: none; }

.subscribe--sidebar { padding: 24px; }
.subscribe--sidebar .subscribe__script { font-size: 26px; }

.subscribe--post { max-width: 680px; margin: 50px auto 0; padding: 40px 44px; transform: rotate(-0.8deg); box-shadow: 0 14px 34px rgba(80, 54, 34, 0.2); }
.subscribe--post .subscribe__script { font-size: 34px; }
.subscribe__title { font-size: 32px; line-height: 1.05; margin-top: 8px; }
.subscribe--post .subscribe__form { grid-template-columns: 1fr auto; margin-top: 20px; }
.subscribe--post .subscribe__form input { padding: 13px 18px; font-size: 14px; }
.subscribe--post .subscribe__form .btn { height: 48px; }
.subscribe__note { font-size: 12px; margin-top: 12px; color: var(--bark); }

/* ---------- Post ---------- */
.post-hero { padding: 0 0 clamp(70px, 7vw, 90px); position: relative; }
.post-hero__head { max-width: 820px; margin: 40px auto 0; padding: 0 var(--gutter); text-align: center; }
.post-hero__meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--honey); }
.post-hero__meta a { text-decoration: none; }
.post-hero__meta a:hover { color: var(--cream); }
.post-hero h1 { font-size: clamp(42px, 5vw, 72px); line-height: 0.98; margin-top: 22px; color: var(--cream); text-wrap: balance; }
.post-hero__dek { font-size: 17px; line-height: 1.65; color: var(--cream-body); max-width: 620px; margin: 22px auto 0; }
.post-hero__by { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 28px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--honey); }
.post-hero__by img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.post { padding: clamp(60px, 7vw, 80px) var(--gutter) clamp(90px, 9vw, 110px); position: relative; color: var(--espresso); }

/* the letter itself (markdown) */
.post-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 680px; margin: 0 auto; font-size: clamp(16px, 1.2vw, 17px); line-height: 1.8; }
.post-body > * { margin: 0; }
.post-body h2 { font-size: clamp(34px, 3.1vw, 42px); line-height: 1.05; margin-top: 22px; text-wrap: balance; }
.post-body h3 { font-size: clamp(27px, 2.4vw, 32px); line-height: 1.1; margin-top: 12px; text-wrap: balance; }
.post-body a { font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--sunny); }
.post-body a:hover { color: var(--olive); }
.post-body mark { background: var(--honey); color: inherit; padding: 0 4px; border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.post-body blockquote { font-family: var(--font-display); font-size: clamp(24px, 2.2vw, 30px); line-height: 1.2; border-left: 4px solid var(--sunny); padding-left: 22px; margin: 10px 0; }
.post-body blockquote p { margin: 0; }
.post-body aside { background: #fff; border-radius: 18px; box-shadow: var(--shadow-md); padding: 24px 28px; font-size: 15.5px; line-height: 1.7; }
.post-body ul, .post-body ol { padding-left: 2.4em; display: grid; gap: 10px; }
.post-body li { padding-left: 0.3em; }
.post-body li > ul, .post-body li > ol { margin-top: 8px; padding-left: 1.6em; }
.post-body li::marker { color: var(--olive); font-weight: 700; }
/* Kit images are transparent PNG collages: no white mount, they sit right on the paper. */
.post-body img { margin: 10px auto; }
.post-body figure { margin: 10px 0; }
/* Before/after pairs (two screenshots in one figure) sit side by side */
.post-body figure:has(> img + img) { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.post-body figure:has(> img + img) > img { flex: 1 1 0; min-width: 0; max-width: 260px; margin: 0; }
.post-body figure:has(> img + img) > figcaption { flex-basis: 100%; }
.post-body figure img { margin: 0 auto; }
.post-body figcaption { font-family: var(--font-script); font-size: 24px; line-height: 1.15; color: var(--bark); text-align: center; margin-top: 14px; text-wrap: balance; }
.post-body figcaption a { font-weight: inherit; }
.post-video { position: relative; aspect-ratio: 16 / 9; background: #fff; padding: 10px; box-shadow: var(--shadow-photo); margin: 10px 0; }
.post-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.post-body hr { border: 0; height: 1.5px; background: #C9C1AD; margin: 10px 0; }
.post-body code { font-size: 0.92em; background: var(--parchment); padding: 1px 5px; border-radius: 4px; }
.post-sig { font-family: var(--font-script); font-size: 44px; line-height: 1; color: var(--olive); margin-top: -10px; }

/* Video version at the top of a post: white polaroid mount, click to play */
.post-video { background: #fff; padding: 12px 12px 4px; box-shadow: var(--shadow-md); transform: rotate(-0.6deg); }
.post-video__frame, .post-video iframe { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border: 0; overflow: hidden; background: var(--espresso); }
.post-body .post-video__frame { border-bottom: 0; }
.post-video__frame img { width: 100%; height: 100%; object-fit: cover; margin: 0; transition: transform .4s ease; }
.post-video__frame:hover img { transform: scale(1.03); }
.post-video__frame .yt__play { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: 64px; height: 64px; }
.post-video figcaption { font-size: 22px; margin: 8px 0 4px; }

/* "Questions people ask": short FAQ after the sign-off */
.post-faq { max-width: 680px; margin: 56px auto 0; display: grid; gap: 12px; }
.post-faq h2 { font-size: clamp(32px, 2.9vw, 40px); line-height: 1.05; margin: 0 0 6px; }
.post-faq details { background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm); padding: 0 24px; }
.post-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-family: var(--font-display); font-size: clamp(19px, 1.6vw, 22px); line-height: 1.2; color: var(--espresso); }
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after { content: "+"; font-family: var(--font-body, inherit); font-size: 22px; color: var(--olive); flex: none; transition: transform .2s ease; }
.post-faq details[open] summary::after { transform: rotate(45deg); }
.post-faq details p { margin: 0; padding: 0 0 20px; font-size: 15.5px; line-height: 1.7; color: var(--bark); }

.post-tags { max-width: 680px; margin: 40px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.post-tags .blog-label { margin-right: 4px; }

.post-pager { max-width: 680px; margin: 50px auto 0; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.post-pager a { text-decoration: none; max-width: 300px; }
.post-pager__next { text-align: right; margin-left: auto; }
.post-pager__title { font-family: var(--font-display); font-size: 22px; line-height: 1.1; margin-top: 6px; transition: color 0.2s; }
.post-pager a:hover .post-pager__title { color: var(--olive); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .blog-sheet { grid-template-columns: 1fr; }
  .blog-aside { position: static; }
}
@media (max-width: 560px) {
  .blog-hero__head { margin-top: 20px; padding-bottom: 36px; }
  .blog-sheet { border-radius: 16px; }
  .subscribe--post { padding: 30px 24px; }
  .subscribe--post .subscribe__form { grid-template-columns: 1fr; }
  .subscribe__title { font-size: 26px; }
  .post-pager__next { text-align: left; margin-left: 0; }
}

/* ---------- Pattern interrupts inside posts (markup in src/content/blog/_README.md) ---------- */

/* Math card: a worked calculation, one step per row */
.math-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-md); padding: 26px 28px 22px; font-size: 15.5px; line-height: 1.55; }
.math-card__title { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--olive); margin: 0 0 14px; }
.math-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1.5px dotted var(--border); }
.math-row > span { flex: 1; color: var(--bark); }
.math-row > b { font-weight: 700; color: var(--espresso); text-align: right; white-space: nowrap; }
.math-row--total { border-bottom: 0; margin-top: 6px; padding: 12px 14px; background: var(--honey); border-radius: 10px; }
.math-row--total > span { color: var(--espresso); font-weight: 700; }
.math-row > b { max-width: 60%; }
.math-row--total > b { white-space: normal; text-wrap: balance; }
.math-card__note { margin: 14px 0 0; font-size: 14px; color: var(--driftwood); }

/* Testimonial card: a student's own words, yellow initial (or photo) avatar */
.quote-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-md); padding: 34px 26px 20px; margin: 10px 0; position: relative; transform: rotate(-0.5deg); }
.quote-card:nth-of-type(even) { transform: rotate(0.5deg); }
.quote-card::before { content: "\201C"; position: absolute; top: -2px; left: 22px; font-family: var(--font-display); font-size: 72px; line-height: 1; color: var(--sunny); }
.post-body .quote-card blockquote { border: 0; padding: 0; margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.65; color: var(--espresso); }
.post-body .quote-card figcaption { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; text-align: left; font-family: var(--font-body); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--driftwood); }
.post-body .quote-card figcaption b { color: var(--espresso); }
.post-body .quote-card figcaption img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; margin: 0; flex: none; }
.quote-card__initial { width: 44px; height: 44px; border-radius: 50%; background: var(--sunny); color: var(--espresso); display: grid; place-items: center; font-family: var(--font-display); font-size: 22px; letter-spacing: 0; text-transform: none; flex: none; }

/* Polaroid: white mount, square corners, script caption (photos, book covers) */
.post-body .polaroid { background: #fff; padding: 12px 12px 6px; box-shadow: var(--shadow-photo); width: fit-content; max-width: min(100%, 340px); margin: 14px auto; transform: rotate(-1.5deg); }
.post-body .polaroid:nth-of-type(even) { transform: rotate(1.5deg); }
.post-body .polaroid img { margin: 0; }
.post-body .polaroid:not(:has(> figcaption)) { padding-bottom: 16px; }
.post-body .polaroid figcaption { font-size: 21px; margin: 8px 0 2px; }
.post-body .polaroid-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 22px; margin: 10px 0; }
.post-body .polaroid-row .polaroid { margin: 0; max-width: 200px; flex: 0 1 180px; }

/* Screenshot: rounded, drop shadow, sits on the paper */
.post-body .shot { margin: 10px auto; max-width: 100%; }
.post-body .shot img { border-radius: 12px; box-shadow: var(--shadow-photo); }
.post-body .shot--narrow { max-width: 420px; }

/* Bar chart: horizontal bars, label · bar · value */
.chart { background: #fff; border-radius: 18px; box-shadow: var(--shadow-md); padding: 24px 26px 18px; }
.chart__title { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--olive); margin: 0 0 16px; }
.chart__bar { display: grid; grid-template-columns: minmax(70px, 28%) 1fr 5.5em; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; }
.chart__label { color: var(--bark); }
.chart__track { height: 20px; background: var(--parchment); border-radius: 6px; overflow: hidden; }
.chart__track i { display: block; height: 100%; width: var(--v); background: var(--sunny); border-radius: 6px; }
.chart__bar--muted .chart__track i { background: var(--sand); }
.chart__value { font-weight: 700; color: var(--espresso); white-space: nowrap; text-align: right; }
.post-body .chart figcaption { font-family: var(--font-body); font-size: 13px; color: var(--driftwood); text-align: left; margin: 12px 0 0; }
@media (max-width: 560px) {
  .math-card, .chart, .quote-card { padding-left: 20px; padding-right: 20px; }
  .chart__bar { grid-template-columns: 1fr auto; }
  .chart__track { grid-column: 1 / -1; grid-row: 2; }
}

/* Product card: a mid-post plug with its own pitch and button (olive paper, cream type, sunny button) */
.product-card { display: grid; grid-template-columns: 150px 1fr; gap: 26px; align-items: center; margin: 14px 0; padding: 26px 28px; border-radius: 20px; box-shadow: var(--shadow-lg); background: var(--moss) url("/assets/textures/paper-olive.jpg") center / 1200px repeat; background-blend-mode: multiply; color: var(--cream-body); }
.post-body .product-card__img { margin: 0; width: 150px; height: auto; background: #fff; padding: 8px; box-shadow: var(--shadow-photo); transform: rotate(-3deg); }
.product-card__kicker { font-family: var(--font-script); font-size: 24px; line-height: 1.1; color: var(--honey); margin: 0 0 4px; }
.product-card__name { font-family: var(--font-display); font-size: clamp(26px, 2.4vw, 32px); line-height: 1.05; color: var(--cream); margin: 0 0 8px; }
.product-card__copy { font-size: 14.5px; line-height: 1.65; margin: 0 0 16px; }
.post-body .product-card a.btn { border-bottom: 0; padding: 13px 24px; font-size: 14px; }
.post-body .product-card a.btn:hover { color: var(--espresso); }
@media (max-width: 560px) {
  .product-card { grid-template-columns: 1fr; padding: 24px 22px; text-align: center; }
  .post-body .product-card__img { width: 130px; margin: 0 auto; }
}
