/* Leitura e estrutura das páginas de publicação. */

:where(html.page-blog-post) .reading-progress {
  position: fixed;
  z-index: 3000;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  pointer-events: none;
  background: transparent;
}

:where(html.page-blog-post) .reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #056bf6, #1bc7fb, #8b5cf6);
  box-shadow: 0 0 14px rgba(27, 199, 251, 0.45);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

:where(html.page-blog-post) .article-shell {
  padding: 38px 0 38px;
}

:where(html.page-blog-post) .article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--blog-soft);
  font-size: 0.84rem;
  font-weight: 650;
}

:where(html.page-blog-post) .article-breadcrumb a {
  color: var(--blog-primary-strong);
  text-decoration: none;
}

:where(html.page-blog-post) .article-breadcrumb a:hover {
  text-decoration: underline;
}

:where(html.page-blog-post) .article-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(32px, 6vw, 70px);
  border: 1px solid var(--blog-border);
  border-radius: 36px;
  background:
    radial-gradient(circle at 84% 14%, rgba(27, 199, 251, 0.18), transparent 25%),
    radial-gradient(circle at 90% 88%, rgba(139, 92, 246, 0.13), transparent 27%),
    var(--blog-panel);
  box-shadow: var(--blog-shadow);
}

:where(html.page-blog-post) .article-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -130px;
  bottom: -170px;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(5, 107, 246, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px rgba(5, 107, 246, 0.03),
    0 0 0 96px rgba(27, 199, 251, 0.018);
}

:where(html.page-blog-post) .article-header h1 {
  max-width: 970px;
  margin: 20px 0 20px;
  color: var(--blog-heading);
  font-size: clamp(2.35rem, 5vw, 4.45rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

:where(html.page-blog-post) .article-lead {
  max-width: 820px;
  margin: 0;
  color: var(--blog-muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.7;
  text-wrap: pretty;
}

:where(html.page-blog-post) .article-header__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 860px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--blog-border);
}

:where(html.page-blog-post) .article-facts {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--blog-soft);
  font-size: 0.8rem;
  font-weight: 650;
}

:where(html.page-blog-post) .article-facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


:where(html.page-blog-post) .article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 52px;
  align-items: start;
  width: min(100%, 1040px);
  margin: 54px auto 0;
}

:where(html.page-blog-post) .article-content {
  min-width: 0;
  color: var(--blog-muted);
  font-size: clamp(1rem, 1.5vw, 1.08rem);
  line-height: 1.86;
}

:where(html.page-blog-post) .article-content > :first-child {
  margin-top: 0;
}

:where(html.page-blog-post) .article-content h2,
:where(html.page-blog-post) .article-content h3 {
  color: var(--blog-heading);
  line-height: 1.14;
  letter-spacing: -0.04em;
  text-wrap: balance;
  scroll-margin-top: 130px;
}

:where(html.page-blog-post) .article-content h2 {
  margin: 52px 0 18px;
  font-size: clamp(1.8rem, 3.8vw, 2.65rem);
}

:where(html.page-blog-post) .article-content h3 {
  margin: 34px 0 14px;
  font-size: 1.4rem;
}

:where(html.page-blog-post) .article-content p {
  margin: 0 0 22px;
  text-wrap: pretty;
}

:where(html.page-blog-post) .article-content strong {
  color: var(--blog-heading);
  font-weight: 750;
}

:where(html.page-blog-post) .article-content a {
  color: var(--blog-primary-strong);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

:where(html.page-blog-post) .article-content code {
  padding: 0.14em 0.4em;
  border: 1px solid var(--blog-border);
  border-radius: 7px;
  color: var(--blog-heading);
  background: var(--blog-panel-strong);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

:where(html.page-blog-post) .article-code {
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 20px;
  background: #080d14;
  box-shadow: var(--blog-shadow-soft);
}

:where(html.page-blog-post) .article-code code {
  display: block;
  min-width: max-content;
  padding: 22px;
  border: 0;
  border-radius: 0;
  color: #dbeafe;
  background: transparent;
  font-size: 0.84rem;
  line-height: 1.7;
  white-space: pre;
}

:where(html.page-blog-post) .article-table-wrap {
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid var(--blog-border);
  border-radius: 20px;
  background: var(--blog-panel);
  box-shadow: var(--blog-shadow-soft);
}

:where(html.page-blog-post) .article-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  color: var(--blog-muted);
  font-size: 0.9rem;
}

:where(html.page-blog-post) .article-table th,
:where(html.page-blog-post) .article-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--blog-border);
  text-align: left;
}

:where(html.page-blog-post) .article-table th {
  color: var(--blog-heading);
  background: rgba(5, 107, 246, 0.07);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

:where(html.page-blog-post) .article-table tr:last-child td {
  border-bottom: 0;
}


:where(html.page-blog-post) .article-project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0;
}

:where(html.page-blog-post) .article-project-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--blog-border);
  border-radius: 14px;
  color: var(--blog-text);
  background: var(--blog-panel-strong);
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    transform 180ms ease;
}

