:root {
  --blog-bg: #f5f7f9;
  --blog-ink: #17233a;
  --blog-muted: #566579;
  --blog-slate: #56697f;
  --blog-green: #6f9e65;
  --blog-button: #477652;
  --blog-border: #d7e0e8;
  --blog-soft: #eaf1f5;
}

html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
.site-header { width: 100%; }
.blog-main { background: var(--blog-bg); }
.blog-container, .article-shell { width: calc(100% - 32px); max-width: 1180px; margin: 0 auto; }
.blog-hero { padding: 54px 0 38px; border-bottom: 1px solid var(--blog-border); background: #eaf2f6; }
.blog-hero__inner { max-width: 1180px; }
.blog-eyebrow, .article-topic { margin: 0 0 12px; color: var(--blog-button); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.blog-hero h1 { max-width: 1000px; margin: 0; color: var(--blog-ink); font-size: clamp(52px, 3.6vw, 58px); line-height: 1.08; }
.blog-hero__intro { max-width: 800px; margin: 14px 0 0; color: var(--blog-muted); font-size: 18px; line-height: 1.55; }
.blog-topics { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.blog-topic { padding: 8px 12px; border: 1px solid #cbd8e1; border-radius: 999px; color: var(--blog-slate); background: rgba(255,255,255,.72); font-size: 13px; font-weight: 700; }
.blog-tools { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); align-items: end; gap: 18px 24px; max-width: none; margin-top: 26px; padding: 16px 20px; border: 1px solid rgba(215,224,232,.9); border-radius: 8px; background: rgba(255,255,255,.72); }
.blog-tools label { display: block; margin-bottom: 8px; color: var(--blog-ink); font-size: 13px; font-weight: 700; }
.blog-search-wrap { display: flex; gap: 8px; }
.blog-search-wrap input { min-width: 0; flex: 1; height: 44px; padding: 0 14px; border: 1px solid #c5d2dc; border-radius: 6px; color: var(--blog-ink); background: #fff; font: inherit; }
.blog-search-wrap input:focus, .blog-filter:focus-visible { outline: 3px solid rgba(111,158,101,.28); outline-offset: 2px; }
.blog-search-wrap button { min-height: 44px; padding: 0 17px; border: 0; border-radius: 6px; color: #fff; background: var(--blog-button); font-weight: 700; cursor: pointer; }
.blog-search-wrap button:hover { background: #3b6545; }
.blog-tools__label { display: block; margin-bottom: 8px; color: var(--blog-ink); font-size: 13px; font-weight: 700; }
.blog-filters { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
.blog-filter { min-height: 38px; padding: 0 12px; border: 1px solid #c5d2dc; border-radius: 999px; color: var(--blog-slate); background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.blog-filter[aria-pressed="true"], .blog-filter:hover { border-color: var(--blog-green); color: #fff; background: var(--blog-slate); }

.blog-section { padding: 46px 0; }
.blog-section__heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.blog-section h2 { margin: 0; color: var(--blog-ink); font-size: clamp(1.9rem, 3vw, 2.45rem); line-height: 1.12; }
.blog-section__heading p { max-width: 500px; margin: 0; color: var(--blog-muted); line-height: 1.65; }
.blog-directory { display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: 28px; }
.blog-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.blog-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--blog-border); border-radius: 7px; background: #fff; box-shadow: 0 4px 14px rgba(23,35,58,.045); }
.blog-card[hidden] { display: none; }
.blog-card__media { display: grid; aspect-ratio: 16 / 9; place-items: center; overflow: hidden; border-bottom: 1px solid #edf1f4; background: #fff; }
.blog-card__media img { display: block; width: 100%; height: 100%; padding: 14px 18px; box-sizing: border-box; object-fit: contain; }
.blog-card__body { display: flex; flex: 1; flex-direction: column; padding: 22px 24px 24px; }
.blog-card h3 { margin: 0; color: var(--blog-ink); font-size: 21px; line-height: 1.24; }
.blog-card h3 a { color: inherit; text-decoration: none; }
.blog-card h3 a:hover { color: var(--blog-button); }
.blog-card__excerpt { margin: 13px 0 18px; color: var(--blog-muted); line-height: 1.58; }
.blog-card__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: auto; color: #68788a; font-size: 13px; }
.blog-card__link { align-self: flex-start; margin-top: 18px; color: var(--blog-button); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.blog-card__link:hover { color: #3b6545; }

.blog-sidebar { display: grid; gap: 16px; position: sticky; top: 22px; }
.sidebar-panel { padding: 20px; border: 1px solid var(--blog-border); border-radius: 7px; background: #fff; box-shadow: 0 4px 14px rgba(23,35,58,.045); }
.sidebar-panel h2 { margin: 0 0 16px; color: var(--blog-ink); font-size: 19px; line-height: 1.2; }
.sidebar-panel h2::after { display: block; width: 30px; height: 2px; margin-top: 10px; content: ""; background: var(--blog-green); }
.sidebar-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.sidebar-list li { padding-bottom: 14px; border-bottom: 1px solid #e7edf1; }
.sidebar-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.sidebar-list a,
.sidebar-list a:link,
.sidebar-list a:visited { color: var(--blog-ink); font-weight: 700; line-height: 1.35; text-decoration: none; }
.sidebar-list a:hover { color: var(--blog-button); }
.sidebar-list small { display: block; margin-top: 5px; color: #68788a; font-size: 12px; line-height: 1.4; }
.sidebar-related-list { display: grid; gap: 14px; }
.sidebar-related-card,
.sidebar-related-card:link,
.sidebar-related-card:visited { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 14px; min-width: 0; color: var(--blog-ink); text-decoration: none; }
.sidebar-related-card:focus-visible { outline: 3px solid rgba(111,158,101,.35); outline-offset: 3px; }
.sidebar-related-thumb { display: grid; width: 78px; height: 60px; place-items: center; overflow: hidden; border: 1px solid var(--blog-border); border-radius: 5px; background: #f7fafb; }
.sidebar-related-thumb img { display: block; width: 100%; height: 100%; padding: 5px; box-sizing: border-box; object-fit: contain; }
.sidebar-related-topic { display: block; margin-bottom: 4px; color: var(--blog-button); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sidebar-related-card strong,
.sidebar-related-card:link strong,
.sidebar-related-card:visited strong { display: block; min-width: 0; color: var(--blog-ink); font-size: 14px; line-height: 1.3; }
.sidebar-related-card:hover strong { color: var(--blog-button); }
.sidebar-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.sidebar-categories a { padding: 7px 9px; border: 1px solid var(--blog-border); border-radius: 999px; color: var(--blog-slate); font-size: 12px; font-weight: 700; text-decoration: none; }
.sidebar-categories a:hover { border-color: var(--blog-green); color: var(--blog-button); }
.sidebar-cta { border-left: 4px solid var(--blog-green); }
.sidebar-cta p { margin: 0 0 16px; color: var(--blog-muted); font-size: 14px; line-height: 1.55; }
.sidebar-cta .btn { width: 100%; justify-content: center; }
.blog-cta { padding: 30px 32px; border: 1px solid var(--blog-border); border-left: 4px solid var(--blog-green); border-radius: 7px; background: #fff; }
.blog-cta h2 { margin: 0; color: var(--blog-ink); font-size: 24px; }
.blog-cta p { max-width: 720px; margin: 10px 0 18px; color: var(--blog-muted); line-height: 1.6; }
.blog-cta .btn { display: inline-flex; }
.blog-empty { grid-column: 1 / -1; padding: 28px; border: 1px dashed var(--blog-border); color: var(--blog-muted); background: #fff; }
.blog-pagination { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; margin-top: 28px; }
.blog-pagination p { margin: 0; color: var(--blog-muted); font-size: 14px; }
.blog-pagination__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.blog-pagination__links a { display: inline-flex; min-width: 38px; min-height: 38px; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--blog-border); border-radius: 5px; color: var(--blog-ink); background: #fff; font-size: 14px; font-weight: 700; text-decoration: none; }
.blog-pagination__links a:hover, .blog-pagination__links a:focus-visible { border-color: var(--blog-green); color: var(--blog-button); }
.blog-pagination__links a[aria-current="page"] { border-color: var(--blog-button); color: #fff; background: var(--blog-button); }
.blog-load-more { display: block; margin: 26px auto 0; min-height: 44px; padding: 0 20px; border: 1px solid var(--blog-button); border-radius: 6px; color: var(--blog-button); background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.blog-load-more:hover { color: #fff; background: var(--blog-button); }

.article-main { padding: 44px 0 72px; }
.breadcrumbs { margin-bottom: 30px; color: #68788a; font-size: 14px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { margin-left: 7px; content: "/"; color: #9aa8b6; }
.breadcrumbs a { color: var(--blog-button); }
.breadcrumbs li { min-width: 0; }
.breadcrumbs li[aria-current="page"] { overflow-wrap: anywhere; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: 48px; }
.article-primary { min-width: 0; }
.article-header { max-width: 850px; }
.article-header h1 { margin: 0; color: var(--blog-ink); font-size: clamp(2.25rem, 4vw, 4rem); line-height: 1.06; overflow-wrap: anywhere; }
.article-lead { max-width: 780px; margin: 20px 0 12px; color: var(--blog-muted); font-size: 19px; line-height: 1.65; }
.article-meta { color: #68788a; font-size: 14px; }
.article-featured { display: grid; width: 100%; max-width: 820px; max-height: 420px; margin: 34px 0 42px; place-items: center; overflow: hidden; background: transparent; }
.article-featured img { display: block; width: min(100%, 700px); max-height: 420px; height: auto; object-fit: contain; }
.article-content { max-width: 780px; color: var(--blog-muted); font-size: 17px; line-height: 1.75; }
.article-content h2 { margin: 46px 0 14px; color: var(--blog-ink); font-size: 30px; line-height: 1.18; }
.article-content h3 { margin: 30px 0 10px; color: var(--blog-ink); font-size: 21px; line-height: 1.3; }
.article-content p { margin: 0 0 19px; }
.article-content ul, .article-content ol { margin: 0 0 23px; padding-left: 24px; }
.article-content li { margin-bottom: 8px; }
.article-content a { color: var(--blog-button); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.article-content strong { color: var(--blog-ink); }
.article-note { margin: 28px 0; padding: 20px 22px; border-left: 4px solid var(--blog-green); background: #fff; }
.article-diagram { display: grid; max-width: 760px; margin: 30px 0 38px; place-items: center; overflow: hidden; background: transparent; }
.article-diagram img { display: block; width: min(100%, 720px); max-height: 360px; height: auto; object-fit: contain; }
.article-diagram figcaption { max-width: 650px; padding: 12px 0 0; color: #68788a; font-size: 13px; line-height: 1.5; }
.article-layout > .blog-sidebar { margin-top: 4px; }
.related-articles { margin-top: 54px; padding-top: 34px; border-top: 1px solid var(--blog-border); }
.related-articles h2 { margin: 0 0 22px; color: var(--blog-ink); font-size: 28px; }
.related-articles .blog-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.related-articles .blog-card__media { display: none; }
.related-articles .blog-card__body { padding: 18px 20px 20px; }
.related-articles .blog-card h3 { font-size: 18px; }

@media (max-width: 980px) {
  .blog-directory, .article-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
  .blog-tools { grid-template-columns: 1fr; }
  .blog-filters { justify-content: flex-start; }
}

@media (max-width: 820px) {
  .blog-directory, .article-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-cta { grid-column: 1 / -1; }
  .article-layout > .blog-sidebar { margin-top: 8px; }
}

@media (max-width: 620px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .blog-main, .article-main, .blog-container, .article-shell, .article-layout, .article-primary { min-width: 0; }
  .blog-container, .article-shell { width: calc(100vw - 24px); max-width: calc(100vw - 24px); box-sizing: border-box; padding-right: 12px; padding-left: 12px; }
  .blog-hero { padding: 38px 0 30px; }
  .blog-hero h1 { font-size: 2.35rem; }
  .blog-hero__intro, .article-lead { font-size: 16px; }
  .blog-tools { margin-top: 22px; padding: 14px; }
  .blog-search-wrap { display: grid; grid-template-columns: 1fr; }
  .blog-search-wrap button { width: 100%; }
  .blog-section, .article-main { padding: 42px 0 54px; }
  .blog-section__heading { display: block; }
  .blog-section__heading p { margin-top: 12px; }
  .blog-card-grid, .related-articles .blog-card-grid { grid-template-columns: 1fr; gap: 18px; }
  .blog-card__body { padding: 20px; }
  .blog-sidebar { grid-template-columns: 1fr; }
  .sidebar-cta { grid-column: auto; }
  .article-layout { gap: 28px; }
  .article-header, .article-content, .article-featured, .breadcrumbs { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .article-header h1 { font-size: 2.2rem; }
  .article-content { font-size: 16px; line-height: 1.68; }
  .article-content h2 { margin-top: 36px; font-size: 25px; }
  .article-featured { max-height: 300px; margin-top: 26px; margin-bottom: 32px; }
  .article-featured img { width: 100%; max-width: 100%; max-height: 300px; padding: 0 8px; box-sizing: border-box; }
  .article-diagram { width: 100%; max-width: 100%; margin-top: 24px; margin-bottom: 30px; }
  .article-diagram img { width: 100%; max-width: 100%; max-height: 260px; }
}
