/* =========================================================
   VARIÁVEIS DE TEMA — TEMA CLARO container
   ========================================================= */ logo

:root {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;

  --border-color: #e2e8f0;

  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;

  --card-bg: #ffffff;

  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);

  /* Barra de rolagem */
  --scroll-track: #f1f5f9;
  --scroll-thumb: #cbd5e1;
  --scroll-thumb-hover: #94a3b8;
}


/* =========================================================
     VARIÁVEIS DE TEMA — TEMA ESCURO
   ========================================================= */

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-surface: #1e293b;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;

  --border-color: #334155;

  --accent-color: #3b82f6;
  --accent-hover: #60a5fa;

  --card-bg: #1e293b;

  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.5);

  /* Variáveis originais do tema escuro */
  --bg-color: #121314;
  --text-color: #e0e0e0;
  --bg-color-section: #191a1b;
  --bg-color-card: #242526;
  --bg-color-input-text: #ffffff;
  --texto-study: #ffffff;

  /* Mapeamento original para a estrutura do layout */
  --bg-primary: var(--bg-color);
  --bg-surface: var(--bg-color-section);
  --text-primary: var(--text-color);
  --text-secondary: #a0a0a0;
  --border-color: #2d2e30;
  --accent-color: #3b82f6;
  --accent-hover: #60a5fa;
  --card-bg: var(--bg-color-card);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);

  /* Barra de rolagem */
  --scroll-track: #191a1b;
  --scroll-thumb: #334155;
  --scroll-thumb-hover: #475569;
}


/* =========================================================
     RESET E CONFIGURAÇÕES GLOBAIS
   ========================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}


/* =========================================================
     BARRA DE ROLAGEM
   ========================================================= */

html {
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}


/* =========================================================
     BODY
   ========================================================= */

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    sans-serif;

  background-color: var(--bg-primary);
  color: var(--text-primary);

  line-height: 1.6;

  padding: 1.5rem;
  min-height: 100vh;

  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Permitir seleção em campos de formulário */

