.am-blog-list-page [hidden],
.am-blog-article-page [hidden],
.article-float[hidden],
.am-blog-panel[hidden],
.am-blog-empty[hidden],
.blg-magazine[hidden],
.am-blog-count[hidden] {
  display: none !important;
}

.am-blog-list-page main,
.am-blog-article-page main {
  overflow-x: clip;
}

.am-blog-hero {
  padding-block: var(--am-hero-crumb-pad) var(--am-space-8);
  background: var(--am-paper);
  color: #171a24;
}

.am-blog-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(20rem, .75fr);
  gap: var(--am-space-6);
  align-items: end;
}

.am-blog-hero__copy,
.am-blog-hero__side {
  min-width: 0;
}

.am-blog-hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.am-blog-hero__copy .am-kicker {
  margin-bottom: var(--am-space-2);
}

.am-blog-hero__copy h1 {
  max-width: 16ch;
  margin: 0;
  overflow-wrap: break-word;
  line-height: 1.15;
}

.am-blog-hero__side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--am-space-3);
}

.am-blog-hero__side p {
  margin: 0;
  color: var(--am-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.am-blog-count {
  display: inline-flex;
  align-items: center;
  gap: var(--am-space-1);
  width: fit-content;
  padding: .55em .9em;
  border-radius: var(--am-radius-pill);
  background: var(--am-surface);
  color: var(--am-ink);
  box-shadow: 0 12px 34px rgba(23, 26, 36, .08);
}

#blg-article-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding-inline: .45rem;
  border-radius: var(--am-radius-pill);
  background: var(--am-primary);
  color: #fff;
  font-family: var(--am-font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.am-blog-library {
  background: var(--am-paper);
  color: var(--am-ink);
}

.am-blog-library .am-section-head {
  margin-bottom: var(--am-space-6);
}

.am-blog-library .am-section-head > * {
  min-width: 0;
}

.am-blog-library .am-section-head .am-kicker,
.am-blog-panel__head .am-kicker {
  margin-bottom: var(--am-space-2);
}

.am-blog-library .am-section-head h2,
.am-blog-panel__head h2 {
  margin: 0;
}

.am-blog-library .am-section-head > p {
  margin: 0;
  color: var(--am-muted);
  overflow-wrap: break-word;
}

.am-blog-panel {
  min-width: 0;
}

.am-blog-panel--series {
  margin-top: var(--am-section-space);
}

.am-blog-panel__head {
  margin-bottom: var(--am-space-4);
}

.blg-magazine {
  display: block;
  margin-bottom: var(--am-space-4);
}

.blog-grid,
.blg-grid,
.blg-grid--rest,
.blg-grid--openclaw-rest {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--am-space-4);
  align-items: stretch;
  background: transparent;
}

.blog-card {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.blg-featured {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--am-radius-lg);
  background: var(--am-surface);
  color: var(--am-ink);
  box-shadow: 0 20px 55px rgba(23, 26, 36, .09);
  transition: transform .22s ease, box-shadow .22s ease;
}

.blg-magazine > .blg-featured {
  grid-column: 1 / -1;
  align-self: start;
}

.blg-featured:hover,
.blg-featured:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 25px 65px rgba(23, 26, 36, .14);
}

.blg-featured:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--am-primary) 45%, transparent);
  outline-offset: 4px;
}

.blg-featured__media {
  position: relative;
  min-width: 0;
  height: clamp(18rem, 32vw, 25rem);
  overflow: hidden;
  background: var(--am-dark);
  color: #fff;
}

.blg-featured__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.blg-featured:hover .blg-featured__img,
.blg-featured:focus-visible .blg-featured__img {
  transform: scale(1.025);
}

.blg-featured__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 26, 36, .08), rgba(23, 26, 36, .82));
  pointer-events: none;
}

.blg-featured__overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--am-space-2);
  min-width: 0;
  padding: var(--am-space-4);
  color: #fff;
}

.blg-featured__pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .45em .9em;
  border-radius: var(--am-radius-pill);
  background: rgba(255, 255, 255, .92);
  color: #171a24;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1;
}

