/* =========================================================
   Blog — listing page (blog.html) and article pages (blog-*.html)
   ========================================================= */

/* ---------- Listing hero ---------- */
.blog-hero { padding-bottom: 96px; }
.blog-hero-inner h1 { margin-inline: auto; }
.blog-hero-inner .lead { margin-inline: auto; }
.blog-search {
  position: relative;
  max-width: 560px;
  margin: 34px auto 0;
}
.blog-search i {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  color: #8d9cc9; pointer-events: none;
}
.blog-search input {
  width: 100%;
  padding: 17px 22px 17px 54px;
  border-radius: 100px;
  border: 1px solid rgba(110, 155, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  outline: none;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.blog-search input::placeholder { color: #8d9cc9; }
.blog-search input:focus { border-color: #6e9bff; background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.2); }

/* ---------- Filters ---------- */
.blog-list { padding-top: 56px; }
.blog-filters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-bottom: 14px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-head); font-weight: 500; font-size: 0.92rem; color: var(--ink-2);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease);
}
.chip i { color: var(--primary); font-size: 0.85rem; transition: color 0.3s; }
.chip span {
  min-width: 24px; padding: 1px 7px; border-radius: 100px;
  background: var(--primary-50); color: var(--primary);
  font-size: 0.75rem; font-weight: 600; text-align: center;
}
.chip:hover { border-color: var(--primary-200); color: var(--primary); transform: translateY(-2px); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }
.chip.active i { color: #fff; }
.chip.active span { background: rgba(255, 255, 255, 0.22); color: #fff; }
.blog-count { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 0 0 36px; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card {
  position: relative;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s;
}
.post-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--primary-200); }
.post-card.is-hidden { display: none; }
.pc-media { display: block; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--navy); }
.pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.post-card:hover .pc-media img { transform: scale(1.06); }
.pc-body { display: flex; flex-direction: column; flex: 1; padding: 24px 26px 26px; }
.pc-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 0.82rem; color: var(--muted); }
.pc-meta i { margin-right: 4px; }
.pc-title { font-size: 1.15rem; line-height: 1.35; margin-bottom: 10px; }
.pc-title a { color: var(--ink); }
.pc-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.post-card:hover .pc-title a { color: var(--primary); }
.pc-excerpt {
  color: var(--muted); font-size: 0.94rem; margin-bottom: 20px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.85rem; color: var(--muted); }
.pc-foot .link-arrow { font-size: 0.9rem; color: var(--primary); }
.post-card:hover .pc-foot .link-arrow i { transform: translateX(5px); }
.post-card a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* featured (first) card spans the row */
.post-card.featured { grid-column: 1 / -1; flex-direction: row; }
.post-card.featured .pc-media { flex: 0 0 58%; aspect-ratio: auto; }
.post-card.featured .pc-media img { object-position: 30% center; }
.post-card.featured .pc-body { flex: 1; padding: clamp(28px, 4vw, 48px); justify-content: center; }
.post-card.featured .pc-title { font-size: clamp(1.4rem, 2.1vw, 1.8rem); line-height: 1.22; }
.post-card.featured .pc-excerpt { font-size: 1.02rem; -webkit-line-clamp: 4; }
.post-card.featured .pc-foot { margin-top: 8px; }
.post-card.featured .pc-meta::before {
  content: "Featured"; order: -1;
  padding: 5px 12px; border-radius: 100px;
  background: var(--ink); color: #fff; font-size: 0.75rem; font-weight: 600;
}
.post-card.featured .pc-meta .tag { margin-right: auto; }

