/* Blog styles. Loaded after styles.css and pages.css. Tokens come from styles.css. */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- blog home hero ---------- */
.blog-hero { padding-bottom: clamp(24px, 4vw, 40px); }
.blog-hero .display { font-size: clamp(44px, 8.6vw, 124px); max-width: 12em; text-wrap: balance; }
.blog-wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter) clamp(56px, 7vw, 96px); display: flex; flex-direction: column; gap: clamp(36px, 5vw, 64px); }
.blog-h2 { font-size: clamp(36px, 5vw, 72px); overflow-wrap: anywhere; }

/* ---------- shared bits ---------- */
.tag-chip {
  display: inline-flex; align-items: center; align-self: flex-start;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1;
  color: var(--primary); background: rgba(255, 255, 255, 0.75); padding: 8px 12px; border-radius: 999px;
}
.tag-chip-lg { background: var(--accent); font-size: 14px; padding: 9px 14px; }
.post-meta, .post-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.post-meta-row { font-size: 15px; color: var(--ink-2); }

/* ---------- featured card ---------- */
.feature {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  background: var(--primary); color: var(--white); border-radius: 48px; overflow: hidden;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.feature.reveal.in:hover { transform: translateY(-4px); transition-duration: 0.2s; transition-delay: 0ms; box-shadow: 0 30px 60px -34px rgba(37, 70, 82, 0.7); }
.feature-media { min-height: 100%; overflow: hidden; background: var(--primary-2); }
.feature-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; transition: transform 0.5s var(--ease); }
.feature:hover .feature-media img { transform: scale(1.04); }
.feature-body { padding: clamp(24px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 18px; min-width: 0; }
.feature-body .eyebrow.dark { background: var(--accent); color: var(--primary); }
.feature-title { font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 76, "opsz" 72; text-transform: uppercase; letter-spacing: -0.012em; line-height: 0.92; font-size: clamp(32px, 4vw, 58px); overflow-wrap: anywhere; text-wrap: balance; }
.feature-title a { color: inherit; text-decoration: none; }
.feature-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.feature-title a:focus-visible { outline-color: var(--accent); }
.feature-excerpt { font-size: 18px; line-height: 1.55; color: rgba(255, 255, 255, 0.82); max-width: 34em; }
.feature .post-meta { color: rgba(255, 255, 255, 0.78); }
.feature-go { margin-top: 6px; pointer-events: none; }
.feature:hover .feature-go { background: #b4ebe5; }

/* ---------- list header + filters ---------- */
.blog-list { display: flex; flex-direction: column; gap: 22px; }
.blog-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.blog-count { font-weight: 700; font-size: 15px; color: var(--ink-2); }
.blog-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; }
.blog-tools[hidden] { display: none; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; flex: 1 1 420px; }
.filter-chip {
  font: inherit; font-weight: 700; font-size: 15px; text-transform: capitalize; cursor: pointer;
  flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--white); color: var(--primary); box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.2s, color 0.2s, transform 0.2s ease-out;
}
.filter-chip:hover { background: var(--accent-soft); }
.filter-chip[aria-pressed="true"] { background: var(--primary); color: var(--accent); box-shadow: none; }
.filter-chip:active { transform: scale(0.96); }
.blog-search { position: relative; display: block; flex: 0 1 300px; min-width: 220px; color: var(--primary); }
.blog-search svg { position: absolute; left: 16px; top: 50%; translate: 0 -50%; pointer-events: none; }
.blog-search input {
  width: 100%; min-height: 48px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--white); border: 2px solid transparent; border-radius: 999px; padding: 0 18px 0 44px;
  box-shadow: inset 0 0 0 1px var(--line); transition: border-color 0.2s;
}
.blog-search input:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 999px; }
.blog-empty { padding: 32px; border-radius: 24px; background: var(--white); font-weight: 600; color: var(--ink-2); text-align: center; }