.blg-featured__hl {
  max-width: 20ch;
  margin: 0;
  color: #fff;
  font-size: clamp(1.45rem, 2.5vw, 2.25rem);
  line-height: 1.18;
  overflow-wrap: break-word;
}

.blg-featured__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--am-space-5);
  color: var(--am-ink);
}

.blg-featured__excerpt {
  margin: 0 0 var(--am-space-4);
  color: var(--am-muted);
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.blg-featured__meta {
  margin-top: auto;
  padding-top: var(--am-space-3);
  border-top: 1px solid var(--am-line);
  color: var(--am-muted);
}

.blg-featured__hint {
  font-family: var(--am-font-mono);
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

.blg-featured.blg-compact {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--am-radius-md);
  box-shadow: 0 14px 38px rgba(23, 26, 36, .07);
}

.blg-featured.blg-compact .blg-featured__media {
  width: 100%;
  height: clamp(12rem, 20vw, 15rem);
  flex: 0 0 auto;
}

.blg-featured.blg-compact .blg-featured__overlay {
  padding: var(--am-space-3);
}

.blg-featured.blg-compact .blg-featured__hl {
  max-width: 26ch;
  font-size: clamp(1.08rem, 1.8vw, 1.3rem);
  line-height: 1.28;
}

.blg-featured.blg-compact .blg-featured__pill {
  font-size: .75rem;
}

.blg-featured.blg-compact .blg-featured__body {
  flex: 1;
  padding: var(--am-space-3);
}

.blg-featured.blg-compact .blg-featured__excerpt {
  display: -webkit-box;
  margin-bottom: var(--am-space-3);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.blg-featured.blg-compact .blg-featured__meta {
  margin-top: auto;
}

.am-blog-empty {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: var(--am-space-5);
  align-items: start;
  padding: var(--am-space-5);
  border-radius: var(--am-radius-lg);
  background: var(--am-mint);
  color: var(--am-mint-ink);
}

.am-blog-empty__copy,
.am-blog-empty__links {
  min-width: 0;
}

.am-blog-empty__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.am-blog-empty__copy .am-kicker {
  margin-bottom: var(--am-space-2);
}

.am-blog-empty__copy h3 {
  margin: 0 0 var(--am-space-2);
  font-size: 1.3rem;
}

.am-blog-empty__copy p {
  margin: 0;
  color: color-mix(in srgb, var(--am-mint-ink) 75%, transparent);
  line-height: 1.65;
}

.am-blog-empty__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--am-space-3);
}

.am-blog-empty__link {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--am-space-3);
  border-radius: var(--am-radius-md);
  background: var(--am-surface);
  color: var(--am-ink);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.am-blog-empty__link:hover,
.am-blog-empty__link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(23, 26, 36, .09);
}

.am-blog-empty__link strong {
  margin-bottom: var(--am-space-1);
  font-size: 1rem;
}

.am-blog-empty__link span {
  color: var(--am-muted);
  line-height: 1.55;
}

.am-blog-closing {
  background: var(--am-paper);
  color: var(--am-ink);
}

.am-blog-closing .c-cta-panel {
  min-width: 0;
}

.am-blog-closing .c-cta-panel .am-kicker {
  margin-bottom: var(--am-space-2);
}

.am-blog-closing__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--am-space-2);
  min-width: 0;
}

.am-blog-closing__actions .c-btn {
  width: 100%;
  justify-content: center;
}

.am-blog-closing .c-btn-ghost {
  color: #fff;
  border-color: color-mix(in srgb, currentColor 40%, transparent);
}

.am-blog-article {
  padding-bottom: var(--am-section-space);
  background: var(--am-paper);
  color: var(--am-ink);
}

.am-blog-article > * {
  width: min(calc(100% - var(--am-space-6)), 56rem);
  margin-inline: auto;
  padding-inline: 0;
}

.article-breadcrumb {
  padding-top: var(--am-hero-pad);
  margin-bottom: var(--am-space-5);
}

