/* =========================================================
   VARIÁVEIS GERAIS
   ========================================================= */

:root {
  --rafael-blue: #2563eb;
  --rafael-blue-dark: #1d4ed8;
  --rafael-navy: #0f172a;
  --rafael-text: #334155;
  --rafael-muted: #64748b;
  --rafael-border: #e2e8f0;
  --rafael-surface: #ffffff;
  --rafael-background: #f8fafc;
  --rafael-success: #16a34a;
  --rafael-purple: #7c3aed;

  --rafael-radius-sm: 8px;
  --rafael-radius-md: 12px;
  --rafael-radius-lg: 18px;

  --rafael-shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --rafael-shadow-md: 0 12px 30px rgba(15, 23, 42, 0.1);
}

/* =========================================================
   CONFIGURAÇÕES GERAIS
   ========================================================= */

html {
  scroll-behavior: smooth;
}

body {
  color: var(--rafael-text);
}


.md-grid {
  max-width: 1700px;
}

.md-main__inner {
  margin-top: 1.2rem;
}

.md-content__inner {
  padding-bottom: 3rem;
}

.md-typeset {
  font-size: 0.82rem;
  line-height: 1.7;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--rafael-navy);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.md-typeset h1 {
  margin-bottom: 1rem;
  font-size: 2.2rem;
  line-height: 1.2;
}

.md-typeset h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rafael-border);
}

.md-typeset p {
  color: var(--rafael-text);
  margin: .75rem 0;
  line-height: 1.65;
}

.md-typeset a {
  font-weight: 500;
}

.md-typeset hr {
  margin: 2.5rem 0;
  border-color: var(--rafael-border);
}

/* =========================================================
   CABEÇALHO E NAVEGAÇÃO
   ========================================================= */

.md-header {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.md-header__title {
  font-weight: 700;
}

.md-tabs {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.md-tabs__link {
  font-weight: 600;
  opacity: 0.85;
}

.md-tabs__link--active,
.md-tabs__link:hover {
  opacity: 1;
}

.md-nav__title {
  font-weight: 700;
}

.md-nav__link {
  border-radius: 6px;
}

.md-nav__link:hover {
  color: var(--rafael-blue);
}

/* =========================================================
   HERO DA PÁGINA INICIAL
   ========================================================= */

.hero {
  position: relative;
  overflow: hidden;
  padding: 2.2rem 2.5rem;
  margin: 1rem 0 3rem;
  border: 1px solid var(--rafael-border);
  border-radius: var(--rafael-radius-lg);
  background:
    radial-gradient(
      circle at top right,
      rgba(37, 99, 235, 0.15),
      transparent 35%
    ),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--rafael-shadow-sm);
}

.hero::before {
  position: absolute;
  top: -90px;
  right: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  content: "";
}

.hero::after {
  position: absolute;
  right: 120px;
  bottom: -100px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.06);
  content: "";
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  max-width: 850px;
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--rafael-navy);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.08;
}

.hero h2 {
  margin-top: 0;
  border-bottom: 0;
  color: var(--rafael-blue);
  font-size: 1.4rem;
}

.hero p {
  max-width: 780px;
  margin-bottom: 1.2rem;
  color: var(--rafael-text);
  font-size: 1rem;
  line-height: 1.7;
}

.hero strong {
  color: var(--rafael-navy);
}

/* =========================================================
   BOTÕES
   ========================================================= */

.md-typeset .md-button {
  padding: 0.65rem 1.1rem;
  margin-top: 0.5rem;
  margin-right: 0.4rem;
  border: 1px solid var(--rafael-blue);
  border-radius: var(--rafael-radius-sm);
  color: var(--rafael-blue);
  font-weight: 700;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.md-typeset .md-button:hover {
  transform: translateY(-2px);
  border-color: var(--rafael-blue-dark);
  background-color: rgba(37, 99, 235, 0.05);
  color: var(--rafael-blue-dark);
  box-shadow: var(--rafael-shadow-sm);
}

.md-typeset .md-button--primary {
  border-color: var(--rafael-blue);
  background-color: var(--rafael-blue);
  color: #ffffff;
}

.md-typeset .md-button--primary:hover {
  border-color: var(--rafael-blue-dark);
  background-color: var(--rafael-blue-dark);
  color: #ffffff;
}

/* =========================================================
   CARDS DA PÁGINA INICIAL
   ========================================================= */

.md-typeset .grid {
  grid-gap: 1rem;
}

.md-typeset .grid.cards > ul,
.md-typeset .grid.cards > ol {
  gap: 1rem;
}

.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li {
  position: relative;
  overflow: hidden;
  padding: 1.4rem;
  border: 1px solid var(--rafael-border);
  border-radius: var(--rafael-radius-md);
  background: var(--rafael-surface);
  box-shadow: var(--rafael-shadow-sm);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.md-typeset .grid.cards > ul > li::before,
.md-typeset .grid.cards > ol > li::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--rafael-blue),
    var(--rafael-purple)
  );
  content: "";
}

.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid.cards > ol > li:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--rafael-shadow-md);
}

.md-typeset .grid.cards strong {
  color: var(--rafael-navy);
  font-size: 1rem;
}

.md-typeset .grid.cards .lg {
  color: var(--rafael-blue);
  font-size: 2rem;
}

.md-typeset .grid.cards hr {
  margin: 0.8rem 0;
}

.md-typeset .grid.cards p:last-child {
  margin-bottom: 0;
}

/* =========================================================
   IMAGENS DOS ARTIGOS
   ========================================================= */

.md-typeset img {
  max-width: 100%;
  border-radius: var(--rafael-radius-md);
}

.md-typeset p > img:only-child {
  display: block;
  margin: 1.5rem auto 2rem;
  border: 1px solid var(--rafael-border);
  box-shadow: var(--rafael-shadow-sm);
}

/* Classe opcional para imagens principais */
.article-cover {
  display: block;
  width: 100%;
  margin: 1.5rem auto 2.5rem;
  border: 1px solid var(--rafael-border);
  border-radius: var(--rafael-radius-lg);
  box-shadow: var(--rafael-shadow-md);
}

/* =========================================================
   CÓDIGO
   ========================================================= */

.md-typeset code {
  border-radius: 5px;
}

.md-typeset pre > code {
  border-radius: var(--rafael-radius-sm);
}

.md-typeset .highlight {
  margin: 1.2rem 0;
  border-radius: var(--rafael-radius-md);
  box-shadow: var(--rafael-shadow-sm);
}

.md-typeset .highlight pre {
  border-radius: var(--rafael-radius-md);
}

.md-clipboard {
  border-radius: 6px;
}

/* =========================================================
   TABELAS
   ========================================================= */

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--rafael-border);
  border-radius: var(--rafael-radius-md);
  box-shadow: var(--rafael-shadow-sm);
}

.md-typeset table:not([class]) th {
  background: #f1f5f9;
  color: var(--rafael-navy);
  font-weight: 700;
}

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
  padding: 0.8rem 1rem;
}

/* =========================================================
   ADMONITIONS
   ========================================================= */

.md-typeset .admonition,
.md-typeset details {
  border-radius: var(--rafael-radius-md);
  box-shadow: var(--rafael-shadow-sm);
}

.md-typeset .admonition-title,
.md-typeset summary {
  font-weight: 700;
}

/* =========================================================
   CITAÇÕES
   ========================================================= */

.md-typeset blockquote {
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--rafael-blue);
  border-radius: 0 var(--rafael-radius-sm) var(--rafael-radius-sm) 0;
  background: rgba(37, 99, 235, 0.05);
  color: var(--rafael-text);
}