/* ---------- post grid + cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-card {
  --card-bg: var(--orange);
  position: relative; isolation: isolate; min-width: 0;
  display: flex; flex-direction: column; gap: 14px; padding: 12px 12px 22px;
  background: var(--card-bg); color: var(--primary); border-radius: 32px;
  transition: opacity 0.9s var(--ease), transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.post-card.c1 { --card-bg: var(--accent); }
.post-card.c2 { --card-bg: var(--blue); }
.post-card.c3 { --card-bg: var(--yellow); }
.post-card.reveal { transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), box-shadow 0.2s ease-out; }
.post-card.reveal.in:hover, .post-card:not(.reveal):hover { transform: translateY(-4px); box-shadow: 0 24px 40px -26px rgba(37, 70, 82, 0.55); transition-duration: 0.2s; transition-delay: 0ms; }
.post-card[hidden], .feature[hidden] { display: none; }
.post-media { aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; background: rgba(255, 255, 255, 0.5); }
.post-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.post-card:hover .post-media img { transform: scale(1.04); }
.post-card-body { padding: 4px 12px 0; display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.post-title { font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 78; text-transform: uppercase; letter-spacing: -0.01em; line-height: 0.96; font-size: clamp(24px, 2.1vw, 30px); overflow-wrap: anywhere; }
.post-title a { color: inherit; text-decoration: none; }
.post-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 32px; }
.post-excerpt { font-size: 15.5px; line-height: 1.5; opacity: 0.88; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .post-meta { margin-top: auto; padding-top: 4px; opacity: 0.8; }

/* ---------- post header ---------- */
.post-head {
  max-width: 1240px; margin: 0 auto;
  padding: clamp(112px, 12vw, 150px) var(--gutter) 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 20px;
}
.crumbs { max-width: 100%; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.crumbs li { white-space: nowrap; }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: 0.5; }
.crumbs li:last-child { display: flex; min-width: 0; overflow: hidden; }
.crumbs li:last-child span { overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--primary); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-h1 { font-size: clamp(34px, 6.2vw, 92px); max-width: 16em; overflow-wrap: anywhere; line-height: 0.92; }
.post-hero { max-width: 1240px; margin: clamp(24px, 3vw, 36px) auto 0; padding: 0 var(--gutter); }
.post-hero img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 40px; background: var(--accent-soft); }

/* ---------- article layout ---------- */
.post-layout { padding-top: clamp(24px, 3vw, 36px); padding-bottom: clamp(28px, 4vw, 48px); }
.post-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.post .prose-card { padding: clamp(22px, 4.5vw, 64px); }
.post .prose { font-size: 18px; line-height: 1.7; max-width: 70ch; }
.post .prose > * + * { margin-top: 1.1em; }
.post .prose h2 { font-size: clamp(28px, 3.2vw, 42px); margin-top: 2.1em; }
.post .prose h2:first-child { margin-top: 0; }
.post .prose h3 { font-family: var(--body); font-weight: 700; font-size: 20px; margin-top: 1.7em; }
.post .prose h4 { font-family: var(--body); font-weight: 700; font-size: 17px; margin-top: 1.4em; color: var(--ink); }
.post .prose h2 + *, .post .prose h3 + * { margin-top: 0.7em; }
.post .prose li { margin-top: 0.55em; }
.post .prose li > ul, .post .prose li > ol { margin-top: 0.5em; }
.post .prose hr { border: 0; height: 2px; background: var(--line); margin: 2em 0; }
.post .prose code { background: var(--paper); padding: 0.1em 0.35em; border-radius: 6px; font-size: 0.92em; }
.post .prose blockquote { margin-left: 0; margin-right: 0; padding: 14px 20px; border-left: 6px solid var(--accent); background: var(--accent-soft); border-radius: 0 20px 20px 0; color: var(--primary); }
.post .prose blockquote > * + * { margin-top: 0.6em; }
.post .prose img { width: 100%; height: auto; border-radius: 24px; background: var(--paper); }
.post .prose p > img:only-child { margin: 0.4em 0; }
.post .prose figure { margin: 1.8em 0; }
.post .prose figcaption { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--ink-2); text-align: center; }

