/* =========================================================
   UGC Beast blog: list page, post page, related posts
   Uses the tokens from styles.css (--blue, --ink, --sky ...)
   ========================================================= */

.blog-main { padding-bottom: 72px; }

/* Breadcrumbs */
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.92rem; font-weight: 600; color: var(--grey-text); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--grey-text); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); overflow-wrap: anywhere; }

/* ---------- /blog ---------- */
.blog-hero { padding-block: 40px 28px; background: var(--sky); }
.blog-hero h1 { margin-top: 18px; font-size: clamp(2.4rem, 4vw + 1rem, 3.8rem); }
.blog-hero p { margin-top: 14px; max-width: 640px; font-size: 1.12rem; color: var(--text-2); }
.post-list { padding-top: 40px; }
.post-empty { color: var(--text-2); }

.post-grid { display: grid; gap: 22px; }
@media (min-width: 700px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card { border-radius: var(--radius); background: var(--white); border: 2px solid var(--line); overflow: hidden; transition: border-color .15s ease, transform .15s ease; }
.post-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.post-card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.post-card-link:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.post-card img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--sky); }
.post-card-body { padding: 18px 20px 22px; }
.post-card-title { font-size: 1.3rem; letter-spacing: -0.02em; line-height: 1.25; color: var(--ink); }
.post-card-meta { margin-top: 8px; font-size: 0.9rem; font-weight: 600; color: var(--grey-text); }
.post-card-desc { margin-top: 8px; font-size: 1rem; line-height: 1.5; color: var(--text-2); }

/* ---------- /blog/<slug> ---------- */
.post-wrap { max-width: 800px; padding-top: 28px; }
.post-header { margin-top: 18px; }
.post-header h1 { font-size: clamp(2.1rem, 3.4vw + 1rem, 3.3rem); line-height: 1.08; }
.post-desc { margin-top: 16px; font-size: 1.2rem; line-height: 1.55; color: var(--text-2); }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; font-size: 0.95rem; font-weight: 700; color: var(--grey-text); }
.post-cover { margin: 28px 0 0; }
.post-cover img { width: 100%; border-radius: var(--radius); background: var(--sky); }

/* Reading layout */
.post-body { margin-top: 36px; font-size: 1.125rem; line-height: 1.75; color: #1D2A4A; }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 { margin-top: 2em; font-size: clamp(1.6rem, 1.4vw + 1.1rem, 2.05rem); line-height: 1.18; letter-spacing: -0.03em; scroll-margin-top: 90px; }
.post-body h3 { margin-top: 1.6em; font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.02em; scroll-margin-top: 90px; }
.post-body h2 + *, .post-body h3 + * { margin-top: 0.6em; }
.post-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.post-body strong { color: var(--ink); font-weight: 800; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li + li { margin-top: 0.4em; }
.post-body li::marker { color: var(--blue); font-weight: 800; }
.post-body img { width: 100%; height: auto; border-radius: 14px; }
.post-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--blue); color: var(--ink); font-weight: 600; }
.post-body hr { border: 0; border-top: 2px solid var(--line); margin: 2.2em 0; }
.post-body code { padding: 2px 6px; border-radius: 6px; background: var(--sky); font-size: 0.92em; }

.post-body .table-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 14px; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.45; }
@media (max-width: 480px) { .post-body table { font-size: 0.95rem; } .post-body th, .post-body td { padding: 10px 10px; } }
.post-body th, .post-body td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.post-body thead th { background: var(--sky); color: var(--ink); font-weight: 800; }
.post-body tbody tr:last-child td { border-bottom: 0; }
.post-body td { font-variant-numeric: tabular-nums; }

/* Buttons inside a post body (same style as the header button) */
.post-body a.btn { color: var(--white); text-decoration: none; font-weight: 800; }
.post-body .post-inline-cta { margin: 2.2em 0; padding: 24px 22px; border-radius: var(--radius); background: var(--sky); text-align: center; }
.post-body .post-inline-cta p { margin: 0; color: var(--ink); font-weight: 700; line-height: 1.5; }
.post-body .post-inline-cta p + p { margin-top: 16px; }
.post-body .post-end-cta { margin-top: 1.4em; }

/* Call to action at the end of every post */
.post-cta { margin-top: 56px; padding: 32px 24px; border-radius: var(--radius); background: var(--blue); color: var(--white); text-align: center; }
.post-cta h2 { color: var(--white); font-size: clamp(1.7rem, 2vw + 1rem, 2.3rem); }
.post-cta p { margin: 12px auto 22px; max-width: 520px; font-size: 1.08rem; color: var(--white); }
@media (min-width: 640px) { .post-cta { padding: 44px; } }

/* Related posts */
.related { margin-top: 64px; padding-block: 56px 8px; background: var(--sky); }
.related h2 { margin-bottom: 24px; font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem); }
.related .post-card { border-color: var(--white); }

/* Long post titles in the breadcrumb stay on one line on phones */
@media (max-width: 640px) {
  .crumbs ol { flex-wrap: nowrap; }
  .crumbs li { flex-shrink: 0; }
  .crumbs li[aria-current] { flex-shrink: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

/* "Written by" box under each post, links to the About page */
.post-author { margin-top: 40px; padding: 18px 20px; border-radius: var(--radius); background: #EAF0FF; }
.post-author p { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--ink); }
.post-author a { font-weight: 700; }
