/* ============================================================
   College Resume — blog.css
   Standalone stylesheet for server-rendered blog + 404 pages.
   Mirrors the site design system (Inter/Poppins, navy/teal,
   soft cards) without pulling in the app CSS.
   ============================================================ */
:root {
  --ink: #16243a;
  --ink-soft: #3c4856;
  --muted: #6b7480;
  --line: #e9edf1;
  --line-soft: #f1f4f6;
  --bg: #ffffff;
  --surface: #f5f8f9;
  --navy: #16243a;
  --teal: #15808b;
  --teal-dark: #116a73;
  --teal-soft: #e6f3f4;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 34px rgba(16,24,40,.07);
  --shadow-lg: 0 8px 40px rgba(16,24,40,.10);
  --radius: 14px;
  --r-lg: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: "Poppins", "Inter", sans-serif; color: var(--ink); letter-spacing: -.01em; line-height: 1.25; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
img { max-width: 100%; height: auto; }
.container { width: min(1140px, 92vw); margin-inline: auto; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 0;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; color: #fff; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px;
}

/* ---------- Header (matches site chrome) ---------- */
.site-header { background: rgba(255,255,255,.85); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 32px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .96rem; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.nav-current { color: var(--ink); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 28px 0; margin-top: 70px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .84rem; color: var(--muted); flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; margin-left: 16px; }
.footer-links a:hover { color: var(--ink); }

/* ---------- Blog landing ---------- */
.blog-main { padding: 48px 0 30px; }
.blog-hero { text-align: center; max-width: 720px; margin: 0 auto 46px; }
.blog-hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 800; margin: 0 0 12px; }
.blog-hero-sub { color: var(--muted); font-size: 1.08rem; margin: 0 auto; max-width: 36em; }
.cat-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }
.cat-link {
  display: inline-block; background: var(--teal-soft); color: var(--teal-dark);
  font-weight: 600; font-size: .88rem; padding: 8px 18px; border-radius: 999px; text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.cat-link:hover { background: var(--teal); color: #fff; }

.section-label { font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 44px 0 16px; font-family: "Inter", sans-serif; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.post-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-card-link { display: flex; flex-direction: column; height: 100%; padding: 26px; text-decoration: none; color: inherit; border-radius: var(--r-lg); }
.post-card-title { font-size: 1.18rem; font-weight: 700; margin: 12px 0 8px; }
.post-card-excerpt { color: var(--ink-soft); font-size: .95rem; line-height: 1.6; margin: 0 0 16px; flex: 1; }
.post-card.featured { border-color: var(--teal); box-shadow: 0 14px 44px rgba(21,128,139,.14); }
.post-card.featured .post-card-title { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.featured-wrap { margin-bottom: 8px; }

.chip {
  display: inline-block; align-self: flex-start; background: var(--teal-soft); color: var(--teal-dark);
  font-weight: 700; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px; text-decoration: none;
}
.chip-featured { background: var(--navy); color: #fff; margin-right: 6px; }
a.chip:hover { background: var(--teal); color: #fff; }

.post-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); }

.blog-empty { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 70px 24px; max-width: 720px; margin: 0 auto; }
.blog-empty h2 { margin: 0 0 10px; font-size: 1.5rem; }
.blog-empty p { color: var(--muted); max-width: 34em; margin: 0 auto 24px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); color: #fff; font-family: "Poppins", "Inter", sans-serif; font-weight: 600;
  font-size: .98rem; padding: 13px 28px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 8px 20px rgba(21,128,139,.22); transition: background .15s ease;
}
.btn-primary:hover { background: var(--teal-dark); color: #fff; }

.back-link { margin: 40px 0 0; }
.back-link a { text-decoration: none; font-weight: 600; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .84rem; color: var(--muted); margin: 0 0 26px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "\203A"; margin: 0 8px 0 4px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--teal-dark); text-decoration: underline; }
.breadcrumbs li[aria-current] { color: var(--ink-soft); font-weight: 600; }

/* ---------- Article ---------- */
.article-main { padding: 44px 0 30px; }
.article-wrap { width: min(720px, 92vw); margin-inline: auto; }
.article-header h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; margin: 14px 0 16px; }
.byline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.byline a { color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.byline a:hover { color: var(--teal-dark); text-decoration: underline; }
.byline-updated { color: var(--teal-dark); font-weight: 600; }

.cover { margin: 0 0 28px; }
.cover img { border-radius: var(--radius); width: 100%; }
.cover figcaption { font-size: .82rem; color: var(--muted); margin-top: 8px; text-align: center; }

/* Table of contents */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 0 0 32px; }
.toc-title { font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-family: "Inter", sans-serif; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 6px 0; }
.toc a { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .94rem; }
.toc a:hover { color: var(--teal-dark); text-decoration: underline; }

/* Article body typography */
.post-body { font-size: 1.04rem; line-height: 1.75; }
.post-body h2 { font-size: 1.45rem; font-weight: 700; margin: 44px 0 14px; scroll-margin-top: 90px; }
.post-body h3 { font-size: 1.14rem; font-weight: 700; margin: 30px 0 10px; scroll-margin-top: 90px; }
.post-body p { margin: 0 0 18px; }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-left: 26px; }
.post-body li { margin: 7px 0; }
.post-body li::marker { color: var(--teal); }
.post-body a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: var(--teal-dark); }
.post-body strong { color: var(--ink); }
.post-body blockquote {
  margin: 26px 0; padding: 4px 22px; border-left: 4px solid var(--teal);
  background: var(--teal-soft); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink); font-weight: 500;
}
.post-body table {
  width: 100%; border-collapse: collapse; margin: 26px 0; font-size: .94rem;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.post-body th, .post-body td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; vertical-align: top; }