.article-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--am-space-1);
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-breadcrumb li {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  color: var(--am-muted);
}

.article-breadcrumb li + li::before {
  content: "›";
  margin-inline-end: var(--am-space-1);
  color: var(--am-muted);
}

.article-breadcrumb a {
  color: var(--am-accent);
  text-decoration: none;
}

.article-breadcrumb [aria-current="page"] {
  max-width: 38ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blog-article-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  margin-bottom: var(--am-space-5);
}

.blog-article-header .am-kicker {
  margin-bottom: var(--am-space-2);
}

.blog-article-header h1 {
  max-width: 19ch;
  margin: 0;
  font-size: clamp(2.15rem, 6vw, 4rem);
  line-height: 1.15;
  overflow-wrap: break-word;
}

.blog-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--am-space-2);
  margin-top: var(--am-space-3);
}

.blog-article-date,
.blog-article-lead {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-width: 0;
  margin: 0;
  padding: .55em .9em;
  border-radius: var(--am-radius-pill);
  line-height: 1;
}

.blog-article-date {
  background: var(--am-primary);
  color: #fff;
  font-family: var(--am-font-mono);
  font-variant-numeric: tabular-nums;
}

.blog-article-lead {
  background: var(--am-plum);
  color: var(--am-plum-ink);
}

.blog-article-readtime {
  margin-inline-start: .35em;
}

.article-hero {
  height: clamp(18rem, 45vw, 29rem);
  margin-block: 0 var(--am-space-5);
  overflow: hidden;
  border-radius: var(--am-radius-lg);
  background: var(--am-plum);
  color: var(--am-plum-ink);
}

.article-hero img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 29rem;
  object-fit: cover;
}

.blog-article-body {
  min-width: 0;
  font-size: 1.0625rem;
  line-height: 1.72;
}

.blog-article-body > :first-child {
  margin-top: 0;
}

.blog-article-body h2,
.blog-article-body h3 {
  max-width: 100%;
  color: var(--am-ink);
  line-height: 1.3;
  overflow-wrap: break-word;
}

.blog-article-body h2 {
  margin: var(--am-space-5) 0 var(--am-space-2);
  font-size: 1.55rem;
}

.blog-article-body h3 {
  margin: var(--am-space-4) 0 var(--am-space-2);
  font-size: 1.55rem;
}

.blog-article-body h2[id],
.blog-article-body h3[id] {
  scroll-margin-top: 7rem;
}

.blog-article-body p {
  margin: 0 0 var(--am-space-3);
}

.blog-article-body ul,
.blog-article-body ol {
  margin: 0 0 var(--am-space-3);
  padding-inline-start: 1.4em;
}

.blog-article-body li + li {
  margin-top: var(--am-space-1);
}

