/* Blog posts and guides (src/lib/article-layout.ts). */
.kar, .kar-related { font-family: 'Montserrat', Arial, sans-serif; color: #1E1919; }
.kar * { box-sizing: border-box; }
.kar h1, .kar h2, .kar h3, .kar h4, .kar p { font-family: inherit; text-transform: none; }
.kar-wrap { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }
.kar-eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase !important; color: #640AE1; }
.kar-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 700; text-decoration: none !important; transition: background .2s ease, transform .2s ease; }
.kar-btn svg { width: 18px; height: 18px; }
.kar-btn:hover { transform: translateY(-1px); }
.kar-btn-sun { background: #FABE19; color: #1E1919 !important; }
.kar-btn-sun:hover { background: #F0AE00; }
.kar-btn-dark { background: #1E1919; color: #fff !important; }
.kar-btn-dark:hover { background: #3a3232; }
.kar a:focus-visible, .kar summary:focus-visible { outline: 2px solid #640AE1; outline-offset: 3px; border-radius: 6px; }

/* Header */
.kar-hero { position: relative; overflow: hidden; width: min(1248px, calc(100% - 40px)); margin: 0 auto; border-radius: 0 0 28px 28px; background: #1E1919; color: #fff; isolation: isolate; }
.kar-c1 { position: absolute; z-index: -1; width: 260px; height: 260px; left: -120px; bottom: -170px; border-radius: 50%; background: #640AE1; }
.kar-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 4vw, 56px); align-items: center; padding: clamp(36px, 5vw, 64px) clamp(24px, 4vw, 56px) clamp(40px, 5vw, 64px); }
.kar-hero-text .kar-hero-grid { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.kar-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; font-size: 14px; color: #C8D2DC; }
.kar-crumbs a { color: #FABE19 !important; font-weight: 700; text-decoration: none !important; }
.kar-hero h1 { margin: 0; color: #fff; font-size: clamp(30px, 4vw, 52px); line-height: 1.08; letter-spacing: -0.02em; }
.kar-summary { margin: 18px 0 0; max-width: 60ch; font-size: clamp(16px, 1.35vw, 18px); line-height: 1.6; color: #E6E0EA; }
.kar-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 28px; }
.kar-by { display: inline-flex; align-items: center; gap: 12px; padding: 6px 18px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff !important; text-decoration: none !important; transition: background .2s ease; }
.kar-by:hover { background: rgba(255,255,255,.14); }
.kar-by img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: top; background: #F0E9FC; }
.kar-by > span { display: grid; line-height: 1.25; }
.kar-by-label { font-size: 12px; color: #C8D2DC; }
.kar-by strong { font-size: 15px; font-weight: 700; color: #fff; }
.kar-by-role { font-size: 13px; color: #FABE19; }
.kar-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: #E6E0EA; }
.kar-facts li { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.kar-facts svg { width: 17px; height: 17px; color: #FABE19; }
.kar-art { position: relative; margin: 0; }
.kar-art::before { content: ""; position: absolute; z-index: -1; width: 64%; aspect-ratio: 1; right: -12%; bottom: -18%; border-radius: 50%; background: #FABE19; }
.kar-art img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 22px; box-shadow: 0 40px 70px -40px rgba(0,0,0,.8); }

/* Body */
.kar-layout { width: min(1200px, calc(100% - 40px)); margin: 0 auto; padding: clamp(44px, 6vw, 80px) 0 clamp(48px, 6vw, 80px); display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 5vw, 80px); align-items: start; }
.kar-main { min-width: 0; max-width: 760px; }
.kar-body { font-size: 17px; line-height: 1.8; color: #3b3535; overflow-wrap: anywhere; }
.kar-body > p:first-child, .kar-body > p:first-of-type { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.65; color: #1E1919; }
.kar-body p { margin: 0 0 18px; }
.kar-body h2 { margin: 48px 0 16px; color: #1E1919; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; letter-spacing: -0.01em; scroll-margin-top: 120px; }
.kar-body h3 { margin: 32px 0 12px; color: #1E1919; font-size: clamp(19px, 1.8vw, 23px); line-height: 1.3; }
.kar-body h4 { margin: 24px 0 10px; color: #1E1919; font-size: 18px; line-height: 1.35; }
.kar-body h2:first-child, .kar-body h3:first-child { margin-top: 0; }
.kar-body strong { color: #1E1919; }
.kar-body a { color: #640AE1; text-decoration: underline; text-underline-offset: 3px; }
.kar-body a:hover { color: #4a07a8; }
.kar-body ul, .kar-body ol { margin: 0 0 20px; padding-left: 0; list-style: none; }
.kar-body ul li, .kar-body ol li { position: relative; margin: 0 0 10px; padding-left: 30px; }
.kar-body ul li::before { content: ""; position: absolute; left: 6px; top: .72em; width: 9px; height: 9px; border-radius: 50%; background: #FABE19; }
.kar-body ol { counter-reset: kar; }
.kar-body ol li { counter-increment: kar; }
.kar-body ol li::before { content: counter(kar); position: absolute; left: 0; top: .2em; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #F0E9FC; color: #640AE1; font-size: 12px; font-weight: 800; line-height: 1; }
.kar-body li > ul, .kar-body li > ol { margin: 10px 0 0; }
.kar-body blockquote { margin: 28px 0; padding: 22px 26px; border-radius: 18px; background: #F4F0FB; border-left: 4px solid #640AE1; color: #1E1919; font-size: 18px; }
.kar-body blockquote p:last-child { margin: 0; }
.kar-body img { max-width: 100%; height: auto; border-radius: 16px; }
.kar-body figure { margin: 24px 0; max-width: 100%; }
.kar-body iframe { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; margin: 24px 0; border: 0; border-radius: 16px; }
.kar-table { margin: 24px 0; overflow-x: auto; border: 1px solid #ECE8F2; border-radius: 16px; }
.kar-body table { width: 100%; min-width: 480px; margin: 0; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.kar-body thead th, .kar-body tr:first-child th { background: #1E1919; color: #fff; }
.kar-body th, .kar-body td { padding: 12px 16px; border-bottom: 1px solid #ECE8F2; text-align: left; vertical-align: top; }
.kar-body th { font-weight: 700; }
.kar-body tbody tr:nth-child(even) td { background: #FAF8F5; }
.kar-body tr:last-child td { border-bottom: 0; }
.kar-body hr { margin: 40px 0; border: 0; border-top: 1px solid #ECE8F2; }

/* Sticky side column */
.kar-aside { position: sticky; top: 110px; display: grid; gap: 18px; }
.kar-toc { padding: 22px; border-radius: 22px; background: #FAF8F5; border: 1px solid #ECE8F2; max-height: calc(100vh - 380px); overflow: auto; }
.kar-toc-title { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase !important; color: #640AE1; }
.kar-toc ol, .kar-toc-mobile ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.kar-toc a, .kar-toc-mobile a { display: block; padding: 7px 10px; border-radius: 10px; color: #3b3535 !important; font-size: 14px; line-height: 1.4; text-decoration: none !important; transition: background .15s ease, color .15s ease; }
.kar-toc a:hover, .kar-toc a.is-current { background: #F0E9FC; color: #640AE1 !important; }
.kar-toc a.is-current { font-weight: 700; }
.kar-help { padding: 24px; border-radius: 22px; background: #1E1919; color: #E6E0EA; }
.kar-help-title { margin: 0 0 8px; color: #fff; font-size: 20px; line-height: 1.25; }
.kar-help p { margin: 0 0 18px; font-size: 14px; line-height: 1.6; }
.kar-help .kar-btn { width: 100%; }
.kar-help-link { display: block; margin-top: 12px; text-align: center; color: #fff !important; font-size: 14px; font-weight: 600; }
.kar-toc-mobile { display: none; margin: 0 0 28px; border-radius: 18px; background: #FAF8F5; border: 1px solid #ECE8F2; }
.kar-toc-mobile summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #640AE1; }
.kar-toc-mobile summary::-webkit-details-marker { display: none; }
.kar-toc-mobile summary svg { width: 20px; height: 20px; transition: transform .2s ease; }
.kar-toc-mobile[open] summary svg { transform: rotate(180deg); }
.kar-toc-mobile ol { padding: 0 10px 14px; }

/* About the author */
.kar-author { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 26px; align-items: start; margin-top: 56px; padding: clamp(22px, 3vw, 32px); border-radius: 26px; background: #F0E9FC; }
.kar-author-photo img { display: block; width: 132px; height: 132px; border-radius: 50%; object-fit: cover; object-position: top; background: #fff; }
.kar-author h2 { margin: 0; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.2; }
.kar-author h2 a { color: #1E1919 !important; text-decoration: none !important; }
.kar-author h2 a:hover { color: #640AE1 !important; }
.kar-author-role { margin: 4px 0 0; font-size: 15px; font-weight: 700; color: #640AE1; }
.kar-author-bio { margin: 14px 0 0; font-size: 15px; line-height: 1.7; color: #3b3535; }
.kar-author-links { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.kar-li { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #fff; color: #640AE1 !important; }
.kar-li svg { width: 20px; height: 20px; }

/* Related reading */
.kar-related { padding: clamp(48px, 6vw, 80px) 0; background: #FFF8E7; }
.kar-related-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.kar-related h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.1; }
.kar-link { display: inline-flex; align-items: center; gap: 8px; color: #640AE1 !important; font-weight: 700; text-decoration: none !important; white-space: nowrap; }
.kar-link svg { width: 18px; height: 18px; }
.kar-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.kar-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: #fff; border: 1px solid #F0E6CC; transition: transform .2s ease, box-shadow .2s ease; }
.kar-card:hover { transform: translateY(-3px); box-shadow: 0 24px 40px -28px rgba(30,25,25,.45); }
.kar-card-media img, .kar-card-blank { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #1E1919; }
.kar-card-body { display: flex; flex: 1; flex-direction: column; padding: 20px 22px 22px; }
.kar-card-cat { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase !important; color: #640AE1; }
.kar-card h3 { margin: 0; font-size: 19px; line-height: 1.3; }
.kar-card h3 a { color: #1E1919 !important; text-decoration: none !important; }
.kar-card h3 a::after { content: ""; position: absolute; inset: 0; }
.kar-card { position: relative; }
.kar-card-sum { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: #5f5a5a; }
.kar-card-go { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 16px; color: #640AE1; font-size: 14px; font-weight: 700; }
.kar-card-go svg { width: 16px; height: 16px; }

@media (max-width: 1024px) {
  .kar-layout { grid-template-columns: minmax(0, 1fr); }
  .kar-main { max-width: none; }
  .kar-aside { position: static; }
  .kar-toc { display: none; }
  .kar-toc-mobile { display: block; }
  .kar-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .kar-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .kar-art { max-width: 560px; }
  .kar-art::before { display: none; }
}
@media (max-width: 640px) {
  .kar-hero, .kar-layout { width: calc(100% - 24px); }
  .kar-wrap { width: calc(100% - 32px); }
  .kar-hero-grid { padding: 28px 20px 32px; }
  .kar-body { font-size: 16px; }
  .kar-author { grid-template-columns: minmax(0, 1fr); }
  .kar-author-photo img { width: 96px; height: 96px; }
  .kar-cards { grid-template-columns: minmax(0, 1fr); }
  .kar-related-head { flex-direction: column; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .kar-btn, .kar-card, .kar-by { transition: none; }
  .kar-btn:hover, .kar-card:hover { transform: none; }
}
