/* ==========================================================================
   blog.css — the blog list (blog.html) and every blog post (_layouts/post.html).
   Look: a calm reading page on the ivory background — no hero band, one photo, the words first.
   Colours/sizes come from variables.css only. Mobile-first; computers at the bottom.

   Section map:
     A  .blog, .blog-row        the list page
     B  .post__head, .post__photo   title block + the one photo of a post
     C  .prose                  the article text written in Markdown
     D  .post__related, .post__foot  related country / university links + review date
   ========================================================================== */

/* ================= A. LIST PAGE ================= */
.blog { padding: var(--sp-6) 0 var(--sp-7); }
.blog__wrap { max-width: 880px; }
.blog__head { padding-bottom: var(--sp-5); border-bottom: 1px solid var(--color-border); }
.blog__head h1 { font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -.035em; color: var(--color-primary-ink); }
.blog__head p { margin-top: var(--sp-3); max-width: 54ch; color: var(--color-text-muted); font-size: var(--fs-lead); }
.blog__empty { padding: var(--sp-6) 0; color: var(--color-text-muted); }
.blog__empty a { color: var(--color-primary); font-weight: 700; }
.blog__list > li { border-bottom: 1px solid var(--color-border); }
.blog__list > li[hidden] { display: none; }
.blog__more { display: flex; justify-content: center; padding-top: var(--sp-6); }
.blog__more[hidden] { display: none; }

/* One article row. Phones: words left, small photo right. */
.blog-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; grid-template-areas: "text img"; gap: var(--sp-4); align-items: start; padding: var(--sp-5) 0; color: var(--color-text); }
.blog-row__img { grid-area: img; --ratio: 1 / 1; border-radius: var(--radius-sm); }
/* No photo yet: just the brand gradient (the label is too small to read here) */
.blog-row__img.is-empty::after { content: none; }
.blog-row__img img { transition: transform .5s var(--ease); }
.blog-row__text { grid-area: text; display: grid; gap: var(--sp-2); min-width: 0; }
.blog-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; font-size: var(--fs-xs); font-weight: 600; color: var(--color-text-muted); }
.blog-row__cat { color: var(--color-primary); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: .68rem; }
.blog-row__title { font-size: 1.08rem; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; color: var(--color-primary-ink); text-wrap: balance; transition: color var(--speed) var(--ease); }
.blog-row__desc { font-size: var(--fs-sm); line-height: 1.55; color: var(--color-text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) {
  .blog-row:hover .blog-row__title { color: var(--color-blue); }
  .blog-row:hover .blog-row__img img { transform: scale(1.04); }
}

/* ================= B. POST: TITLE + PHOTO ================= */
.post { padding: var(--sp-5) 0 var(--sp-7); }
.post__wrap { max-width: 760px; }
.post__crumbs { display: flex; align-items: center; gap: .35rem; font-size: var(--fs-xs); font-weight: 700; color: var(--color-text-muted); }
.post__crumbs a { color: var(--color-primary); }
.post__crumbs .icon { width: 12px; height: 12px; opacity: .6; }
.post__head h1 { margin-top: var(--sp-3); font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.75rem); line-height: 1.15; letter-spacing: -.03em; color: var(--color-primary-ink); text-wrap: balance; }
.post__lead { margin-top: var(--sp-3); font-size: var(--fs-lead); line-height: 1.6; color: var(--color-text-muted); }
.post__meta { display: flex; align-items: center; gap: .5rem; margin-top: var(--sp-4); font-size: var(--fs-xs); font-weight: 600; color: var(--color-text-muted); }
.post__photo { margin-top: var(--sp-5); --ratio: 1200 / 630; border-radius: var(--radius-md); }

/* ================= C. ARTICLE TEXT (Markdown) =================
   Everything inside a post's text is styled here, so a post never needs its own CSS.
   Extras in Markdown (BLOG_GUIDE.md): a "> " quote followed by  {: .note}  or  {: .warn}  */