.blog-article-body a:not(.c-btn) {
  color: var(--am-accent);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

.blog-article-body a:not(.c-btn):hover,
.blog-article-body a:not(.c-btn):focus-visible {
  color: var(--am-primary-deep);
}

.blog-article-body strong {
  color: var(--am-ink);
}

.blog-article-body mark {
  padding-inline: .14em;
  background: linear-gradient(transparent 42%, var(--am-sand) 42%);
  color: var(--am-ink);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.blog-article-body del {
  color: var(--am-muted);
}

.blog-article-body blockquote {
  margin: var(--am-space-4) 0;
  padding: var(--am-space-3) var(--am-space-4);
  border-inline-start: 4px solid var(--am-primary);
  border-radius: 0 var(--am-radius-md) var(--am-radius-md) 0;
  background: var(--am-plum);
  color: var(--am-plum-ink);
}

.blog-article-body blockquote p:last-child {
  margin-bottom: 0;
}

.blog-article-body pre,
.blog-article-body .code-scroll {
  max-width: 100%;
  margin: var(--am-space-4) 0;
  padding: var(--am-space-3);
  overflow-x: auto;
  border-radius: var(--am-radius-md);
  background: var(--am-dark);
  color: #f7f7fb;
  line-height: 1.6;
}

.blog-article-body code {
  font-family: var(--am-font-mono);
  font-size: .93em;
}

.blog-article-body p code,
.blog-article-body li code,
.blog-article-body dd code {
  padding: .16em .4em;
  border-radius: var(--am-radius-sm);
  background: var(--am-plum);
  color: var(--am-plum-ink);
  overflow-wrap: anywhere;
}

.blog-article-body dl {
  margin: var(--am-space-4) 0;
}

.blog-article-body dt {
  margin-top: var(--am-space-2);
  color: var(--am-ink);
  font-weight: 700;
}

.blog-article-body dd {
  margin: var(--am-space-1) 0 0;
  padding-inline-start: var(--am-space-3);
  border-inline-start: 2px solid var(--am-line);
  color: var(--am-muted);
}

.blog-article-body .table-scroll {
  width: 100%;
  max-width: 100%;
  margin: var(--am-space-4) 0;
  overflow-x: auto;
}

.blog-article-body table {
  display: table;
  width: 100%;
  min-width: 38rem;
  border-collapse: collapse;
  background: var(--am-surface);
  color: var(--am-ink);
  font-variant-numeric: tabular-nums;
}

.blog-article-body th,
.blog-article-body td {
  min-width: 8rem;
  padding: var(--am-space-2) var(--am-space-3);
  border-bottom: 1px solid var(--am-line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.blog-article-body th {
  background: var(--am-mint);
  color: var(--am-mint-ink);
  font-weight: 700;
}

.blog-article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--am-radius-md);
  box-shadow: 0 16px 40px rgba(23, 26, 36, .09);
}

.blog-article-body figure {
  margin: var(--am-space-4) 0;
}

.blog-article-body figcaption {
  margin-top: var(--am-space-1);
  color: var(--am-muted);
  font-size: .88rem;
  line-height: 1.5;
  text-align: center;
}

.article-toc {
  margin: 0 0 var(--am-space-4);
  padding: var(--am-space-4);
  border-inline-start: 4px solid var(--am-primary);
  border-radius: var(--am-radius-md);
  background: var(--am-plum);
  color: var(--am-plum-ink);
}

.article-toc__title {
  margin: 0 0 var(--am-space-2) !important;
  color: var(--am-plum-ink);
  font-size: 1rem;
  font-weight: 800;
}

.article-toc__list,
.article-toc__sublist {
  margin-bottom: 0 !important;
}

.article-toc__list {
  padding-inline-start: 1.5em !important;
}

.article-toc__sublist {
  margin-top: var(--am-space-1) !important;
  padding-inline-start: 1.25em !important;
}

.article-toc li::marker {
  color: var(--am-primary);
  font-family: var(--am-font-mono);
  font-weight: 700;
}

.article-toc a:not(.c-btn) {
  color: var(--am-plum-ink);
}

.article-faq__item {
  margin: 0;
  border-top: 1px solid var(--am-line);
  background: var(--am-surface);
  color: var(--am-ink);
}

.article-faq__item:last-of-type {
  border-bottom: 1px solid var(--am-line);
}

.article-faq__q {
  padding: var(--am-space-2) var(--am-space-3);
  color: var(--am-ink);
  font-weight: 700;
  cursor: pointer;
  overflow-wrap: break-word;
}

.article-faq__a {
  padding: var(--am-space-2) var(--am-space-3) var(--am-space-3);
  border-top: 1px solid var(--am-line);
  background: var(--am-surface);
  color: var(--am-muted);
}

.article-faq__a p:last-child {
  margin-bottom: 0;
}

.article-further-reading {
  margin: var(--am-space-4) 0;
  padding: var(--am-space-4);
  border-radius: var(--am-radius-md);
  background: var(--am-mint);
  color: var(--am-mint-ink);
}

.article-further-reading h3 {
  margin-top: 0;
  color: var(--am-mint-ink);
}

.article-further-reading ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--am-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-further-reading li {
  min-width: 0;
  margin: 0;
}

.article-cta-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  height: 100%;
  padding: var(--am-space-3);
  border: 1px solid var(--am-line);
  border-radius: var(--am-radius-md);
  background: var(--am-surface);
  color: var(--am-ink) !important;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.article-cta-link::after {
  content: "→";
  flex: 0 0 auto;
  margin-inline-start: var(--am-space-2);
  color: var(--am-primary);
}

.article-cta-link:hover,
.article-cta-link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(23, 26, 36, .09);
}

.article-mac-promo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--am-space-4);
  align-items: center;
  margin: var(--am-space-4) 0 0;
  padding: var(--am-space-4);
  border-radius: var(--am-radius-lg);
  background: var(--am-primary);
  color: #fff;
}

