/* Shared layout for index pages (categories + posts) */
.vp-content-wrapper {
  max-width: 76rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

@media (min-width: 48rem) {
  .vp-content-wrapper {
    padding: 3rem 2rem;
  }
}

.vp-content-header {
  margin-bottom: 2rem;
}

.vp-content-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--vp-c-text-1);
}

.vp-content-subtitle {
  font-size: 1rem;
  color: var(--vp-c-text-2);
  margin: 0;
  line-height: 1.6;
}

@media (min-width: 48rem) {
  .vp-content-header h1 {
    font-size: 2rem;
  }
}

/* Shared card grid */
.vp-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 30rem) {
  .vp-content-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 75rem) {
  .vp-content-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 90rem) {
  .vp-content-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Shared card */
.vp-content-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.4rem 1.2rem;
  border: 1px solid var(--vp-c-divider);
  border-radius: 0.75rem;
  background-color: var(--vp-c-bg-alt);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.vp-content-card:hover,
.vp-content-card:focus-visible {
  text-decoration: none;
  border-color: var(--vp-c-brand-1);
  background-color: var(--vp-c-bg);
  transform: translateY(-0.25rem);
  box-shadow: 0 0.75rem 2rem rgba(123, 197, 228, 0.2);
}

.vp-content-card-head {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.vp-content-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.6rem;
  line-height: 1;
  transform: translateY(-0.15em);
}

.vp-content-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--vp-c-text-1);
  margin: 0;
  line-height: 1.25;
}

.vp-content-card:hover .vp-content-card-title {
  color: var(--vp-c-brand-1);
}

.vp-content-card-description {
  font-size: 0.95rem;
  color: var(--vp-c-text-2);
  line-height: 1.6;
  margin: 0;
}

.vp-content-card-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.25rem 0 0;
  padding: 0;
}

.vp-content-card-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--vp-c-brand-1) 12%, var(--vp-c-bg));
  border: 1px solid color-mix(in srgb, var(--vp-c-brand-1) 30%, var(--vp-c-divider));
  color: var(--vp-c-text-1);
}

@media (min-width: 48rem) {
  .vp-content-card-title { font-size: 1.2rem; }
}

/* Sections (groups of cards) */
.vp-content-section {
  margin-bottom: 2.5rem;
}

.vp-content-section:last-child {
  margin-bottom: 0;
}

.vp-content-section-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  color: var(--vp-c-text-1);
  letter-spacing: 0.02em;
}

@media (min-width: 48rem) {
  .vp-content-section-title {
    font-size: 1.25rem;
    margin-bottom: 1.125rem;
  }
}

/* Tag filter chips above grid */
.vp-content-tagbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
  align-items: center;
}

.vp-content-tagbar-label {
  font-size: 0.85rem;
  color: var(--vp-c-text-2);
  margin-right: 0.25rem;
}

.vp-content-tagbar button {
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background-color: var(--vp-c-bg-alt);
  border: 1px solid var(--vp-c-divider);
  color: var(--vp-c-text-2);
  cursor: pointer;
  transition: all 0.15s;
}

.vp-content-tagbar button:hover {
  border-color: var(--vp-c-brand-1);
  color: var(--vp-c-brand-1);
}

.vp-content-tagbar button.is-active {
  background-color: var(--vp-c-brand-1);
  color: var(--vp-c-bg);
  border-color: var(--vp-c-brand-1);
}

.vp-content-card.vp-tag-hidden,
.vp-content-card.vp-search-hidden {
  display: none;
}

.vp-content-section.vp-tag-hidden,
.vp-content-section.vp-search-hidden {
  display: none;
}

/* ---- TOC (right rail, used on /post/<slug>/ and /categories/<slug>/) ---- */
.vp-toc {
  display: none;
  font-size: 0.85rem;
  color: var(--vp-c-text-2);
}

@media (min-width: 64rem) {
  .vp-toc {
    display: block;
  }
}

.vp-toc-inner {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding-left: 1rem;
  border-left: 1px solid var(--vp-c-divider);
}