.prose { margin-top: var(--sp-6); font-size: var(--fs-lead); line-height: 1.8; color: var(--color-text); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { margin-top: 2em; font-size: clamp(1.3rem, 1.1rem + .9vw, 1.65rem); line-height: 1.25; letter-spacing: -.02em; color: var(--color-primary-ink); scroll-margin-top: calc(var(--header-h) + var(--sp-5)); }
.prose h3 { margin-top: 1.7em; font-size: 1.15rem; line-height: 1.3; color: var(--color-primary-ink); }
.prose h2 + *, .prose h3 + * { margin-top: .55em; }
.prose a { color: var(--color-primary); font-weight: 600; text-decoration: underline; text-decoration-color: var(--color-blue-pale); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: text-decoration-color var(--speed) var(--ease); }
.prose a:hover { text-decoration-color: var(--color-primary); }
.prose strong { font-weight: 700; color: var(--color-primary-ink); }
.prose ul, .prose ol { display: grid; gap: .45em; padding-left: 1.35em; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; left: -1.05em; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--color-primary); }
.prose ol { list-style: decimal; }
.prose ol > li::marker { font-weight: 800; color: var(--color-primary); }
.prose img { width: 100%; height: auto; border-radius: var(--radius-md); }
.prose hr { margin: 2.2em 0; border: 0; border-top: 1px solid var(--color-border); }
.prose blockquote { padding: var(--sp-4) var(--sp-5); border-left: 3px solid var(--color-primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--color-wash); color: var(--color-primary-ink); font-size: var(--fs-base); line-height: 1.65; }
.prose blockquote > * + * { margin-top: .6em; }
.prose blockquote.warn { border-left-color: var(--icon-orange-b); background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-border); }
/* Tables: scroll sideways on phones instead of squashing */
.prose table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.5; -webkit-overflow-scrolling: touch; }
.prose th, .prose td { padding: .65rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-border); }
.prose th { color: var(--color-primary-ink); font-weight: 800; border-bottom: 2px solid var(--color-primary); white-space: nowrap; }
.prose td { min-width: 8rem; }

/* ================= D. RELATED + FOOT ================= */
.post__related { display: grid; gap: var(--sp-2); margin-top: var(--sp-6); }
.post__related-title { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-muted); }
.post__related-link { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease); }
.post__related-link > span:nth-child(2) { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.post__related-link b { font-size: var(--fs-sm); font-weight: 800; color: var(--color-primary-ink); }
.post__related-link small { font-size: var(--fs-xs); color: var(--color-text-muted); }
.post__related-go { width: 18px; height: 18px; color: var(--color-primary); transition: transform var(--speed) var(--ease); }
@media (hover: hover) {
  .post__related-link:hover { border-color: var(--color-blue-pale); box-shadow: var(--shadow-sm); }
  .post__related-link:hover .post__related-go { transform: translateX(3px); }
}
.post__foot { display: grid; gap: var(--sp-3); margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--color-border); }
.post__foot p { font-size: var(--fs-xs); line-height: 1.6; color: var(--color-text-muted); }
.post__foot p a { color: var(--color-primary); font-weight: 700; }
.post__foot .btn--link { justify-self: start; }
.post__back { transform: scaleX(-1); }
.post__foot .btn--link:hover .post__back { transform: scaleX(-1) translateX(3px); }

/* ================= COMPUTERS ================= */
@media (min-width: 768px) {
  .blog { padding-top: var(--sp-7); }
  .blog-row { grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "img text"; gap: var(--sp-5); align-items: center; padding: var(--sp-5) 0; }
  .blog-row__img { --ratio: 1200 / 630; border-radius: var(--radius-md); }
  .blog-row__title { font-size: 1.3rem; }
  .post { padding-top: var(--sp-7); }
}
@media (min-width: 1024px) {
  .prose h2 { scroll-margin-top: calc(var(--announce-h) + var(--header-h-lg) + var(--sp-5)); }
}
@media (prefers-reduced-motion: reduce) {
  .blog-row__img img, .post__related-go { transition: none; }
}
