@font-face {
  font-family: Vazir;
  src:
    url('/fonts/Vazir.woff2') format('woff2'),
    url('/fonts/Vazir.woff') format('woff'),
    url('/fonts/Vazir.ttf') format('truetype');
}

html:lang(fa) body {
  font-family: Vazir, system-ui, sans-serif;
}

html:lang(fa) nav [data-nav-controls] {
  margin-left: 0 !important;
  margin-right: auto !important;
}

nav [data-nav-controls] {
  margin-inline-start: auto;
}

p {
  text-align: start;
}

.categories summary {
  cursor: pointer;
}

.categories-menu {
  display: none;
  min-width: 12rem;
  position: absolute;
  inset-inline-start: 0;
  top: 1.75rem;
  z-index: 1;
}

.categories[open] .categories-menu {
  display: grid;
  gap: 0.25rem;
}

.categories-menu a {
  border-radius: var(--bs-border-radius);
  color: var(--bs-secondary-color);
  padding: 0.4rem 0.6rem;
  text-decoration: none;
}

.categories-menu a:hover {
  background: var(--bs-tertiary-bg);
  color: var(--bs-primary);
}

main {
  max-width: 54rem;
  min-height: 70vh;
}

main > h1,
main article > h1 {
  margin-bottom: 1rem;
}

main > article {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-xl);
  box-shadow: var(--bs-box-shadow-sm);
  margin-top: 1.5rem;
  padding: 1.5rem;
}

.content-detail > h1,
.content-detail > h2,
.content-detail > h3,
.content-detail > h4 {
  color: var(--bs-emphasis-color);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

.content-detail > h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-block: 0 1.25rem;
}

.content-detail > h2 {
  font-size: clamp(1.5rem, 3.2vw, 1.875rem);
  font-weight: 700;
  margin-block: 2em 0.65em;
  padding-block-end: 0.3em;
  position: relative;
}

.content-detail > h2::after {
  background: var(--bs-primary);
  border-radius: 2px;
  block-size: 3px;
  content: '';
  inline-size: 3.5rem;
  inset-block-end: 0;
  inset-inline-start: 0;
  position: absolute;
}

.content-detail > h3 {
  font-size: clamp(1.25rem, 2.7vw, 1.5rem);
  font-weight: 600;
  margin-block: 1.6em 0.55em;
  padding-inline-start: 0.85em;
  position: relative;
}

.content-detail > h3::before {
  background: var(--bs-primary);
  border-radius: 2px;
  content: '';
  inline-size: 4px;
  inset-block: 0.15em;
  inset-inline-start: 0;
  position: absolute;
}

.content-detail > h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-block: 1.4em 0.5em;
  padding-inline-start: 1.1em;
  position: relative;
}

.content-detail > h4::before {
  color: var(--bs-primary);
  content: '›';
  font-size: 0.9em;
  font-weight: 700;
  inset-inline-start: 0;
  position: absolute;
}

html:lang(fa) .content-detail > h1,
html:lang(fa) .content-detail > h2,
html:lang(fa) .content-detail > h3,
html:lang(fa) .content-detail > h4 {
  letter-spacing: normal;
}

html:lang(fa) .content-detail > h4::before {
  content: '‹';
}

html:lang(fa) .content-detail code {
  direction: ltr;
  unicode-bidi: isolate;
}

.post-sources h2 {
  font-size: 1.35rem;
}

