/* Modern blog / resource-library presentation. Builds on service-pages.css
   (design tokens, header, footer). No Elementor dependencies. */

/* ---------- Shared archive pieces ---------- */
.blog-hero { background: linear-gradient(135deg, #eef3ff 0%, #fff 72%); border-bottom: 1px solid #dfe6f2; padding: 52px 0 42px; }
.blog-hero .kicker { margin-bottom: 10px; }
.blog-hero h1 { color: var(--navy-dark); font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.1; margin: 0 0 14px; max-width: 22em; letter-spacing: -0.01em; }
.blog-hero .lede { color: #42516a; font-size: 1.12rem; line-height: 1.6; margin: 0; max-width: 44em; }
.blog-crumbs { font-size: 0.85rem; color: #5f6b81; margin: 0 0 16px; }
.blog-crumbs a { color: var(--navy); text-decoration: none; }
.blog-crumbs a:hover, .blog-crumbs a:focus { text-decoration: underline; }
.blog-crumbs [aria-current="page"] { color: #5f6b81; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.blog-search { position: relative; margin-top: 26px; max-width: 560px; }
.blog-search .blog-search-row { display: flex; gap: 10px; }
.blog-search input[type="search"] { flex: 1; min-width: 0; border: 1px solid #ccd7ea; border-radius: 10px; font: inherit; padding: 13px 16px; background: #fff; }
.blog-search input[type="search"]:focus { outline: 3px solid rgba(3, 38, 180, 0.14); border-color: var(--navy); }
.blog-search button { border: 0; cursor: pointer; font: inherit; }

.topic-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.topic-nav a { background: #fff; border: 1px solid #ccd7ea; border-radius: 999px; color: var(--navy-dark); font-size: 0.88rem; font-weight: 700; padding: 9px 16px; text-decoration: none; transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
.topic-nav a:hover, .topic-nav a:focus { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.topic-nav a[aria-current="page"] { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.topic-nav a small { font-weight: 600; opacity: 0.65; margin-left: 4px; }

/* ---------- Article cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 34px; align-items: stretch; }
.post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e1e7f0; border-radius: 12px; overflow: hidden; box-shadow: 0 5px 18px rgba(1, 24, 119, 0.07); transition: box-shadow 0.15s ease, transform 0.15s ease; }
.post-card:hover, .post-card:focus-within { box-shadow: 0 10px 26px rgba(1, 24, 119, 0.14); transform: translateY(-2px); }
.post-card-thumb { display: block; height: 190px; overflow: hidden; background: var(--bg-tint); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 24px; }
.post-card-badge { align-self: flex-start; background: #eef3ff; border-radius: 999px; color: var(--navy-dark); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; padding: 5px 11px; text-transform: uppercase; text-decoration: none; margin-bottom: 12px; }
.post-card-badge:hover, .post-card-badge:focus { background: var(--navy-dark); color: #fff; }
.post-card h2, .post-card h3 { font-size: 1.22rem; line-height: 1.25; margin: 0 0 10px; }
.post-card h2 a, .post-card h3 a { color: var(--navy-dark); text-decoration: none; }
.post-card h2 a:hover, .post-card h2 a:focus, .post-card h3 a:hover, .post-card h3 a:focus { color: var(--red); }
.post-card p { color: #4d5969; font-size: 0.94rem; line-height: 1.55; margin: 0 0 14px; }
.post-card .post-card-more { margin-top: auto; color: var(--red); font-weight: 800; font-size: 0.86rem; text-decoration: none; }
.post-card .post-card-more:hover, .post-card .post-card-more:focus { text-decoration: underline; }

.archive-empty { margin-top: 34px; background: var(--bg-tint); border: 1px solid #ccd7ea; border-radius: 12px; padding: 28px; color: #42516a; }
.archive-empty a { font-weight: 700; }

.archive-nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-top: 40px; border-top: 1px solid var(--line); padding-top: 24px; }
.archive-nav a { font-weight: 700; color: var(--navy); text-decoration: none; }
.archive-nav a:hover, .archive-nav a:focus { color: var(--red); text-decoration: underline; }

/* ---------- Single article ---------- */
.post-hero { background: linear-gradient(135deg, #eef3ff 0%, #fff 78%); border-bottom: 1px solid #dfe6f2; padding: 44px 0 36px; }
.post-hero h1 { color: var(--navy-dark); font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.15; margin: 0 0 16px; max-width: 26em; letter-spacing: -0.01em; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; color: #5f6b81; font-size: 0.9rem; }
.post-meta .post-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.post-meta .post-cats a { background: #fff; border: 1px solid #ccd7ea; border-radius: 999px; color: var(--navy-dark); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; padding: 5px 12px; text-decoration: none; text-transform: uppercase; }
.post-meta .post-cats a:hover, .post-meta .post-cats a:focus { background: var(--navy-dark); color: #fff; }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; padding: 44px 0 60px; }
.post-figure { margin: 0 0 30px; }
.post-figure img { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }

.post-body { color: var(--ink); font-size: 1.04rem; line-height: 1.75; max-width: 46em; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { color: var(--navy-dark); font-size: 1.55rem; line-height: 1.25; margin: 2em 0 0.6em; letter-spacing: -0.01em; }
.post-body h3 { color: var(--navy-dark); font-size: 1.2rem; margin: 1.6em 0 0.5em; }
.post-body h4 { color: var(--navy-dark); font-size: 1.05rem; margin: 1.4em 0 0.5em; }
.post-body p { margin: 0 0 1.15em; }
.post-body ul, .post-body ol { margin: 0 0 1.15em; padding-left: 26px; }
.post-body li { margin-bottom: 0.45em; }
.post-body a { color: var(--navy); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(250, 70, 22, 0.55); text-underline-offset: 3px; }
.post-body a:hover, .post-body a:focus { color: var(--red); }
.post-body img { border-radius: 10px; margin: 8px 0; height: auto; }
.post-body blockquote { border-left: 4px solid var(--red); background: var(--bg-tint); border-radius: 0 10px 10px 0; margin: 0 0 1.15em; padding: 14px 20px; }
.post-body table { border-collapse: collapse; width: 100%; margin: 0 0 1.15em; font-size: 0.95rem; display: block; overflow-x: auto; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.post-body th { background: var(--bg-tint); color: var(--navy-dark); }
.post-body iframe, .post-body video { max-width: 100%; }

.post-aside { position: sticky; top: 24px; display: grid; gap: 22px; }
.post-aside .aside-card h3 { margin-top: 0; }
.post-toc h2 { color: var(--navy-dark); font-size: 1.1rem; line-height: 1.25; margin: 0 0 12px; }
.post-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.post-toc li { margin: 0; line-height: 1.35; }
.post-toc li.toc-level-3, .post-toc li.toc-level-4, .post-toc li.toc-level-5, .post-toc li.toc-level-6 { padding-left: 14px; }
.post-toc li.toc-level-4, .post-toc li.toc-level-5, .post-toc li.toc-level-6 { padding-left: 28px; }
.post-toc a { color: var(--navy-dark); font-size: 0.91rem; font-weight: 600; text-decoration: none; }
.post-toc a::before { content: "›"; color: var(--red); font-weight: 800; margin-right: 7px; }
.post-toc a:hover, .post-toc a:focus { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.post-aside .aside-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.post-aside .aside-list a { display: block; color: var(--navy-dark); font-weight: 600; font-size: 0.93rem; line-height: 1.4; text-decoration: none; padding-left: 16px; position: relative; }
.post-aside .aside-list a::before { content: "›"; position: absolute; left: 0; color: var(--red); font-weight: 800; }
.post-aside .aside-list a:hover, .post-aside .aside-list a:focus { color: var(--red); }

.related-posts { border-top: 1px solid var(--line); padding: 48px 0 64px; background: var(--bg-soft); }
.related-posts h2 { color: var(--navy-dark); font-size: 1.5rem; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post-layout { grid-template-columns: 1fr; gap: 34px; }
  .post-aside { position: static; }
  .post-layout { display: flex; flex-direction: column; }
  .post-aside { display: contents; }
  .post-toc { order: 1; }
  .post-layout > article { order: 2; }
  .post-aside .aside-card:not(.post-toc) { order: 3; }
}
@media (max-width: 600px) {
  .blog-hero { padding: 38px 0 32px; }
  .post-grid { grid-template-columns: 1fr; gap: 20px; }
  .post-card-thumb { height: 175px; }
  .post-layout { padding: 32px 0 44px; }
  .post-body { font-size: 1rem; }
  .topic-nav { gap: 8px; }
  .topic-nav a { font-size: 0.82rem; padding: 8px 12px; }
  .blog-search .blog-search-row { flex-direction: column; }
}