.post-body th { background: var(--navy); color: #fff; font-family: "Poppins", "Inter", sans-serif; font-weight: 600; font-size: .88rem; }
.post-body tbody tr:nth-child(even) { background: var(--surface); }
.post-body figure { margin: 26px 0; }
.post-body img { border-radius: var(--radius); }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

/* Sources */
.sources { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); }
.sources h2 { font-size: 1.05rem; margin: 0 0 12px; }
.sources ul { margin: 0; padding-left: 22px; font-size: .92rem; color: var(--muted); }
.sources li { margin: 6px 0; }

/* CTA box */
.cta-box {
  background: var(--navy); color: #fff; border-radius: var(--r-lg);
  padding: 34px 32px; margin: 48px 0 8px; text-align: center; box-shadow: var(--shadow-lg);
}
.cta-box h2 { color: #fff; font-size: 1.35rem; margin: 0 0 10px; }
.cta-box p { color: rgba(255,255,255,.82); margin: 0 auto 22px; max-width: 34em; }
.cta-box .btn-primary { box-shadow: 0 8px 24px rgba(0,0,0,.28); }

/* Related */
.related { margin-top: 56px; }

/* ---------- 404 page ---------- */
.nf-main { min-height: calc(100svh - 240px); display: flex; align-items: center; }
.nf-card { text-align: center; max-width: 620px; margin: 0 auto; padding: 60px 24px; }
.nf-code { font-family: "Poppins", "Inter", sans-serif; font-weight: 800; font-size: clamp(3.4rem, 10vw, 5.5rem); color: var(--teal-soft); -webkit-text-stroke: 2px var(--teal); line-height: 1; margin: 0 0 8px; }
.nf-card h1 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); margin: 0 0 12px; }
.nf-card p { color: var(--muted); margin: 0 0 28px; }
.nf-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  font-family: "Poppins", "Inter", sans-serif; font-weight: 600; font-size: .98rem;
  padding: 11.5px 26px; border-radius: 999px; text-decoration: none; transition: border-color .15s ease, color .15s ease;
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .site-nav { gap: 16px; }
  .site-nav a { display: none; }
  .site-nav a.nav-current, .site-nav a[href="/courses"] { display: inline; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .brand-logo { height: 28px; }
  .blog-main, .article-main { padding-top: 30px; }
  .post-card-link { padding: 20px; }
  .post-body { font-size: 1rem; }
  .post-body th, .post-body td { padding: 8px 10px; }
  .cta-box { padding: 26px 20px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links a { margin: 0 8px; }
}

/* ---------- Print ---------- */
@media print {
  body { font-size: 12pt; color: #000; background: #fff; }
  .site-header, .site-footer, .skip-link, .cta-box, .related, .cat-nav, .breadcrumbs, .nf-links { display: none !important; }
  .article-wrap { width: 100%; }
  a { color: #000; text-decoration: none; }
  .post-body a::after { content: " (" attr(href) ")"; font-size: .85em; color: #444; }
  .post-body th { background: #fff; color: #000; border: 1px solid #000; }
  .post-body td { border: 1px solid #000; }
  .post-body blockquote { background: #fff; border-left: 3px solid #000; color: #000; }
}