.card-title {
  align-items: baseline;
  display: flex;
  font-size: 1.35rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-meta,
.detail-meta,
.reading-time {
  color: var(--bs-secondary-color);
}

.card-meta {
  font-size: 0.78rem;
  font-weight: 400;
  margin-inline-start: auto;
}

html[data-bs-theme='light'] .detail-meta,
html[data-bs-theme='light'] .post-toc,
html[data-bs-theme='light'] .post-series-section,
html[data-bs-theme='light'] .post-series-introduction {
  background: var(--bs-secondary-bg);
}

.detail-meta {
  background: var(--bs-tertiary-bg);
  border-inline-start: 3px solid var(--bs-primary);
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding: 0.45rem 0.7rem;
}

.detail-meta + .reading-time {
  font-size: 0.9rem;
  font-weight: 600;
}

main article p,
main article ul,
main article blockquote {
  line-height: 1.8;
}

main article pre {
  background: var(--bs-dark);
  border-radius: var(--bs-border-radius);
  color: var(--bs-light);
  overflow: auto;
  padding: 1rem;
}

html[data-bs-theme='dark'] main article pre {
  background: #111820;
  border: 1px solid #495057;
  color: #f8f9fa;
}

main article .code-block {
  position: relative;
}

main article .code-block pre {
  padding-top: 3rem;
}

html:lang(fa) .code-block {
  direction: ltr;
  text-align: left;
}

html:lang(fa) .code-block[dir='rtl'] {
  direction: rtl;
  text-align: right;
}

html:lang(fa) .code-block[dir='rtl'] .code-copy {
  inset-inline-end: auto;
  inset-inline-start: 0.5rem;
}

.code-copy {
  align-items: center;
  background: color-mix(in srgb, var(--bs-body-bg) 90%, transparent);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  color: var(--bs-secondary-color);
  display: inline-flex;
  font: inherit;
  font-size: 0.75rem;
  gap: 0.3rem;
  inset-block-start: 0.5rem;
  inset-inline-end: 0.5rem;
  line-height: 1;
  padding: 0.35rem 0.5rem;
  position: absolute;
}

.code-copy:hover,
.code-copy:focus-visible {
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
}

.code-copy-icon {
  fill: none;
  height: 1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
  width: 1rem;
}

.code-copy.is-copied {
  color: var(--bs-success);
}

main article .mermaid-diagram {
  display: block;
  height: auto;
  margin-block: 1.5rem;
  margin-inline: auto;
  max-width: 100%;
}

main > article img {
  border-radius: var(--bs-border-radius-lg);
  max-width: 100%;
}

main article table {
  border-collapse: collapse;
  display: block;
  margin-block: 1.5rem;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

main article th,
main article td {
  border: 1px solid var(--bs-border-color);
  padding: 0.75rem;
  text-align: start;
}

main article th {
  background: var(--bs-tertiary-bg);
}

.post-toc {
  background: var(--bs-tertiary-bg);
  border-inline-start: 3px solid var(--bs-primary);
  margin-block: 1.5rem;
  padding: 1rem 1.25rem;
}

.post-toc h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.post-toc ol {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.post-toc a {
  text-decoration: none;
}

.post-sources {
  border-top: 1px solid var(--bs-border-color);
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.post-sources ol {
  padding-inline-start: 1.5rem;
}

.post-sources li + li {
  margin-top: 0.5rem;
}

.post-sources a {
  text-decoration: none;
}

.post-series-section,
.post-series-introduction {
  background: var(--bs-tertiary-bg);
  border-inline-start: 3px solid var(--bs-primary);
  margin-top: 2rem;
  padding: 1rem 1.25rem;
}

.post-series-introduction {
  margin-bottom: 1rem;
}

.post-series-introduction a {
  text-decoration: none;
}

.post-series,
.post-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.post-series {
  justify-content: space-between;
  margin-top: 0;
}

.post-series a {
  color: var(--bs-link-color);
  text-decoration: none;
}

.home-shell {
  display: grid;
  gap: 4.5rem;
  padding-block: 2rem 1rem;
}

.home-hero {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 3.5rem;
}

.home-kicker,
.home-eyebrow {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.home-hero h1,
.home-section h2 {
  font-weight: 700;
  letter-spacing: -0.04em;
}

.home-hero h1 {
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.98;
  margin: 0;
  max-width: 16ch;
}

.home-hero h1 span {
  color: var(--bs-secondary-color);
  font-weight: 300;
}

.home-summary {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 500;
  margin: 2rem 0 0.75rem;
  max-width: 42rem;
}

.home-intro {
  color: var(--bs-secondary-color);
  line-height: 1.8;
  margin: 0;
  max-width: 40rem;
}

.home-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.home-actions .btn-dark {
  padding: 0.7rem 1rem;
}

.home-actions .btn-link,
.home-section-heading a {
  color: var(--bs-body-color);
  font-weight: 600;
  text-decoration-color: var(--bs-border-color);
  text-underline-offset: 0.25em;
}

.home-section {
  display: grid;
  gap: 1.5rem;
}

.home-section-heading {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.home-section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin: 0;
}

.home-section-heading .home-eyebrow {
  margin-bottom: 0.4rem;
}

.home-products,
.home-writing {
  display: grid;
  gap: 0.85rem;
}

.home-products article,
.home-writing article {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  box-shadow: none;
  margin: 0;
  padding: 1.25rem;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

html[data-bs-theme='light'] main > article,
html[data-bs-theme='light'] .home-products article,
html[data-bs-theme='light'] .home-writing article {
  background: var(--bs-body-bg);
}

.home-products article:hover,
.home-writing article:hover {
  border-color: var(--bs-body-color);
  transform: translateY(-2px);
}

.home-products article h2,
.home-writing article h2 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.home-products article p,
.home-writing article p {
  color: var(--bs-secondary-color);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.65rem;
}

.home-products article time,
.home-writing article time {
  color: var(--bs-secondary-color);
  font-size: 0.78rem;
}

.card-read-more {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
  display: block;
  font-weight: 600;
  margin-block-start: 1rem;
  margin-inline-start: auto;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
  width: fit-content;
}

.card-read-more:hover,
.card-read-more:focus-visible {
  background: var(--bs-body-color);
  border-color: var(--bs-body-color);
  color: var(--bs-body-bg);
}

@media (prefers-reduced-motion: reduce) {
  .home-products article,
  .home-writing article,
  .card-read-more {
    transition: none;
  }

  .home-products article:hover,
  .home-writing article:hover {
    transform: none;
  }
}

@media (min-width: 48rem) {
  .home-products {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  }

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

@media (max-width: 40rem) {
  .home-shell {
    gap: 3rem;
  }

  .home-hero {
    padding-bottom: 2.5rem;
  }

  .home-section-heading {
    align-items: start;
    flex-direction: column;
  }
}

.footer-tags a,
main > article > p:last-child a {
  background: var(--bs-info-bg-subtle);
  border-radius: var(--bs-pill-border-radius);
  color: var(--bs-info-text-emphasis);
  display: inline-block;
  font-size: 0.875rem;
  padding: 0.2rem 0.6rem;
  text-decoration: none;
}

@media (max-width: 40rem) {
  nav [data-nav-controls] {
    margin-inline-start: 0;
  }
}

/* Company branding; the shared Blog typography and article components remain intact. */
:root {
  --mpa-accent: #176654;
  --mpa-soft: #e4efeb;
}
[data-bs-theme='dark'] {
  --mpa-accent: #8dd5bd;
  --mpa-soft: #1b3934;
}
body {
  --bs-body-font-family: system-ui, sans-serif;
}
.mpa-mark {
  font-size: 1.5rem;
  font-weight: 850;
  letter-spacing: -0.07em;
}
.mpa-mark span {
  color: var(--mpa-accent);
}
main.container {
  max-width: 74rem;
}
main > .content-detail {
  max-width: 54rem;
  margin-inline: auto;
}
main > article:not(.content-detail) {
  max-width: 54rem;
}
.home-shell {
  gap: 4rem;
  padding-block: 0.5rem 1rem;
}
.mpa-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem;
  padding-block: 1.5rem 3.5rem;
}
.mpa-hero h1 {
  font-size: clamp(2.5rem, 4.4vw, 4.1rem);
  max-width: 18ch;
  line-height: 1.1;
}
.mpa-hero h1 span {
  color: var(--mpa-accent);
  font-weight: 700;
}
.home-eyebrow {
  color: var(--mpa-accent);
}
.mpa-hero .home-summary {
  margin-top: 1.5rem;
  font-size: 1.15rem;
}
.mpa-button {
  background: #176654;
  color: #fff;
  border: 1px solid #176654;
  padding: 0.7rem 1rem;
  font-weight: 600;
}
.mpa-button:hover,
.mpa-button:focus-visible {
  background: #104c3f;
  color: #fff;
  border-color: #104c3f;
}
.mpa-visual {
  position: relative;
}
.mpa-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.5rem;
}
.mpa-visual > span {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  font:
    0.65rem ui-monospace,
    monospace;
  letter-spacing: 0.16em;
  color: #acd1c7;
}
.mpa-services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.mpa-services article {
  border-top: 2px solid var(--mpa-accent);
  padding: 1.5rem 1.1rem;
  background: var(--bs-body-bg);
  border-radius: 0 0 0.75rem 0.75rem;
}
.mpa-number {
  display: block;
  color: var(--mpa-accent);
  font:
    0.72rem ui-monospace,
    monospace;
  margin-bottom: 1.75rem;
}
.mpa-services h3 {
  font-size: 1.25rem;
}
.mpa-services p,
.mpa-note {
  color: var(--bs-secondary-color);
  line-height: 1.75;
  margin: 0;
}
.mpa-note {
  font-size: 0.875rem;
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--bs-border-color);
}
.mpa-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: 1rem;
  background: var(--mpa-soft);
}
.mpa-cta p:last-child {
  margin-bottom: 0;
}
.skip-link:focus {
  display: block;
  padding: 1rem;
  background: var(--bs-body-bg);
}
html:lang(fa) .home-hero h1,
html:lang(fa) .home-section h2,
html:lang(fa) .home-eyebrow {
  letter-spacing: normal;
}
html:lang(fa) .mpa-hero h1 {
  line-height: 1.5;
  max-width: none;
}
html:lang(fa) .mpa-number {
  font-family: Vazir, sans-serif;
}
@media (max-width: 48rem) {
  .mpa-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .mpa-visual {
    max-width: 34rem;
  }
  .mpa-services {
    grid-template-columns: 1fr;
  }
  .mpa-cta {
    align-items: start;
    flex-direction: column;
  }
  .home-writing {
    grid-template-columns: 1fr;
  }
  header nav {
    gap: 0.8rem !important;
  }
}
