:root {
  --blog-reading: 56rem;
  --blog-copy-size: 1rem;
  --blog-list-title: clamp(2rem, 4.5vw, 3rem);
  --blog-article-title: clamp(1.8rem, 3.8vw, 2.6rem);
  --blog-section-title: clamp(1.3rem, 2.5vw, 1.6rem);
  --blog-subtitle: 1.3rem;
  --blog-small: 0.875rem;
  --blog-leading: 1.9;
  --blog-title-leading: 1.4;
  --blog-card-shift: -4px;
}

.blog-index,
.blog-article {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
}

.blog-index *,
.blog-article *,
.reading-wrap *,
.article-hero *,
.blog-hero * {
  box-sizing: border-box;
}

.blog-index h1,
.blog-index h2,
.blog-index h3,
.article-hero h1,
.blog-hero h1,
.article-body h1,
.article-body h2,
.article-body h3,
#related-posts h2,
#related-posts h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-title, -0.02em);
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.blog-index a:focus-visible,
.blog-index button:focus-visible,
.article-hero a:focus-visible,
.blog-hero a:focus-visible,
.reading-wrap a:focus-visible,
.article-body a:focus-visible,
#related-posts a:focus-visible,
#post-nav a:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 4px;
}

.blog-skip {
  position: fixed;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-pill);
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-float);
  transform: translateY(-200%);
}

.blog-skip:focus {
  transform: translateY(0);
}

/* All article regions share one outer box and one gutter. */
.reading-wrap,
.article-hero,
.blog-hero,
.blog-article .breadcrumbs,
.blog-article > main > .promo-block,
.blog-article > main > #related-posts,
.blog-article > main > #post-nav {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--blog-reading) + var(--gutter) + var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.reading-wrap.prose,
.prose.reading-wrap,
.reading-wrap .prose,
.article-body {
  font-size: var(--blog-copy-size);
  line-height: var(--blog-leading);
  color: var(--text);
}

.reading-wrap.prose,
.prose.reading-wrap {
  width: 100%;
  max-width: calc(var(--blog-reading) + var(--gutter) + var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.reading-wrap .prose,
.reading-wrap > .article-body {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.breadcrumbs {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: var(--blog-small);
  line-height: 1.8;
  color: var(--text-muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.breadcrumbs li + li::before {
  content: "›";
  margin-inline-end: 0.65rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-underline-offset: 0.2em;
}

.breadcrumbs a:hover {
  color: var(--text);
}

.blog-list-hero {
  padding-block: clamp(2rem, 5vw, 4rem);
  text-align: center;
}

.blog-list-hero .badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.6rem;
}

.blog-list-hero .badge__dot {
  flex-shrink: 0;
}

.blog-list-hero h1 {
  margin: 1.1rem 0;
  font-size: var(--blog-list-title);
  line-height: var(--blog-title-leading);
}

.blog-list-hero__summary {
  max-width: 40rem;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: var(--blog-copy-size);
  line-height: var(--blog-leading);
}

.blog-topic-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.blog-catalogue {
  padding-block: 1rem 2.5rem;
}

.blog-catalogue__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
}

.blog-catalogue__head h2 {
  margin: 0;
  font-size: var(--blog-section-title);
}

.blog-list-status {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--blog-small);
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}

.blog-filter {
  position: relative;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: var(--panel);
  font-family: var(--font-body);
  font-size: var(--blog-small);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color var(--speed), background var(--speed);
}

.blog-filter:hover {
  border-color: var(--text-muted);
}

.blog-filter[aria-pressed="true"] {
  padding-inline-start: 1.9rem;
  color: var(--text);
  background: var(--card);
  border-color: var(--text-muted);
}

.blog-filter[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.85rem;
  top: calc(50% - 0.2rem);
  width: 0.4rem;
  height: 0.4rem;
  border-radius: var(--radius-round);
  background: var(--accent);
}

.blog-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.article-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.6rem;
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-card);
  color: var(--text);
  transition: transform var(--speed), border-color var(--speed), box-shadow var(--speed);
}

.article-card:hover,
.article-card:focus-within {
  transform: translateY(var(--blog-card-shift));
  border-color: var(--text-muted);
  box-shadow: var(--shadow-float);
}

.article-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: var(--blog-small);
  line-height: 1.6;
}

.article-card .tag,
.blog-meta .tag {
  display: inline-block;
  max-width: 100%;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  background: var(--groove);
  font-size: var(--blog-small);
  white-space: normal;
  overflow-wrap: anywhere;
}

.article-card h3 {
  margin: 1rem 0 0.75rem;
  font-size: var(--blog-subtitle);
  line-height: 1.6;
}

.article-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.article-card h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article-card__summary {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: var(--blog-copy-size);
  line-height: 1.85;
}

.article-card__link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--text);
  font-size: var(--blog-small);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.blog-empty {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  color: var(--text-muted);
  line-height: var(--blog-leading);
}

.blog-empty a {
  color: var(--text);
}

.blog-list-promo {
  margin-block: 1rem 3rem;
}

