/* =========================================================
   Blog styles. Shared tokens and components are in site.css.
   Sections: page header, filters, post cards, featured, pager, article, author, search, empty state
   ========================================================= */

/* ---- Search + topic filters ---- */
.blog-tools { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.topic-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.topic { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 500; font-size: .9rem; text-decoration: none; transition: background-color .25s, color .25s, border-color .25s, transform .2s var(--ease); }
.topic:hover { border-color: var(--navy); transform: translateY(-2px); }
.topic.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.topic small { opacity: .7; font-size: .78rem; }
.search-form { display: flex; gap: 8px; width: min(100%, 360px); }
.search-form input { flex: 1; min-width: 0; padding: 10px 16px; font-size: .95rem; color: var(--text); background: #fff; border: 2px solid var(--line); border-radius: var(--radius-pill); outline: 0; transition: border-color .25s, box-shadow .25s; }
.search-form input:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .3); }
.search-form button { padding: 10px 18px; border: 0; border-radius: var(--radius-pill); background: var(--navy); color: #fff; font-weight: 600; cursor: pointer; transition: background-color .25s; }
.search-form button:hover { background: var(--navy-dark); }
.search-form--hero { width: min(100%, 520px); margin-top: 24px; }

/* ---- Post cards ---- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.post-card-media { display: block; aspect-ratio: 16 / 10; background: #e9eff3; overflow: hidden; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.post-card:hover .post-card-media img { transform: scale(1.05); }
.post-card-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-size: 2.2rem; color: var(--navy); opacity: .35; background: linear-gradient(135deg, var(--accent-tint), #e9eff3); }
.post-card-body { display: flex; flex-direction: column; gap: 10px; padding: 22px; flex: 1; }
.post-tag { align-self: flex-start; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-tint); padding: 3px 12px; border-radius: var(--radius-pill); text-decoration: none; }
.post-tag:hover { background: var(--accent); color: var(--navy-dark); }
.post-card-title { font-size: 1.15rem; line-height: 1.35; font-weight: 600; }
.post-card-title a { color: var(--navy-dark); text-decoration: none; }
.post-card-title a:hover { color: var(--accent-ink); }
.post-card-excerpt { color: var(--muted); font-size: .93rem; }
.post-meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); }

/* ---- Featured post ---- */
.featured { display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 40px; }
.featured-media { min-height: 280px; background: #e9eff3; }
.featured-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-body { padding: 36px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.featured-body h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.25; font-weight: 700; }
.featured-body h2 a { color: var(--navy-dark); text-decoration: none; }
.featured-body h2 a:hover { color: var(--accent-ink); }
.featured-body p { color: var(--muted); }

/* ---- Pager ---- */
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 44px; }
.pager-link { min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 600; text-decoration: none; transition: background-color .25s, color .25s, border-color .25s; }
a.pager-link:hover { border-color: var(--navy); }
.pager-link.is-current { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---- Article ---- */
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin-top: 22px; color: rgba(255, 255, 255, .85); font-size: .92rem; }
.article-author { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.article-author:hover strong { color: var(--accent-soft); }
.article-author strong { display: block; line-height: 1.3; transition: color .2s; }
.article-author small { color: rgba(255, 255, 255, .7); }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: var(--accent-tint); display: inline-grid; place-items: center; color: var(--navy); font-weight: 700; }
.avatar--lg { width: 120px; height: 120px; font-size: 2.4rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.article-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 32px; box-shadow: var(--shadow); display: block; }
.prose { font-size: 1.06rem; line-height: 1.8; color: #2d3740; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.7rem; line-height: 1.3; font-weight: 700; color: var(--navy-dark); margin: 2.2em 0 .6em; }
.prose h3 { font-size: 1.3rem; line-height: 1.35; font-weight: 600; color: var(--navy-dark); margin: 1.8em 0 .5em; }
.prose h4 { font-size: 1.1rem; font-weight: 600; color: var(--navy-dark); margin: 1.5em 0 .4em; }
.prose p { margin: 0 0 1.2em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.5em; }
.prose li { margin-bottom: .4em; }
.prose a { color: var(--accent-ink); text-underline-offset: 3px; }
.prose a:hover { color: var(--navy); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1em 0; }
.prose blockquote { margin: 1.6em 0; padding: 14px 22px; border-left: 4px solid var(--accent); background: var(--light); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--navy-dark); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose pre { background: var(--navy-dark); color: #e6edf3; padding: 18px; border-radius: var(--radius-sm); overflow-x: auto; font-size: .9rem; line-height: 1.6; }
.prose code { background: #eef2f5; padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.prose th { background: var(--light); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 36px 0; padding: 18px 0; border-block: 1px solid var(--line); font-weight: 600; color: var(--navy-dark); }
.share a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-pill); background: var(--navy); color: #fff; font-size: .9rem; text-decoration: none; transition: background-color .25s; }
.share a:hover { background: var(--navy-dark); }
.author-box { display: flex; gap: 20px; align-items: flex-start; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--light); margin-bottom: 32px; }
.author-box h2 { font-size: 1.15rem; color: var(--navy-dark); margin: 0 0 2px; }
.author-box .role { color: var(--accent-ink); font-weight: 600; font-size: .88rem; margin-bottom: 8px; }
.author-box p { color: var(--muted); font-size: .93rem; }
.sidebar { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 24px; }
.widget { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.widget h2 { font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 12px; }
.widget ul { list-style: none; display: grid; gap: 4px; }
.widget a { display: block; padding: 6px 0; color: var(--navy); text-decoration: none; font-size: .93rem; }
.widget a:hover { color: var(--accent-ink); }
.related { margin-top: 64px; }
.related h2 { font-size: 1.6rem; color: var(--navy-dark); margin-bottom: 24px; }

/* ---- Author page ---- */
.author-card { display: flex; gap: 32px; align-items: center; margin-bottom: 48px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
.author-card h1 { font-size: 2rem; color: var(--navy-dark); margin-bottom: 4px; }
.author-card .role { color: var(--accent-ink); font-weight: 600; margin-bottom: 12px; }
.author-card p { color: var(--muted); }
.social-links { display: flex; gap: 10px; margin-top: 16px; }
.social-links a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; text-decoration: none; transition: background-color .25s, transform .2s var(--ease); }
.social-links a:hover { background: var(--accent-ink); transform: translateY(-2px); }
.list-heading { font-size: 1.5rem; color: var(--navy-dark); margin-bottom: 24px; }

/* ---- Search ---- */
.result-count { margin-bottom: 24px; color: var(--muted); }
.result-count strong { color: var(--navy-dark); }

/* ---- Empty state ---- */
.empty { text-align: center; padding: 64px 20px; max-width: 520px; margin: 0 auto; }
.empty i { font-size: 2.4rem; color: var(--navy); opacity: .35; margin-bottom: 16px; }
.empty h2, .empty h3 { font-size: 1.4rem; color: var(--navy-dark); margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 20px; }

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 720px) {
  .featured { grid-template-columns: 1fr; }
  .featured-media { min-height: 200px; aspect-ratio: 16 / 9; }
  .featured-body { padding: 24px; }
  .author-card { flex-direction: column; text-align: center; padding: 24px; }
  .social-links { justify-content: center; }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
  .author-box { flex-direction: column; }
  .blog-tools .search-form { width: 100%; }
}