/* "talk to an expert" tile that fills the last grid row */
.cta-tile {
  justify-content: center;
  padding: 32px 30px;
  background: var(--navy); border-color: var(--navy-3); color: #b9c6ea;
  isolation: isolate;
}
.cta-tile::before {
  content: ""; position: absolute; z-index: -1; width: 320px; height: 320px; right: -120px; top: -120px;
  border-radius: 50%; background: #0043d1; filter: blur(70px); opacity: 0.6;
}
.cta-tile .icon-box { margin-bottom: 18px; }
.cta-tile .pc-title { color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; }
.cta-tile p { font-size: 0.95rem; margin-bottom: 22px; }
.cta-tile .btn { align-self: flex-start; }
.cta-tile.is-hidden { display: none; }
@media (max-width: 1080px) { .cta-tile { display: none; } }

.blog-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.blog-empty i { font-size: 2.4rem; color: var(--primary-300); margin-bottom: 14px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* topics */
.topic-card p { color: var(--muted); font-size: 0.95rem; }
.topic-links { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.topic-links .muted { color: var(--muted); font-size: 0.88rem; }
.topic-links .muted:hover { color: var(--primary); }

/* ---------- Article hero ---------- */
.post-hero { padding-bottom: 150px; }
.post-hero-inner { max-width: 900px; }
.post-hero h1 { font-size: clamp(2rem, 4.2vw, 3.3rem); line-height: 1.15; max-width: 900px; }
.post-hero .lead { max-width: 740px; }
.post-cat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; margin-bottom: 20px;
  border-radius: 100px;
  background: rgba(47, 107, 255, 0.14);
  border: 1px solid rgba(110, 155, 255, 0.3);
  color: #b3c9ff; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.post-cat:hover { color: #fff; border-color: rgba(110, 155, 255, 0.6); }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 26px; font-size: 0.92rem; color: #a9b6dc; }
.post-meta i { color: #6e9bff; margin-right: 6px; }

/* ---------- Article layout ---------- */
.post-section { position: relative; padding-bottom: clamp(60px, 8vw, 100px); }
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  align-items: start;
  margin-top: -100px;
  position: relative; z-index: 2;
}
.post-article { min-width: 0; }
.post-cover {
  margin: 0 0 36px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--navy);
  aspect-ratio: 1200 / 630;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.takeaways {
  padding: 26px 28px 14px;
  margin-bottom: 40px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--primary-100);
  border-left: 4px solid var(--primary);
}
.tk-title { font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 1.08rem; margin-bottom: 14px; }
.tk-title i { color: var(--primary); margin-right: 6px; }
.takeaways li { color: var(--ink-2); }

/* ---------- Prose ---------- */
.prose { font-size: 1.07rem; line-height: 1.8; color: var(--ink-2); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.25em; }
.prose h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  margin: 2em 0 0.7em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h3 {
  font-size: clamp(1.15rem, 1.6vw, 1.3rem);
  margin: 1.6em 0 0.5em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--primary-200); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.prose a:hover { text-decoration-color: var(--primary); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 0; }
.prose ul li { position: relative; padding-left: 28px; margin-bottom: 0.6em; }
.prose ul li::before {
  content: ""; position: absolute; left: 6px; top: 0.72em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad);
}
.prose ol { counter-reset: step; list-style: none; }
.prose ol li { position: relative; padding-left: 44px; margin-bottom: 0.8em; counter-increment: step; }
.prose ol li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.15em;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-50); color: var(--primary);
  font-family: var(--font-head); font-size: 0.85rem; font-weight: 700; line-height: 1;
}
.prose blockquote {
  margin: 1.6em 0;
  padding: 22px 26px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-50), #fff);
  border: 1px solid var(--primary-100);
  font-family: var(--font-head); font-size: 1.08rem; font-weight: 500; color: var(--ink); line-height: 1.6;
  position: relative;
}
.prose blockquote::before {
  content: "\201C"; position: absolute; top: -18px; left: 18px;
  font-size: 4rem; line-height: 1; color: var(--primary-300); font-family: Georgia, serif;
}
.prose .callout {
  margin: 1.6em 0;
  padding: 18px 22px 18px 56px;
  border-radius: var(--radius);
  background: #fff8e8;
  border: 1px solid #ffe2a6;
  position: relative;
  font-size: 1rem;
}
.prose .callout::before {
  content: "\f0eb"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; left: 20px; top: 18px;
  color: #d48a00; font-size: 1.1rem;
}
.prose .callout strong { color: #8a5a00; }

.table-wrap { overflow-x: auto; margin: 1.6em 0; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.55; min-width: 520px; }
.prose th, .prose td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th { background: var(--navy); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 0.9rem; }
.prose tbody tr:nth-child(even) { background: var(--bg-soft); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 600; color: var(--ink); }

/* ---------- In-article CTA ---------- */
.post-cta {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin: 48px 0;
  padding: 34px 36px;
  border-radius: var(--radius-lg);
  background: var(--grad); background-size: 200% 200%;
  animation: ctaShift 10s ease infinite;
  color: #e6edff;
}
.post-cta h2 { color: #fff; font-size: clamp(1.3rem, 2vw, 1.6rem); margin-bottom: 6px; }
.post-cta p { margin: 0; max-width: 460px; }
.post-cta .ring {
  position: absolute; z-index: -1; right: -80px; top: -120px;
  width: 300px; height: 300px; border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  animation: spin 30s linear infinite;
}

/* ---------- Article FAQ ---------- */
.post-faq { margin-top: 20px; }
.post-faq h2 { font-size: clamp(1.5rem, 2.4vw, 1.95rem); scroll-margin-top: calc(var(--header-h) + 24px); }
.post-faq .faq-list { max-width: none; }

/* ---------- Tags + share ---------- */
.post-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line);
}
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.share { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 600; color: var(--ink); font-size: 0.9rem; }
.share-links { display: flex; gap: 8px; }
.share-links a, .share-links button {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease-back);
}
.share-links a:hover, .share-links button:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-3px); }
.share-links button.copied { background: var(--success); border-color: var(--success); color: #fff; }

/* ---------- Sidebar ---------- */
.post-aside {
  position: sticky; top: calc(var(--header-h) + 20px);
  display: grid; gap: 20px;
  margin-top: 130px; /* clears the hero the layout overlaps */
}
.aside-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.aside-title { font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 1rem; margin-bottom: 12px; }
.aside-title i { color: var(--primary); margin-right: 6px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: calc(100vh - 380px); overflow-y: auto; scrollbar-width: thin; }
.toc a {
  display: block;
  padding: 7px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted); font-size: 0.88rem; line-height: 1.4;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.toc a:hover { color: var(--primary); }
.toc a.active { color: var(--primary); border-left-color: var(--primary); background: var(--primary-50); font-weight: 600; }
.aside-cta { background: var(--navy); border-color: var(--navy-3); color: #b9c6ea; }
.aside-cta .aside-title { color: #fff; font-size: 1.08rem; }
.aside-cta p { font-size: 0.92rem; }
.aside-cta .icon-box { width: 48px; height: 48px; font-size: 1.1rem; border-radius: 14px; margin-bottom: 16px; }
.aside-cta .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.3; }

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

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .post-layout { grid-template-columns: 1fr; gap: 0; }
  .post-aside { position: static; margin-top: 0; }
  .post-aside .toc { display: none; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .post-card.featured { flex-direction: column; }
  .post-card.featured .pc-media { min-height: 0; aspect-ratio: 1200 / 630; flex: none; }
  .post-card.featured .pc-body { padding: 24px 26px 26px; }
  .post-grid { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 680px) {
  .blog-filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: -16px; padding: 4px 16px 10px; scrollbar-width: none; }
  .blog-filters::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .post-hero { padding-bottom: 110px; }
  .post-layout { margin-top: -70px; }
  .post-cover { margin-bottom: 28px; border-radius: var(--radius); }
  .prose { font-size: 1.02rem; }
  .post-cta { padding: 28px 24px; }
  .post-cta .btn { width: 100%; white-space: normal; text-align: center; }
  .takeaways { padding: 22px 20px 10px; }
  .post-foot { flex-direction: column; align-items: flex-start; }
}