.post .prose .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 20px; border: 1px solid var(--line); background: var(--white); margin: 1.6em 0; }
.post .prose .table-wrap:focus-visible { outline-offset: 2px; }
.post .prose table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15.5px; line-height: 1.5; }
.post .prose th, .post .prose td { padding: 12px 16px; text-align: left; vertical-align: top; }
.post .prose th { background: var(--primary); color: var(--white); font-weight: 700; }
.post .prose tbody tr:nth-child(even) { background: var(--paper); }
.post .prose td + td, .post .prose th + th { border-left: 1px solid var(--line); }
.post .prose th + th { border-left-color: rgba(255, 255, 255, 0.18); }

.post .prose .video-embed { aspect-ratio: 16 / 9; border-radius: 24px; overflow: hidden; background: var(--primary); margin: 1.6em 0; }
.post .prose .video-embed iframe { display: block; width: 100%; height: 100%; border: 0; }

.toc a[aria-current="true"] { background: var(--accent); color: var(--primary); }

/* ---------- disclaimer, cta, more ---------- */
.post-disclaimer {
  max-width: 1240px; margin: 0 auto clamp(40px, 6vw, 72px); width: calc(100% - var(--gutter) * 2);
  display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; border-radius: 20px;
  background: var(--accent-soft); color: var(--primary); font-weight: 600; font-size: 16px; line-height: 1.45;
  box-shadow: inset 0 0 0 1px rgba(37, 70, 82, 0.15);
}
.post-disclaimer svg { flex: none; margin-top: 1px; }
.blog-cta .cta-copy { gap: 28px; }
.blog-cta .display { font-size: clamp(44px, 7vw, 112px); }
.more { max-width: 1240px; margin: 0 auto; padding: clamp(56px, 7vw, 100px) var(--gutter) 0; display: flex; flex-direction: column; gap: 28px; }
.blog-wrap + .cta { margin-top: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: minmax(0, 1fr); border-radius: 36px; }
  .feature-media img { aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .post-card { border-radius: 28px; }
  .post-title a::after { border-radius: 28px; }
  .feature { border-radius: 28px; }
  .post-hero img { border-radius: 24px; }
  .post .prose-card { border-radius: 28px; }
  .post .prose { font-size: 17.5px; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; scroll-snap-type: x proximity; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chip { flex: none; scroll-snap-align: start; }
  .blog-search { flex-basis: 100%; }
  .blog-hero .display { font-size: clamp(40px, 12.5vw, 64px); }
}

@media (prefers-reduced-motion: reduce) {
  .post-card, .feature, .filter-chip { transition: none; }
  .post-card:hover, .feature:hover, .post-card.reveal.in:hover, .feature.reveal.in:hover { transform: none; }
  .post-media img, .feature-media img { transition: none; }
  .post-card:hover .post-media img, .feature:hover .feature-media img { transform: none; }
}

/* ---------- quick answer + FAQ (SEO blocks) ---------- */
.post .prose .quick-answer { padding: 20px 24px; border-radius: 24px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(37, 70, 82, 0.15); color: var(--primary); font-size: 17.5px; line-height: 1.6; }
.quick-answer > * + * { margin-top: 0.6em; }
.quick-answer-label { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-2); }
.quick-answer ol, .quick-answer ul { padding-left: 1.3em; }
.post .prose .post-faq { margin-top: 2.1em; }
.post-faq h2 { margin-bottom: 0.6em; }
.post-faq details { border-top: 1px solid var(--line); }
.post-faq details:last-of-type { border-bottom: 1px solid var(--line); }
.post-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; font-weight: 700; font-size: 18px; line-height: 1.35; color: var(--primary); cursor: pointer; list-style: none; }
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -2px; transition: rotate 0.25s var(--ease); }
.post-faq details[open] > summary::after { rotate: 225deg; translate: 0 2px; }
.post-faq summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.post-faq details > p { margin: 0 0 18px; padding-right: 28px; }
@media (prefers-reduced-motion: reduce) { .post-faq summary::after { transition: none; } }