/* Split-meta hero: text first in markup, compact metadata on the right. */
.article-hero,
.blog-hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  align-items: start;
  gap: 2rem;
  padding-block: 1rem 2rem;
}

.article-hero__copy,
.blog-hero__copy {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.article-hero h1,
.blog-hero h1 {
  margin: 0 0 1rem;
  font-size: var(--blog-article-title);
  line-height: var(--blog-title-leading);
  letter-spacing: -0.02em;
}

.article-hero__summary,
.blog-hero__summary,
.article-hero__copy > p,
.blog-hero__copy > p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--blog-copy-size);
  line-height: var(--blog-leading);
}

.blog-meta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  gap: 0.8rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  color: var(--text-muted);
  font-size: var(--blog-small);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.blog-meta::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.2rem;
  border: 2px solid var(--text);
  border-radius: var(--radius-round);
  background:
    linear-gradient(90deg, var(--clear) 46%, var(--text) 46% 52%, var(--clear) 52%),
    linear-gradient(var(--clear) 46%, var(--text) 46% 52%, var(--clear) 52%),
    radial-gradient(ellipse at center, var(--clear) 48%, var(--text) 49% 54%, var(--clear) 55%),
    var(--mist-tint);
}

.blog-meta > p {
  margin: 0;
}

.blog-meta time,
.blog-meta__readtime,
.article-readtime {
  display: inline-block;
  max-width: 100%;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.article-body {
  counter-reset: relay-section;
  padding-block: 0 1rem;
  overflow-wrap: break-word;
}

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

.article-body p,
.article-body ul,
.article-body ol,
.article-body dl {
  margin-block: 0 1.25rem;
}

.article-body h2 {
  margin: 2.3rem 0 1rem;
  font-size: var(--blog-section-title);
  line-height: 1.55;
  counter-increment: relay-section;
  scroll-margin-top: var(--anchor-offset);
}

.article-body h2::before {
  content: counter(relay-section, decimal-leading-zero);
  display: inline-block;
  margin-inline-end: 0.7rem;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--groove);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--blog-small);
  font-weight: var(--weight-medium);
  vertical-align: 0.12em;
}

.article-body h3 {
  margin: 1.7rem 0 0.75rem;
  font-size: var(--blog-subtitle);
  line-height: 1.6;
}

.article-body ul,
.article-body ol {
  padding-inline-start: 1.5rem;
}

.article-body li + li {
  margin-top: 0.55rem;
}

.article-body a:not(.btn) {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
}

.article-body a:not(.btn):hover {
  text-decoration-thickness: 2px;
}

.article-body strong {
  font-weight: var(--weight-bold);
  color: var(--text);
}

.article-body img,
.article-body svg {
  max-width: 100%;
}

.article-body img {
  height: auto;
  border-radius: var(--radius-xl);
}

.article-body figure {
  margin: 1.5rem 0;
}

.article-body figcaption {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: var(--blog-small);
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1.3rem 1.5rem;
  border-inline-start: 3px solid var(--text-muted);
  border-radius: var(--radius-xl);
  background: var(--panel);
  color: var(--text-muted);
}

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

.article-body hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.article-body :not(pre) > code {
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-line);
  background: var(--groove);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--blog-small);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-body pre {
  position: relative;
  max-width: 100%;
  margin: 1.5rem 0;
  padding: 3rem 1.5rem 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-xl);
  color: var(--panel);
  background: var(--text);
  font-family: var(--font-mono);
  font-size: var(--blog-small);
  line-height: 1.8;
  tab-size: 2;
}

.article-body pre::before {
  content: "VPNRP / CONFIG";
  position: absolute;
  top: 0.8rem;
  left: 1.5rem;
  color: var(--panel);
  font-family: var(--font-mono);
  font-size: var(--blog-small);
  opacity: 0.8;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: var(--clear);
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.article-body .table-scroll {
  width: 100%;
  max-width: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.article-body table {
  width: 100%;
  margin-block: 1.5rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--blog-small);
  line-height: 1.8;
  text-align: start;
}

.article-body .table-scroll table {
  margin: 0;
}

.article-body caption {
  padding: 0.8rem 1rem;
  color: var(--text-muted);
  text-align: start;
}

.article-body th,
.article-body td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.article-body thead th {
  background: var(--text);
  color: var(--card);
  font-weight: var(--weight-semibold);
}

.article-body tbody th {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.article-body tbody tr {
  background: var(--card);
}

.article-body tbody tr:nth-child(even) {
  background: var(--panel);
}

.article-body tbody tr:hover {
  background: var(--groove);
}

.article-body tbody tr:last-child > * {
  border-bottom: 0;
}

.article-body .callout,
.article-body .verdict {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--text-muted);
  border-radius: var(--radius-xl);
  color: var(--text);
  background: var(--panel);
}

.article-body .callout {
  padding-inline-start: 3.5rem;
}

.article-body .callout::before {
  content: "i";
  position: absolute;
  top: 1.25rem;
  inset-inline-start: 1rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-round);
  color: var(--text);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--blog-small);
  font-weight: var(--weight-bold);
  line-height: 1.4rem;
}

