/* =========================
   VARIÁVEIS GLOBAIS
========================= */

:root {
  --text-color: #333;
  --heading-color: #1a1a1a;
  --link-color: #0056b3;
  --menu-bg: #1a1a1a;
  --menu-hover: #262626;
  --table-border: #ddd;
}

/* =========================
   CORES POR PÁGINA
========================= */

body.fitas {
  --accent-color: #243c24;
  --menu-accent: #a2b648;
}

body.cartilha {
  --accent-color: #934bea;
  --menu-accent: #934bea;
}

/* =========================
   FONTES
========================= */

@font-face {
  font-family: "Gilroy";
  src: url("../fonts/Gilroy-Thin.woff2") format("woff2"),
       url("../fonts/Gilroy-Thin.woff") format("woff");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: url("../fonts/Gilroy-Regular.woff2") format("woff2"),
       url("../fonts/Gilroy-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: url("../fonts/Gilroy-Bold.woff2") format("woff2"),
       url("../fonts/Gilroy-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: url("../fonts/Gilroy-Heavy.woff2") format("woff2"),
       url("../fonts/Gilroy-Heavy.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* =========================
   BASE
========================= */

html {
  scroll-behavior: smooth;
}

/* Respeitar preferências de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: "Gilroy", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-color);
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* =========================
   TIPOGRAFIA
========================= */

p {
  margin-bottom: 1rem;
}

strong {
  font-weight: 700;
}

.small-text {
  font-weight: 100;
}

h1 {
  color: var(--accent-color);
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 6px;
}

h2,
h3 {
  color: var(--accent-color);
  margin-top: 1.5rem;
}

/* Classe para esconder visualmente mas manter para leitores de tela */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================
   LISTAS
========================= */

ul {
  margin-bottom: 1.25rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.625rem;
}

/* Listas de definição (dl) */
dl {
  margin-bottom: 1.25rem;
}

dt {
  font-weight: 700;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

dd {
  margin-left: 0;
  margin-bottom: 1rem;
  padding-left: 41px; /* Alinhamento com o texto após o ícone */
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-size: 0.95rem;
  background: #fff;
  border: 2px solid #f4c4d7;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 1rem;
}

th,
td {
  border: 1px solid #f4c4d7;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

thead th {
  background: #f4c4d7;
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background: #faeef3;
}

tbody tr:hover {
  background: #f0d4e0;
}

/* Melhor contraste para foco em células */
th:focus,
td:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: -2px;
}

/* =========================
   BLOCOS
========================= */

.referencias {
  background: #f4f4f4;
  padding: 20px;
  border-radius: 8px;
  margin-top: 30px;
  font-size: 0.95rem;
}

.referencias h2,
.referencias h3 {
  margin-top: 1.5rem;
}

.referencias h2:first-child,
.referencias h3:first-child {
  margin-top: 0;
}

.ficha-tecnica {
  background: #f4f4f4;
  padding: 25px;
  border-radius: 8px;
  margin-top: 40px;
  border-left: 5px solid var(--accent-color);
  font-size: 0.9rem;
}

.ficha-tecnica h2,
.ficha-tecnica h3 {
  margin-top: 0;
  color: var(--heading-color);
}

.ficha-tecnica h3 {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

.ficha-tecnica strong {
  display: block;
  margin-top: 10px;
  color: var(--heading-color);
}

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

a {
  color: var(--link-color);
  text-decoration: underline;
  font-weight: 700;
}

a:hover,
a:focus {
  text-decoration: none;
}

a:focus {
  outline: 3px solid var(--link-color);
  outline-offset: 2px;
}

/* Links externos - indicador visual opcional */
a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.8em;
  vertical-align: super;
}

/* =========================
   ELEMENTOS
========================= */

hr {
  border: 0;
  border-top: 1px solid var(--table-border);
  margin: 30px 0;
}

/* Código inline */
code {
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

/* Abreviações */
abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* =========================
   IMAGENS E SVG
========================= */

img,
svg {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
  margin: 20px 0;
}

.img-50 {
  width: 35px;
  height: 35px;
  display: inline-block;
  margin: 0 6px 0 0;
  vertical-align: middle;
  flex-shrink: 0;
}

/* =========================
   MENU MODERNO
========================= */

.menu-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  color: var(--menu-accent);
  transition: transform 0.3s ease;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover {
  transform: scale(1.1);
}

.menu-toggle:focus {
  outline: 3px solid var(--menu-accent);
  outline-offset: 2px;
}

/* Overlay para fechar menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

.side-menu {
  position: fixed;
  top: 0;
  left: -260px;
  width: 250px;
  height: 100vh;
  background: var(--menu-bg);
  padding: 80px 0 20px;
  transition: left 0.35s cubic-bezier(0.77, 0, 0.18, 1);
  z-index: 1000;
  overflow-y: auto;
}

.side-menu.active {
  left: 0;
}

.side-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-menu li {
  margin: 8px 0;
}

.side-menu a {
  color: #fff;
  padding: 10px 22px;
  display: block;
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.3px;
  line-height: 1.4;
  position: relative;
  transition: background 0.25s ease, padding-left 0.25s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.side-menu a:hover {
  background: var(--menu-hover);
  padding-left: 30px;
}

.side-menu a:focus {
  outline: 3px solid var(--menu-accent);
  outline-offset: -3px;
}

.side-menu a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left;
  width: 18px;
  height: 2px;
  background: var(--menu-accent);
  transition: transform 0.25s ease;
}

.side-menu a:hover::before {
  transform: translateY(-50%) scaleX(1);
}

.side-menu a.active {
  background: var(--menu-hover);
}

.side-menu a.active::before {
  transform: translateY(-50%) scaleX(1);
}

/* =========================
   ÍCONES COM TEXTO
========================= */

.linha-icone {
  margin: 4px 0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

@media (max-width: 768px) {
  body {
    margin: 20px auto;
    padding: 0 15px;
  }

  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 8px;
  }

  .menu-toggle {
    top: 10px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  .linha-icone {
    flex-wrap: wrap;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

/* =========================
   IMPRESSÃO
========================= */

@media print {
  .menu-toggle,
  .side-menu,
  .overlay {
    display: none;
  }

  body {
    max-width: 100%;
    margin: 0;
    padding: 1cm;
  }

  a {
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* =========================
   SKIP LINK (ACESSIBILIDADE)
========================= */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-color);
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 700;
  z-index: 10000;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}