.blog-page {
  min-height: 100vh;
}

.blog-main,
.post-shell {
  width: min(1180px, 94vw);
  margin: 0 auto;
  padding: clamp(1.1rem, 2vw, 1.6rem) 0 clamp(4rem, 8vw, 5.5rem);
}

.archive-head,
.post-head,
.post-panel,
.archive-card,
.archive-featured,
.archive-empty,
.archive-pagination {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 249, 255, 0.96));
  box-shadow: var(--shadow-sm);
}

.archive-head {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: grid;
  gap: 1rem;
}

.archive-kicker,
.post-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: rgba(57, 21, 175, 0.08);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.archive-head h1,
.post-head h1 {
  margin: 0;
  max-width: 14ch;
  font-family: "Fraunces", serif;
  font-size: clamp(2.3rem, 5.8vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.archive-copy,
.post-deck {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.7;
}

.archive-toolbar {
  display: grid;
  gap: 1rem;
}

.archive-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.archive-search input {
  flex: 1 1 280px;
  min-width: 0;
  border: 1px solid #d7d1f7;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0.95rem 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.archive-search input:focus {
  outline: 2px solid rgba(57, 21, 175, 0.18);
  outline-offset: 2px;
  border-color: rgba(57, 21, 175, 0.35);
}

.archive-search button,
.archive-search a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.archive-search button {
  border: 0;
  color: #fff;
  background: linear-gradient(145deg, #3915af, #2b1e79);
  cursor: pointer;
}

.archive-search a {
  border: 1px solid #cbc2fa;
  color: #291d74;
  background: #fff;
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem;
}

.category-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.62rem 0.9rem;
  border: 1px solid #ddd8fb;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #44398f;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.category-link:hover,
.category-link.active {
  border-color: rgba(57, 21, 175, 0.2);
  background: rgba(57, 21, 175, 0.08);
  color: var(--brand);
}

.archive-state,
.post-meta,
.archive-meta,
.related-meta,
.post-breadcrumbs {
  color: #645f93;
  font-size: 0.9rem;
}

.archive-featured {
  margin-top: 1.4rem;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.archive-featured-media,
.archive-card-media,
.post-hero-media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(57, 21, 175, 0.12), rgba(254, 190, 18, 0.15));
}

.archive-featured-media {
  min-height: 360px;
}

.archive-featured-media img,
.archive-card-media img,
.post-hero-media img,
.post-content img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.archive-featured-copy {
  padding: clamp(1.4rem, 2.6vw, 2rem);
  display: grid;
  align-content: center;
  gap: 0.9rem;
}

.archive-featured-copy h2,
.archive-card-copy h2 {
  margin: 0;
  color: #1f1851;
  font-size: clamp(1.55rem, 2.3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.archive-featured-copy p,
.archive-card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.archive-grid {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.archive-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.archive-card:hover,
.archive-featured:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 42px rgba(29, 22, 86, 0.13);
  border-color: rgba(57, 21, 175, 0.18);
}

.archive-card-media {
  aspect-ratio: 16 / 10;
}

.archive-card-copy {
  padding: 1.15rem 1.15rem 1.25rem;
  display: grid;
  gap: 0.8rem;
}

.archive-meta,
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
}

.archive-meta span,
.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.archive-meta span::before,
.post-meta span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(57, 21, 175, 0.3);
}

.archive-meta span:first-child::before,
.post-meta span:first-child::before {
  display: none;
}

.archive-pagination,
.archive-empty {
  margin-top: 1.4rem;
  padding: 1.1rem 1.25rem;
}

.archive-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.archive-pagination a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.post-shell {
  display: grid;
  gap: 1.15rem;
}

.post-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.4rem;
}

.post-breadcrumbs a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.post-head {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: grid;
  gap: 0.95rem;
}

.post-head h1 {
  max-width: 16ch;
}

.post-hero-media {
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 16 / 8.2;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.55fr);
  gap: 1.1rem;
  align-items: start;
}

.post-article {
  min-width: 0;
}

.post-content {
  padding: clamp(1.35rem, 2.6vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-sm);
  color: #261f5c;
  line-height: 1.85;
}

.post-content > *:first-child {
  margin-top: 0;
}

.post-content > *:last-child {
  margin-bottom: 0;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre,
.post-content table,
.post-content figure {
  margin: 0 0 1.25rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin: 2rem 0 0.85rem;
  color: #1c1548;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.post-content h2 {
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.post-content h3 {
  font-size: clamp(1.2rem, 1.7vw, 1.45rem);
}

.post-content a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

.post-content strong {
  color: #1a1444;
}

.post-content ul,
.post-content ol {
  padding-left: 1.2rem;
}

.post-content li + li {
  margin-top: 0.45rem;
}

.post-content blockquote {
  padding: 1rem 1.1rem;
  border-left: 4px solid rgba(57, 21, 175, 0.35);
  border-radius: 0 18px 18px 0;
  background: rgba(57, 21, 175, 0.06);
  color: #342b75;
}

.post-content hr {
  border: 0;
  border-top: 1px solid #e3def9;
  margin: 1.7rem 0;
}

.post-content img {
  height: auto;
  border-radius: 18px;
  margin: 1.2rem 0;
  box-shadow: 0 16px 34px rgba(29, 22, 86, 0.12);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #e1dcf8;
}

.post-content th,
.post-content td {
  padding: 0.82rem 0.9rem;
  border-bottom: 1px solid #ece8fb;
  text-align: left;
  vertical-align: top;
}

.post-content th {
  background: #f7f5ff;
}

.post-sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 104px;
}

.post-panel {
  padding: 1.2rem;
  display: grid;
  gap: 0.9rem;
}

.post-panel h3 {
  margin: 0;
  font-size: 1rem;
  color: #211956;
}

.share-copy,
.share-url {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.share-url {
  overflow-wrap: anywhere;
  text-decoration: none;
}

.share-grid,
.related-list {
  display: grid;
  gap: 0.72rem;
}

.share-action,
.related-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  padding: 0.88rem 0.95rem;
  border: 1px solid #ded8fb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #2a1d77;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
}

.share-action {
  cursor: pointer;
}

.share-action:hover,
.related-item:hover {
  border-color: rgba(57, 21, 175, 0.22);
  background: rgba(57, 21, 175, 0.05);
}

.related-item strong {
  color: #1f1851;
  line-height: 1.45;
}

@media (max-width: 1080px) {
  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-layout {
    grid-template-columns: 1fr;
  }

  .post-sidebar {
    position: static;
  }
}

@media (max-width: 860px) {
  .archive-featured {
    grid-template-columns: 1fr;
  }

  .archive-featured-media {
    min-height: 260px;
  }
}

@media (max-width: 720px) {
  .archive-grid {
    grid-template-columns: 1fr;
  }

  .archive-head h1,
  .post-head h1 {
    max-width: none;
  }

  .archive-pagination {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .blog-main,
  .post-shell {
    padding-bottom: 3.5rem;
  }

  .archive-head,
  .post-head,
  .post-content,
  .post-panel,
  .archive-card-copy,
  .archive-featured-copy {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .archive-search {
    display: grid;
  }

  .archive-search button,
  .archive-search a {
    width: 100%;
  }

  .post-content table,
  .post-content thead,
  .post-content tbody,
  .post-content tr,
  .post-content th,
  .post-content td {
    display: block;
  }

  .post-content thead {
    display: none;
  }

  .post-content tr {
    padding: 0.1rem 0;
  }

  .post-content td {
    padding: 0.65rem 0;
    border-bottom: 0;
  }
}