.article-body .callout--warning,
.article-body .callout.warning {
  border-inline-start-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 9%, var(--card));
}

.article-body .callout--warning::before,
.article-body .callout.warning::before {
  content: "!";
  border-color: var(--warn);
}

.article-body .callout--success,
.article-body .callout.success {
  border-inline-start-color: var(--success);
  background: color-mix(in srgb, var(--success) 9%, var(--card));
}

.article-body .callout--success::before,
.article-body .callout.success::before {
  border-color: var(--success);
}

.article-body .verdict {
  border-inline-start-color: var(--accent);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.article-body .callout > :last-child,
.article-body .verdict > :last-child {
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 1.5rem;
}

.stat-card {
  min-width: 0;
  padding: 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--mist-tint);
}

.stat-card:nth-child(even) {
  background: var(--sage-tint);
}

.stat-card:nth-child(3n) {
  background: var(--lavender-tint);
}

.stat-num {
  display: block;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--blog-section-title);
  font-weight: var(--weight-bold);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.stat-label {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: var(--blog-small);
  line-height: 1.8;
}

.article-body .check-list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  margin-block: 1.5rem;
  list-style: none;
}

.article-body .check-list li {
  margin: 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  list-style: none;
}

.article-body .check-list li::before,
.article-body .check-list li::after {
  content: none;
}

.promo-block {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-block: 2rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text);
  background: linear-gradient(120deg, var(--mist-tint), var(--lavender-tint));
  box-shadow: var(--shadow-card);
}

.promo-block::before {
  content: "";
  position: absolute;
  inset: 0.5rem;
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-xl);
  pointer-events: none;
}

.promo-block__copy,
.promo-block__actions {
  position: relative;
  min-width: 0;
}

.promo-block__brand {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-section-title);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}

.promo-block__copy p {
  max-width: 36rem;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--blog-copy-size);
  line-height: 1.85;
}

.promo-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex-shrink: 0;
}

.promo-block .btn {
  flex-shrink: 0;
  white-space: normal;
  text-align: center;
}

.promo-block .btn--main {
  border: 1px solid var(--text);
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.promo-block .btn--main:hover {
  background: var(--panel);
}

.promo-block .btn--outline {
  border: 1px solid var(--text-muted);
  color: var(--text);
  background: var(--clear);
}

#related-posts {
  padding-block: 1.5rem 1rem;
}

#related-posts:empty,
#post-nav:empty,
#related-posts[hidden],
#post-nav[hidden] {
  display: none;
}

#related-posts > h2 {
  margin: 0 0 1.2rem;
  color: var(--text);
  font-size: var(--blog-section-title);
  line-height: 1.6;
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

#related-posts .article-card {
  padding: 1.25rem;
}

#related-posts .article-card h3 {
  font-size: var(--blog-copy-size);
}

#related-posts .article-card__summary {
  font-size: var(--blog-small);
}

#post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-block: 1rem 2rem;
}

.post-nav__card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
  transition: transform var(--speed), border-color var(--speed), background var(--speed);
}

.post-nav__card--next {
  grid-column: 2;
}

.post-nav__card:hover,
.post-nav__card:focus-visible {
  transform: translateY(var(--blog-card-shift));
  border-color: var(--text-muted);
  background: var(--card);
}

.post-nav__label,
.post-nav__tag {
  color: var(--text-muted);
  font-size: var(--blog-small);
  line-height: 1.7;
}

.post-nav__title {
  font-family: var(--font-display);
  font-size: var(--blog-copy-size);
  font-weight: var(--weight-semibold);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

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

  .related-posts__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .article-hero,
  .blog-hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .article-hero__copy,
  .blog-hero__copy {
    grid-column: 1;
    grid-row: 2;
  }

  .blog-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    grid-column: 1;
    grid-row: 1;
    padding: 1.5rem;
    gap: 0.6rem;
  }

  .blog-meta::before {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0 0.2rem 0 0;
  }

  .article-body table {
    display: block;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
  }

  .article-body th,
  .article-body td {
    min-width: 9rem;
  }

  .promo-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .no-break {
    white-space: normal;
  }

  .blog-post-grid,
  .stat-grid,
  #post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav__card--next {
    grid-column: 1;
  }

  .article-card {
    padding: 1.4rem;
  }

  .blog-list-hero {
    padding-block: 1.5rem 2rem;
  }

  .blog-list-hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .article-hero,
  .blog-hero {
    padding-block: 0.5rem 1.5rem;
  }

  .breadcrumbs {
    margin-top: 1.3rem;
  }

  .promo-block {
    padding: 1.5rem;
  }

  .promo-block__actions {
    width: 100%;
  }

  .promo-block__actions .btn {
    flex: 1 1 auto;
  }

  .article-body h2 {
    margin-top: 1.8rem;
  }

  .article-body pre {
    padding-inline: 1rem;
  }

  .article-body pre::before {
    left: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-card,
  .blog-filter,
  .post-nav__card {
    transition: none;
  }

  .article-card:hover,
  .article-card:focus-within,
  .post-nav__card:hover,
  .post-nav__card:focus-visible {
    transform: none;
  }
}