.page-shell--blog {
  --blog-bg-start: #f8fbff;
  --blog-bg-mid: #f3f7fc;
  --blog-bg-end: #fff9f2;
  --blog-card: linear-gradient(135deg, rgba(247, 251, 255, 0.94), rgba(255, 250, 242, 0.68));
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 12%, rgba(124, 163, 214, 0.14), transparent 28rem),
    radial-gradient(circle at 86% 24%, rgba(231, 166, 79, 0.14), transparent 25rem),
    linear-gradient(135deg, var(--blog-bg-start) 0%, var(--blog-bg-mid) 48%, var(--blog-bg-end) 100%);
}

.blog-page {
  width: var(--page-width);
  margin: 0 auto;
  background: var(--blog-card);
  box-shadow: var(--shadow);
  border: 1px solid var(--home-border);
  border-radius: 0.75rem;
  padding: 0.62in 0.72in 0.5in;
  backdrop-filter: blur(18px);
}

.blog-hero {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.blog-hero__eyebrow,
.blog-card__category,
.blog-article__category {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-hero__title,
.blog-article__title {
  margin: 0.32rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.blog-hero__description,
.blog-article__summary {
  max-width: 35rem;
  margin: 0.46rem 0 0;
  color: var(--muted);
}

.blog-index {
  margin-top: 1.35rem;
}

.blog-post-list {
  display: grid;
  gap: 0.9rem;
}

.blog-category {
  padding: 0.2rem 0 0;
}

.blog-category__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.2rem 0;
  cursor: pointer;
  list-style: none;
}

.blog-category__summary::-webkit-details-marker {
  display: none;
}

.blog-category__summary::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transform-origin: 45% 55%;
  transition: transform 160ms ease, border-color 160ms ease;
}

.blog-category[open] .blog-category__summary::before {
  transform: rotate(45deg);
}

.blog-category__label {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.blog-category__count {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  margin-left: 0.15rem;
}

.blog-category__posts {
  display: grid;
  gap: 0.75rem;
  padding: 0.72rem 0 0.3rem 1rem;
}

.blog-post-list:empty::before,
.blog-loading {
  content: "Loading posts...";
  margin: 0;
  color: var(--muted);
}

.blog-card {
  display: block;
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(24, 32, 42, 0.08);
  border-radius: 0.5rem;
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.blog-card:hover,
.blog-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(73, 86, 106, 0.22);
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(24, 32, 42, 0.08);
}

.blog-card h3 {
  margin: 0.32rem 0 0;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.28;
}

.blog-card p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.blog-card__meta,
.blog-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.62rem;
  margin-top: 0.58rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.72rem;
}

.blog-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0 0.52rem;
  border: 1px solid rgba(73, 86, 106, 0.14);
  border-radius: 999px;
  background: rgba(73, 86, 106, 0.06);
  color: #465364;
  font-size: 0.78rem;
  font-weight: 650;
}

.blog-article__header {
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--rule);
}

.blog-article__body {
  max-width: 42rem;
  margin-top: 1.25rem;
  font-family: var(--font-blog-body);
}

.blog-article__body h2 {
  margin: 1.4rem 0 0.48rem;
  color: var(--accent-dark);
  font-size: 1.08rem;
  line-height: 1.28;
}

.blog-article__body p,
.blog-article__body li {
  color: #3f4c5b;
}

.blog-inline-ref {
  font-weight: 600;
}

.blog-article__body p {
  margin: 0.62rem 0 0;
}

.blog-article__body a {
  color: #2868aa;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.blog-article__emphasis {
  color: var(--accent-dark);
  font-style: italic;
  font-weight: 500;
}

.blog-article__body ul,
.blog-article__body ol {
  margin: 0.62rem 0 0 1.18rem;
  padding: 0;
}

.blog-article__body li {
  margin: 0.28rem 0;
}

.blog-article__body blockquote {
  margin: 0.85rem 0 0;
  padding: 0.72rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(73, 86, 106, 0.06);
  color: #3f4c5b;
}

.blog-article__body blockquote p {
  margin: 0;
  font-style: italic;
}

.blog-figure,
.blog-table-figure {
  margin: 1rem 0 0;
}

.blog-figure {
  width: 100%;
}

.blog-figure--align-left,
.blog-table-figure--align-left {
  margin-left: 0;
  margin-right: auto;
}

.blog-figure--align-center,
.blog-table-figure--align-center {
  margin-left: auto;
  margin-right: auto;
}

.blog-figure--align-right,
.blog-table-figure--align-right {
  margin-left: auto;
  margin-right: 0;
}

.blog-figure__image {
  display: block;
  width: min(100%, 36rem);
  height: auto;
  margin: 0 auto;
  border: 1px solid rgba(24, 32, 42, 0.1);
  border-radius: 0.28rem;
  background: #ffffff;
}

.blog-figure-group__grid {
  display: grid;
  gap: 0.8rem;
}