:where(html.page-blog-post) .article-project-links a:first-child {
  border-color: transparent;
  color: #ffffff;
  background: linear-gradient(135deg, #056bf6, #1bc7fb);
  box-shadow: 0 12px 26px rgba(5, 107, 246, 0.2);
}

:where(html.page-blog-post) .article-project-links a:hover {
  border-color: var(--blog-border-strong);
  transform: translateY(-2px);
}

:where(html.page-blog-post) .article-content ul,
:where(html.page-blog-post) .article-content ol {
  display: grid;
  gap: 12px;
  margin: 0 0 26px;
  padding-left: 24px;
}

:where(html.page-blog-post) .article-content li::marker {
  color: var(--blog-primary);
  font-weight: 800;
}

:where(html.page-blog-post) .article-quote {
  position: relative;
  margin: 34px 0;
  padding: 25px 26px 25px 30px;
  overflow: hidden;
  border: 1px solid rgba(5, 107, 246, 0.14);
  border-radius: 23px;
  color: var(--blog-heading);
  background:
    radial-gradient(circle at 92% 20%, rgba(27, 199, 251, 0.14), transparent 28%),
    rgba(5, 107, 246, 0.065);
  font-size: 1.08em;
  font-weight: 650;
  line-height: 1.7;
}

:where(html.page-blog-post) .article-quote::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: linear-gradient(180deg, #056bf6, #1bc7fb);
}

:where(html.page-blog-post) .article-note {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
  margin: 30px 0;
  padding: 20px;
  border: 1px solid var(--blog-border);
  border-radius: 21px;
  background: var(--blog-panel);
  box-shadow: var(--blog-shadow-soft);
}

:where(html.page-blog-post) .article-note__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #ffffff;
  background: linear-gradient(135deg, #056bf6, #1bc7fb);
}


:where(html.page-blog-post) .article-note h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

:where(html.page-blog-post) .article-note p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
}

:where(html.page-blog-post) .article-toc {
  position: sticky;
  top: 118px;
  padding: 20px;
  border: 1px solid var(--blog-border);
  border-radius: 22px;
  background: var(--blog-panel);
  box-shadow: var(--blog-shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

:where(html.page-blog-post) .article-toc strong {
  display: block;
  margin-bottom: 13px;
  color: var(--blog-heading);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

:where(html.page-blog-post) .article-toc nav {
  display: grid;
  gap: 5px;
}

:where(html.page-blog-post) .article-toc a {
  display: block;
  padding: 9px 10px;
  border-radius: 11px;
  color: var(--blog-soft);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.45;
  text-decoration: none;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

:where(html.page-blog-post) .article-toc a:hover,
:where(html.page-blog-post) .article-toc a.is-active {
  color: var(--blog-primary-strong);
  background: rgba(5, 107, 246, 0.08);
}

:where(html.page-blog-post) .article-share {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--blog-border);
}

:where(html.page-blog-post) .article-share button,
:where(html.page-blog-post) .article-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--blog-border);
  border-radius: 13px;
  color: var(--blog-text);
  background: var(--blog-panel-strong);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 180ms ease;
}

:where(html.page-blog-post) .article-share button:hover,
:where(html.page-blog-post) .article-back:hover {
  border-color: var(--blog-border-strong);
  transform: translateY(-1px);
}

:where(html.page-blog-post) .article-share button.is-copied {
  border-color: rgba(22, 163, 74, 0.25);
  color: var(--blog-success);
  background: rgba(22, 163, 74, 0.08);
}

:where(html.page-blog-post) .article-end {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-top: 52px;
  padding: 24px;
  border: 1px solid var(--blog-border);
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 20%, rgba(27, 199, 251, 0.12), transparent 28%),
    var(--blog-panel);
  box-shadow: var(--blog-shadow-soft);
}

:where(html.page-blog-post) .article-end__avatar {
  display: block;
  width: 74px;
  height: 74px;
  padding: 3px;
  border-radius: 23px;
  object-fit: cover;
  background: linear-gradient(135deg, #056bf6, #1bc7fb, #8b5cf6);
}

:where(html.page-blog-post) .article-end__copy strong {
  display: block;
  margin-bottom: 5px;
  color: var(--blog-heading);
  font-size: 1rem;
}

:where(html.page-blog-post) .article-end__copy p {
  margin: 0;
  color: var(--blog-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

:where(html.page-blog-post) .article-back {
  min-height: 46px;
  padding: 0 16px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  :where(html.page-blog-post) .article-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  :where(html.page-blog-post) .article-toc {
    position: static;
    order: -1;
  }

  :where(html.page-blog-post) .article-toc nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :where(html.page-blog-post) .article-share {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  :where(html.page-blog-post) .article-shell {
    padding-top: 28px;
  }

  :where(html.page-blog-post) .article-header {
    padding: 30px 22px 32px;
    border-radius: 28px;
  }

  :where(html.page-blog-post) .article-header h1 {
    font-size: clamp(2.15rem, 10vw, 3rem);
  }

  :where(html.page-blog-post) .article-header__meta {
    display: grid;
  }

  :where(html.page-blog-post) .article-facts {
    flex-wrap: wrap;
  }


  :where(html.page-blog-post) .article-layout {
    margin-top: 38px;
  }

  :where(html.page-blog-post) .article-toc nav {
    grid-template-columns: 1fr;
  }

  :where(html.page-blog-post) .article-content {
    line-height: 1.78;
  }

  :where(html.page-blog-post) .article-content h2 {
    margin-top: 42px;
  }

  :where(html.page-blog-post) .article-quote {
    padding: 22px 20px 22px 25px;
  }

  :where(html.page-blog-post) .article-note {
    grid-template-columns: 1fr;
  }

  :where(html.page-blog-post) .article-project-links {
    display: grid;
  }

  :where(html.page-blog-post) .article-project-links a {
    width: 100%;
  }

  :where(html.page-blog-post) .article-end {
    grid-template-columns: auto 1fr;
  }

  :where(html.page-blog-post) .article-back {
    grid-column: 1 / -1;
    width: 100%;
  }
}