.article-mac-promo > * {
  min-width: 0;
}

.article-mac-promo .am-kicker {
  margin-bottom: var(--am-space-2);
}

.article-mac-promo h2,
.article-mac-promo h3 {
  margin: 0 0 var(--am-space-2);
  color: #fff;
}

.article-mac-promo p {
  margin: 0;
  color: rgba(255, 255, 255, .82);
}

.article-mac-promo .c-btn-secondary {
  background: #fff;
  color: var(--am-primary-deep);
  border-color: #fff;
}

.article-float {
  position: fixed;
  right: var(--am-space-3);
  bottom: var(--am-space-3);
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(18rem, calc(100vw - var(--am-space-6)));
  overflow: hidden;
  padding: var(--am-space-3);
  border-top: 4px solid var(--am-accent);
  border-radius: var(--am-radius-md);
  background: var(--am-dark);
  color: #fff;
  box-shadow: 0 24px 70px rgba(23, 26, 36, .28);
}

.article-float__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--am-space-2);
  align-items: start;
  margin-bottom: var(--am-space-3);
}

.article-float__title {
  min-width: 0;
  color: #fff;
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.article-float__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--am-radius-pill);
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.article-float__close svg {
  width: 1rem;
  height: 1rem;
}

.article-float .c-btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 56.25rem) {
  .article-float {
    display: none !important;
  }
}

@media (max-width: 48rem) {
  .am-blog-hero__grid,
  .am-blog-empty,
  .article-mac-promo {
    grid-template-columns: minmax(0, 1fr);
  }

  .am-blog-hero__copy h1 {
    max-width: 100%;
  }

  .blog-grid,
  .blg-grid,
  .blg-grid--rest,
  .blg-grid--openclaw-rest {
    grid-template-columns: minmax(0, 1fr);
  }

  .blg-featured {
    display: flex;
    flex-direction: column;
  }

  .blg-featured__media {
    width: 100%;
    height: clamp(14rem, 60vw, 20rem);
  }

  .blg-featured__body {
    padding: var(--am-space-3);
  }

  .am-blog-empty__links,
  .article-further-reading ul {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-mac-promo .c-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 24.375rem) {
  .am-blog-hero {
    padding-bottom: var(--am-space-6);
  }

  .am-blog-hero__grid {
    gap: var(--am-space-4);
  }

  .am-blog-empty {
    padding: var(--am-space-3);
  }

  .article-breadcrumb {
    padding-top: var(--am-space-8);
  }

  .blog-article-header h1 {
    font-size: clamp(2rem, 12vw, 2.8rem);
  }

  .blog-article-meta {
    align-items: flex-start;
  }

  .blog-article-date,
  .blog-article-lead {
    max-width: 100%;
    line-height: 1.3;
  }

  .article-hero {
    height: 15rem;
    border-radius: var(--am-radius-md);
  }

  .article-toc,
  .article-further-reading,
  .article-mac-promo {
    padding: var(--am-space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blg-featured,
  .blg-featured__img,
  .am-blog-empty__link,
  .article-cta-link {
    transition: none;
  }

  .blg-featured:hover,
  .blg-featured:focus-visible,
  .am-blog-empty__link:hover,
  .am-blog-empty__link:focus-visible,
  .article-cta-link:hover,
  .article-cta-link:focus-visible {
    transform: none;
  }
}
