/* ===========================
   1. TOKENS DE TEMA
   =========================== */

/* Tema ESCURO (padrão) */
:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --link: #60a5fa;
  --accent: #22d3ee;

  /* hero SEMPRE branco (claro ou escuro) */
  --hero-title: #ffffff;
  --hero-subtitle: #e5e7eb;
}

/* Tema CLARO: só muda as cores gerais, hero continua branco */
:root[data-theme="light"] {
  --bg: #f9fafb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --link: #1d4ed8;
  --accent: #2563eb;
}

/* ===========================
   2. BASE / LAYOUT
   =========================== */

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* container genérico */
.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

/* main cresce para empurrar o rodapé */
.site-main {
  flex: 1;
  margin-top: 12px;
}

/* cards genéricos */
.card,
.doc {
  background: var(--panel);
  color: var(--text);
  border: 1px solid #192132;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
}

.muted {
  color: var(--muted);
}

/* ===========================
   3. HEADER / HERO
   =========================== */

.header {
  background: #0b1220;
  border-bottom: 1px solid #1f2937;
}

.header .wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(120px, 18vw, 220px);
  width: 100%;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat url('/assets/img/hero-biblioteca.webp');
  filter: saturate(1.05) contrast(1.02);
}

.hero__content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: clamp(12px, 3vw, 28px) clamp(16px, 4vw, 48px);
  background: linear-gradient(90deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 60%);
}

.hero__title {
  margin: 0 0 6px;
  color: var(--hero-title);
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.hero__subtitle {
  margin: 0;
  color: var(--hero-subtitle);
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
}

.hero__title .hero__brand {
  color: inherit;
}
.hero__title .hero__brand:focus,
.hero__title .hero__brand:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ===========================
   4. BLOCO INTRO + IMAGEM
   =========================== */

.intro {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr; /* texto menor, imagem maior (ou inverte se quiser) */
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.intro__media img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

.intro__text h2 {
  margin-top: 0;
  font-size: clamp(24px, 3.6vw, 36px);
}

.intro__text p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
}

/* Título “Deveres de uma geração sem direitos” */
.intro__title {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: var(--text);         /* branco no escuro, preto no claro */
}

.intro__title-link {
  color: inherit;             /* pega a cor de .intro__title */
  text-decoration: none;
  font-weight: 600;
}

/* não deixa o :visited ficar roxo/azul padrão */
.intro__title-link:visited {
  color: inherit;
}

.intro__title-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 860px) {
  .intro {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   5. DESTAQUE “DEVERES”
   =========================== */

.card-home-deveres {
  margin-top: 18px;
}

.card--destaque {
  border-width: 2px;
  border-color: #38bdf8;
}

/* botões */
.btn,
.btn-primary,
.btn-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary,
.btn {
  border: 0;
  background: #0ea5e9;
  color: #0b1120;
}
.btn-primary:hover,
.btn:hover {
  filter: brightness(1.05);
}

.btn-link {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: transparent;
  color: var(--link);
}
.btn-link:hover {
  background: rgba(148, 163, 184, 0.12);
  text-decoration: underline;
}

/* ===========================
   6. COLEÇÃO / LISTA DE DOCS
   =========================== */

h2#titulo {
  margin: 10px 0 12px;
}

.grid,
.grid-docs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.doc a {
  color: var(--link);
}
.doc a:hover {
  text-underline-offset: 2px;
  text-decoration: underline;
}

/* ===========================
   7. FOOTER E TEMA
   =========================== */

.site-footer {
  margin-top: 32px;
  padding: 16px;
  text-align: center;
  background: var(--bg);
  color: var(--muted);
  border-top: 1px solid rgba(15,23,42,0.65);
}

/* botão de tema alinhado à direita */
.theme-toggle {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

#btnTheme {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  background: #0b1220;
  color: #fff;
}


/* ===========================
   8. MENU NAVEGAÇÃO
   =========================== */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px auto 0;
}

.section-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--link);
  text-decoration: none;
}

.section-nav a:hover {
  background: rgba(148, 163, 184, 0.16);
  text-decoration: underline;
}