input,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Estrutura superior ------------------------------------------------------- */
.nav-header {
    max-width: 580px;
    margin: 60px auto 0 auto;
    padding: 0 20px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.btn-back:hover {
    background-color: var(--bg-color-hover);
}



/* =========================================================
     CONTAINER PRINCIPAL
   ========================================================= */

.container {
  max-width: 900px;
  margin: 0 auto;
}


/* =========================================================
     HEADER
   ========================================================= */

header {
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

header p {
  color: var(--text-secondary);
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* =========================================================
     HEADER / CAPA
   ========================================================= */

.page-header {
  margin-bottom: 1.5rem;
}

.header-hero {
  position: relative;

  width: 100%;
  min-height: 30rem;

  overflow: hidden;

  background: var(--bg-primary);

  /*
     * Apenas os cantos superiores são arredondados.
     * Os inferiores permanecem retos.
     */
  border-radius: 16px 16px 0 0;
}


/* Imagem de fundo */

.header-hero-image {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
  object-position: center top;

  z-index: 0;

  opacity: 0;

  transition: opacity 0.6s ease-in-out;

  pointer-events: none;
}

.header-hero-image.active {
  opacity: 1;
}


/* =========================================================
     DEGRADÊ SOBRE A IMAGEM — TEMA CLARO
   ========================================================= */

.header-hero-gradient {
  position: absolute;
  inset: 0;

  z-index: 1;

  background: linear-gradient(to bottom,
      rgba(248, 250, 252, 0) 0%,
      rgba(248, 250, 252, 0.05) 15%,
      rgba(248, 250, 252, 0.25) 30%,
      rgba(248, 250, 252, 0.65) 48%,
      var(--bg-primary) 78%,
      var(--bg-primary) 100%);
}


/* Conteúdo sobre a imagem */

.header-content {
  position: relative;

  z-index: 2;

  max-width: 100%;

  margin: 1rem;

  padding-top: 260px;
  padding-bottom: 1rem;
}

.header-content h1 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.header-content p {
  margin-bottom: 0.75rem;
}


/* =========================================================
     DEGRADÊ SOBRE A IMAGEM — TEMA ESCURO
   ========================================================= */

[data-theme="dark"] .header-hero-gradient {
  background: linear-gradient(to bottom,
      rgba(15, 23, 42, 0) 0%,
      rgba(15, 23, 42, 0.05) 15%,
      rgba(15, 23, 42, 0.30) 30%,
      rgba(15, 23, 42, 0.70) 48%,
      var(--bg-primary) 78%,
      var(--bg-primary) 100%);
}


/* =========================================================
     NAVEGAÇÃO DAS ABAS
   ========================================================= */

.tabs-nav {
  display: flex;

  gap: 0.5rem;

  border-bottom: 2px solid var(--border-color);

  margin-bottom: 1.5rem;
}

.tab-button {
  padding: 0.75rem 1.25rem;

  font-size: 1rem;
  font-weight: 600;

  color: var(--text-secondary);

  background: none;

  border: none;
  border-bottom: 3px solid transparent;

  cursor: pointer;

  margin-bottom: -2px;
}

.tab-button:hover {
  color: var(--accent-color);
}

.tab-button.active {
  color: var(--accent-color);

  border-bottom-color: var(--accent-color);
}


/* =========================================================
     PAINÉIS DAS ABAS
   ========================================================= */

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}


/* =========================================================
     GRID / ORGANIZAÇÃO DOS CARDS
   ========================================================= */

.grid {
  display: flex;

  flex-direction: column;

  gap: 1.5rem;
}


/* =========================================================
     CARDS
   ========================================================= */

.card {
  background-color: var(--card-bg);

  border: 1px solid var(--border-color);

  border-radius: 0.75rem;

  padding: 1.5rem;

  box-shadow: var(--shadow);
}

.card h3 {
  margin-bottom: 0.5rem;

  color: var(--accent-color);
}

.card p {
  color: var(--text-secondary);

  font-size: 0.95rem;
}


/* Listas dentro dos cards */

.card ol,
.card ul {
  margin: 1rem;
}

.card li {
  padding-bottom: 1rem;
}


/* =========================================================
     LINKS
   ========================================================= */

a {
  text-decoration: none;

  color: var(--accent-color);
}

a:hover {
  color: var(--accent-hover);
}


/* =========================================================
     CLASSES UTILITÁRIAS
   ========================================================= */

.bold {
  font-weight: 700;
}


/* =========================================================
     CONTEÚDO RELACIONADO / ADSENSE
   ========================================================= */

.related-content {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  padding: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  height: 10rem;
}

aside.logo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

/* =========================================================
     LOGO
   ========================================================= */

.logo-text {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  text-anchor: middle;
}

.logo-title {
  font-size: 76px;

  font-weight: 800;

  letter-spacing: 1px;
}

.logo-title-study {
  fill: var(--texto-study);
}

.logo-title-lab {
  fill: url(#techGrad);
}

.logo-subtitle {
  font-size: 20px;

  font-weight: 500;

  fill: #718096;

  letter-spacing: 4px;
}


/* =========================================================
     RESPONSIVIDADE — TABLETS E CELULARES
   ========================================================= */

@media (max-width: 768px) {

  .header-hero {
    min-height: 480px;

    border-radius: 12px 12px 0 0;
  }

  .header-content {
    padding-top: 240px;
  }

}


/* =========================================================
     RESPONSIVIDADE — CELULARES PEQUENOS
   ========================================================= */

@media (max-width: 480px) {

  .header-hero {
    min-height: 440px;

    border-radius: 10px 10px 0 0;
  }

  .header-content {
    padding-top: 210px;
  }

}



/* ==========================================
   CONFIGURAÇÃO PARA TELAS GRANDES (PC)
   ========================================== */
@media (min-width: 1024px) {
  body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
  }

  #main-article {
    flex: 1;
    min-width: 0;
  }

  .aside-left,
  .aside-right {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    align-self: stretch;
    width: 250px;
    flex-shrink: 0;
  }

  /* No PC, o comportamento padrão de ambos é acompanhar o scroll (sticky) */
  .aside-fix {
    position: sticky;
    top: 20px;
    width: 100%;
    height: 300px;
  }
}

/* ==========================================
   CONFIGURAÇÃO PARA TELAS MENORES (CELULAR/TABLET)
   ========================================== */
@media (max-width: 1023px) {
  body {
    display: block;
    /* Remove o layout em colunas */
    padding: 15px;
    padding-bottom: 90px;
    /* Garante que o aside flutuante não cubra o botão ou texto final */
  }

  /* --- ASIDE ESQUERDO: Flutuante fixo na parte inferior --- */
  .aside-left {
    position: fixed;
    bottom: 15px;
    left: 15px;
    right: 15px;
    z-index: 9999;
    /* Fica sempre por cima do conteúdo */
  }

  .aside-left .aside-fix {
    width: 100%;
    height: 60px;
    /* Altura compacta para celular */
  }

  /* --- ASIDE DIREITO: Fluxo normal (vai para o final da página) --- */
  .aside-right {
    width: 100%;
  }

  .aside-right .aside-fix {
    width: 100%;
    height: auto;
  }
}

/* ==========================================
   ESTILO VISUAL DO COMPONENTE (VIDRO FUMÊ)
   ========================================== */
.aside-fix {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}