/* Guide pages: the byline row in the hero, the contents nav and the reading column with its panels
   (free download inset, key takeaways, official sources, what to do next). Loaded after resources.css,
   which holds the photo hero and the article cards used under "Related guides". */

/* ============================================================ hero */
.kh-art-hero .page-hero-title { font-size: clamp(29px, 1.5vw + 17px, 38px); line-height: 1.13; }
.kh-art-hero .page-hero-intro { font-size: 17px; }
.kh-art-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; color: rgba(255, 255, 255, .9); font-size: 13.5px; font-weight: 500; }
/* the current-page crumb repeats the h1 just below, so it truncates instead of wrapping onto a second line */
.kh-art-hero .crumbs li:last-child { flex: 1 1 0; min-width: 0; }
.kh-art-hero .crumbs li:last-child::before { flex: none; }
.kh-art-hero .crumbs [aria-current] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kh-art-meta > span { display: inline-flex; align-items: center; gap: 8px; }
.kh-art-meta .icon { width: 17px; height: 17px; color: var(--teal-tick); }
.kh-art-meta a { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .45); text-underline-offset: 3px; }
.kh-art-meta a:hover { text-decoration-color: currentColor; }

/* ============================================================ layout: contents nav + reading column */
/* The reading column keeps its 760 px measure. Up to the 1180 px container it sits flush right (the board); wider, the
   contents nav grows a little, the gap stops at 140 px and the spare width stays on the right instead of opening a hole. */
.kh-article { display: grid; grid-template-columns: clamp(280px, 100% - 1090px, 330px) minmax(0, 760px); justify-content: start; align-items: start; gap: 40px clamp(56px, 100% - 1040px, 140px); padding-block: var(--sec-y); }
.kh-toc { position: sticky; top: 16px; padding: 20px 20px 10px; border: 1px solid #e6edf8; border-radius: 16px; background: linear-gradient(180deg, #f8fbff 0%, #f3f7fd 100%); }
.kh-toc h2 { color: var(--ink); font-size: 16px; letter-spacing: 0; }
.kh-toc ol { margin-top: 12px; list-style: none; padding: 0; counter-reset: kh-toc; }
.kh-toc li { counter-increment: kh-toc; }
.kh-toc a { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid #e3e9f3; color: var(--ink-2); font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.kh-toc a::before { content: counter(kh-toc, decimal-leading-zero); flex: none; padding-top: 1px; color: var(--teal-dark); font-size: 12.5px; font-weight: 800; }
.kh-toc a:hover { color: var(--blue); }

.kh-prose { min-width: 0; color: var(--body); font-size: 17px; line-height: 1.75; }
.kh-prose > * + * { margin-top: clamp(34px, 1.2vw + 22px, 44px); }
.kh-prose h2 { margin-bottom: 12px; font-size: 26px; line-height: 1.2; }
.kh-prose section { scroll-margin-top: 16px; }
.kh-prose a:not(.btn):not(.text-link):not(.icon-card) { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* free download inset (after the first section) */
.kh-inset { display: flex; align-items: flex-start; gap: 18px; padding: 20px 22px; border: 1px solid #d5f1e9; border-radius: 16px; background: linear-gradient(180deg, #f1fcf9 0%, #e8f8f3 100%); }
.kh-inset-icon { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 14px; background: #fff; color: var(--green-ui); box-shadow: var(--shadow-sm); }
.kh-inset-icon .icon { width: 28px; height: 28px; stroke-width: 1.7; }
.kh-inset-copy { min-width: 0; font-size: 15px; line-height: 1.55; }
.kh-inset-label { color: var(--teal-dark); font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.kh-inset-title { margin-top: 2px; color: var(--ink); font-size: 18px; font-weight: var(--fw-title); line-height: 1.3; }
.kh-inset-title + p { margin-top: 4px; }
.kh-inset .text-link { margin-top: 10px; font-size: 15.5px; }

/* key takeaways */
.kh-takeaways { padding: 28px 30px 30px; border: 1px solid #d5f1e9; border-radius: 16px; background: var(--mint-50); }
.kh-takeaways h2 { margin-bottom: 16px; font-size: 22px; }
.kh-takeaways .check-list-ui { gap: 12px; }
.kh-takeaways .check-list-ui li { font-size: 16.5px; }

/* official sources */
.kh-sources ul { display: grid; gap: 12px; list-style: none; padding: 0; }
.kh-sources a { display: inline-flex; align-items: flex-start; gap: 9px; color: var(--blue); font-size: 16px; font-weight: 700; line-height: 1.45; text-decoration: underline; text-decoration-color: rgba(31, 107, 239, .35); text-underline-offset: 3px; }
.kh-sources a:hover { text-decoration-color: currentColor; }
.kh-sources .icon { width: 17px; height: 17px; margin-top: 3px; }

/* what to do next */
.kh-next > p { margin-bottom: 20px; }
.kh-next .grid-3 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* one column at every width, so the system's "centre a lone last card" rule (768-1099) must not shrink the third card */
.kh-next .grid-3 > :last-child:nth-child(odd):not(:only-child) { grid-column: auto; justify-self: stretch; width: auto; }
.kh-next .icon-card--help { min-height: 64px; }
.kh-next .icon-card-title { font-size: 17px; }

@media (max-width: 1099px) {
  .kh-article { grid-template-columns: minmax(0, 1fr); }
  .kh-toc { position: static; }
}
@media (max-width: 767px) {
  .kh-prose { font-size: 16.5px; }
  .kh-prose h2 { font-size: 23px; }
  .kh-inset { flex-direction: column; gap: 12px; padding: 18px; }
  .kh-takeaways { padding: 20px 18px; }
}