.vp-toc-title {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vp-c-text-1);
}

.vp-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vp-toc-item {
  margin: 0.25rem 0;
  line-height: 1.4;
}

.vp-toc-depth-3 {
  padding-left: 0.85rem;
  font-size: 0.8rem;
}

.vp-toc a {
  display: block;
  padding: 0.15rem 0;
  color: var(--vp-c-text-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1rem;
  padding-left: calc(1rem - 2px);
  transition: color 0.15s, border-color 0.15s;
}

.vp-toc a:hover {
  color: var(--vp-c-brand-1);
}

.vp-toc a.is-active {
  color: var(--vp-c-brand-1);
  border-left-color: var(--vp-c-brand-1);
  font-weight: 500;
}

/* Mobile TOC FAB + drawer */
.vp-toc-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background-color: var(--vp-c-brand-1);
  color: var(--vp-c-bg);
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.18);
}

.vp-toc-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 55;
  border: none;
  padding: 0;
}

@media (min-width: 64rem) {
  .vp-toc-fab,
  .vp-toc-backdrop {
    display: none !important;
  }
}

html.vp-toc-mobile-open .vp-toc {
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 22rem);
  z-index: 56;
  background-color: var(--vp-c-bg);
  border-left: 1px solid var(--vp-c-divider);
  padding: 4rem 1.25rem 1.5rem;
  overflow-y: auto;
  box-shadow: -0.5rem 0 1.5rem rgba(0, 0, 0, 0.2);
}

html.vp-toc-mobile-open .vp-toc-inner {
  position: static;
  max-height: none;
  border-left: none;
  padding-left: 0;
}

html.vp-toc-mobile-open .vp-toc-backdrop {
  display: block;
}

/* ---- Article wrapper with right TOC rail ---- */
.vp-post-wrapper {
  max-width: 56.25rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

@media (min-width: 48rem) {
  .vp-post-wrapper {
    padding: 3rem 2rem;
  }
}

@media (min-width: 64rem) {
  .vp-post-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 14rem;
    column-gap: 2.5rem;
    max-width: 76rem;
  }

  .vp-post-wrapper > .vp-breadcrumb,
  .vp-post-wrapper > .vp-post-content {
    grid-column: 1;
  }

  .vp-post-wrapper > .vp-toc {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* Breadcrumb */
.vp-breadcrumb {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--vp-c-text-2);
  flex-wrap: wrap;
}

.vp-breadcrumb a {
  color: var(--vp-c-brand-1);
  text-decoration: none;
  transition: color 0.2s;
}

.vp-breadcrumb a:hover {
  color: var(--vp-c-brand-2);
  text-decoration: underline;
}

.vp-breadcrumb-sep {
  margin: 0 0.25rem;
}

/* Post header (used inside article pages) */
.vp-post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--vp-c-divider);
}

.vp-post-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: var(--vp-c-text-1);
}

.vp-post-lead {
  font-size: 1rem;
  color: var(--vp-c-text-2);
  line-height: 1.6;
  margin: 1rem 0 0;
}

.vp-post-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
}

.vp-post-tags li {
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--vp-c-brand-1) 12%, var(--vp-c-bg));
  border: 1px solid color-mix(in srgb, var(--vp-c-brand-1) 30%, var(--vp-c-divider));
  color: var(--vp-c-text-1);
}

@media (min-width: 48rem) {
  .vp-post-header h1 {
    font-size: 2.5rem;
  }
}

/* Sidebar search input */
.vp-sidebar-search-wrap {
  padding: 0 0 0.75rem;
}

.vp-sidebar-search-input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  border: 1px solid var(--vp-c-divider);
  border-radius: 0.4rem;
  background-color: var(--vp-c-bg);
  color: var(--vp-c-text-1);
}

.vp-sidebar-search-input:focus {
  outline: none;
  border-color: var(--vp-c-brand-1);
}

.vp-sidebar-search-hidden {
  display: none !important;
}