.blog-figure-group__item {
  min-width: 0;
}

.blog-figure-group__image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(24, 32, 42, 0.1);
  border-radius: 0.28rem;
  background: #ffffff;
}

.blog-figure-group__item-caption {
  margin: 0.35rem 0 0;
  color: #556272;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
}

.blog-figure__caption,
.blog-table__caption,
.blog-table {
  font-family: "Times New Roman", Times, serif;
}

.blog-figure__caption,
.blog-table__caption {
  margin-top: 0.45rem;
  color: #4d5967;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
}

.blog-caption__label {
  font-weight: 700;
}

.blog-table-wrap {
  overflow-x: auto;
}

.blog-table {
  width: 100%;
  margin-top: 0;
  border-collapse: collapse;
  color: #2f3c4b;
  font-size: 0.95rem;
  line-height: 1.45;
}

.blog-table th,
.blog-table td {
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(24, 32, 42, 0.14);
  text-align: left;
  vertical-align: top;
}

.blog-table th {
  background: rgba(73, 86, 106, 0.08);
  font-weight: 700;
}

.blog-error {
  margin: 0;
  color: var(--muted);
}

html[data-theme="dark"] .page-shell--blog {
  --blog-bg-start: #101821;
  --blog-bg-mid: #13231f;
  --blog-bg-end: #211b13;
  --blog-card: linear-gradient(135deg, rgba(20, 37, 42, 0.68), rgba(43, 34, 21, 0.42));
  background:
    radial-gradient(circle at 14% 10%, rgba(98, 211, 191, 0.16), transparent 28rem),
    radial-gradient(circle at 88% 24%, rgba(241, 182, 91, 0.13), transparent 25rem),
    linear-gradient(135deg, var(--blog-bg-start) 0%, var(--blog-bg-mid) 48%, var(--blog-bg-end) 100%);
}

html[data-theme="dark"] .blog-page {
  background: var(--blog-card);
  border-color: rgba(218, 232, 240, 0.12);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .blog-hero,
html[data-theme="dark"] .blog-article__header {
  border-color: rgba(218, 232, 240, 0.14);
}

html[data-theme="dark"] .blog-hero__title,
html[data-theme="dark"] .blog-article__title,
html[data-theme="dark"] .blog-card h3,
html[data-theme="dark"] .blog-article__body h2 {
  color: #edf4f7;
}

html[data-theme="dark"] .blog-hero__description,
html[data-theme="dark"] .blog-card p,
html[data-theme="dark"] .blog-card__meta,
html[data-theme="dark"] .blog-article__summary,
html[data-theme="dark"] .blog-article__meta,
html[data-theme="dark"] .blog-article__body p,
html[data-theme="dark"] .blog-article__body li,
html[data-theme="dark"] .blog-table,
html[data-theme="dark"] .blog-loading,
html[data-theme="dark"] .blog-error {
  color: #b6c3ce;
}

html[data-theme="dark"] .blog-hero__eyebrow,
html[data-theme="dark"] .blog-card__category,
html[data-theme="dark"] .blog-article__category {
  color: #7ab7f0;
}

html[data-theme="dark"] .blog-card {
  border-color: rgba(218, 232, 240, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .blog-category__label {
  color: #edf4f7;
}

html[data-theme="dark"] .blog-category__summary::before {
  border-color: #7ab7f0;
}

html[data-theme="dark"] .blog-category__count {
  color: #7ab7f0;
}

html[data-theme="dark"] .blog-card:hover,
html[data-theme="dark"] .blog-card:focus-visible {
  border-color: rgba(122, 183, 240, 0.32);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .blog-figure__image {
  border-color: rgba(218, 232, 240, 0.16);
}

html[data-theme="dark"] .blog-figure-group__image {
  border-color: rgba(218, 232, 240, 0.16);
}

html[data-theme="dark"] .blog-figure__caption,
html[data-theme="dark"] .blog-table__caption,
html[data-theme="dark"] .blog-figure-group__item-caption {
  color: #c6d3dd;
}

html[data-theme="dark"] .blog-table th,
html[data-theme="dark"] .blog-table td {
  border-color: rgba(218, 232, 240, 0.16);
}

html[data-theme="dark"] .blog-table th {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .blog-tags span {
  border-color: rgba(122, 183, 240, 0.2);
  background: rgba(122, 183, 240, 0.08);
  color: #c8dff5;
}

html[data-theme="dark"] .blog-article__body blockquote {
  background: rgba(255, 255, 255, 0.06);
  color: #c6d3dd;
}

html[data-theme="dark"] .blog-article__body a,
html[data-theme="dark"] .blog-article__emphasis {
  color: #7ab7f0;
}

@media (max-width: 780px) {
  .blog-page {
    padding: 1.4rem 1rem 1.2rem;
  }

  .blog-figure-group__grid {
    grid-template-columns: 1fr !important;
  }
}