/* =========================================================
   LISTAS E CHECKBOXES
   ========================================================= */

.md-typeset ul,
.md-typeset ol {
  line-height: 1.65;
}

.md-typeset .task-list-control .task-list-indicator::before {
  background-color: var(--rafael-blue);
}

/* =========================================================
   RODAPÉ
   ========================================================= */

.md-footer {
  margin-top: 3rem;
}

.md-footer-meta {
  background-color: var(--rafael-navy);
}

.md-social__link {
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.md-social__link:hover {
  transform: translateY(-2px);
  opacity: 1;
}

/* =========================================================
   CAMPO DE BUSCA
   ========================================================= */

.md-search__form {
  border-radius: var(--rafael-radius-sm);
}

.md-search-result__article {
  border-radius: var(--rafael-radius-sm);
}

/* =========================================================
   MODO ESCURO
   ========================================================= */

[data-md-color-scheme="slate"] {
  --rafael-navy: #f8fafc;
  --rafael-text: #cbd5e1;
  --rafael-muted: #94a3b8;
  --rafael-border: rgba(148, 163, 184, 0.2);
  --rafael-surface: #172033;
  --rafael-background: #0f172a;
  --rafael-shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.18);
  --rafael-shadow-md: 0 12px 30px rgba(0, 0, 0, 0.28);
}

[data-md-color-scheme="slate"] body {
  color: var(--rafael-text);
}

[data-md-color-scheme="slate"] .hero {
  border-color: var(--rafael-border);
  background:
    radial-gradient(
      circle at top right,
      rgba(59, 130, 246, 0.16),
      transparent 35%
    ),
    linear-gradient(135deg, #172033 0%, #111827 100%);
}

[data-md-color-scheme="slate"] .hero p,
[data-md-color-scheme="slate"] .md-typeset p {
  color: var(--rafael-text);
  margin: .75rem 0;
  line-height: 1.65;
}

[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li,
[data-md-color-scheme="slate"] .md-typeset .grid.cards > ol > li {
  border-color: var(--rafael-border);
  background: var(--rafael-surface);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background: #1e293b;
  color: #f8fafc;
}

[data-md-color-scheme="slate"] .md-typeset blockquote {
  background: rgba(59, 130, 246, 0.09);
}

/* =========================================================
   RESPONSIVIDADE
   ========================================================= */

@media screen and (max-width: 960px) {
  .hero {
    padding: 2.5rem 2rem;
  }

  .md-typeset h1 {
    font-size: 2.5rem;
  }
}

@media screen and (max-width: 600px) {
  .md-main__inner {
    margin-top: 0.5rem;
  }

  .md-typeset {
    font-size: 0.78rem;
  }

  .hero {
    padding: 2rem 1.2rem;
    margin-top: 0.5rem;
    border-radius: var(--rafael-radius-md);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero h2 {
    font-size: 1.15rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .md-typeset .md-button {
    display: block;
    width: 100%;
    margin-right: 0;
    text-align: center;
  }

  .md-typeset .grid.cards > ul > li,
  .md-typeset .grid.cards > ol > li {
    padding: 1.1rem;
  }
}

/* =========================================================
   OVERRIDES PROFISSIONAIS — LAYOUT E RESPONSIVIDADE
   ========================================================= */

:root {
  --rafael-content-max: 860px;
  --rafael-layout-max: 1680px;
}

.md-grid {
  max-width: var(--rafael-layout-max);
}

.md-content {
  min-width: 0;
}

.md-content__inner {
  max-width: var(--rafael-content-max);
  margin-inline: auto;
  padding-bottom: 4rem;
}

.md-sidebar--primary {
  width: 12.5rem;
}

.md-sidebar--secondary {
  width: 12rem;
}

.md-typeset {
  font-size: 0.9rem;
  line-height: 1.78;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  text-wrap: balance;
}

.md-typeset h1 {
  max-width: 18ch;
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 2.4vw, 3rem);
  line-height: 1.08;
  font-weight: 750;
}

.md-typeset h2 {
  font-size: clamp(1.35rem, 1.5vw, 1.7rem);
  line-height: 1.25;
}

.md-typeset h3 {
  font-size: 1.18rem;
  line-height: 1.3;
}

.md-tabs__list {
  gap: 0.1rem;
}

.md-tabs__link {
  padding-inline: 0.65rem;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.md-nav__link {
  line-height: 1.35;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.md-nav__link:hover {
  background: rgba(37, 99, 235, 0.08);
}

.md-nav__link--active {
  color: var(--rafael-blue);
  font-weight: 650;
}

.md-typeset > blockquote:first-of-type {
  padding: 1rem 1.15rem;
  margin: 0 0 1.6rem;
  border-left: 4px solid var(--rafael-blue);
  border-radius: 0 var(--rafael-radius-md) var(--rafael-radius-md) 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(124, 58, 237, 0.04));
  box-shadow: none;
}

.md-typeset > blockquote:first-of-type p {
  margin: 0.3rem 0;
}

.md-typeset p > img:only-child,
.article-cover {
  width: 100%;
  height: auto;
}

.md-typeset .md-typeset__table {
  width: 100%;
  overflow-x: auto;
}

.md-typeset table:not([class]) {
  min-width: 620px;
}

.md-typeset li + li {
  margin-top: 0.2rem;
}

@media screen and (max-width: 1400px) {
  :root {
    --rafael-content-max: 800px;
  }

  .md-grid {
    max-width: 1440px;
  }

  .md-sidebar--primary {
    width: 11.5rem;
  }

  .md-sidebar--secondary {
    width: 11rem;
  }

  .md-typeset h1 {
    max-width: 20ch;
    font-size: clamp(1.9rem, 2.3vw, 2.65rem);
  }
}

@media screen and (max-width: 1220px) {
  :root {
    --rafael-content-max: 760px;
  }

  .md-sidebar--primary {
    width: 10.75rem;
  }

  .md-sidebar--secondary {
    width: 10.25rem;
  }

  .md-typeset {
    font-size: 0.87rem;
  }
}

@media screen and (max-width: 960px) {
  .md-main__inner {
    margin-top: 0.8rem;
  }

  .md-content__inner {
    max-width: 100%;
  }

  .md-typeset h1 {
    max-width: none;
    font-size: clamp(1.9rem, 5vw, 2.45rem);
  }

  .hero {
    padding: 2.5rem 2rem;
  }
}

@media screen and (max-width: 600px) {
  .md-main__inner {
    margin-top: 0.35rem;
  }

  .md-content__inner {
    padding-bottom: 2.5rem;
  }

  .md-typeset {
    font-size: 0.84rem;
    line-height: 1.72;
  }

  .md-typeset h1 {
    margin-bottom: 1rem;
    font-size: clamp(1.75rem, 9vw, 2.15rem);
    line-height: 1.12;
  }

  .md-typeset h2 {
    margin-top: 2.2rem;
    font-size: 1.35rem;
  }

  .md-typeset h3 {
    font-size: 1.12rem;
  }

  .hero {
    padding: 1.8rem 1.15rem;
    margin-top: 0.4rem;
    border-radius: var(--rafael-radius-md);
  }

  .hero h1 {
    font-size: clamp(1.9rem, 10vw, 2.5rem);
  }

  .hero h2 {
    font-size: 1.1rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .md-typeset .md-button {
    display: block;
    width: 100%;
    margin-right: 0;
    text-align: center;
  }

  .md-typeset .grid.cards > ul > li,
  .md-typeset .grid.cards > ol > li {
    padding: 1.1rem;
  }

  .md-typeset p > img:only-child,
  .article-cover {
    margin-top: 1.1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--rafael-radius-sm);
  }

  .md-typeset table:not([class]) {
    min-width: 560px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   AJUSTES FINAIS — TÍTULOS, METADADOS E MENU SUPERIOR
   ========================================================= */

/* O título usa toda a largura disponível do artigo */
.md-typeset h1 {
  width: 100%;
  max-width: none;
  margin: 0 0 0.9rem;
  font-size: clamp(2rem, 2.15vw, 2.7rem);
  line-height: 1.08;
  font-weight: 750;
  text-wrap: pretty;
}

/* Bloco de nível, tempo de leitura e tecnologias mais compacto */
.md-typeset > blockquote:first-of-type {
  padding: 0.62rem 0.95rem;
  margin: 0 0 1.25rem;
  border-left: 4px solid var(--rafael-blue);
  border-radius: 0 var(--rafael-radius-md) var(--rafael-radius-md) 0;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.07),
    rgba(124, 58, 237, 0.04)
  );
  box-shadow: none;
}

.md-typeset > blockquote:first-of-type p {
  margin: 0;
  line-height: 1.42;
}

.md-typeset > blockquote:first-of-type p + p {
  margin-top: 0.38rem;
}

/* Menu superior mais compacto para todos os itens caberem */
.md-tabs__list {
  gap: 0;
}

.md-tabs__item {
  height: 2.4rem;
}

.md-tabs__link {
  padding-inline: 0.42rem;
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Em telas um pouco menores, reduz ainda mais sem cortar o último item */
@media screen and (max-width: 1500px) {
  .md-tabs__link {
    padding-inline: 0.34rem;
    font-size: 0.63rem;
  }
}

@media screen and (max-width: 1350px) {
  .md-tabs__link {
    padding-inline: 0.28rem;
    font-size: 0.6rem;
  }

  .md-header__title {
    max-width: 13rem;
  }
}

/* Notebook */
@media screen and (max-width: 1400px) {
  .md-typeset h1 {
    max-width: none;
    font-size: clamp(1.9rem, 2.05vw, 2.45rem);
  }
}

/* Tablet */
@media screen and (max-width: 960px) {
  .md-typeset h1 {
    max-width: none;
    font-size: clamp(1.9rem, 5vw, 2.35rem);
  }

  .md-typeset > blockquote:first-of-type {
    padding: 0.6rem 0.85rem;
  }
}

/* Celular */
@media screen and (max-width: 600px) {
  .md-typeset h1 {
    width: 100%;
    max-width: none;
    margin-bottom: 0.85rem;
    font-size: clamp(1.72rem, 8vw, 2.05rem);
    line-height: 1.12;
  }

  .md-typeset > blockquote:first-of-type {
    padding: 0.58rem 0.75rem;
    margin-bottom: 1rem;
  }

  .md-typeset > blockquote:first-of-type p {
    line-height: 1.4;
  }
}
/* Remove o título "Início" da Home */
body[data-md-page="index"] .md-content__inner > h1:first-child {
    display: none;
}



/* =========================================================
   CORREÇÕES DEFINITIVAS — HOME, CONTEÚDOS E HERO
   ========================================================= */

/*
  Remove o H1 automático somente em páginas que possuem:
  - o bloco .hero (Home)
  - a grade de cards (Conteúdos)
  Não afeta os títulos dos artigos.
*/
body:has(.hero) .md-content__inner > h1:first-child,
body:has(.grid.cards) .md-content__inner > h1:first-child {
  display: none !important;
}

/* Elimina o espaço superior deixado pelo título removido */
body:has(.hero) .md-content__inner,
body:has(.grid.cards) .md-content__inner {
  padding-top: 0 !important;
}

/* Hero realmente compacto */
.hero {
  padding: 1.15rem 1.4rem !important;
  margin: 0 0 1.4rem !important;
  border-radius: 14px !important;
}

/* Título principal da Home */
.hero h1 {
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 0.25rem !important;
  padding: 0 !important;
  font-size: clamp(1.8rem, 2.8vw, 2.55rem) !important;
  line-height: 1.08 !important;
  text-wrap: pretty !important;
}

/* Subtítulo da Home */
.hero h2 {
  margin: 0 0 0.55rem !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: clamp(0.98rem, 1.35vw, 1.18rem) !important;
  line-height: 1.3 !important;
}

/* Texto da apresentação */
.hero p {
  max-width: 900px !important;
  margin: 0 0 0.45rem !important;
  font-size: 0.92rem !important;
  line-height: 1.55 !important;
}

.hero p:last-child {
  margin-bottom: 0 !important;
}

/* Evita que os elementos decorativos aumentem visualmente o bloco */
.hero::before {
  top: -130px !important;
  right: -120px !important;
  width: 220px !important;
  height: 220px !important;
}

.hero::after {
  right: 90px !important;
  bottom: -135px !important;
  width: 165px !important;
  height: 165px !important;
}

/* Página de conteúdos começa diretamente nos cards */
body:has(.grid.cards) .grid.cards {
  margin-top: 0 !important;
}

/* Menu superior: mantém todos os itens visíveis */
.md-tabs__list {
  gap: 0 !important;
}

.md-tabs__item {
  height: 2.35rem !important;
}

.md-tabs__link {
  padding-inline: 0.34rem !important;
  font-size: 0.63rem !important;
  font-weight: 650 !important;
  letter-spacing: -0.012em !important;
  white-space: nowrap !important;
}

/* Título dos artigos usa toda a largura disponível */
.md-typeset h1 {
  width: 100%;
  max-width: none !important;
  margin: 0 0 0.9rem;
  font-size: clamp(2rem, 2.15vw, 2.7rem);
  line-height: 1.08;
  text-wrap: pretty;
}

/* Bloco de nível, tempo de leitura e tecnologias */
.md-typeset > blockquote:first-of-type {
  padding: 0.58rem 0.9rem !important;
  margin: 0 0 1.15rem !important;
}

.md-typeset > blockquote:first-of-type p {
  margin: 0 !important;
  line-height: 1.4 !important;
}

.md-typeset > blockquote:first-of-type p + p {
  margin-top: 0.32rem !important;
}

/* Notebook */
@media screen and (max-width: 1400px) {
  .md-tabs__link {
    padding-inline: 0.27rem !important;
    font-size: 0.59rem !important;
  }

  .hero {
    padding: 1.05rem 1.25rem !important;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 2.5vw, 2.35rem) !important;
  }
}

/* Tablet */
@media screen and (max-width: 960px) {
  .hero {
    padding: 1rem 1.1rem !important;
    margin-bottom: 1.2rem !important;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.25rem) !important;
  }

  .hero h2 {
    font-size: 1rem !important;
  }

  .hero p {
    font-size: 0.88rem !important;
  }
}

/* Celular */
@media screen and (max-width: 600px) {
  .hero {
    padding: 0.9rem 0.9rem !important;
    margin: 0 0 1rem !important;
    border-radius: 12px !important;
  }

  .hero h1 {
    font-size: clamp(1.65rem, 8vw, 2rem) !important;
    line-height: 1.1 !important;
  }

  .hero h2 {
    margin-bottom: 0.45rem !important;
    font-size: 0.96rem !important;
  }

  .hero p {
    margin-bottom: .5rem !important;
    font-size: 0.86rem !important;
    line-height: 1.55 !important;
  }

  .md-typeset > blockquote:first-of-type {
    padding: 0.55rem 0.72rem !important;
    margin-bottom: 0.95rem !important;
  }
}

/* =========================================================
   HOME — APROVEITAMENTO DE LARGURA E ESPAÇAMENTOS
   ========================================================= */

/* A Home pode utilizar mais largura que os artigos */
body:has(.hero) .md-content__inner {
  width: 100%;
  max-width: 1100px !important;
  margin-inline: auto;
}

/* Hero ocupa toda a largura disponível da Home */
body:has(.hero) .hero {
  width: 100%;
  max-width: none;
}

/* Reduz o espaço entre o hero e a próxima seção */
body:has(.hero) .hero {
  margin-bottom: 1rem !important;
}

/* Linha divisória da Home mais discreta e compacta */
body:has(.hero) .md-typeset hr {
  margin: 1.5rem 0 1.8rem !important;
}

/* Remove espaço exagerado antes de Base de conhecimento */
body:has(.hero) .md-typeset hr + h2 {
  margin-top: 0 !important;
}

/* Cards aproveitam toda a largura disponível */
body:has(.hero) .md-typeset .grid {
  width: 100%;
}

/* Em telas grandes, mantém duas colunas equilibradas */
@media screen and (min-width: 961px) {
  body:has(.hero) .md-typeset .grid.cards > ul,
  body:has(.hero) .md-typeset .grid.cards > ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet */
@media screen and (max-width: 960px) {
  body:has(.hero) .md-content__inner {
    max-width: 100% !important;
  }
}

/* Celular */
@media screen and (max-width: 600px) {
  body:has(.hero) .md-typeset hr {
    margin: 1.1rem 0 1.4rem !important;
  }
}
/* =========================================================
   PÁGINA DE CONTEÚDOS — LARGURA TOTAL
   ========================================================= */

/* Usa uma largura maior na página de listagem */
body:has(.grid.cards):not(:has(.hero)) .md-content__inner {
  width: 100%;
  max-width: 1180px !important;
  margin-inline: auto;
  padding-top: 0 !important;
}

/* Cards ocupam toda a área disponível */
body:has(.grid.cards):not(:has(.hero)) .grid.cards {
  width: 100%;
  margin-top: 0 !important;
}

/* Duas colunas equilibradas em telas grandes */
@media screen and (min-width: 961px) {
  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ul,
  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Uma coluna em tablet e celular */
@media screen and (max-width: 960px) {
  body:has(.grid.cards):not(:has(.hero)) .md-content__inner {
    max-width: 100% !important;
  }

  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ul,
  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ol {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   PÁGINA CONTEÚDOS — REMOVE A BARRA LATERAL ESQUERDA
   ========================================================= */

/* Oculta a navegação lateral somente na página com os cards */
body:has(.grid.cards):not(:has(.hero)) .md-sidebar--primary {
  display: none !important;
}

/* Remove o espaço que seria reservado para a barra lateral */
body:has(.grid.cards):not(:has(.hero)) .md-content {
  margin-left: 0 !important;
}

/* Centraliza e amplia a área dos cards */
body:has(.grid.cards):not(:has(.hero)) .md-content__inner {
  width: 100%;
  max-width: 1240px !important;
  margin-inline: auto !important;
  padding-top: 0 !important;
}

/* Garante que a listagem use toda a largura */
body:has(.grid.cards):not(:has(.hero)) .grid.cards {
  width: 100%;
  margin: 0 !important;
}

/* Três colunas em telas grandes */
@media screen and (min-width: 1200px) {
  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ul,
  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Duas colunas em notebooks e tablets */
@media screen and (min-width: 761px) and (max-width: 1199px) {
  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ul,
  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Uma coluna no celular */
@media screen and (max-width: 760px) {
  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ul,
  body:has(.grid.cards):not(:has(.hero)) .grid.cards > ol {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   HOME E CONTEÚDOS — CENTRALIZAÇÃO REAL NA TELA
   ========================================================= */

/* Remove completamente as duas barras laterais nessas páginas */
body:has(.hero) .md-sidebar--primary,
body:has(.hero) .md-sidebar--secondary,
body:has(.grid.cards):not(:has(.hero)) .md-sidebar--primary,
body:has(.grid.cards):not(:has(.hero)) .md-sidebar--secondary {
  display: none !important;
}

/* Centraliza a estrutura principal na largura total da página */
body:has(.hero) .md-main__inner,
body:has(.grid.cards):not(:has(.hero)) .md-main__inner {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important;
}

/* Remove margens reservadas para as barras laterais */
body:has(.hero) .md-content,
body:has(.grid.cards):not(:has(.hero)) .md-content {
  flex: 0 1 1180px !important;
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
}

/* Área interna ocupa exatamente o centro */
body:has(.hero) .md-content__inner,
body:has(.grid.cards):not(:has(.hero)) .md-content__inner {
  width: 100% !important;
  max-width: 1180px !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

/* Tablet e celular */
@media screen and (max-width: 1220px) {
  body:has(.hero) .md-content,
  body:has(.grid.cards):not(:has(.hero)) .md-content,
  body:has(.hero) .md-content__inner,
  body:has(.grid.cards):not(:has(.hero)) .md-content__inner {
    max-width: calc(100% - 2rem) !important;
  }
}

@media screen and (max-width: 600px) {
  body:has(.hero) .md-content,
  body:has(.grid.cards):not(:has(.hero)) .md-content,
  body:has(.hero) .md-content__inner,
  body:has(.grid.cards):not(:has(.hero)) .md-content__inner {
    max-width: calc(100% - 1.2rem) !important;
  }
}
/* =========================================================
   ARTIGOS — LAYOUT DE LEITURA EQUILIBRADO
   ========================================================= */

@media screen and (min-width: 1220px) {
  /*
   * Distribuição aproximada:
   * menu esquerdo: 210px
   * artigo: todo o espaço restante
   * menu direito: 210px
   */
  .md-main__inner {
    display: grid !important;
    grid-template-columns:
      minmax(190px, 210px)
      minmax(0, 1fr)
      minmax(190px, 210px);
    column-gap: 1.75rem !important;
    width: 100%;
    max-width: 1680px;
    margin-inline: auto;
  }

  /* Menu da categoria */
  .md-sidebar--primary {
    grid-column: 1;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
  }

  /* Conteúdo principal */
  .md-content {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    max-width: none !important;
    margin: 0 !important;
  }

  /* Área real de leitura */
  .md-content__inner {
    width: 100%;
    max-width: 980px !important;
    margin: 0 auto !important;
  }

  /* Índice "Nesta página" */
  .md-sidebar--secondary {
    grid-column: 3;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
  }
}

/* Telas maiores: artigo um pouco mais largo */
@media screen and (min-width: 1550px) {
  .md-main__inner {
    grid-template-columns:
      minmax(200px, 220px)
      minmax(0, 1fr)
      minmax(190px, 210px);
    column-gap: 2rem !important;
  }

  .md-content__inner {
    max-width: 1040px !important;
  }
}

/* Notebooks menores */
@media screen and (min-width: 1220px) and (max-width: 1399px) {
  .md-main__inner {
    grid-template-columns:
      minmax(170px, 190px)
      minmax(0, 1fr)
      minmax(170px, 190px);
    column-gap: 1.25rem !important;
  }

  .md-content__inner {
    max-width: 880px !important;
  }
}

/* =========================================================
   HOME E CONTEÚDOS — CENTRALIZAÇÃO DEFINITIVA
   Deve permanecer no final absoluto do arquivo
   ========================================================= */

/*
 * Nas páginas Home e Conteúdos, remove a grade de três colunas
 * usada nos artigos e cria uma única coluna central.
 */
@media screen and (min-width: 1220px) {
  .md-main__inner:has(.hero),
  .md-main__inner:has(.grid.cards):not(:has(.hero)) {
    display: grid !important;
    grid-template-columns: minmax(0, 1180px) !important;
    justify-content: center !important;
    column-gap: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }

  .md-main__inner:has(.hero) > .md-sidebar,
  .md-main__inner:has(.grid.cards):not(:has(.hero)) > .md-sidebar {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .md-main__inner:has(.hero) > .md-content,
  .md-main__inner:has(.grid.cards):not(:has(.hero)) > .md-content {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .md-main__inner:has(.hero) .md-content__inner,
  .md-main__inner:has(.grid.cards):not(:has(.hero)) .md-content__inner {
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
  }
}

@media screen and (max-width: 1219px) {
  .md-main__inner:has(.hero),
  .md-main__inner:has(.grid.cards):not(:has(.hero)) {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
  }

  .md-main__inner:has(.hero) > .md-sidebar,
  .md-main__inner:has(.grid.cards):not(:has(.hero)) > .md-sidebar {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .md-main__inner:has(.hero) > .md-content,
  .md-main__inner:has(.grid.cards):not(:has(.hero)) > .md-content {
    width: calc(100% - 2rem) !important;
    max-width: 1180px !important;
    margin-right: auto !important;
    margin-left: auto !important;
    padding: 0 !important;
  }

  .md-main__inner:has(.hero) .md-content__inner,
  .md-main__inner:has(.grid.cards):not(:has(.hero)) .md-content__inner {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }
}

@media screen and (max-width: 600px) {
  .md-main__inner:has(.hero) > .md-content,
  .md-main__inner:has(.grid.cards):not(:has(.hero)) > .md-content {
    width: calc(100% - 1.2rem) !important;
  }
}
/* =========================================================
   PÁGINA SOBRE
   ========================================================= */

/* Remove as colunas laterais e centraliza a página Sobre */
.md-main__inner:has(.about-hero) {
  display: grid !important;
  grid-template-columns: minmax(0, 1100px) !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important;
  column-gap: 0 !important;
}

.md-main__inner:has(.about-hero) > .md-sidebar {
  display: none !important;
}

.md-main__inner:has(.about-hero) > .md-content {
  grid-column: 1 !important;
  width: 100% !important;
  max-width: 1100px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.md-main__inner:has(.about-hero) .md-content__inner {
  width: 100% !important;
  max-width: 1100px !important;
  margin: 0 !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

/* Bloco de apresentação */
.about-hero {
  position: relative;
  overflow: hidden;
  padding: 1.8rem 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--rafael-border);
  border-radius: var(--rafael-radius-lg);
  background:
    radial-gradient(
      circle at top right,
      rgba(37, 99, 235, 0.14),
      transparent 35%
    ),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--rafael-shadow-sm);
}

.about-hero h1 {
  margin: 0 0 1rem !important;
  color: var(--rafael-blue);
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.about-hero p {
  max-width: 900px;
  margin-bottom: 0.8rem;
  font-size: 0.96rem;
  line-height: 1.7;
}

.about-hero p:last-child {
  margin-bottom: 0;
}

/* Cards de áreas de atuação */
.about-grid {
  margin-bottom: 2.5rem;
}

.about-grid > ul,
.about-grid > ol {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Grade de tecnologias */
.technology-grid {
  margin: 1rem 0 2.5rem;
}

.technology-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .75rem;
}

.technology-grid li {
  margin: 0 !important;
  padding: .85rem 1rem;

  border: 1px solid var(--rafael-border);
  border-radius: 12px;

  background: var(--rafael-surface);

  text-align: center;
  font-weight: 600;

  box-shadow: var(--rafael-shadow-sm);

  transition: .2s;
}

.technology-grid li:hover {
  transform: translateY(-2px);
  box-shadow: var(--rafael-shadow-md);
}

/* Links finais */
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.about-links .md-button {
  margin: 0;
}

/* Modo escuro */
[data-md-color-scheme="slate"] .about-hero {
  background:
    radial-gradient(
      circle at top right,
      rgba(59, 130, 246, 0.16),
      transparent 35%
    ),
    linear-gradient(135deg, #172033 0%, #111827 100%);
}

/* Tablet */
@media screen and (max-width: 960px) {
  .md-main__inner:has(.about-hero) > .md-content {
    width: calc(100% - 2rem) !important;
    margin-inline: auto !important;
  }

  .about-grid > ul,
  .about-grid > ol {
    grid-template-columns: 1fr;
  }

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

/* Celular */
@media screen and (max-width: 600px) {
  .md-main__inner:has(.about-hero) > .md-content {
    width: calc(100% - 1.2rem) !important;
  }

  .about-hero {
    padding: 1.2rem 1rem;
    border-radius: var(--rafael-radius-md);
  }

  .about-hero h1 {
    font-size: 1.9rem;
  }

  .about-hero p {
    font-size: 0.88rem;
  }

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

  .about-links {
    display: block;
  }

  .about-links .md-button {
    display: block;
    width: 100%;
    margin-bottom: 0.6rem;
    text-align: center;
  }
}



/* =========================================================
   AJUSTES FINAIS — TIPOGRAFIA DA PÁGINA SOBRE
   ========================================================= */

/* Hero mais sóbrio e compacto */
.about-hero {
  padding: 1.35rem 1.6rem !important;
  margin-bottom: 1.5rem !important;
}

/* Título principal menor e coerente com o restante do site */
.about-hero h1 {
  margin: 0 0 0.7rem !important;
  font-size: clamp(1.8rem, 2.2vw, 2.2rem) !important;
  line-height: 1.12 !important;
  font-weight: 750 !important;
}

/* Texto de apresentação menor e com leitura confortável */
.about-hero p {
  max-width: 940px !important;
  margin-bottom: 0.55rem !important;
  font-size: 0.9rem !important;
  line-height: 1.62 !important;
}

.about-hero p:last-child {
  margin-bottom: 0 !important;
}

/* Cards das áreas de atuação mais compactos */
.about-grid {
  margin-bottom: 2rem !important;
}

.about-grid > ul,
.about-grid > ol {
  gap: 0.9rem !important;
}

/* Reduz o padding dos cards somente na página Sobre */
.about-grid.grid.cards > ul > li,
.about-grid.grid.cards > ol > li {
  padding: 1.05rem !important;
}

/* Ícones menores */
.about-grid .lg {
  font-size: 1.65rem !important;
}

/* Títulos dos cards menores */
.about-grid strong {
  font-size: 0.94rem !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
}

/* Textos dos cards menores */
.about-grid p {
  margin-top: 0.65rem !important;
  font-size: 0.86rem !important;
  line-height: 1.58 !important;
}

/* Linha interna dos cards mais compacta */
.about-grid hr {
  margin: 0.65rem 0 !important;
}

/* Títulos das seções da página Sobre */
.md-main__inner:has(.about-hero) .md-typeset h2 {
  margin-top: 1rem !important;
  font-size: clamp(1.25rem, 1.35vw, 1.5rem) !important;
}

/* Tecnologias em quatro colunas em telas grandes */
.technology-grid {
  margin: 0.9rem 0 2rem !important;
}

.technology-grid ul {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0.65rem !important;
}

.technology-grid li {
  padding: 0.65rem 0.8rem !important;
  font-size: 0.84rem !important;
  line-height: 1.3 !important;
}

/* Notebook */
@media screen and (max-width: 1200px) {
  .technology-grid ul {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Tablet */
@media screen and (max-width: 960px) {
  .about-hero {
    padding: 1.15rem 1.25rem !important;
  }

  .about-hero h1 {
    font-size: clamp(1.7rem, 4vw, 2rem) !important;
  }

  .about-grid strong {
    font-size: 0.92rem !important;
  }

  .technology-grid ul {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Celular */
@media screen and (max-width: 600px) {
  .about-hero {
    padding: 1rem 0.9rem !important;
  }

  .about-hero h1 {
    font-size: 1.65rem !important;
  }

  .about-hero p {
    font-size: 0.86rem !important;
    line-height: 1.55 !important;
  }

  .about-grid .lg {
    font-size: 1.5rem !important;
  }

  .about-grid strong {
    font-size: 0.9rem !important;
  }

  .about-grid p {
    font-size: 0.84rem !important;
  }

  .technology-grid ul {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
/* =========================================================
   LEITURA DOS ARTIGOS
   ========================================================= */

.md-typeset p + p {
    margin-top: .8rem;
}

.md-typeset h2 {
    margin-top: 1rem !important;
}

.md-typeset h2 + p {
    margin-top: .7rem;
}

.md-typeset h3 {
    margin-top: 1.6rem !important;
}

.md-typeset ul,
.md-typeset ol {
    margin-top: .7rem;
    margin-bottom: .9rem;
}

.md-typeset li {
    margin-bottom: .2rem;
}
/* =========================================================
   ARTIGOS — TIPOGRAFIA E ESPAÇAMENTO COMPACTOS
   ========================================================= */

/* Aplica somente às páginas de leitura */
.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset {
  font-size: 0.82rem !important;
  line-height: 1.62 !important;
}

/* Parágrafos mais próximos */
.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset p {
  margin-top: 0.55rem !important;
  margin-bottom: 0.55rem !important;
  font-size: inherit !important;
  line-height: 1.62 !important;
}

/* Títulos de seção */
.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset h2 {
  margin-top: 1.45rem !important;
  margin-bottom: 0.55rem !important;
  padding-bottom: 0.35rem !important;
  font-size: 1.35rem !important;
  line-height: 1.25 !important;
}

/* Subtítulos */
.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset h3 {
  margin-top: 1.2rem !important;
  margin-bottom: 0.45rem !important;
  font-size: 1.08rem !important;
}

/* Linhas horizontais entre seções */
.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset hr {
  margin-top: 1.15rem !important;
  margin-bottom: 1.15rem !important;
}

/* Código mais compacto */
.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset .highlight {
  margin-top: 0.75rem !important;
  margin-bottom: 0.85rem !important;
}

.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset pre {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset pre > code {
  font-size: 0.78rem !important;
  line-height: 1.55 !important;
}

/* Listas */
.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset ul,
.md-main__inner:not(:has(.hero)):not(:has(.grid.cards)):not(:has(.about-hero))
.md-typeset ol {
  margin-top: 0.55rem !important;
  margin-bottom: 0.7rem !important;
}
/* =========================================================
   HOME — AJUSTE VERTICAL DO HERO
   ========================================================= */

body:has(.hero) .hero {
  padding-top: 0.85rem !important;
  padding-bottom: 0.95rem !important;
}

/* Aproxima o título do topo */
body:has(.hero) .hero h1 {
  margin-top: 0 !important;
  margin-bottom: 0.2rem !important;
}

/* Mantém o restante mais compacto */
body:has(.hero) .hero h2 {
  margin-bottom: 0.4rem !important;
}

body:has(.hero) .hero p {
  margin-bottom: 0.35rem !important;
}

/* Espaço controlado antes dos botões */
body:has(.hero) .hero .md-button {
  margin-top: 0.35rem !important;
}

/* Celular */
@media screen and (max-width: 600px) {
  body:has(.hero) .hero {
    padding-top: 0.75rem !important;
    padding-bottom: 0.8rem !important;
  }
}
/* =========================================================
   PÁGINA CONTEÚDOS
   ========================================================= */

/* Cards mais compactos */
.grid.cards > ul > li {
    padding: 1.2rem !important;
}

/* Ícones menores */
.grid.cards .lg,
.grid.cards svg {
    font-size: 2.1rem !important;
    width: 2.1rem !important;
    height: 2.1rem !important;
}

/* Título do card */
.grid.cards strong {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

/* Texto descritivo */
.grid.cards p {
    font-size: 0.94rem !important;
    line-height: 1.6 !important;
    margin-bottom: .75rem !important;
}

/* Lista de artigos */
.grid.cards li li {
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    margin-bottom: .3rem !important;
}

/* Links dos artigos */
.grid.cards li li a {
    font-size: inherit !important;
}

/* Linha separadora */
.grid.cards hr {
    margin: .8rem 0 !important;
}



/* =========================================================
   REVISÃO FINAL — PÁGINA DE CONTEÚDOS E CONSISTÊNCIA VISUAL
   Deve permanecer no final do arquivo
   ========================================================= */

/*
 * Estes seletores atuam somente na página Conteúdos.
 * A Home também possui cards, por isso excluímos páginas com .hero
 * e a página Sobre, que possui .about-hero.
 */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ul,
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ol {
  gap: 0.85rem !important;
}

/* Cards mais compactos */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ul > li,
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ol > li {
  padding: 1rem !important;
}

/* Cabeçalho do card: ícone e título */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ul > li > p:first-child,
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ol > li > p:first-child {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.55rem !important;
  line-height: 1.25 !important;
}

/* Ícones menores e proporcionais */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards .lg,
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards svg {
  width: 1.8rem !important;
  height: 1.8rem !important;
  min-width: 1.8rem !important;
  font-size: 1.8rem !important;
}

/* Título de cada categoria */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards strong {
  font-size: 0.98rem !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
}

/* Linha separadora mais discreta */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards hr {
  margin: 0.6rem 0 0.7rem !important;
}

/* Descrição da categoria */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ul > li > p:not(:first-child),
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ol > li > p:not(:first-child) {
  margin: 0 0 0.55rem !important;
  font-size: 0.82rem !important;
  line-height: 1.52 !important;
}

/* Lista de artigos dentro dos cards */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ul > li > ul,
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ol > li > ul {
  margin: 0.45rem 0 0 !important;
  padding-left: 1.05rem !important;
}

/* Itens e links dos artigos */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ul > li > ul > li,
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ol > li > ul > li {
  margin: 0 0 0.28rem !important;
  padding-left: 0.08rem !important;
  font-size: 0.8rem !important;
  line-height: 1.42 !important;
}

body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ul > li > ul > li > a,
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ol > li > ul > li > a {
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: 500 !important;
}

/* Evita cards visualmente altos demais */
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ul > li,
body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
.grid.cards > ol > li {
  min-height: 0 !important;
}

/* Notebook */
@media screen and (max-width: 1400px) {
  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards strong {
    font-size: 0.94rem !important;
  }

  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ul > li > p:not(:first-child),
  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ol > li > p:not(:first-child) {
    font-size: 0.8rem !important;
  }

  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ul > li > ul > li,
  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ol > li > ul > li {
    font-size: 0.78rem !important;
  }
}

/* Tablet */
@media screen and (max-width: 960px) {
  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ul > li,
  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ol > li {
    padding: 0.9rem !important;
  }

  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards .lg,
  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards svg {
    width: 1.65rem !important;
    height: 1.65rem !important;
    min-width: 1.65rem !important;
    font-size: 1.65rem !important;
  }
}

/* Celular */
@media screen and (max-width: 600px) {
  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards strong {
    font-size: 0.92rem !important;
  }

  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ul > li > p:not(:first-child),
  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ol > li > p:not(:first-child) {
    font-size: 0.79rem !important;
  }

  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ul > li > ul > li,
  body:has(.grid.cards):not(:has(.hero)):not(:has(.about-hero))
  .grid.cards > ol > li > ul > li {
    font-size: 0.78rem !important;
  }
}



/* =========================================================
   AJUSTES FINAIS — CARDS DA HOME
   Deve permanecer no final do arquivo
   ========================================================= */

/* Grade da Home mais equilibrada */
body:has(.hero) .grid.cards > ul,
body:has(.hero) .grid.cards > ol {
  gap: 0.9rem !important;
}

/* Cards da Home mais refinados */
body:has(.hero) .grid.cards > ul > li,
body:has(.hero) .grid.cards > ol > li {
  padding: 1.1rem !important;
  border-color: var(--rafael-border) !important;
  box-shadow: var(--rafael-shadow-sm) !important;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease !important;
}

/* Hover mais elegante */
body:has(.hero) .grid.cards > ul > li:hover,
body:has(.hero) .grid.cards > ol > li:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(37, 99, 235, 0.4) !important;
  box-shadow: var(--rafael-shadow-md) !important;
}

/* Cabeçalho do card */
body:has(.hero) .grid.cards > ul > li > p:first-child,
body:has(.hero) .grid.cards > ol > li > p:first-child {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem !important;
  line-height: 1.25 !important;
}

/* Ícones menores */
body:has(.hero) .grid.cards .lg,
body:has(.hero) .grid.cards svg {
  width: 1.9rem !important;
  height: 1.9rem !important;
  min-width: 1.9rem !important;
  font-size: 1.9rem !important;
}

/* Títulos dos cards */
body:has(.hero) .grid.cards strong {
  font-size: 0.98rem !important;
  line-height: 1.25 !important;
  font-weight: 650 !important;
  letter-spacing: -0.015em !important;
  transition: color 0.2s ease !important;
}

/* Título e ícone ganham destaque no hover */
body:has(.hero) .grid.cards > ul > li:hover strong,
body:has(.hero) .grid.cards > ol > li:hover strong,
body:has(.hero) .grid.cards > ul > li:hover .lg,
body:has(.hero) .grid.cards > ol > li:hover .lg {
  color: var(--rafael-blue-dark) !important;
}

/* Remove visualmente a linha interna dos cards da Home */
body:has(.hero) .grid.cards hr {
  display: none !important;
}

/* Descrição dos cards */
body:has(.hero) .grid.cards > ul > li > p:not(:first-child),
body:has(.hero) .grid.cards > ol > li > p:not(:first-child) {
  margin: 0 0 0.6rem !important;
  font-size: 0.83rem !important;
  line-height: 1.52 !important;
}

/* Links finais dos cards */
body:has(.hero) .grid.cards > ul > li a,
body:has(.hero) .grid.cards > ol > li a {
  font-size: 0.8rem !important;
  line-height: 1.4 !important;
  font-weight: 500 !important;
}

/* Mantém o link final mais próximo do conteúdo */
body:has(.hero) .grid.cards > ul > li > p:last-child,
body:has(.hero) .grid.cards > ol > li > p:last-child {
  margin-top: 0.35rem !important;
  margin-bottom: 0 !important;
}

/* Título "Base de conhecimento" um pouco mais discreto */
body:has(.hero) .md-typeset h2 {
  font-size: clamp(1.25rem, 1.35vw, 1.5rem) !important;
  margin-bottom: 0.7rem !important;
}

/* Notebook */
@media screen and (max-width: 1400px) {
  body:has(.hero) .grid.cards > ul > li,
  body:has(.hero) .grid.cards > ol > li {
    padding: 1rem !important;
  }

  body:has(.hero) .grid.cards strong {
    font-size: 0.94rem !important;
  }

  body:has(.hero) .grid.cards > ul > li > p:not(:first-child),
  body:has(.hero) .grid.cards > ol > li > p:not(:first-child) {
    font-size: 0.81rem !important;
  }
}

/* Tablet */
@media screen and (max-width: 960px) {
  body:has(.hero) .grid.cards .lg,
  body:has(.hero) .grid.cards svg {
    width: 1.75rem !important;
    height: 1.75rem !important;
    min-width: 1.75rem !important;
    font-size: 1.75rem !important;
  }

  body:has(.hero) .grid.cards > ul > li,
  body:has(.hero) .grid.cards > ol > li {
    padding: 0.95rem !important;
  }
}

/* Celular */
@media screen and (max-width: 600px) {
  body:has(.hero) .grid.cards strong {
    font-size: 0.92rem !important;
  }

  body:has(.hero) .grid.cards > ul > li > p:not(:first-child),
  body:has(.hero) .grid.cards > ol > li > p:not(:first-child) {
    font-size: 0.79rem !important;
  }

  body:has(.hero) .grid.cards > ul > li a,
  body:has(.hero) .grid.cards > ol > li a {
    font-size: 0.78rem !important;
  }
}
/* =========================================================
   HOME — TEXTO APROVEITA A LARGURA DO HERO
   ========================================================= */

body:has(.hero) .hero p {
  width: 100% !important;
  max-width: none !important;
}

/* Mantém os botões na largura natural */
body:has(.hero) .hero .md-button {
  width: auto !important;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media screen and (max-width: 768px) {

    /* Mais respiro nas laterais */
    .md-main__inner {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Área principal do conteúdo */
    .md-content__inner {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hero da Home */
    .hero {
        padding: 1.2rem !important;
        border-radius: 16px !important;
    }

    /* Artigos */
    .md-typeset {
        font-size: .95rem !important;
        line-height: 1.65 !important;
    }

    /* Evita texto colado na borda */
    .md-typeset p,
    .md-typeset li,
    .md-typeset blockquote {
        max-width: 100%;
    }

    /* Imagens ocupam a largura disponível */
    .md-typeset img {
        border-radius: 12px;
    }

    /* Cards */
    .grid.cards > ul > li {
        padding: 1rem !important;
    }
}

@media screen and (max-width: 430px) {

    .md-main__inner {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .hero {
        padding: 1.35rem !important;
    }

    .md-typeset h1 {
        font-size: 1.9rem !important;
    }

    .md-typeset h2 {
        font-size: 1.45rem !important;
    }
}



/* =========================================================
   AJUSTE FINAL — TIPOGRAFIA DA SEÇÃO SOBRE
   Deve permanecer no final do arquivo
   ========================================================= */

/* Bloco principal mais compacto */
.about-hero {
  padding: 1.15rem 1.4rem !important;
  margin-bottom: 1.25rem !important;
}

/* Título "Sobre" */
.about-hero h1 {
  margin: 0 0 0.6rem !important;
  font-size: clamp(1.65rem, 1.9vw, 2rem) !important;
  line-height: 1.12 !important;
  font-weight: 750 !important;
}

/* Texto de apresentação */
.about-hero p {
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 0.5rem !important;
  font-size: 0.82rem !important;
  line-height: 1.58 !important;
}

.about-hero p:last-child {
  margin-bottom: 0 !important;
}

/* Cards de especialidades mais compactos */
.about-grid {
  margin-bottom: 1.7rem !important;
}

.about-grid > ul,
.about-grid > ol {
  gap: 0.8rem !important;
}

.about-grid.grid.cards > ul > li,
.about-grid.grid.cards > ol > li {
  padding: 0.9rem !important;
}

/* Cabeçalho de cada card */
.about-grid.grid.cards > ul > li > p:first-child,
.about-grid.grid.cards > ol > li > p:first-child {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.5rem !important;
  line-height: 1.22 !important;
}

/* Ícones */
.about-grid .lg,
.about-grid svg {
  width: 1.45rem !important;
  height: 1.45rem !important;
  min-width: 1.45rem !important;
  font-size: 1.45rem !important;
}

/* Títulos dos cards */
.about-grid strong {
  font-size: 0.86rem !important;
  line-height: 1.28 !important;
  font-weight: 700 !important;
  letter-spacing: -0.012em !important;
}

/* Linha divisória */
.about-grid hr {
  margin: 0.5rem 0 0.6rem !important;
}

/* Descrição dos cards */
.about-grid p:not(:first-child) {
  margin: 0 !important;
  font-size: 0.78rem !important;
  line-height: 1.5 !important;
}

/* Títulos das demais seções da página Sobre */
.md-main__inner:has(.about-hero) .md-typeset h2 {
  margin-top: 1.5rem !important;
  margin-bottom: 0.65rem !important;
  padding-bottom: 0.35rem !important;
  font-size: clamp(1.12rem, 1.2vw, 1.32rem) !important;
  line-height: 1.25 !important;
}

/* Chips de tecnologias */
.technology-grid li,
.technology-grid > div {
  padding: 0.55rem 0.7rem !important;
  font-size: 0.78rem !important;
  line-height: 1.25 !important;
  font-weight: 600 !important;
}

/* Links e botões finais */
.about-links .md-button {
  padding: 0.55rem 0.9rem !important;
  font-size: 0.8rem !important;
}

/* Notebook */
@media screen and (max-width: 1200px) {
  .about-hero h1 {
    font-size: clamp(1.6rem, 2.2vw, 1.9rem) !important;
  }

  .about-hero p {
    font-size: 0.8rem !important;
  }

  .about-grid strong {
    font-size: 0.84rem !important;
  }

  .about-grid p:not(:first-child) {
    font-size: 0.76rem !important;
  }
}

/* Tablet */
@media screen and (max-width: 960px) {
  .about-hero {
    padding: 1rem 1.1rem !important;
  }

  .about-hero h1 {
    font-size: 1.7rem !important;
  }

  .about-hero p {
    font-size: 0.8rem !important;
    line-height: 1.55 !important;
  }

  .about-grid.grid.cards > ul > li,
  .about-grid.grid.cards > ol > li {
    padding: 0.85rem !important;
  }
}

/* Celular */
@media screen and (max-width: 600px) {
  .about-hero {
    padding: 0.95rem 0.9rem !important;
  }

  .about-hero h1 {
    font-size: 1.55rem !important;
  }

  .about-hero p {
    font-size: 0.78rem !important;
    line-height: 1.52 !important;
  }

  .about-grid .lg,
  .about-grid svg {
    width: 1.35rem !important;
    height: 1.35rem !important;
    min-width: 1.35rem !important;
    font-size: 1.35rem !important;
  }

  .about-grid strong {
    font-size: 0.82rem !important;
  }

  .about-grid p:not(:first-child) {
    font-size: 0.75rem !important;
  }

  .technology-grid li,
  .technology-grid > div {
    font-size: 0.76rem !important;
  }
}

/* =========================================================
   CORREÇÃO FINAL — MENU MOBILE
   Mantém a sidebar oculta no desktop das páginas especiais,
   mas restaura o drawer usado pelo menu hambúrguer no celular.
   Deve permanecer no final absoluto do arquivo.
   ========================================================= */

@media screen and (max-width: 1219px) {
  /*
   * O Material for MkDocs usa .md-sidebar--primary como o
   * painel lateral aberto pelo botão de três linhas.
   * Regras anteriores com display:none removiam o painel,
   * por isso o fundo escurecia, mas nenhum menu aparecia.
   */
  .md-main__inner:has(.hero) > .md-sidebar--primary,
  .md-main__inner:has(.grid.cards):not(:has(.hero)) > .md-sidebar--primary,
  .md-main__inner:has(.about-hero) > .md-sidebar--primary {
    display: block !important;
    width: 12.1rem !important;
    min-width: 12.1rem !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* O índice "Nesta página" pode continuar oculto no mobile */
  .md-main__inner:has(.hero) > .md-sidebar--secondary,
  .md-main__inner:has(.grid.cards):not(:has(.hero)) > .md-sidebar--secondary,
  .md-main__inner:has(.about-hero) > .md-sidebar--secondary {
    display: none !important;
  }

  /* Garante que a navegação interna do drawer seja renderizada */
  .md-sidebar--primary .md-sidebar__scrollwrap,
  .md-sidebar--primary .md-sidebar__inner,
  .md-sidebar--primary .md-nav {
    display: block !important;
    visibility: visible !important;
  }
}



/* =========================================================
   CORREÇÃO — SCROLL DO MENU MOBILE EM MODO HORIZONTAL
   Garante rolagem vertical do drawer em telas baixas,
   como iPhone em orientação landscape.
   Deve permanecer no final absoluto do arquivo.
   ========================================================= */

@media screen and (max-width: 1219px) {
  /*
   * O menu lateral precisa ocupar no máximo a altura visível
   * e permitir rolagem independente do conteúdo da página.
   */
  .md-sidebar--primary {
    top: 0 !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  .md-sidebar--primary .md-sidebar__scrollwrap {
    height: 100% !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  .md-sidebar--primary .md-sidebar__inner {
    min-height: 100% !important;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom)) !important;
  }

  /*
   * Evita que algum elemento interno do Material bloqueie
   * o gesto vertical em Safari/iOS.
   */
  .md-sidebar--primary .md-nav,
  .md-sidebar--primary .md-nav__list {
    overflow: visible !important;
    touch-action: pan-y !important;
  }
}

/* Ajuste específico para celulares em modo horizontal */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .md-sidebar--primary {
    height: 100svh !important;
    max-height: 100svh !important;
  }

  .md-sidebar--primary .md-sidebar__scrollwrap {
    height: 100svh !important;
    max-height: 100svh !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
  }

  .md-sidebar--primary .md-sidebar__inner {
    padding-bottom: calc(3rem + env(safe-area-inset-bottom)) !important;
  }
}

/* =========================================================
   HOME — BOTÃO DE DESTAQUE PARA O PORTFÓLIO
   ========================================================= */

.md-typeset .md-button--portfolio {
  border: 0;
  background-image: linear-gradient(
    90deg,
    var(--rafael-blue),
    var(--rafael-purple)
  );
  color: #ffffff;
  box-shadow: var(--rafael-shadow-md);
}

.md-typeset .md-button--portfolio:hover {
  transform: translateY(-2px);
  border: 0;
  background-image: linear-gradient(90deg, var(--rafael-blue-dark), #6d28d9);
  color: #ffffff;
  box-shadow: var(--rafael-shadow-md);
}

/* Ícone do botão acompanha a cor do texto e fica alinhado */
.md-typeset .md-button--portfolio .twemoji {
  margin-right: 0.4em;
  vertical-align: -0.16em;
}

.md-typeset .md-button--portfolio .twemoji svg {
  fill: currentColor;
}